eic-smear  1.0.3
A collection of ROOT classes for Monte Carlo events and a fast-smearing code simulating detector effects for the Electron-Ion Collider task force
Pythia6ParticleBuilder.cxx
Go to the documentation of this file.
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::auto_ptr<ParticleMC>
22 Pythia6ParticleBuilder::Create(const TMCParticle& mc) const {
23  std::auto_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() << " " <<
37  particle->GetChildNIndex() << std::endl;
38  particle->Set4Vector(p);
39  particle->SetVertex(v);
40  return particle;
41 }
42 
43 } // namespace erhic
std::auto_ptr< ParticleMC > Create(const TMCParticle &) const