EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Pythia6ParticleBuilder.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Pythia6ParticleBuilder.cxx
1 
10 #include <iostream>
11 
12 #include <TLorentzVector.h>
13 #include <TMCParticle.h>
14 #include <TVector3.h>
15 
18 
19 namespace erhic {
20 
21 std::unique_ptr<ParticleMC>
22 Pythia6ParticleBuilder::Create(const TMCParticle& mc) const {
23  std::unique_ptr<ParticleMC> particle(new ParticleMC);
24  TLorentzVector p(mc.GetPx(),
25  mc.GetPy(),
26  mc.GetPz(),
27  mc.GetEnergy());
28  TVector3 v(mc.GetVx(),
29  mc.GetVy(),
30  mc.GetVz());
31  particle->SetStatus(mc.GetKS());
32  particle->SetId(mc.GetKF());
33  particle->SetParentIndex(mc.GetParent());
34  particle->SetChild1Index(mc.GetFirstChild());
35  particle->SetChildNIndex(mc.GetLastChild());
36  //std::cout << "ChildN index " << mc.GetLastChild() << " " << particle->GetChildNIndex() << std::endl;
37  particle->Set4Vector(p);
38  particle->SetVertex(v);
39  return particle;
40 }
41 
42 } // namespace erhic