Exemplo n.º 1
0
void Lund_Interface::FillFragmentationBlob(Blob *blob)
{
  Particle *particle;
  Flavour flav;
  Vec4D momentum, position;
  for (int i=0;i<hepevt.nhep;++i) {
    if ((hepevt.isthep[i]!=2)&&(hepevt.isthep[i]!=1)&&(hepevt.isthep[i]!=149)) continue;
    if (hepevt.idhep[i]==93) flav=Flavour(kf_cluster);
    else flav=IdhepToSherpa(hepevt.idhep[i]);
    if (flav==Flavour(kf_string) || 
	flav==Flavour(kf_cluster)) {
      for (int j=hepevt.jdahep[i][0]-1;j<hepevt.jdahep[i][1];j++) {
        flav=IdhepToSherpa(hepevt.idhep[j]);
	momentum=Vec4D(hepevt.phep[j][3],hepevt.phep[j][0],
		       hepevt.phep[j][1],hepevt.phep[j][2]);
	position=Vec4D(hepevt.vhep[j][3],hepevt.vhep[j][0],
		       hepevt.vhep[j][1],hepevt.vhep[j][2]);
	particle = new Particle(-1,flav,momentum);
	particle->SetNumber(0);
	particle->SetStatus(part_status::active);
	particle->SetInfo('P');
	particle->SetFinalMass(hepevt.phep[j][4]);
	blob->SetPosition(position);
	blob->AddToOutParticles(particle);
      }
    }
  }
  blob->SetStatus(blob_status::needs_hadrondecays);
}
Exemplo n.º 2
0
void Lund_Interface::FillOutgoingParticlesInBlob(Blob *blob)
{
  Flavour    flav;
  Vec4D      momentum;
  Particle * particle;

  int n_q(0), n_g(0); Particle_Vector partons;
  for (int j=hepevt.jdahep[0][0]-1;j<hepevt.jdahep[0][1];j++) {
    int idhep = hepevt.idhep[j];
    flav=IdhepToSherpa(idhep);
    momentum=Vec4D(hepevt.phep[j][3],hepevt.phep[j][0],
		   hepevt.phep[j][1],hepevt.phep[j][2]);
    // don't fill blob position vector here, because decay is in CMS until boosting back
    particle = new Particle(-1,flav,momentum);
    particle->SetNumber(0);
    particle->SetStatus(part_status::active);
    particle->SetInfo('D');
    particle->SetFinalMass(hepevt.phep[j][4]);
    blob->AddToOutParticles(particle);
    
    if(abs(idhep)>0 && abs(idhep)<7) {
      n_q++;
      partons.push_back(particle);
    }
    else if(abs(idhep)==21) {
      n_g++;
      partons.push_back(particle);
    }
  }
  
  size_t n=partons.size();
  if(n>0) blob->SetStatus(blob_status::needs_showers);
  if(n_q==2 && n_g==0 && n==2) {
    if(partons[0]->Flav().IsAnti()) {
      partons[0]->SetFlow(2,-1);
      partons[1]->SetFlow(1,partons[0]->GetFlow(2));
    }
    else {
      partons[0]->SetFlow(1,-1);
      partons[1]->SetFlow(2,partons[0]->GetFlow(1));
    }
  }
  else if(n_q==0 && n_g==2 && n==2) {
    partons[0]->SetFlow(2,-1);
    partons[0]->SetFlow(1,-1);
    partons[1]->SetFlow(2,partons[0]->GetFlow(1));
    partons[1]->SetFlow(1,partons[0]->GetFlow(2));
  }
  else if(n_q==0 && n_g==3 && n==3) {
    partons[0]->SetFlow(2,-1);
    partons[0]->SetFlow(1,-1);
    partons[1]->SetFlow(2,partons[0]->GetFlow(1));
    partons[1]->SetFlow(1,-1);
    partons[2]->SetFlow(2,partons[1]->GetFlow(1));
    partons[2]->SetFlow(1,partons[0]->GetFlow(2));
  }
  else if(n>0) {
    msg_Error()<<METHOD<<" wasn't able to set the color flow for"<<endl<<*blob<<endl;
  }
}
Exemplo n.º 3
0
bool Soft_Cluster_Handler::
AttachHadronsToBlob(Cluster_List * clin,Blob * blob)
{
  Cluster_Iterator cit(clin->begin());
  Particle * part;
  Cluster * cluster;
  while (cit!=clin->end()) {
    cluster = (*cit);
    switch (cluster->size()) {
    case 1:
      part = cluster->GetSelf();
      part->SetFinalMass();
      blob->AddToOutParticles(part);
      msg_Tracking()<<"$$ attach one hadron ("<<part->Flav()<<", "
		    <<part->Momentum()<<", "
		    <<"pt = "<<part->Momentum().PPerp()<<", "
		    <<"y = "<<part->Momentum().Y()<<") "
		    <<"from cluster "<<cluster->Number()<<", "
		    <<"m = "<<cluster->Mass()<<".\n";
      delete cluster->GetTrip();
      delete cluster->GetAnti();
      delete cluster;
      cit = clin->erase(cit);
      break;
    case 2:
      FixHHDecay(cluster,blob,(*cluster)[0],(*cluster)[1]);
      delete cluster->GetTrip();
      delete cluster->GetAnti();
      delete cluster;
      cit = clin->erase(cit);
      break;      
    case 0:
      cit++;
      break;
    default:
      cit++;
      break;
    }
  }
  return true;
}
Exemplo n.º 4
0
bool Hadron_Remnant::DecomposeHadron() 
{
  bool success=true;
  double Eb(p_beam->Energy());
  for (Particle_List::iterator pit=m_extracted.begin();
       pit!=m_extracted.end();++pit) {
    if ((*pit)->Momentum()[0]>Eb || (*pit)->Momentum()[0]<0.0) {
      msg_Error()<<"Hadron_Remnant::DecomposeHadron(): "
			 <<"Constituent energy out of range. \n   E_"
			 <<(*pit)->Flav()<<" = "<<(*pit)->Momentum()[0]
			 <<"."<<std::endl;
      success=false;
    }
    for (size_t j=0;j<m_constit.size();++j) {
      if ((*pit)->Flav()==m_constit[j]) {
	//std::cout<<METHOD<<" "<<success<<":"<<(*pit)->Flav()
	//	 <<" ("<<ValenceQuark(*pit)<<")"<<std::endl;
	if (success && ValenceQuark(*pit)) {
	  p_start = new Color_Dipole(*pit,&m_companions);  
	  p_start->Begin(ANTI((*pit)->Flav().IsAnti()))->
	    SetFlav(Opposite((*pit)->Flav()));
	  return success;
	}
      }
    }
  }
  Flavour    flav = m_constit[(size_t)(ran->Get()*3.)];
  Particle * part = new Particle(-1,flav); 
  part->SetStatus(part_status::active);
  part->SetFinalMass(flav.Mass());
  part->SetFlow(COLOR((qri::type)(flav.IsAnti())),Flow::Counter());
  //std::cout<<METHOD<<":"<<flav<<std::endl
  //	   <<"  "<<(*part)<<std::endl;
  p_start = new Color_Dipole(part,&m_companions);  
  p_start->Begin(ANTI(flav.IsAnti()))->SetFlav(Opposite(flav));
  m_companions.push_back(part);
  return success;
}