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