1 // This class calculates the inclusive charged particle density
2 // in each for the 5 FMD rings.
4 #ifndef ALIFMDDENSITYCALCULATOR_H
5 #define ALIFMDDENSITYCALCULATOR_H
9 #include "AliForwardUtil.h"
14 class AliFMDCorrELossFit;
17 * This class calculates the inclusive charged particle density
18 * in each for the 5 FMD rings.
21 * - AliESDFMD object possibly corrected for sharing
24 * - 5 RingHistos objects - each with a number of vertex dependent
25 * 2D histograms of the inclusive charge particle density
27 * @par Corrections used:
28 * - AliFMDAnaCalibEnergyDistribution
29 * - AliFMDDoubleHitCorrection
30 * - AliFMDDeadCorrection
32 * @ingroup pwg2_forward_algo
34 class AliFMDDensityCalculator : public TNamed
40 AliFMDDensityCalculator();
44 * @param name Name of object
46 AliFMDDensityCalculator(const char* name);
50 * @param o Object to copy from
52 AliFMDDensityCalculator(const AliFMDDensityCalculator& o);
56 virtual ~AliFMDDensityCalculator();
58 * Assignement operator
60 * @param o Object to assign from
62 * @return Reference to this object
64 AliFMDDensityCalculator& operator=(const AliFMDDensityCalculator& o);
66 * Initialize this sub-algorithm
68 * @param etaAxis Not used
70 virtual void Init(const TAxis& etaAxis);
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.
79 * @return true on successs
81 virtual Bool_t Calculate(const AliESDFMD& fmd,
82 AliForwardUtil::Histos& hists,
83 UShort_t vtxBin, Bool_t lowFlux);
85 * Scale the histograms to the total number of events
87 * @param dir where to put the output
88 * @param nEvents Number of events
90 virtual void ScaleHistograms(TList* dir, Int_t nEvents);
92 * Output diagnostic histograms to directory
94 * @param dir List to write in
96 virtual void DefineOutput(TList* dir);
98 * Set the debug level. The higher the value the more output
100 * @param dbg Debug level
102 void SetDebug(Int_t dbg=1) { fDebug = dbg; }
104 * Maximum particle weight to use
108 void SetMaxParticles(UShort_t m) { fMaxParticles = m; }
110 * Set the lower multiplicity cut. This overrides the setting in
111 * the energy loss fits.
113 * @param cut Cut to use
115 void SetMultCut(Double_t cut) { fMultCut = cut; }
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.
121 * @return Lower cut on multiplicity
123 Double_t GetMultCut() const;
127 * @param option Print options
128 * - max Print max weights
130 void Print(Option_t* option="") const;
133 * Find the max weight to use for FMD<i>dr</i> in eta bin @a iEta
135 * @param cor Correction
138 * @param iEta Eta bin
140 Int_t FindMaxWeight(AliFMDCorrELossFit* cor,
141 UShort_t d, Char_t r, Int_t iEta) const;
144 * Find the max weights and cache them
147 void CacheMaxWeights();
149 * Find the (cached) maximum weight for FMD<i>dr</i> in
150 * @f$\eta@f$ bin @a iEta
154 * @param iEta Eta bin
156 * @return max weight or <= 0 in case of problems
158 Int_t GetMaxWeight(UShort_t d, Char_t r, Int_t iEta) const;
160 * Find the (cached) maximum weight for FMD<i>dr</i> iat
167 * @return max weight or <= 0 in case of problems
169 Int_t GetMaxWeight(UShort_t d, Char_t r, Float_t eta) const;
172 * Get the number of particles corresponding to the signal mult
178 * @param t Strip (not used)
179 * @param v Vertex bin
180 * @param eta Pseudo-rapidity
181 * @param lowFlux Low-flux flag
183 * @return The number of particles
185 virtual Float_t NParticles(Float_t mult,
186 UShort_t d, Char_t r, UShort_t s, UShort_t t,
187 UShort_t v, Float_t eta, Bool_t lowFlux) const;
189 * Get the inverse correction factor. This consist of
191 * - acceptance correction (corners of sensors)
192 * - double hit correction (for low-flux events)
193 * - dead strip correction
198 * @param t Strip (not used)
199 * @param v Vertex bin
200 * @param eta Pseudo-rapidity
201 * @param lowFlux Low-flux flag
205 virtual Float_t Correction(UShort_t d, Char_t r, UShort_t s, UShort_t t,
206 UShort_t v, Float_t eta, Bool_t lowFlux) const;
208 * Get the acceptance correction for strip @a t in an ring of type @a r
210 * @param r Ring type ('I' or 'O')
211 * @param t Strip number
213 * @return Inverse acceptance correction
215 virtual Float_t AcceptanceCorrection(Char_t r, UShort_t t) const;
217 * Generate the acceptance corrections
219 * @param r Ring to generate for
221 * @return Newly allocated histogram of acceptance corrections
223 virtual TH1D* GenerateAcceptanceCorrection(Char_t r) const;
225 * Internal data structure to keep track of the histograms
227 struct RingHistos : public AliForwardUtil::RingHistos
239 RingHistos(UShort_t d, Char_t r);
243 * @param o Object to copy from
245 RingHistos(const RingHistos& o);
247 * Assignment operator
249 * @param o Object to assign from
251 * @return Reference to this
253 RingHistos& operator=(const RingHistos& o);
261 * @param dir Where to put it
263 void Output(TList* dir);
265 * Scale the histograms to the total number of events
267 * @param dir Where the output is
268 * @param nEvents Number of events
270 void ScaleHistograms(TList* dir, Int_t nEvents);
271 TH2D* fEvsN; // Correlation of Eloss vs uncorrected Nch
272 TH2D* fEvsM; // Correlation of Eloss vs corrected Nch
273 TProfile* fEtaVsN; // Average uncorrected Nch vs eta
274 TProfile* fEtaVsM; // Average corrected Nch vs eta
275 TProfile* fCorr; // Average correction vs eta
276 TH2D* fDensity; // Distribution inclusive Nch
277 ClassDef(RingHistos,1);
280 * Get the ring histogram container
285 * @return Ring histogram container
287 RingHistos* GetRingHistos(UShort_t d, Char_t r) const;
289 TList fRingHistos; // List of histogram containers
290 Double_t fMultCut; // Low cut on scaled energy loss
291 TH1D* fSumOfWeights; // Histogram
292 TH1D* fWeightedSum; // Histogram
293 TH1D* fCorrections; // Histogram
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
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
302 Int_t fDebug; // Debug level
304 ClassDef(AliFMDDensityCalculator,1); // Calculate Nch density