Ejemplo n.º 1
0
void Colour_Generator::FinalColours() {
  //   msg_Out()<<METHOD<<":\n";
  size_t flow(0),col(0);
  Particle * part;
  Flavour flav;
  for (size_t beam=0;beam<2;beam++) {
    size_t length(m_hadrons[1-beam]->Size());
    
    /*      msg_Out()<<"   Trips["<<beam<<"]:";
	    for (set<int>::iterator cit=m_col[beam][0].begin();
	    cit!=m_col[beam][0].end();cit++) msg_Out()<<" "<<(*cit);
	    msg_Out()<<"\n";
	    msg_Out()<<"   Antis["<<beam<<"]:";
	    for (set<int>::iterator cit=m_col[beam][1].begin();
	    cit!=m_col[beam][1].end();cit++) msg_Out()<<" "<<(*cit);
	    msg_Out()<<"\n";*/
    
    for (size_t i=length-2;i<length;i++) {
      part = m_hadrons[1-beam]->GetParticle(i);
      flav = part->Flav();
      if (flav.IsQuark() || flav.IsDiQuark()) {
	if ((flav.IsQuark()   && !flav.IsAnti()) ||
	    (flav.IsDiQuark() && flav.IsAnti()))    flow=0;
	if ((flav.IsQuark()   && flav.IsAnti()) ||
	    (flav.IsDiQuark() && !flav.IsAnti()))   flow=1;
	if (m_col[beam][flow].size()>0) {
	  col = (*m_col[beam][flow].begin());
	  part->SetFlow(flow+1,col);
	  m_col[beam][flow].erase(m_col[beam][flow].begin());
	}
	else {
	  part->SetFlow(flow+1,-1);
	  m_col[beam][1-flow].insert(part->GetFlow(flow+1));	  
	}
      }
      else if (flav.IsGluon()) {
	for (flow=0;flow<2;flow++) {
	  if (m_col[beam][flow].size()>0) {
	    col = (*m_col[beam][flow].begin());
	    part->SetFlow(flow+1,col);
	    m_col[beam][flow].erase(m_col[beam][flow].begin());
	  }
	  else {
	    part->SetFlow(flow+1,-1);
	    m_col[beam][1-flow].insert(part->GetFlow(flow+1));	  
	  }
	}
      }
      //       msg_Out()<<(*part)<<"\n";
    }
  }
}
Ejemplo n.º 2
0
Proto_Particle::
Proto_Particle(Flavour flav,Vec4D mom,char info) :
  m_flav(flav), m_mom(mom), m_info(info), 
  m_mass(hadpars->GetConstituents()->Mass(flav)), m_kt2max(0.), 
  p_partner(NULL)
{ 
  if (!flav.IsGluon() && !flav.IsDiQuark()) {
    if (flav.IsQuark() && flav.Kfcode()>5) {
      std::cerr<<"Error in Proto_Particle::Proto_Particle():\n"
	       <<"   Tried to form a cluster particle from a "<<flav<<".\n"
	       <<"   Please make sure that heavy coloured objects decay "
	       <<"before they enter hadronization.\n"
	       <<"   Will exit the run.\n";
      abort();
    }
  }
  control::s_AHAprotoparticles++; 
  s_actives.push_back(this);
}