Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-09-28 07:02:51

0001 /**
0002  \file
0003  Implementation of class erhic::Pythia6ParticleBuilder.
0004  
0005  \author    Thomas Burton
0006  \date      2012-01-17
0007  \copyright 2012 Brookhaven National Lab
0008  */
0009 
0010 #include <iostream>
0011 
0012 #include <TLorentzVector.h>
0013 #include <TMCParticle.h>
0014 #include <TVector3.h>
0015 
0016 #include "eicsmear/erhic/ParticleMC.h"
0017 #include "eicsmear/erhic/Pythia6ParticleBuilder.h"
0018 
0019 namespace erhic {
0020 
0021 std::unique_ptr<ParticleMC>
0022 Pythia6ParticleBuilder::Create(const TMCParticle& mc) const {
0023   std::unique_ptr<ParticleMC> particle(new ParticleMC);
0024   TLorentzVector p(mc.GetPx(),
0025                    mc.GetPy(),
0026                    mc.GetPz(),
0027                    mc.GetEnergy());
0028   TVector3 v(mc.GetVx(),
0029              mc.GetVy(),
0030              mc.GetVz());
0031   particle->SetStatus(mc.GetKS());
0032   particle->SetId(mc.GetKF());
0033   particle->SetParentIndex(mc.GetParent());
0034   particle->SetChild1Index(mc.GetFirstChild());
0035   particle->SetChildNIndex(mc.GetLastChild());
0036   //std::cout << "ChildN index " << mc.GetLastChild() << " " <<  particle->GetChildNIndex() << std::endl;
0037   particle->Set4Vector(p);
0038   particle->SetVertex(v);
0039   return particle;
0040 }
0041 
0042 }  // namespace erhic