EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EventMC.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file EventMC.cxx
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