]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FORWARD/analysis2/AliFMDDensityCalculator.h
The revisited SPD cluster analysis in the new AOD framework and the corrections for...
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / AliFMDDensityCalculator.h
CommitLineData
7984e5f7 1// This class calculates the inclusive charged particle density
2// in each for the 5 FMD rings.
3//
4#ifndef ALIFMDDENSITYCALCULATOR_H
5#define ALIFMDDENSITYCALCULATOR_H
7e4038b5 6#include <TNamed.h>
7#include <TList.h>
1174780f 8#include <TArrayI.h>
7e4038b5 9#include "AliForwardUtil.h"
10class AliESDFMD;
11class TH2D;
dd497217 12class TH1D;
0bd4b00f 13class TProfile;
1174780f 14class AliFMDCorrELossFit;
7e4038b5 15
16/**
17 * This class calculates the inclusive charged particle density
18 * in each for the 5 FMD rings.
19 *
20 * @par Input:
21 * - AliESDFMD object possibly corrected for sharing
22 *
23 * @par Output:
24 * - 5 RingHistos objects - each with a number of vertex dependent
25 * 2D histograms of the inclusive charge particle density
26 *
27 * @par Corrections used:
28 * - AliFMDAnaCalibEnergyDistribution
29 * - AliFMDDoubleHitCorrection
30 * - AliFMDDeadCorrection
31 *
8eb443e1 32 * @ingroup pwg2_forward_algo
7e4038b5 33 */
34class AliFMDDensityCalculator : public TNamed
35{
36public:
37 /**
38 * Constructor
39 */
40 AliFMDDensityCalculator();
41 /**
42 * Constructor
43 *
44 * @param name Name of object
45 */
46 AliFMDDensityCalculator(const char* name);
47 /**
48 * Copy constructor
49 *
50 * @param o Object to copy from
51 */
52 AliFMDDensityCalculator(const AliFMDDensityCalculator& o);
53 /**
54 * Destructor
55 */
56 virtual ~AliFMDDensityCalculator();
57 /**
58 * Assignement operator
59 *
60 * @param o Object to assign from
61 *
62 * @return Reference to this object
63 */
7c1a1f1d 64 AliFMDDensityCalculator& operator=(const AliFMDDensityCalculator& o);
1174780f 65 /**
66 * Initialize this sub-algorithm
67 *
68 * @param etaAxis Not used
69 */
70 virtual void Init(const TAxis& etaAxis);
7e4038b5 71 /**
72 * Do the calculations
73 *
74 * @param fmd AliESDFMD object (possibly) corrected for sharing
75 * @param hists Histogram cache
76 * @param vtxBin Vertex bin
77 * @param lowFlux Low flux flag.
78 *
79 * @return true on successs
80 */
81 virtual Bool_t Calculate(const AliESDFMD& fmd,
82 AliForwardUtil::Histos& hists,
0bd4b00f 83 UShort_t vtxBin, Bool_t lowFlux);
7e4038b5 84 /**
85 * Scale the histograms to the total number of events
86 *
c389303e 87 * @param dir where to put the output
7e4038b5 88 * @param nEvents Number of events
89 */
8eb443e1 90 virtual void ScaleHistograms(TList* dir, Int_t nEvents);
7e4038b5 91 /**
92 * Output diagnostic histograms to directory
93 *
94 * @param dir List to write in
95 */
8eb443e1 96 virtual void DefineOutput(TList* dir);
ea3e5d95 97 /**
98 * Set the debug level. The higher the value the more output
99 *
100 * @param dbg Debug level
101 */
102 void SetDebug(Int_t dbg=1) { fDebug = dbg; }
0bd4b00f 103 /**
104 * Maximum particle weight to use
105 *
106 * @param m
107 */
108 void SetMaxParticles(UShort_t m) { fMaxParticles = m; }
109 /**
110 * Set the lower multiplicity cut. This overrides the setting in
111 * the energy loss fits.
112 *
113 * @param cut Cut to use
114 */
115 void SetMultCut(Double_t cut) { fMultCut = cut; }
116 /**
117 * Get the multiplicity cut. If the user has set fMultCut (via
118 * SetMultCut) then that value is used. If not, then the lower
119 * value of the fit range for the enery loss fits is returned.
120 *
121 * @return Lower cut on multiplicity
122 */
123 Double_t GetMultCut() const;
124 /**
125 * Print information
126 *
1174780f 127 * @param option Print options
128 * - max Print max weights
0bd4b00f 129 */
130 void Print(Option_t* option="") const;
7e4038b5 131protected:
1174780f 132 /**
133 * Find the max weight to use for FMD<i>dr</i> in eta bin @a iEta
134 *
135 * @param cor Correction
136 * @param d Detector
137 * @param r Ring
138 * @param iEta Eta bin
139 */
140 Int_t FindMaxWeight(AliFMDCorrELossFit* cor,
141 UShort_t d, Char_t r, Int_t iEta) const;
142
143 /**
144 * Find the max weights and cache them
145 *
146 */
147 void CacheMaxWeights();
148 /**
149 * Find the (cached) maximum weight for FMD<i>dr</i> in
150 * @f$\eta@f$ bin @a iEta
151 *
152 * @param d Detector
153 * @param r Ring
154 * @param iEta Eta bin
155 *
156 * @return max weight or <= 0 in case of problems
157 */
158 Int_t GetMaxWeight(UShort_t d, Char_t r, Int_t iEta) const;
159 /**
160 * Find the (cached) maximum weight for FMD<i>dr</i> iat
161 * @f$\eta@f$
162 *
163 * @param d Detector
164 * @param r Ring
165 * @param eta Eta bin
166 *
167 * @return max weight or <= 0 in case of problems
168 */
169 Int_t GetMaxWeight(UShort_t d, Char_t r, Float_t eta) const;
170
7e4038b5 171 /**
172 * Get the number of particles corresponding to the signal mult
173 *
174 * @param mult Signal
175 * @param d Detector
176 * @param r Ring
177 * @param s Sector
178 * @param t Strip (not used)
179 * @param v Vertex bin
180 * @param eta Pseudo-rapidity
181 * @param lowFlux Low-flux flag
182 *
183 * @return The number of particles
184 */
185 virtual Float_t NParticles(Float_t mult,
186 UShort_t d, Char_t r, UShort_t s, UShort_t t,
0bd4b00f 187 UShort_t v, Float_t eta, Bool_t lowFlux) const;
7e4038b5 188 /**
189 * Get the inverse correction factor. This consist of
190 *
191 * - acceptance correction (corners of sensors)
192 * - double hit correction (for low-flux events)
193 * - dead strip correction
194 *
195 * @param d Detector
196 * @param r Ring
197 * @param s Sector
198 * @param t Strip (not used)
199 * @param v Vertex bin
200 * @param eta Pseudo-rapidity
201 * @param lowFlux Low-flux flag
202 *
203 * @return
204 */
205 virtual Float_t Correction(UShort_t d, Char_t r, UShort_t s, UShort_t t,
0bd4b00f 206 UShort_t v, Float_t eta, Bool_t lowFlux) const;
7e4038b5 207 /**
208 * Get the acceptance correction for strip @a t in an ring of type @a r
209 *
210 * @param r Ring type ('I' or 'O')
211 * @param t Strip number
212 *
213 * @return Inverse acceptance correction
214 */
215 virtual Float_t AcceptanceCorrection(Char_t r, UShort_t t) const;
0bd4b00f 216 /**
217 * Generate the acceptance corrections
218 *
219 * @param r Ring to generate for
220 *
221 * @return Newly allocated histogram of acceptance corrections
222 */
223 virtual TH1D* GenerateAcceptanceCorrection(Char_t r) const;
7e4038b5 224 /**
225 * Internal data structure to keep track of the histograms
226 */
9d99b0dd 227 struct RingHistos : public AliForwardUtil::RingHistos
7e4038b5 228 {
229 /**
230 * Default CTOR
231 */
232 RingHistos();
233 /**
234 * Constructor
235 *
236 * @param d detector
237 * @param r ring
238 */
239 RingHistos(UShort_t d, Char_t r);
240 /**
241 * Copy constructor
242 *
243 * @param o Object to copy from
244 */
245 RingHistos(const RingHistos& o);
246 /**
247 * Assignment operator
248 *
249 * @param o Object to assign from
250 *
251 * @return Reference to this
252 */
253 RingHistos& operator=(const RingHistos& o);
254 /**
255 * Destructor
256 */
257 ~RingHistos();
c389303e 258 /**
259 * Make output
260 *
261 * @param dir Where to put it
262 */
7e4038b5 263 void Output(TList* dir);
9d99b0dd 264 /**
265 * Scale the histograms to the total number of events
266 *
c389303e 267 * @param dir Where the output is
9d99b0dd 268 * @param nEvents Number of events
269 */
270 void ScaleHistograms(TList* dir, Int_t nEvents);
7e4038b5 271 TH2D* fEvsN; // Correlation of Eloss vs uncorrected Nch
272 TH2D* fEvsM; // Correlation of Eloss vs corrected Nch
0bd4b00f 273 TProfile* fEtaVsN; // Average uncorrected Nch vs eta
274 TProfile* fEtaVsM; // Average corrected Nch vs eta
275 TProfile* fCorr; // Average correction vs eta
7e4038b5 276 TH2D* fDensity; // Distribution inclusive Nch
9d99b0dd 277 ClassDef(RingHistos,1);
7e4038b5 278 };
279 /**
280 * Get the ring histogram container
281 *
282 * @param d Detector
283 * @param r Ring
284 *
285 * @return Ring histogram container
286 */
287 RingHistos* GetRingHistos(UShort_t d, Char_t r) const;
288
ea3e5d95 289 TList fRingHistos; // List of histogram containers
290 Double_t fMultCut; // Low cut on scaled energy loss
1174780f 291 TH1D* fSumOfWeights; // Histogram
292 TH1D* fWeightedSum; // Histogram
293 TH1D* fCorrections; // Histogram
0bd4b00f 294 UShort_t fMaxParticles; // Maximum particle weight to use
295 TH1D* fAccI; // Acceptance correction for inner rings
296 TH1D* fAccO; // Acceptance correction for outer rings
1174780f 297 TArrayI fFMD1iMax; // Array of max weights
298 TArrayI fFMD2iMax; // Array of max weights
299 TArrayI fFMD2oMax; // Array of max weights
300 TArrayI fFMD3iMax; // Array of max weights
301 TArrayI fFMD3oMax; // Array of max weights
ea3e5d95 302 Int_t fDebug; // Debug level
7e4038b5 303
304 ClassDef(AliFMDDensityCalculator,1); // Calculate Nch density
305};
306
307#endif
308// Local Variables:
309// mode: C++
310// End:
311