EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EventSmear.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file EventSmear.h
1 
9 #ifndef INCLUDE_EICSMEAR_HADRONIC_EVENTSMEAR_H_
10 #define INCLUDE_EICSMEAR_HADRONIC_EVENTSMEAR_H_
11 
12 #include <vector>
13 
14 #include <Rtypes.h> // For ClassDef macro
15 #include <TBranch.h>
16 
21 
22 namespace erhic {
23 namespace hadronic {
24 
28 class EventSmear : public VirtualEvent {
29  public:
33  virtual ~EventSmear();
34 
38  EventSmear();
39 
43  virtual const Smear::ParticleMCS* GetTrack(UInt_t) const;
44 
48  virtual Smear::ParticleMCS* GetTrack(UInt_t);
49 
53  virtual UInt_t GetNTracks() const;
54 
58  virtual void AddLast(Smear::ParticleMCS*);
59 
60  protected:
61  std::vector<Smear::ParticleMCS*> particles;
62 
63  ClassDef(erhic::hadronic::EventSmear, 1)
64 };
65 
66 } // namespace hadronic
67 } // namespace erhic
68 
69 namespace Smear {
70 
74 class HadronicEventBuilder : public EventFactory<erhic::hadronic::EventSmear> {
75  public:
79  virtual ~HadronicEventBuilder() { }
80 
86  HadronicEventBuilder(const Detector& d, TBranch& mcBranch)
87  : mDetector(d)
88  , mMcEvent(NULL) {
89  mcBranch.SetAddress(&mMcEvent);
90  }
91 
98  virtual EventType* Create() {
99  EventType* event = new EventType;
100  for (unsigned j(0); j < mMcEvent->GetNTracks(); j++) {
101  const erhic::VirtualParticle* ptr = mMcEvent->GetTrack(j);
102  if (ptr) {
103  event->AddLast(mDetector.Smear(*ptr));
104  } // if
105  } // for
106  return event;
107  }
108 
109  protected:
112 };
113 
114 } // namespace Smear
115 
116 #endif // INCLUDE_EICSMEAR_HADRONIC_EVENTSMEAR_H_