Coverity fix 11174 (B.Hippolyte)
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / AliBasedNdetaTask.h
CommitLineData
ce85db45 1//
2// Task to analyse the AOD for for dN/deta in the base regions
3//
4#ifndef ALIBASEDNDETATASK_H
5#define ALIBASEDNDETATASK_H
6#include <AliAnalysisTaskSE.h>
7// #include <AliAODBaseMult.h>
8class TList;
9class TH2D;
10class TH1D;
11class AliAODEvent;
12
13/**
14 * Task to determine the
15 */
16class AliBasedNdetaTask : public AliAnalysisTaskSE
17{
18public:
19 /**
20 * Constructor
21 *
22 */
23 AliBasedNdetaTask();
24 /**
25 * Constructor
26 *
27 * @param name Name of task
28 * @param maxVtx Set @f$v_z@f$ range
29 */
30 AliBasedNdetaTask(const char* name);
31
32 /**
33 * Set the vertex range to use
34 *
35 * @param min Minimum (in centermeter)
36 * @param max Maximum (in centermeter)
37 */
38 void SetVertexRange(Double_t min, Double_t max) { fVtxMin=min; fVtxMax=max; }
39 /**
40 * Set the rebinning factor
41 *
42 * @param rebin Rebinning factor
43 */
44 void SetRebinning(Int_t rebin) { fRebin = rebin; }
45 /**
46 * Set the trigger maskl
47 *
48 * @param mask Trigger mask
49 */
50 void SetTriggerMask(UShort_t mask) { fTriggerMask = mask; }
51 /**
52 * Set the trigger mask
53 *
54 * @param mask trigger mask
55 */
56 void SetTriggerMask(const char* mask);
e58000b7 57 /**
58 * Trigger efficiency for selected trigger(s)
59 *
60 * @param e Trigger efficiency
61 */
3846ec25 62 void SetCutEdges(Bool_t cut) {fCutEdges = cut;}
63 /**
64 * Trigger efficiency for selected trigger(s)
65 *
66 * @param e Trigger efficiency
67 */
e58000b7 68 void SetTriggerEff(Double_t e) { fTriggerEff = e; }
69 /**
70 * Set the shape correction (a.k.a., track correction) for selected
71 * trigger(s)
72 *
73 * @param h Correction
74 */
3846ec25 75 void LoadNormalizationData(UShort_t sys, UShort_t energy);
76
e58000b7 77 void SetShapeCorrection(const TH1* h);
ce85db45 78 /**
79 * Destructor
80 *
81 */
82 virtual ~AliBasedNdetaTask();
83 /**
84 * Initialise on master - does nothing
85 *
86 */
87 virtual void Init() {}
88 /**
89 * Create output objects.
90 *
91 * This is called once per slave process
92 */
93 virtual void UserCreateOutputObjects();
94 /**
95 * Process a single event
96 *
97 * @param option Not used
98 */
99 virtual void UserExec(Option_t* option);
100 /**
101 * Called at end of event processing..
102 *
103 * This is called once in the master
104 *
105 * @param option Not used
106 */
107 virtual void Terminate(Option_t* option);
108protected:
109 AliBasedNdetaTask(const AliBasedNdetaTask&);
110 AliBasedNdetaTask& operator=(const AliBasedNdetaTask&) { return *this; }
111
112 /**
113 * Retrieve the histogram
114 *
115 * @param aod AOD event
116 * @param mc Whether to get the MC histogram or not
117 *
118 * @return Retrieved histogram or null
119 */
fb3430ac 120 virtual TH2D* GetHistogram(const AliAODEvent* aod, Bool_t mc=false) = 0;
ce85db45 121 /**
122 * Check the trigger and vertex
123 *
124 * @param aod
125 *
126 * @return
127 */
fb3430ac 128 Bool_t CheckEvent(const AliAODEvent* aod);
ce85db45 129 /**
130 * Clone a 2D histogram
131 *
132 * @param in Histogram to clone.
133 * @param name New name of clone.
134 *
135 * @return The clone
136 */
fb3430ac 137 TH2D* CloneHist(const TH2D* in, const char* name);
ce85db45 138 /**
139 * Make a copy of the input histogram and rebin that histogram
140 *
141 * @param h Histogram to rebin
142 *
143 * @return New (rebinned) histogram
144 */
145 TH1D* Rebin(const TH1D* h) const;
146 /**
147 * Make an extension of @a h to make it symmetric about 0
148 *
149 * @param h Histogram to symmertrice
150 *
151 * @return Symmetric extension of @a h
152 */
153 TH1* Symmetrice(const TH1* h) const;
154 /**
155 * Project onto the X axis
156 *
157 * @param h 2D histogram
158 * @param name New name
159 * @param firstbin First bin to use
160 * @param lastbin Last bin to use
161 * @param error Whether to calculate errors
162 *
163 * @return Newly created histogram or null
164 */
165 TH1D* ProjectX(const TH2D* h,
166 const char* name,
167 Int_t firstbin,
168 Int_t lastbin,
169 bool corr=true,
170 bool error=true) const;
171 /**
172 * Set histogram graphical options, etc.
173 *
174 * @param h Histogram to modify
175 * @param colour Marker color
176 * @param marker Marker style
177 * @param title Title of histogram
178 * @param ytitle Title on y-axis.
179 */
180 void SetHistogramAttributes(TH1D* h, Int_t colour, Int_t marker,
181 const char* title,
182 const char* ytitle="#frac{1}{N} #frac{dN_{ch}}{d#eta}");
183 /**
184 * Trigger histogram bins
185 */
186 enum {
187 kAll = 1,
188 kB = 2,
189 kA = 3,
190 kC = 4,
191 kE = 5,
3846ec25 192 kMB = 6,
193 kPileUp = 7,
194 kWithTrigger= 8,
195 kWithVertex = 9,
196 kAccepted = 10,
197 kMCNSD = 11
ce85db45 198 };
199
200 TH2D* fSum; // Sum of histograms
201 TH2D* fSumMC; // Sum of MC histograms (if any)
202
203 TList* fSums; // Container of sums
204 TList* fOutput; // Container of outputs
205
206 TH1D* fTriggers; // Histogram of triggers
207
208 Double_t fVtxMin; // Minimum v_z
209 Double_t fVtxMax; // Maximum v_z
210 Int_t fTriggerMask; // Trigger mask
211 Int_t fRebin; // Rebinning factor
212 Bool_t fCutEdges; // Whether to cut edges when rebinning
213 Bool_t fSymmetrice; // Whether to symmetrice data
214 Bool_t fCorrEmpty; // Correct for empty bins
e58000b7 215 Double_t fTriggerEff; // Trigger efficiency for selected trigger(s)
216 TH1* fShapeCorr; // Shape correction
3846ec25 217 Float_t fCentLow; // Low centrality cut
218 Float_t fCentHigh; // High centrality cut
219
ce85db45 220 ClassDef(AliBasedNdetaTask,1); // Determine multiplicity in base area
221};
222
223#endif
224//
225// Local Variables:
226// mode: C++
227// End:
228//