AliPhysics  f05a842 (f05a842)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliESDCentrality.C
Go to the documentation of this file.
1 //-*- Mode: C++ -*-
2 #ifndef ALIESDCentrality_H
3 #define ALIESDCentrality_H
4 /* This file is property of and copyright by the ALICE HLT Project *
5  * ALICE Experiment at CERN, All rights reserved. *
6  * See cxx source for full Copyright notice */
7 
8 //*****************************************************
9 // Class AliCentralitySelectionTask
10 // author: Alberica Toia
11 //*****************************************************
12 
13 #include "TNamed.h"
14 
18 class AliESDCentrality : public TNamed
19 {
20  public:
43 
49  void SetCentralityV0M(Float_t cent) {fCentralityV0M = cent;}
92 
100  Float_t GetCentralityPercentile(const char *method);
108  Int_t GetCentralityClass10(const char *method);
116  Int_t GetCentralityClass5(const char *method);
126  Bool_t IsEventInCentralityClass(Float_t a, Float_t b, const char *method);
127 
128  private:
129  Float_t fCentralityV0M; // Centrality from V0
130  Float_t fCentralityFMD; // Centrality from FMD
131  Float_t fCentralityTRK; // Centrality from tracks
132  Float_t fCentralityTKL; // Centrality from tracklets
133  Float_t fCentralityCL0; // Centrality from Clusters in layer 0
134  Float_t fCentralityV0MvsFMD; // Centrality from V0 vs FMD
135  Float_t fCentralityTKLvsV0M; // Centrality from tracklets vs V0
136  Float_t fCentralityZEMvsZDC; // Centrality from ZEM vs ZDC
137 
138  ClassDef(AliESDCentrality, 2)
139 };
140 
141 inline
142 AliESDCentrality::AliESDCentrality() : TNamed("ESDCentrality", "Centrality"),
143  fCentralityV0M(0),
144  fCentralityFMD(0),
145  fCentralityTRK(0),
146  fCentralityTKL(0),
147  fCentralityCL0(0),
148  fCentralityV0MvsFMD(0),
149  fCentralityTKLvsV0M(0),
150  fCentralityZEMvsZDC(0)
151 {
153 }
154 
155 inline
157  TNamed(cnt),
158  fCentralityV0M(cnt.fCentralityV0M),
159  fCentralityFMD(cnt.fCentralityFMD),
160  fCentralityTRK(cnt.fCentralityTRK),
161  fCentralityTKL(cnt.fCentralityTKL),
162  fCentralityCL0(cnt.fCentralityCL0),
163  fCentralityV0MvsFMD(cnt.fCentralityV0MvsFMD),
164  fCentralityTKLvsV0M(cnt.fCentralityTKLvsV0M),
165  fCentralityZEMvsZDC(cnt.fCentralityZEMvsZDC)
166 {
168 }
169 
170 inline
172 {
174  if (this!=&c) {
175  TNamed::operator=(c);
184  }
185 
186  return *this;
187 }
188 
189 inline
191 {
193 }
194 
195 inline
197 {
198  TString method = x;
199  if(method.CompareTo("V0M")==0) return fCentralityV0M;
200  if(method.CompareTo("FMD")==0) return fCentralityFMD;
201  if(method.CompareTo("TRK")==0) return fCentralityTRK;
202  if(method.CompareTo("TKL")==0) return fCentralityTKL;
203  if(method.CompareTo("CL0")==0) return fCentralityCL0;
204  if(method.CompareTo("V0MvsFMD")==0) return fCentralityV0MvsFMD;
205  if(method.CompareTo("TKLvsV0M")==0) return fCentralityTKLvsV0M;
206  if(method.CompareTo("ZENvsZDC")==0) return fCentralityZEMvsZDC;
207  return -1;
208 }
209 
210 inline
212 {
213  TString method = x;
214  if(method.CompareTo("V0M")==0) return (Int_t) (fCentralityV0M / 10.0);
215  if(method.CompareTo("FMD")==0) return (Int_t) (fCentralityFMD / 10.0);
216  if(method.CompareTo("TRK")==0) return (Int_t) (fCentralityTRK / 10.0);
217  if(method.CompareTo("TKL")==0) return (Int_t) (fCentralityTKL / 10.0);
218  if(method.CompareTo("CL0")==0) return (Int_t) (fCentralityCL0 / 10.0);
219  if(method.CompareTo("V0MvsFMD")==0) return (Int_t) (fCentralityV0MvsFMD / 10.0);
220  if(method.CompareTo("TKLvsV0M")==0) return (Int_t) (fCentralityTKLvsV0M / 10.0);
221  if(method.CompareTo("ZENvsZDC")==0) return (Int_t) (fCentralityZEMvsZDC / 10.0);
222  return -1;
223 }
224 
226 {
227  TString method = x;
228  if(method.CompareTo("V0M")==0) return (Int_t) (fCentralityV0M / 5.0);
229  if(method.CompareTo("FMD")==0) return (Int_t) (fCentralityFMD / 5.0);
230  if(method.CompareTo("TRK")==0) return (Int_t) (fCentralityTRK / 5.0);
231  if(method.CompareTo("TKL")==0) return (Int_t) (fCentralityTKL / 5.0);
232  if(method.CompareTo("CL0")==0) return (Int_t) (fCentralityCL0 / 5.0);
233  if(method.CompareTo("V0MvsFMD")==0) return (Int_t) (fCentralityV0MvsFMD / 5.0);
234  if(method.CompareTo("TKLvsV0M")==0) return (Int_t) (fCentralityTKLvsV0M / 5.0);
235  if(method.CompareTo("ZENvsZDC")==0) return (Int_t) (fCentralityZEMvsZDC / 5.0);
236  return -1;
237 }
238 
239 inline
241 {
242  TString method = x;
243  if ((method.CompareTo("V0M")==0) && (fCentralityV0M >=a && fCentralityV0M < b)) return kTRUE;
244  if ((method.CompareTo("FMD")==0) && (fCentralityFMD >=a && fCentralityFMD < b)) return kTRUE;
245  if ((method.CompareTo("TRK")==0) && (fCentralityTRK >=a && fCentralityTRK < b)) return kTRUE;
246  if ((method.CompareTo("TKL")==0) && (fCentralityTKL >=a && fCentralityTKL < b)) return kTRUE;
247  if ((method.CompareTo("CL0")==0) && (fCentralityCL0 >=a && fCentralityCL0 < b)) return kTRUE;
248  if ((method.CompareTo("V0MvsFMD")==0) && (fCentralityV0MvsFMD >=a && fCentralityV0MvsFMD < b)) return kTRUE;
249  if ((method.CompareTo("TKLvsV0M")==0) && (fCentralityTKLvsV0M >=a && fCentralityTKLvsV0M < b)) return kTRUE;
250  if ((method.CompareTo("ZEMvsZDC")==0) && (fCentralityZEMvsZDC >=a && fCentralityZEMvsZDC < b)) return kTRUE;
251  else return kFALSE;
252 }
253 
254 
255 
256 
257 #endif //ALIESDCENTRALITY_H
void SetCentralityV0M(Float_t cent)
void SetCentralityTKLvsV0M(Float_t cent)
void SetCentralityCL0(Float_t cent)
Int_t GetCentralityClass5(const char *method)
Int_t GetCentralityClass10(const char *method)
AliESDCentrality & operator=(const AliESDCentrality &cnt)
TCanvas * c
Definition: TestFitELoss.C:172
void SetCentralityFMD(Float_t cent)
void SetCentralityTKL(Float_t cent)
int Int_t
Definition: External.C:63
float Float_t
Definition: External.C:68
void SetCentralityTRK(Float_t cent)
Float_t GetCentralityPercentile(const char *method)
void SetCentralityV0MvsFMD(Float_t cent)
void SetCentralityZEMvsZDC(Float_t cent)
bool Bool_t
Definition: External.C:53
Bool_t IsEventInCentralityClass(Float_t a, Float_t b, const char *method)