Make sure that histograms are obtained from output list in
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / AliFMDDensityCalculator.h
CommitLineData
7e4038b5 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"
6class AliESDFMD;
7class 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 */
27class AliFMDDensityCalculator : public TNamed
28{
29public:
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 */
9d99b0dd 76 void ScaleHistograms(TList* dir, Int_t nEvents);
7e4038b5 77 /**
78 * Output diagnostic histograms to directory
79 *
80 * @param dir List to write in
81 */
9d99b0dd 82 void DefineOutput(TList* dir);
7e4038b5 83protected:
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 */
9d99b0dd 133 struct RingHistos : public AliForwardUtil::RingHistos
7e4038b5 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);
9d99b0dd 165 /**
166 * Scale the histograms to the total number of events
167 *
168 * @param nEvents Number of events
169 */
170 void ScaleHistograms(TList* dir, Int_t nEvents);
7e4038b5 171 TH2D* fEvsN; // Correlation of Eloss vs uncorrected Nch
172 TH2D* fEvsM; // Correlation of Eloss vs corrected Nch
173 TH2D* fDensity; // Distribution inclusive Nch
9d99b0dd 174 ClassDef(RingHistos,1);
7e4038b5 175 };
176 /**
177 * Get the ring histogram container
178 *
179 * @param d Detector
180 * @param r Ring
181 *
182 * @return Ring histogram container
183 */
184 RingHistos* GetRingHistos(UShort_t d, Char_t r) const;
185
186 TList fRingHistos; // List of histogram containers
187 Double_t fMultCut; // Low cut on scaled energy loss
188
189 ClassDef(AliFMDDensityCalculator,1); // Calculate Nch density
190};
191
192#endif
193// Local Variables:
194// mode: C++
195// End:
196