1 #ifndef ALIROOT_PWG2_FORWARD_ANALYSIS2_ALIFMDDENSITYCALCULATOR_H
2 #define ALIROOT_PWG2_FORWARD_ANALYSIS2_ALIFMDDENSITYCALCULATOR_H
5 #include "AliForwardUtil.h"
12 * This class calculates the inclusive charged particle density
13 * in each for the 5 FMD rings.
16 * - AliESDFMD object possibly corrected for sharing
19 * - 5 RingHistos objects - each with a number of vertex dependent
20 * 2D histograms of the inclusive charge particle density
22 * @par Corrections used:
23 * - AliFMDAnaCalibEnergyDistribution
24 * - AliFMDDoubleHitCorrection
25 * - AliFMDDeadCorrection
27 * @ingroup pwg2_forward
29 class AliFMDDensityCalculator : public TNamed
35 AliFMDDensityCalculator();
39 * @param name Name of object
41 AliFMDDensityCalculator(const char* name);
45 * @param o Object to copy from
47 AliFMDDensityCalculator(const AliFMDDensityCalculator& o);
51 virtual ~AliFMDDensityCalculator();
53 * Assignement operator
55 * @param o Object to assign from
57 * @return Reference to this object
59 AliFMDDensityCalculator& operator=(const AliFMDDensityCalculator& o);
63 * @param fmd AliESDFMD object (possibly) corrected for sharing
64 * @param hists Histogram cache
65 * @param vtxBin Vertex bin
66 * @param lowFlux Low flux flag.
68 * @return true on successs
70 virtual Bool_t Calculate(const AliESDFMD& fmd,
71 AliForwardUtil::Histos& hists,
72 UShort_t vtxBin, Bool_t lowFlux);
74 * Scale the histograms to the total number of events
76 * @param dir where to put the output
77 * @param nEvents Number of events
79 void ScaleHistograms(TList* dir, Int_t nEvents);
81 * Output diagnostic histograms to directory
83 * @param dir List to write in
85 void DefineOutput(TList* dir);
87 * Set the debug level. The higher the value the more output
89 * @param dbg Debug level
91 void SetDebug(Int_t dbg=1) { fDebug = dbg; }
93 * Maximum particle weight to use
97 void SetMaxParticles(UShort_t m) { fMaxParticles = m; }
99 * Set the lower multiplicity cut. This overrides the setting in
100 * the energy loss fits.
102 * @param cut Cut to use
104 void SetMultCut(Double_t cut) { fMultCut = cut; }
106 * Get the multiplicity cut. If the user has set fMultCut (via
107 * SetMultCut) then that value is used. If not, then the lower
108 * value of the fit range for the enery loss fits is returned.
110 * @return Lower cut on multiplicity
112 Double_t GetMultCut() const;
116 * @param option Not used
118 void Print(Option_t* option="") const;
121 * Get the number of particles corresponding to the signal mult
127 * @param t Strip (not used)
128 * @param v Vertex bin
129 * @param eta Pseudo-rapidity
130 * @param lowFlux Low-flux flag
132 * @return The number of particles
134 virtual Float_t NParticles(Float_t mult,
135 UShort_t d, Char_t r, UShort_t s, UShort_t t,
136 UShort_t v, Float_t eta, Bool_t lowFlux) const;
138 * Get the inverse correction factor. This consist of
140 * - acceptance correction (corners of sensors)
141 * - double hit correction (for low-flux events)
142 * - dead strip correction
147 * @param t Strip (not used)
148 * @param v Vertex bin
149 * @param eta Pseudo-rapidity
150 * @param lowFlux Low-flux flag
154 virtual Float_t Correction(UShort_t d, Char_t r, UShort_t s, UShort_t t,
155 UShort_t v, Float_t eta, Bool_t lowFlux) const;
157 * Get the acceptance correction for strip @a t in an ring of type @a r
159 * @param r Ring type ('I' or 'O')
160 * @param t Strip number
162 * @return Inverse acceptance correction
164 virtual Float_t AcceptanceCorrection(Char_t r, UShort_t t) const;
166 * Generate the acceptance corrections
168 * @param r Ring to generate for
170 * @return Newly allocated histogram of acceptance corrections
172 virtual TH1D* GenerateAcceptanceCorrection(Char_t r) const;
174 * Internal data structure to keep track of the histograms
176 struct RingHistos : public AliForwardUtil::RingHistos
188 RingHistos(UShort_t d, Char_t r);
192 * @param o Object to copy from
194 RingHistos(const RingHistos& o);
196 * Assignment operator
198 * @param o Object to assign from
200 * @return Reference to this
202 RingHistos& operator=(const RingHistos& o);
210 * @param dir Where to put it
212 void Output(TList* dir);
214 * Scale the histograms to the total number of events
216 * @param dir Where the output is
217 * @param nEvents Number of events
219 void ScaleHistograms(TList* dir, Int_t nEvents);
220 TH2D* fEvsN; // Correlation of Eloss vs uncorrected Nch
221 TH2D* fEvsM; // Correlation of Eloss vs corrected Nch
222 TProfile* fEtaVsN; // Average uncorrected Nch vs eta
223 TProfile* fEtaVsM; // Average corrected Nch vs eta
224 TProfile* fCorr; // Average correction vs eta
225 TH2D* fDensity; // Distribution inclusive Nch
226 ClassDef(RingHistos,1);
229 * Get the ring histogram container
234 * @return Ring histogram container
236 RingHistos* GetRingHistos(UShort_t d, Char_t r) const;
238 TList fRingHistos; // List of histogram containers
239 Double_t fMultCut; // Low cut on scaled energy loss
240 TH1D* fSumOfWeights; //! Histogram
241 TH1D* fWeightedSum; //! Histogram
242 TH1D* fCorrections; //! Histogram
243 UShort_t fMaxParticles; // Maximum particle weight to use
244 TH1D* fAccI; // Acceptance correction for inner rings
245 TH1D* fAccO; // Acceptance correction for outer rings
246 Int_t fDebug; // Debug level
248 ClassDef(AliFMDDensityCalculator,1); // Calculate Nch density