2 * @file AliFMDMCHitHandler.h
3 * @author Christian Holm Christensen <cholm@master.hehi.nbi.dk>
4 * @date Thu Feb 7 12:04:02 2013
10 #ifndef ALIFMDMCHITHANDLER_H
11 #define ALIFMDMCHITHANDLER_H
12 #include <AliMCEventHandler.h>
17 * This class defines an input handler for simulated data which will
18 * connect the FMD Hit tree. It is intended to be added to the global
19 * MC input handler using AliMCEventHandler::AddSubsidiaryHandler
22 class AliFMDMCHitHandler : public AliMCEventHandler
30 AliFMDMCHitHandler(const char* name="FMD",
31 const char* clsName="AliFMDHit",
32 AliMCEventHandler* parent=0);
34 virtual ~AliFMDMCHitHandler() {}
37 * @name Interface member functions
47 virtual Bool_t Init(TTree* t,Option_t* o) { return AliMCEventHandler::Init(t,o); }
49 * Initialize the input
53 * @return true on success
55 virtual Bool_t Init(Option_t* opt);
57 * Called at the beginning of an event
59 * @param entry Entry in tree
61 * @return true on success
63 virtual Bool_t BeginEvent(Long64_t entry);
65 * Called when the input file is changed
67 * @param path New path
69 * @return true on success
71 virtual Bool_t Notify() { return AliMCEventHandler::Notify(); }
73 * Called when the input file is changed
75 * @param path New path
77 * @return true on success
79 virtual Bool_t Notify(const char* path);
81 * Called at the end of an event
83 * @return true on success
85 virtual Bool_t FinishEvent();
87 * Called at the end of a job
89 * @return true on success
91 virtual Bool_t Terminate();
93 * Called at the end of a sub-job
95 * @return true on success
97 virtual Bool_t TerminateIO();
102 virtual void ResetIO();
106 * @param iev Event number
108 * @return true on success
110 virtual Bool_t LoadEvent(Int_t iev);
112 * Set the number of events in the container
114 * @param nev Number of events
116 virtual void SetNumberOfEventsInContainer(Int_t nev) {
117 this->fNEventsInContainer = nev;}
118 virtual Bool_t OpenFile(Int_t ev);
121 AliMCEventHandler* GetParent() { return fParent; }
125 * @return The connected hits tree
127 virtual TTree* GetTree() const { return fTree;}
128 TClonesArray* GetArray() { return fArray; }
130 * Static member function to create and attach this handler
132 * @param name Name of the handler
134 * @return Newly allocated handler or null
136 static AliFMDMCHitHandler* Create(const char* name="FMD",
137 const char* what="Hits");
138 static TClonesArray* GetParticleArray(AliFMDMCHitHandler* handler,
141 AliFMDMCHitHandler(const AliFMDMCHitHandler& o)
142 : AliMCEventHandler(),
150 fNEventsInContainer(0),
156 AliFMDMCHitHandler& operator=(const AliFMDMCHitHandler& o)
158 if (&o == this) return *this;
159 // AliMCEventHandler::operator=(o);
165 TString* GetParentPath() const;
166 AliMCEventHandler* fParent; // Parent MC handler
169 TDirectory* fDir; //!
170 TClonesArray* fArray; //!
172 Int_t fNEventsPerFile; //!
173 Int_t fNEventsInContainer; //!
175 Int_t fFileNumber; //!
176 TString fTreeName; //!
177 TString fFileBase; //!
178 ClassDef(AliFMDMCHitHandler,1); // Connect FMD hits tree