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
EventMC.cxx
Go to the documentation of this file.
1 
11 
12 #include <TLorentzVector.h>
13 
14 namespace erhic {
15 namespace hadronic {
16 
18  Clear("");
19 }
20 
22 : mTracks("erhic::hadronic::ParticleMC", 100) {
23 }
24 
25 void EventMC::Clear(Option_t* /* option */) {
26  mTracks.Clear();
27 }
28 
29 const ParticleMC* EventMC::GetTrack(UInt_t i) const {
30  return static_cast<ParticleMC*>(mTracks.At(i));
31 }
32 
34  return static_cast<ParticleMC*>(mTracks.At(i));
35 }
36 
37 UInt_t EventMC::GetNTracks() const {
38  return mTracks.GetEntries();
39 }
40 
42  new(mTracks[GetNTracks()]) ParticleMC(*p);
43  return GetNTracks();
44 }
45 
47  double energy(NAN);
48  if (GetTrack(0) && GetTrack(1)) {
49  energy = (GetTrack(0)->Get4Vector() + GetTrack(1)->Get4Vector()).M();
50  } // if
51  return energy;
52 }
53 
54 } // namespace hadronic
55 } // namespace erhic
virtual UInt_t Add(ParticleMC *particle)
Definition: EventMC.cxx:41
virtual const ParticleMC * GetTrack(UInt_t) const
Definition: EventMC.cxx:29
virtual UInt_t GetNTracks() const
Definition: EventMC.cxx:37
virtual TLorentzVector Get4Vector() const
Definition: ParticleMC.h:196
virtual Double_t GetCentreOfMassEnergy() const
Definition: EventMC.cxx:46
virtual void Clear(Option_t *="")
Definition: EventMC.cxx:25