remove svn:executable
[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 */
62 void SetTriggerEff(Double_t e) { fTriggerEff = e; }
63 /**
64 * Set the shape correction (a.k.a., track correction) for selected
65 * trigger(s)
66 *
67 * @param h Correction
68 */
69 void SetShapeCorrection(const TH1* h);
ce85db45 70 /**
71 * Destructor
72 *
73 */
74 virtual ~AliBasedNdetaTask();
75 /**
76 * Initialise on master - does nothing
77 *
78 */
79 virtual void Init() {}
80 /**
81 * Create output objects.
82 *
83 * This is called once per slave process
84 */
85 virtual void UserCreateOutputObjects();
86 /**
87 * Process a single event
88 *
89 * @param option Not used
90 */
91 virtual void UserExec(Option_t* option);
92 /**
93 * Called at end of event processing..
94 *
95 * This is called once in the master
96 *
97 * @param option Not used
98 */
99 virtual void Terminate(Option_t* option);
100protected:
101 AliBasedNdetaTask(const AliBasedNdetaTask&);
102 AliBasedNdetaTask& operator=(const AliBasedNdetaTask&) { return *this; }
103
104 /**
105 * Retrieve the histogram
106 *
107 * @param aod AOD event
108 * @param mc Whether to get the MC histogram or not
109 *
110 * @return Retrieved histogram or null
111 */
fb3430ac 112 virtual TH2D* GetHistogram(const AliAODEvent* aod, Bool_t mc=false) = 0;
ce85db45 113 /**
114 * Check the trigger and vertex
115 *
116 * @param aod
117 *
118 * @return
119 */
fb3430ac 120 Bool_t CheckEvent(const AliAODEvent* aod);
ce85db45 121 /**
122 * Clone a 2D histogram
123 *
124 * @param in Histogram to clone.
125 * @param name New name of clone.
126 *
127 * @return The clone
128 */
fb3430ac 129 TH2D* CloneHist(const TH2D* in, const char* name);
ce85db45 130 /**
131 * Make a copy of the input histogram and rebin that histogram
132 *
133 * @param h Histogram to rebin
134 *
135 * @return New (rebinned) histogram
136 */
137 TH1D* Rebin(const TH1D* h) const;
138 /**
139 * Make an extension of @a h to make it symmetric about 0
140 *
141 * @param h Histogram to symmertrice
142 *
143 * @return Symmetric extension of @a h
144 */
145 TH1* Symmetrice(const TH1* h) const;
146 /**
147 * Project onto the X axis
148 *
149 * @param h 2D histogram
150 * @param name New name
151 * @param firstbin First bin to use
152 * @param lastbin Last bin to use
153 * @param error Whether to calculate errors
154 *
155 * @return Newly created histogram or null
156 */
157 TH1D* ProjectX(const TH2D* h,
158 const char* name,
159 Int_t firstbin,
160 Int_t lastbin,
161 bool corr=true,
162 bool error=true) const;
163 /**
164 * Set histogram graphical options, etc.
165 *
166 * @param h Histogram to modify
167 * @param colour Marker color
168 * @param marker Marker style
169 * @param title Title of histogram
170 * @param ytitle Title on y-axis.
171 */
172 void SetHistogramAttributes(TH1D* h, Int_t colour, Int_t marker,
173 const char* title,
174 const char* ytitle="#frac{1}{N} #frac{dN_{ch}}{d#eta}");
175 /**
176 * Trigger histogram bins
177 */
178 enum {
179 kAll = 1,
180 kB = 2,
181 kA = 3,
182 kC = 4,
183 kE = 5,
184 kMB = 6,
185 kWithTrigger= 7,
186 kWithVertex = 8,
e58000b7 187 kAccepted = 9,
188 kMCNSD = 10
ce85db45 189 };
190
191 TH2D* fSum; // Sum of histograms
192 TH2D* fSumMC; // Sum of MC histograms (if any)
193
194 TList* fSums; // Container of sums
195 TList* fOutput; // Container of outputs
196
197 TH1D* fTriggers; // Histogram of triggers
198
199 Double_t fVtxMin; // Minimum v_z
200 Double_t fVtxMax; // Maximum v_z
201 Int_t fTriggerMask; // Trigger mask
202 Int_t fRebin; // Rebinning factor
203 Bool_t fCutEdges; // Whether to cut edges when rebinning
204 Bool_t fSymmetrice; // Whether to symmetrice data
205 Bool_t fCorrEmpty; // Correct for empty bins
e58000b7 206 Double_t fTriggerEff; // Trigger efficiency for selected trigger(s)
207 TH1* fShapeCorr; // Shape correction
ce85db45 208
209 ClassDef(AliBasedNdetaTask,1); // Determine multiplicity in base area
210};
211
212#endif
213//
214// Local Variables:
215// mode: C++
216// End:
217//