EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EicRcEvent.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file EicRcEvent.cxx
1 //
2 // AYK (ayk@bnl.gov), 2014/07/09
3 //
4 // EIC code reconstructed event class; consider to reuse eic-smear codes;
5 //
6 
7 #include <EicRootManager.h>
8 #include <EicRcEvent.h>
9 
10 // ---------------------------------------------------------------------------------------
11 
13 {
15 
16  return io ? io->GetGenMcEvent() : 0;
17 } // EicRcEvent::GetGenMcEvent()
18 
19 // ---------------------------------------------------------------------------------------
20 
21 const erhic::ParticleMC* EicRcEvent::GetGenMcTrack(int genMcIndex) const
22 {
24 
25  return io ? io->GetGenMcTrack(genMcIndex) : 0;
26 } // EicRcEvent::GetGenMcTrack()
27 
28 // ---------------------------------------------------------------------------------------
29 
31 {
32  for(unsigned i(0); i < mParticles.size(); ++i) {
34 
35  if(particle) delete particle;
36  } //for i
37 } // EicRcEvent::ClearParticles()
38 
39 // ---------------------------------------------------------------------------------------
40 
42 {
43  // Sanity check: skip beam particles;
44  if (genMcIndex <= 1) return 0;
45 
46  // FIXME: this call is not too much efficient, sorry; need to create a separate
47  // mapping set perhaps;
48  for(unsigned iq=0; iq<mParticles.size(); iq++) {
50 
51  // Has never been checked;
52  if (particle->GetGeneratorIndex() == genMcIndex ||
53  particle->GetPndMCTrackIndex() == genMcIndex-2)
54  return particle;
55  } //for iq
56 
57  return 0;
58 } // EicRcEvent::GetRcParticleMatchingGenMcTrack()
59 
60 // ---------------------------------------------------------------------------------------
61 
63 {
64 #if _OLD_
65  // Skip the first two entries, as these are the incident beams;
66  for(unsigned i(2); i < GetNTracks(); ++i) {
67 #endif
68  for(unsigned i(0); i < GetNTracks(); ++i) {
69  const EicRcParticle *particle = GetTrack(i);
70 
71  if (particle && i != mScatteredLeptonID) final.push_back(particle);
72  } //for i
73 } // EicRcEvent::HadronicFinalState()
74 
75 // ---------------------------------------------------------------------------------------
76