]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FORWARD/analysis2/AliFMDEventInspector.h
Renames and new scripts
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / AliFMDEventInspector.h
1 // 
2 // This class inspects the event 
3 //
4 #ifndef ALIFMDEVENTINSPECTOR_H
5 #define ALIFMDEVENTINSPECTOR_H
6 #include <TNamed.h>
7 class AliESDEvent;
8 class TH2D;
9 class TH1D;
10 class TH1I;
11 class TAxis;
12 class TList;
13
14 /** 
15  * This class inspects the event 
16  *
17  * @par Input:
18  *   - AliESDFMD object possibly corrected for sharing
19  *
20  * @par Output:
21  *   - A histogram of v_z of events with triggers. 
22  *   - A histogram of v_z of events with vertex and triggers 
23  *   - A histogram of trigger counters 
24  * 
25  * Note, that these are added to the master output list 
26  *
27  * @par Corrections used: 
28  *   - None
29  *
30  * @ingroup pwg2_forward_algo 
31  */
32 class AliFMDEventInspector : public TNamed
33 {
34 public:
35   /** 
36    * Return codes 
37    */
38   enum ECodes {
39     /** all ok */
40     kOk = 0,
41     /** No ESD event */
42     kNoEvent = 0x1, 
43     /** No triggers found */
44     kNoTriggers = 0x2, 
45     /** No SPD data */ 
46     kNoSPD = 0x4, 
47     /** No FMD data */
48     kNoFMD = 0x8, 
49     /** No vertex found */
50     kNoVertex = 0x10, 
51     /** Vertex out of range */
52     kBadVertex = 0x20
53   };
54   /** 
55    * Trigger bins 
56    */
57   enum ETrgBins { 
58     kInel, 
59     kInelGt0, 
60     kNSD, 
61     kEmpty, 
62     kA, 
63     kB, 
64     kC, 
65     kE
66   };
67   /** 
68    * Collision systems
69    */
70   enum ECollisionSystem { 
71     kUnknown,
72     kPP, 
73     kPbPb
74   };
75   /** 
76    * Constructor 
77    */
78   AliFMDEventInspector();
79   /** 
80    * Constructor 
81    * 
82    * @param name Name of object
83    */
84   AliFMDEventInspector(const char* name);
85   /** 
86    * Copy constructor 
87    * 
88    * @param o Object to copy from 
89    */
90   AliFMDEventInspector(const AliFMDEventInspector& o);
91   /** 
92    * Destructor 
93    */
94   virtual ~AliFMDEventInspector();
95   /** 
96    * Assignement operator
97    * 
98    * @param o Object to assign from 
99    * 
100    * @return Reference to this object
101    */
102   AliFMDEventInspector& operator=(const AliFMDEventInspector&);
103
104   /** 
105    * Initialize the object 
106    * 
107    * @param vtxAxis Vertex axis in use 
108    */
109   void Init(const TAxis& vtxAxis);
110   /** 
111    * Process the event 
112    * 
113    * @param event     Input event 
114    * @param triggers  On return, the triggers fired 
115    * @param lowFlux   On return, true if the event is considered a low-flux 
116    *                  event (according to the setting of fLowFluxCut) 
117    * @param ivz       On return, the found vertex bin (1-based).  A zero
118    *                  means outside of the defined vertex range
119    * @param vz        On return, the z position of the interaction
120    * 
121    * @return 0 (or kOk) on success, otherwise a bit mask of error codes 
122    */
123   UInt_t Process(const AliESDEvent* event, 
124                  UInt_t&            triggers,
125                  Bool_t&            lowFlux,
126                  UShort_t&          ivz, 
127                  Double_t&          vz);
128   /** 
129    * Define the output histograms.  These are put in a sub list of the
130    * passed list.   The histograms are merged before the parent task calls 
131    * AliAnalysisTaskSE::Terminate 
132    * 
133    * @param dir Directory to add to 
134    */
135   void DefineOutput(TList* dir);
136   /** 
137    * Set the number of SPD tracklets for which we consider the event a
138    * low-flux event or not .
139    * 
140    * @param c Cut (default 1000)
141    */
142   void SetLowFluxCut(Int_t c) { fLowFluxCut = c; }
143   /** 
144    * Set the maximum error on @f$ v_z@f$
145    * 
146    * @param c Maximum error (in centimeters)
147    */
148   void SetMaxVzErr(Double_t c=0.1) { fMaxVzErr = c; }
149   /** 
150    * Set the debug level.  The higher the value the more output 
151    * 
152    * @param dbg Debug level 
153    */
154   void SetDebug(Int_t dbg=1) { fDebug = dbg; }
155   /** 
156    * Fetch our histograms from the passed list 
157    * 
158    * @param d             Input
159    * @param hEventsTr     On return, pointer to histogram, or null
160    * @param hEventsTrVtx  On return, pointer to histogram, or null
161    * @param hTriggers     On return, pointer to histogram, or null
162    * 
163    * @return true on success, false otherwise 
164    */
165   Bool_t FetchHistograms(TList* d, 
166                          TH1I*& hEventsTr, 
167                          TH1I*& hEventsTrVtx, 
168                          TH1I*& hTriggers) const;
169   /** 
170    * Read the collision system, collision energy, and L3 field setting
171    * from the ESD
172    * 
173    * @param esd ESD to get information from 
174    * 
175    * @return true on success, false 
176    */
177   Bool_t ReadRunDetails(const AliESDEvent* esd);
178   /** 
179    * Get the collision system (one of the value in ECollisionSystem)
180    * 
181    * @return Collision system 
182    */
183   UShort_t GetCollisionSystem() const { return fCollisionSystem; }
184   /** 
185    * Get the center of mass energy (per nucleon pair) in GeV 
186    * 
187    * @return center of mass energy (per nucleon pair) in GeV 
188    */
189   UShort_t GetEnergy() const { return fEnergy; }
190   /** 
191    * Get the magnetic field setting of the L3 magnet in kilo Gauss. 
192    * 
193    * @return The magnetic field setting 
194    */
195   Short_t  GetField() const { return fField; }
196   /** 
197    * Print information
198    * 
199    * @param option Not used 
200    */
201   void Print(Option_t* option="") const;
202 protected:
203   /** 
204    * Read the trigger information from the ESD event 
205    * 
206    * @param esd        ESD event 
207    * @param triggers   On return, contains the trigger bits 
208    * 
209    * @return @c true on success, @c false otherwise 
210    */
211   Bool_t ReadTriggers(const AliESDEvent* esd, UInt_t& triggers);
212   /** 
213    * Read the vertex information from the ESD event 
214    * 
215    * @param esd  ESD event 
216    * @param vz   On return, the vertex Z position 
217    * 
218    * @return @c true on success, @c false otherwise 
219    */
220   Bool_t ReadVertex(const AliESDEvent* esd, Double_t& vz);
221
222   TH1I*    fHEventsTr;    //! Histogram of events w/trigger
223   TH1I*    fHEventsTrVtx; //! Events w/trigger and vertex 
224   TH1I*    fHTriggers;    //! Triggers
225   TH1I*    fHType;        //! Type (low/high flux) of event
226   Int_t    fLowFluxCut;   //  Low flux cut
227   Double_t fMaxVzErr;     //  Maximum error on v_z
228   TList*   fList;         //! Histogram container 
229   UShort_t fEnergy;       // CMS energy (per nucleon pair) [GeV]
230   Short_t  fField;        // L3 magnetic field [kG]
231   UShort_t fCollisionSystem; //  
232   Int_t    fDebug;        //  Debug level 
233   ClassDef(AliFMDEventInspector,1); // Inspect the event 
234 };
235
236 #endif
237 // Local Variables:
238 //   mode: C++
239 // End:
240
241
242