]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FORWARD/analysis2/AliFMDDensityCalculator.h
New implementation of the forward multiplicity analysis.
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / AliFMDDensityCalculator.h
1 #ifndef ALIROOT_PWG2_FORWARD_ANALYSIS2_ALIFMDDENSITYCALCULATOR_H
2 #define ALIROOT_PWG2_FORWARD_ANALYSIS2_ALIFMDDENSITYCALCULATOR_H
3 #include <TNamed.h>
4 #include <TList.h>
5 #include "AliForwardUtil.h"
6 class AliESDFMD;
7 class TH2D;
8
9 /** 
10  * This class calculates the inclusive charged particle density
11  * in each for the 5 FMD rings. 
12  *
13  * @par Input:
14  *   - AliESDFMD object possibly corrected for sharing
15  *
16  * @par Output:
17  *   - 5 RingHistos objects - each with a number of vertex dependent 
18  *     2D histograms of the inclusive charge particle density 
19  * 
20  * @par Corrections used: 
21  *   - AliFMDAnaCalibEnergyDistribution 
22  *   - AliFMDDoubleHitCorrection 
23  *   - AliFMDDeadCorrection 
24  *
25  * @ingroup pwg2_forward_analysis 
26  */
27 class AliFMDDensityCalculator : public TNamed
28 {
29 public:
30   /** 
31    * Constructor 
32    */
33   AliFMDDensityCalculator();
34   /** 
35    * Constructor 
36    * 
37    * @param name Name of object
38    */
39   AliFMDDensityCalculator(const char* name);
40   /** 
41    * Copy constructor 
42    * 
43    * @param o Object to copy from 
44    */
45   AliFMDDensityCalculator(const AliFMDDensityCalculator& o);
46   /** 
47    * Destructor 
48    */
49   virtual ~AliFMDDensityCalculator();
50   /** 
51    * Assignement operator
52    * 
53    * @param o Object to assign from 
54    * 
55    * @return Reference to this object
56    */
57   AliFMDDensityCalculator& operator=(const AliFMDDensityCalculator&);
58   /** 
59    * Do the calculations 
60    * 
61    * @param fmd      AliESDFMD object (possibly) corrected for sharing
62    * @param hists    Histogram cache
63    * @param vtxBin   Vertex bin 
64    * @param lowFlux  Low flux flag. 
65    * 
66    * @return true on successs 
67    */
68   virtual Bool_t Calculate(const AliESDFMD& fmd, 
69                            AliForwardUtil::Histos& hists, 
70                            Int_t vtxBin, Bool_t lowFlux);
71   /** 
72    * Scale the histograms to the total number of events 
73    * 
74    * @param nEvents Number of events 
75    */
76   void ScaleHistograms(Int_t nEvents);
77   /** 
78    * Output diagnostic histograms to directory 
79    * 
80    * @param dir List to write in
81    */  
82   void Output(TList* dir);
83 protected:
84   /** 
85    * Get the number of particles corresponding to the signal mult
86    * 
87    * @param mult     Signal
88    * @param d        Detector
89    * @param r        Ring 
90    * @param s        Sector 
91    * @param t        Strip (not used)
92    * @param v        Vertex bin 
93    * @param eta      Pseudo-rapidity 
94    * @param lowFlux  Low-flux flag 
95    * 
96    * @return The number of particles 
97    */
98   virtual Float_t NParticles(Float_t mult, 
99                              UShort_t d, Char_t r, UShort_t s, UShort_t t, 
100                              Int_t v, Float_t eta, Bool_t lowFlux) const;
101   /** 
102    * Get the inverse correction factor.  This consist of
103    * 
104    * - acceptance correction (corners of sensors) 
105    * - double hit correction (for low-flux events) 
106    * - dead strip correction 
107    * 
108    * @param d        Detector
109    * @param r        Ring 
110    * @param s        Sector 
111    * @param t        Strip (not used)
112    * @param v        Vertex bin 
113    * @param eta      Pseudo-rapidity 
114    * @param lowFlux  Low-flux flag 
115    * 
116    * @return 
117    */
118   virtual Float_t Correction(UShort_t d, Char_t r, UShort_t s, UShort_t t, 
119                              Int_t v, Float_t eta, Bool_t lowFlux) const;
120   /** 
121    * Get the acceptance correction for strip @a t in an ring of type @a r
122    * 
123    * @param r  Ring type ('I' or 'O')
124    * @param t  Strip number 
125    * 
126    * @return Inverse acceptance correction 
127    */
128   virtual Float_t AcceptanceCorrection(Char_t r, UShort_t t) const;
129
130   /** 
131    * Internal data structure to keep track of the histograms
132    */
133   struct RingHistos : public TObject 
134   { 
135     /** 
136      * Default CTOR
137      */
138     RingHistos();
139     /** 
140      * Constructor
141      * 
142      * @param d detector
143      * @param r ring 
144      */
145     RingHistos(UShort_t d, Char_t r);
146     /** 
147      * Copy constructor 
148      * 
149      * @param o Object to copy from 
150      */
151     RingHistos(const RingHistos& o);
152     /** 
153      * Assignment operator 
154      * 
155      * @param o Object to assign from 
156      * 
157      * @return Reference to this 
158      */
159     RingHistos& operator=(const RingHistos& o);
160     /** 
161      * Destructor 
162      */
163     ~RingHistos();
164     void Output(TList* dir);
165     UShort_t  fDet;          // Detector
166     Char_t    fRing;         // Ring
167     TH2D*     fEvsN;         // Correlation of Eloss vs uncorrected Nch
168     TH2D*     fEvsM;         // Correlation of Eloss vs corrected Nch
169     TH2D*     fDensity;      // Distribution inclusive Nch
170   };
171   /** 
172    * Get the ring histogram container 
173    * 
174    * @param d Detector
175    * @param r Ring 
176    * 
177    * @return Ring histogram container 
178    */
179   RingHistos* GetRingHistos(UShort_t d, Char_t r) const;
180
181   TList    fRingHistos;    // List of histogram containers
182   Double_t fMultCut;       // Low cut on scaled energy loss
183
184   ClassDef(AliFMDDensityCalculator,1); // Calculate Nch density 
185 };
186
187 #endif
188 // Local Variables:
189 //   mode: C++
190 // End:
191