Exemplo n.º 1
0
Return_Value::code Lund_Interface::PerformDecay(Blob * blob)
{
  if (blob->NInP()!=1 ||
      blob->InParticle(0)->Status()!=part_status::active)
  {
    msg_Error()<<METHOD<<" returns Error."<<endl;
    msg_Error()<<" blob->Status()="<<blob->Status()<<endl;
    msg_Error()<<" blob->NInP()="<<blob->NInP()<<endl;
    msg_Error()<<" part->Status()="<<blob->InParticle(0)->Status()<<endl;
    return Return_Value::Error;
  }

  Particle * part = blob->InParticle(0);
  Flavour fl = part->Flav();
  int kc = pycomp(SherpaToIdhep(fl))-1;
  double peak = pydat2.pmas[1-1][kc];
  double w_cut = pydat2.pmas[3-1][kc];
  if( part->FinalMass()+Accu() < peak-w_cut || part->FinalMass()-Accu() > peak+w_cut) {
    return Return_Value::Retry_Method;
  }

  int nhep(0);
  int idhep = SherpaToIdhep(fl);
  hepevt.idhep[nhep] = idhep;
  for (short int j=1;j<4;++j) hepevt.phep[nhep][j-1]=part->Momentum()[j];
  hepevt.phep[nhep][3] = part->Momentum()[0];
  hepevt.phep[nhep][4] = part->FinalMass();
  for (short int j=0;j<4;++j) hepevt.vhep[nhep][j]=0.0;
  hepevt.isthep[nhep]=1;
  hepevt.jmohep[nhep][0]=0;
  hepevt.jmohep[nhep][1]=0;
  hepevt.jdahep[nhep][0]=0;
  hepevt.jdahep[nhep][1]=0;
  nhep++;
  
  hepevt.nevhep=0;
  hepevt.nhep=nhep;
  pyhepc(2);
  pydat1.mstu[70-1]=1;
  pydat1.mstu[71-1]=hepevt.nhep;
  int ip(1);
  pydecy(ip);
  if (pydat1.mstu[24-1]!=0) {
    msg_Tracking()<<"ERROR in "<<METHOD<<" : "<<std::endl
	       <<"   PYDECY call results in error code : "<<pydat1.mstu[24-1]<<std::endl
                  <<"   for decay of "<<fl<<" ("<<(long int) fl<<" -> "<<idhep<<")"<<std::endl;
    if (pydat1.mstu[23-1]<int(rpa->gen.NumberOfGeneratedEvents()/100) ||
	rpa->gen.NumberOfGeneratedEvents()<200) {
      msg_Tracking()<<"   Up to now: "<<pydat1.mstu[23-1]<<" errors, try new event."<<std::endl;
      return Return_Value::Retry_Method;
    }
    msg_Tracking()<<"   Up to now: "<<pydat1.mstu[23-1]<<" errors, abort the run."<<std::endl;
  }
  part->SetStatus(part_status::decayed);
  pyhepc(1);
  FillOutgoingParticlesInBlob(blob);
  return Return_Value::Success;
} 
Exemplo n.º 2
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.º 3
0
int Lund_Interface::PrepareFragmentationBlob(Blob * blob) 
{
  int nhep = 0;
  hepevt.idhep[nhep]=SherpaToIdhep(Flavour(kf_photon));
  for (short int j=1;j<4;++j) hepevt.phep[nhep][j-1]=blob->CMS()[j];
  hepevt.phep[nhep][3]=blob->CMS()[0];
  double pabs=(blob->CMS()).Abs2();
  if (pabs<0) hepevt.phep[nhep][4]=0.0;
  else hepevt.phep[nhep][4]=sqrt(pabs);
  for (short int j=0;j<4;++j) hepevt.vhep[nhep][j]=0.0;
  hepevt.isthep[nhep]=1;
  hepevt.jmohep[nhep][0]=0;
  hepevt.jmohep[nhep][1]=0;
  hepevt.jdahep[nhep][0]=0;
  hepevt.jdahep[nhep][1]=0;
  
  // gluon splittings
  for (int i(0);i<blob->NInP();++i) {
    Particle * part = blob->InParticle(i);
  if (part->GetFlow(1)!=0 && part->GetFlow(2)!=0) {
    Flavour            flav = Flavour(kf_d);
    if (ran->Get()<0.5) flav = Flavour(kf_u);
      Particle *help1(new Particle(-1,flav,0.5*part->Momentum()));
      Particle *help2(new Particle(-1,flav.Bar(),help1->Momentum()));
    help1->SetStatus(part_status::active);
    help2->SetStatus(part_status::active);
    AddPartonToString(help1,nhep);
    delete help1;
      unsigned int lastc(part->GetFlow(2));
      for (++i;i<blob->NInP();++i) {
      part = blob->InParticle(i);
      AddPartonToString(part,nhep);
	if (part->GetFlow(1)==lastc) {
	  lastc=0;
	  break;
	}
    }      
      if (lastc!=0)
	msg_Error()<<METHOD<<"(): Error. Open color string."<<std::endl;
    AddPartonToString(help2,nhep);
    delete help2;
      lastc=0;
  }
  else {
      for (;i<blob->NInP();i++) {
      part = blob->InParticle(i);
      AddPartonToString(part,nhep);
	if (part->GetFlow(1)==0) break;
      }  
    }  
  }
  return nhep;
}
Exemplo n.º 4
0
void Hadron_Decay_Handler::SetPosition(ATOOLS::Blob* blob)
{
  Particle* inpart = blob->InParticle(0);
  if(inpart->Flav().Kfcode()==kf_K) {
    blob->SetPosition(inpart->XProd());
    return;
  }
  
  // boost lifetime into lab
  double gamma = 1./rpa->gen.Accu();
  if (inpart->Flav().HadMass()>rpa->gen.Accu()) {
    gamma = inpart->E()/inpart->Flav().HadMass();
  }
  else {
    double q2    = dabs(inpart->Momentum().Abs2());
    if (q2>rpa->gen.Accu()) gamma = inpart->E()/sqrt(q2);
  }
  double lifetime_boosted = gamma * inpart->Time();
  
  Vec3D      spatial = inpart->Distance( lifetime_boosted );
  Vec4D     position = Vec4D( lifetime_boosted*rpa->c(), spatial );
  blob->SetPosition( inpart->XProd() + position ); // in mm
}
Exemplo n.º 5
0
bool One_PT_Distribution::EvaluateNLOContrib(const Particle &p1,
				   double weight,double ncount) const
{
  p_histo->InsertMCB(p1.Momentum().PPerp(),weight,ncount);
  return true;
}
Exemplo n.º 6
0
bool One_Mass_Distribution::Evaluate(const Particle &p1,
				     double weight,double ncount) const
{
  p_histo->Insert(p1.Momentum().Mass(),weight,ncount);
  return true;
}
Exemplo n.º 7
0
 static bool OrderP(const Particle &a,const Particle &b) 
 { return dabs(a.Momentum().Eta())>dabs(b.Momentum().Eta()); }
Exemplo n.º 8
0
 static bool OrderP(const Particle &a,const Particle &b) 
 { return a.Momentum().PPerp2()>b.Momentum().PPerp2(); }
Exemplo n.º 9
0
void Cluster_Decay_Analysis::AnalyseThis(Blob * blob)
{
  return;
  int Npiplus(0),Npiminus(0),Npi0(0),NKplus(0),NKminus(0),NK0(0),NK0b(0),Neta(0),Netaprime(0),
    Nrhoplus(0),Nrhominus(0),Nrho0(0),NKstarplus(0),NKstarminus(0),NKstar0(0),NKstar0b(0),
    Nomega(0),Nphi(0);
  Particle * part;
  int kfc, LambdaCount(0), LambdaP(0), LambdaM(0);
  Vec4D QLambda(0.,0.,0.,0.);
  double x, max_x = 0., max_xB = 0.;
  for (int i=0;i<blob->NInP();i++) {
    part = blob->InParticle(i);
    kfc  = int(part->Flav());
    x    = 2.*part->Momentum()[0]/rpa->gen.Ecms();
    if (x>max_x) max_x = x;
    switch (kfc) {
    case 5:
    case -5:
      if (x>max_xB) max_xB = x;
      m_histograms[string("x_E_B-Quarks")]->Insert(x);
      break;
    }
  }
  if (max_x==max_xB) m_histograms[string("x_E_B-Quarks_L")]->Insert(max_x);

  max_x  = max_xB = 0.;

  for (int i=0;i<blob->NOutP();i++) {
    part = blob->OutParticle(i);
    x    = 2.*part->Momentum()[0]/rpa->gen.Ecms();
    if (x>max_x) max_x = x;
    kfc  = int(part->Flav());
    switch (kfc) {
    case 111:
      Npi0++;
      m_histograms[string("x_p_Pseudoscalars")]->Insert(2.*Vec3D(part->Momentum()).Abs()/rpa->gen.Ecms());
      break;
    case 211:
      Npiplus++;
      m_histograms[string("x_p_Pseudoscalars")]->Insert(2.*Vec3D(part->Momentum()).Abs()/rpa->gen.Ecms());
      break;
    case -211:
      Npiminus++;
      m_histograms[string("x_p_Pseudoscalars")]->Insert(2.*Vec3D(part->Momentum()).Abs()/rpa->gen.Ecms());
      break;
    case 221:
      Neta++;
      m_histograms[string("x_p_Pseudoscalars")]->Insert(2.*Vec3D(part->Momentum()).Abs()/rpa->gen.Ecms());
      break;
    case 311:
      NK0++;
      m_histograms[string("x_p_Pseudoscalars")]->Insert(2.*Vec3D(part->Momentum()).Abs()/rpa->gen.Ecms());
      break;
    case -311:
      NK0b++;
      m_histograms[string("x_p_Pseudoscalars")]->Insert(2.*Vec3D(part->Momentum()).Abs()/rpa->gen.Ecms());
      break;
    case 321:
      NKplus++;
      m_histograms[string("x_p_Pseudoscalars")]->Insert(2.*Vec3D(part->Momentum()).Abs()/rpa->gen.Ecms());
      break;
    case -321:
      NKminus++;
      m_histograms[string("x_p_Pseudoscalars")]->Insert(2.*Vec3D(part->Momentum()).Abs()/rpa->gen.Ecms());
      break;
    case 331:
      Netaprime++;
      m_histograms[string("x_p_Pseudoscalars")]->Insert(2.*Vec3D(part->Momentum()).Abs()/rpa->gen.Ecms());
      break;
    case 113:
      Nrho0++;
      m_histograms[string("x_p_Vectors")]->Insert(2.*Vec3D(part->Momentum()).Abs()/rpa->gen.Ecms());
      break;
    case 213:
      Nrhoplus++;
      m_histograms[string("x_p_Vectors")]->Insert(2.*Vec3D(part->Momentum()).Abs()/rpa->gen.Ecms());
      break;
    case -213:
      Nrhominus++;
      m_histograms[string("x_p_Vectors")]->Insert(2.*Vec3D(part->Momentum()).Abs()/rpa->gen.Ecms());
      break;
    case 223:
      Nomega++;
      m_histograms[string("x_p_Vectors")]->Insert(2.*Vec3D(part->Momentum()).Abs()/rpa->gen.Ecms());
      break;
    case 313:
      NKstar0++;
      m_histograms[string("x_p_Vectors")]->Insert(2.*Vec3D(part->Momentum()).Abs()/rpa->gen.Ecms());
      break;
    case -313:
      NKstar0b++;
      m_histograms[string("x_p_Vectors")]->Insert(2.*Vec3D(part->Momentum()).Abs()/rpa->gen.Ecms());
      break;
    case 323:
      NKstarplus++;
      m_histograms[string("x_p_Vectors")]->Insert(2.*Vec3D(part->Momentum()).Abs()/rpa->gen.Ecms());
      break;
    case -323:
      NKstarminus++;
      m_histograms[string("x_p_Vectors")]->Insert(2.*Vec3D(part->Momentum()).Abs()/rpa->gen.Ecms());
      break;
    case 333:
      Nphi++;
      m_histograms[string("x_p_Vectors")]->Insert(2.*Vec3D(part->Momentum()).Abs()/rpa->gen.Ecms());
      break;
    case 411:
    case 413:
    case 421:
    case 423:
    case 431:
    case 433:
      m_histograms[string("x_p_C-Hadrons")]->Insert(2.*Vec3D(part->Momentum()).Abs()/rpa->gen.Ecms());
      break;
    case 511:
    case 521:
      //case 531:
      //      if (2.*Vec3D(part->Momentum()).Abs()/rpa->gen.Ecms()<0.89 &&
      //	  2.*Vec3D(part->Momentum()).Abs()/rpa->gen.Ecms()>0.88) 
      //	cout<<(*blob)<<endl<<endl
      //	    <<"#################################################################################"<<endl<<endl;
      m_histograms[string("x_p_B-Mesons")]->Insert(2.*Vec3D(part->Momentum()).Abs()/rpa->gen.Ecms());
      m_histograms[string("x_E_B-Mesons")]->Insert(x);
      if (x>max_xB) max_xB = x;
      break;
    case 513:
    case 523:
    case 533:
      m_histograms[string("x_p_Bstar-Mesons")]->Insert(2.*Vec3D(part->Momentum()).Abs()/rpa->gen.Ecms());
      m_histograms[string("x_E_Bstar-Mesons")]->Insert(x);
      break;
    case 3122:
      QLambda += part->Momentum();
      LambdaCount++; LambdaP++;
      break;
    case -3122:
      QLambda -= part->Momentum();
      LambdaCount++; LambdaM++;
      break;
    }
  }    
  if (LambdaCount==2 && LambdaP==1 && LambdaM==1) 
    m_histograms[string("Q(Lambda_Lambda)")]->Insert(sqrt(-QLambda.Abs2()));
  if (max_x==max_xB)   m_histograms[string("x_E_B-Mesons_L")]->Insert(max_x);

  m_histograms[string("pi+_Number")]->Insert(Npiplus);
  m_histograms[string("pi-_Number")]->Insert(Npiminus);
  m_histograms[string("pi0_Number")]->Insert(Npi0);
  m_histograms[string("K+_Number")]->Insert(NKplus);
  m_histograms[string("K-_Number")]->Insert(NKminus);
  m_histograms[string("K0_Number")]->Insert(NK0);
  m_histograms[string("K0_Bar_Number")]->Insert(NK0b);
  m_histograms[string("eta_Number")]->Insert(Neta);
  m_histograms[string("etaPrime_Number")]->Insert(Netaprime);
    
  m_histograms[string("rho+_Number")]->Insert(Nrhoplus);
  m_histograms[string("rho-_Number")]->Insert(Nrhominus);
  m_histograms[string("rho0_Number")]->Insert(Nrho0);
  m_histograms[string("KStar+_Number")]->Insert(NKstarplus);
  m_histograms[string("KStar-_Number")]->Insert(NKstarminus);
  m_histograms[string("KStar0_Number")]->Insert(NKstar0);
  m_histograms[string("KStar0_Bar_Number")]->Insert(NKstar0b);
  m_histograms[string("omega_Number")]->Insert(Nomega);
  m_histograms[string("phi_Number")]->Insert(Nphi);
}