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
hadronic/EventSmear.h
Go to the documentation of this file.
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_
Smear::HadronicEventBuilder::mDetector
Detector mDetector
Definition: hadronic/EventSmear.h:110
VirtualEvent.h
Smear
Definition: Acceptance.cxx:16
erhic
Definition: EventDis.cxx:14
EventMC.h
Smear::HadronicEventBuilder::mMcEvent
erhic::hadronic::EventMC * mMcEvent
Definition: hadronic/EventSmear.h:111
erhic::hadronic::EventSmear::EventSmear
EventSmear()
Constructor.
Definition: hadronic/EventSmear.cxx:21
Smear::HadronicEventBuilder::~HadronicEventBuilder
virtual ~HadronicEventBuilder()
Destructor.
Definition: hadronic/EventSmear.h:79
erhic::VirtualEvent
Abstract base class for a physics event.
Definition: VirtualEvent.h:25
ParticleMCS.h
erhic::hadronic::EventMC::GetTrack
virtual const ParticleMC * GetTrack(UInt_t) const
Returns the nth track from the event.
Definition: hadronic/EventMC.cxx:29
erhic::hadronic::EventSmear::~EventSmear
virtual ~EventSmear()
Destructor.
Definition: hadronic/EventSmear.cxx:14
Smear::Detector
The detector structure.
Definition: Detector.h:44
Smear::EventFactory
Event factory for events of a particular type.
Definition: smear/EventFactory.h:30
EventFactory.h
erhic::VirtualParticle
Abstract base class for a general particle.
Definition: VirtualParticle.h:23
Smear::HadronicEventBuilder::Create
virtual EventType * Create()
Create a smeared event corresponding to the current DIS Monte Carlo event in the input branch passed ...
Definition: hadronic/EventSmear.h:98
erhic::hadronic::EventMC
A realisation of erhic::VirtualEvent for a hadron-hadron Monte Carlo event.
Definition: hadronic/EventMC.h:29
erhic::hadronic::EventSmear::AddLast
virtual void AddLast(Smear::ParticleMCS *)
Add a particle to the end of the list.
Definition: hadronic/EventSmear.cxx:36
erhic::hadronic::EventSmear
Realisation of hadronic::EventMC as an event with detector smearing.
Definition: hadronic/EventSmear.h:28
Smear::ParticleMCS
A smeared Monte Carlo particle.
Definition: ParticleMCS.h:27
Smear::EventFactory< erhic::hadronic::EventSmear >::EventType
erhic::hadronic::EventSmear EventType
Definition: smear/EventFactory.h:32
Smear::HadronicEventBuilder
Factory class for smeared hadronic events.
Definition: hadronic/EventSmear.h:74
Smear::Detector::Smear
ParticleMCS * Smear(const erhic::VirtualParticle &) const
Detector level particle smearing.
Definition: Detector.cxx:132
erhic::hadronic::EventSmear::particles
std::vector< Smear::ParticleMCS * > particles
Definition: hadronic/EventSmear.h:61
Smear::HadronicEventBuilder::HadronicEventBuilder
HadronicEventBuilder(const Detector &d, TBranch &mcBranch)
Constructor.
Definition: hadronic/EventSmear.h:86
erhic::hadronic::EventSmear::GetNTracks
virtual UInt_t GetNTracks() const
Returns the number of tracks in the event.
Definition: hadronic/EventSmear.cxx:32
erhic::hadronic::EventMC::GetNTracks
virtual UInt_t GetNTracks() const
Returns the number of tracks in the event.
Definition: hadronic/EventMC.cxx:37
erhic::hadronic::EventSmear::GetTrack
virtual const Smear::ParticleMCS * GetTrack(UInt_t) const
Returns the numbered track for the event.
Definition: hadronic/EventSmear.cxx:24