]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FORWARD/analysis2/AliFMDCorrector.h
Change to raw OCDB in case not yet set
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / AliFMDCorrector.h
1 // This class calculates the exclusive charged particle density
2 // in each for the 5 FMD rings. 
3 //
4 #ifndef ALIFMDCORRECTOR_H
5 #define ALIFMDCORRECTOR_H
6 /**
7  * @file   AliFMDCorrector.h
8  * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk>
9  * @date   Wed Mar 23 14:01:02 2011
10  * 
11  * @brief  
12  * 
13  * @ingroup pwg2_forward_aod
14  * 
15  */
16 #include <TNamed.h>
17 #include <TList.h>
18 #include "AliForwardUtil.h"
19 class TH2D;
20
21 /** 
22  * @defgroup pwg2_forward_algo Algorithms 
23  *
24  * @ingroup pwg2_forward 
25  */
26 /** 
27  * This class calculates the exclusive charged particle density
28  * in each for the 5 FMD rings. 
29  *
30  * @par Input:
31  *   - 5 RingHistos objects - each with a number of vertex dependent 
32  *     2D histograms of the inclusive charge particle density 
33  *
34  * @par Output:
35  *   - 5 RingHistos objects - each with a number of vertex dependent 
36  *     2D histograms of the exclusive charge particle density 
37  * 
38  * @par Corrections used: 
39  *   - AliFMDCorrSecondaryMap;
40  *   - AliFMDCorrVertexBias
41  *   - AliFMDCorrMergingEfficiency
42  *
43  * @ingroup pwg2_forward_algo 
44  * @ingroup pwg2_forward_aod
45  */
46 class AliFMDCorrector : public TNamed
47 {
48 public:
49   /** 
50    * Constructor 
51    */
52   AliFMDCorrector();
53   /** 
54    * Constructor 
55    * 
56    * @param name Name of object
57    */
58   AliFMDCorrector(const char* name);
59   /** 
60    * Copy constructor 
61    * 
62    * @param o Object to copy from 
63    */
64   AliFMDCorrector(const AliFMDCorrector& o);
65   /** 
66    * Destructor 
67    */
68   virtual ~AliFMDCorrector();
69   /** 
70    * Assignement operator
71    * 
72    * @param o Object to assign from 
73    * 
74    * @return Reference to this object
75    */
76   AliFMDCorrector& operator=(const AliFMDCorrector&);
77   /** 
78    * Initialize this object
79    *
80    * @param etaAxis Eta axis to use  -- not used
81    */
82   virtual void Init(const TAxis& etaAxis);
83   /**
84    * Do the calculations 
85    * 
86    * @param hists    Cache of histograms 
87    * @param vtxBin   Vertex bin 
88    * 
89    * @return true on successs 
90    */
91   virtual Bool_t Correct(AliForwardUtil::Histos& hists, UShort_t vtxBin);
92   /** 
93    * Scale the histograms to the total number of events 
94    * 
95    * @param dir     Where the output is stored
96    * @param nEvents Number of events 
97    */
98   virtual void ScaleHistograms(const TList* dir, Int_t nEvents);
99   /** 
100    * Output diagnostic histograms to directory 
101    * 
102    * @param dir List to write in
103    */  
104   virtual void DefineOutput(TList* dir);
105   /** 
106    * Set the debug level.  The higher the value the more output 
107    * 
108    * @param dbg Debug level 
109    */
110   void SetDebug(Int_t dbg=1) { fDebug = dbg; }
111   /** 
112    * @{
113    * @name Enable/disable parts of the corrections
114    */
115   /** 
116    *  Whether to do correction for secondaries
117    *
118    * @param use If true, use the secondary correction
119    */
120   void SetUseSecondaryMap(Bool_t use=true) { fUseSecondaryMap = use; }
121   /**
122    * Check
123    *
124    * @return true if the correction for secondaries is done
125    */
126   Bool_t IsUseSecondaryMap() const { return fUseSecondaryMap; }
127   /**
128    *  Whether to do correction for vertex bias
129    *
130    * @param use If true, use the vertex bias correction
131    */
132   void SetUseVertexBias(Bool_t use=true) { fUseVertexBias = use; }
133   /**
134    * Check
135    *
136    * @return true if the correction for vertex bias is done
137    */
138   Bool_t IsUseVertexBias() const { return fUseVertexBias; }
139   /**
140    *  Whether to do correction for dead-channel acceptance
141    *
142    * @param use If true, use the dead-channel acceptance correction
143    */
144   void SetUseAcceptance(Bool_t use=true) { fUseAcceptance = use; }
145   /**
146    * Check
147    *
148    * @return true if the correction for dead-channel acceptance is done
149    */
150   Bool_t IsUseAcceptance() const { return fUseAcceptance; }
151   /**
152    * Whether to use the merging efficiency correction
153    *
154    * @param use If true, use the merging efficiency correction
155    */
156   void SetUseMergingEfficiency(Bool_t use=true) { fUseMergingEfficiency = use; }
157   /**
158    * Check
159    *
160    * @return true if the merging efficiency correction is used.
161    */
162   Bool_t IsUseMergingEfficiency() const { return fUseMergingEfficiency; }
163   /* @} */
164
165   /**
166    * Print information
167    * 
168    * @param option Not used 
169    */
170   virtual void Print(Option_t* option="") const;
171 protected:
172   /** 
173    * Internal data structure to keep track of the histograms
174    */
175   struct RingHistos : public AliForwardUtil::RingHistos 
176   { 
177     /** 
178      * Default CTOR
179      */
180     RingHistos();
181     /** 
182      * Constructor
183      * 
184      * @param d detector
185      * @param r ring 
186      */
187     RingHistos(UShort_t d, Char_t r);
188     /** 
189      * Copy constructor 
190      * 
191      * @param o Object to copy from 
192      */
193     RingHistos(const RingHistos& o);
194     /** 
195      * Assignment operator 
196      * 
197      * @param o Object to assign from 
198      * 
199      * @return Reference to this 
200      */
201     RingHistos& operator=(const RingHistos& o);
202     /** 
203      * Destructor 
204      */
205     ~RingHistos();
206     /** 
207      * Make output 
208      * 
209      * @param dir Where to put it 
210      */
211     void Output(TList* dir);
212     /** 
213      * Scale the histograms to the total number of events 
214      * 
215      * @param dir     where the output is stored
216      * @param nEvents Number of events 
217      */
218     void ScaleHistograms(TList* dir, Int_t nEvents);
219     TH2D*     fDensity;      // Distribution primary Nch
220     ClassDef(RingHistos,1);
221   };
222   /** 
223    * Get the ring histogram container 
224    * 
225    * @param d Detector
226    * @param r Ring 
227    * 
228    * @return Ring histogram container 
229    */
230   RingHistos* GetRingHistos(UShort_t d, Char_t r) const;
231
232   TList    fRingHistos;           // List of histogram containers
233   Bool_t   fUseSecondaryMap;      // Whether to do correction for secondaries
234   Bool_t   fUseVertexBias;        // Whether to do correction for vertex bias
235   Bool_t   fUseAcceptance;        // Whether to do correction for dead ch's.
236   Bool_t   fUseMergingEfficiency; // Whether to use the merging efficiency
237   Int_t    fDebug;                //  Debug level 
238
239   ClassDef(AliFMDCorrector,2); // Correct the inclusive d2N/detadphi
240 };
241
242 #endif
243 // Local Variables:
244 //   mode: C++
245 // End:
246