]>
Commit | Line | Data |
---|---|---|
d15bf53f | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | //***************************************************** | |
17 | // Class AliCentralitySelectionTask | |
18 | // author: Alberica Toia | |
19 | //***************************************************** | |
20 | /// A container for the centrality stored in the ESD. | |
21 | ||
22 | #include "AliESDCentrality.h" | |
23 | ||
24 | ClassImp(AliESDCentrality) | |
25 | ||
26 | AliESDCentrality::AliESDCentrality() : TNamed("ESDCentrality", "Centrality"), | |
27 | fCentralityV0M(0), | |
28 | fCentralityFMD(0), | |
29 | fCentralityTRK(0), | |
30 | fCentralityTKL(0), | |
31 | fCentralityCL0(0), | |
be0d4e9b | 32 | fCentralityCL1(0), |
d15bf53f | 33 | fCentralityV0MvsFMD(0), |
34 | fCentralityTKLvsV0M(0), | |
35 | fCentralityZEMvsZDC(0) | |
36 | { | |
37 | /// constructor | |
38 | } | |
39 | ||
40 | AliESDCentrality::AliESDCentrality(const AliESDCentrality& cnt) : | |
41 | TNamed(cnt), | |
42 | fCentralityV0M(cnt.fCentralityV0M), | |
43 | fCentralityFMD(cnt.fCentralityFMD), | |
44 | fCentralityTRK(cnt.fCentralityTRK), | |
45 | fCentralityTKL(cnt.fCentralityTKL), | |
46 | fCentralityCL0(cnt.fCentralityCL0), | |
be0d4e9b | 47 | fCentralityCL1(cnt.fCentralityCL1), |
d15bf53f | 48 | fCentralityV0MvsFMD(cnt.fCentralityV0MvsFMD), |
49 | fCentralityTKLvsV0M(cnt.fCentralityTKLvsV0M), | |
50 | fCentralityZEMvsZDC(cnt.fCentralityZEMvsZDC) | |
51 | { | |
52 | /// Copy constructor | |
53 | } | |
54 | ||
55 | AliESDCentrality& AliESDCentrality::operator=(const AliESDCentrality& c) | |
56 | { | |
57 | /// Assignment operator | |
58 | if (this!=&c) { | |
59 | TNamed::operator=(c); | |
60 | fCentralityV0M = c.fCentralityV0M; | |
61 | fCentralityFMD = c.fCentralityFMD; | |
62 | fCentralityTRK = c.fCentralityTRK; | |
63 | fCentralityTKL = c.fCentralityTKL; | |
64 | fCentralityCL0 = c.fCentralityCL0; | |
be0d4e9b | 65 | fCentralityCL1 = c.fCentralityCL1; |
d15bf53f | 66 | fCentralityV0MvsFMD = c.fCentralityV0MvsFMD; |
67 | fCentralityTKLvsV0M = c.fCentralityTKLvsV0M; | |
68 | fCentralityZEMvsZDC = c.fCentralityZEMvsZDC; | |
69 | } | |
70 | ||
71 | return *this; | |
72 | } | |
73 | ||
74 | AliESDCentrality::~AliESDCentrality() | |
75 | { | |
76 | /// destructor | |
77 | } | |
78 | ||
79 | Float_t AliESDCentrality::GetCentralityPercentile(const char *x) | |
80 | { | |
81 | TString method = x; | |
82 | if(method.CompareTo("V0M")==0) return fCentralityV0M; | |
83 | if(method.CompareTo("FMD")==0) return fCentralityFMD; | |
84 | if(method.CompareTo("TRK")==0) return fCentralityTRK; | |
85 | if(method.CompareTo("TKL")==0) return fCentralityTKL; | |
86 | if(method.CompareTo("CL0")==0) return fCentralityCL0; | |
be0d4e9b | 87 | if(method.CompareTo("CL1")==0) return fCentralityCL1; |
d15bf53f | 88 | if(method.CompareTo("V0MvsFMD")==0) return fCentralityV0MvsFMD; |
89 | if(method.CompareTo("TKLvsV0M")==0) return fCentralityTKLvsV0M; | |
90 | if(method.CompareTo("ZENvsZDC")==0) return fCentralityZEMvsZDC; | |
91 | return -1; | |
92 | } | |
93 | ||
94 | Int_t AliESDCentrality::GetCentralityClass10(const char *x) | |
95 | { | |
96 | TString method = x; | |
97 | if(method.CompareTo("V0M")==0) return (Int_t) (fCentralityV0M / 10.0); | |
98 | if(method.CompareTo("FMD")==0) return (Int_t) (fCentralityFMD / 10.0); | |
99 | if(method.CompareTo("TRK")==0) return (Int_t) (fCentralityTRK / 10.0); | |
100 | if(method.CompareTo("TKL")==0) return (Int_t) (fCentralityTKL / 10.0); | |
101 | if(method.CompareTo("CL0")==0) return (Int_t) (fCentralityCL0 / 10.0); | |
be0d4e9b | 102 | if(method.CompareTo("CL1")==0) return (Int_t) (fCentralityCL1 / 10.0); |
d15bf53f | 103 | if(method.CompareTo("V0MvsFMD")==0) return (Int_t) (fCentralityV0MvsFMD / 10.0); |
104 | if(method.CompareTo("TKLvsV0M")==0) return (Int_t) (fCentralityTKLvsV0M / 10.0); | |
105 | if(method.CompareTo("ZENvsZDC")==0) return (Int_t) (fCentralityZEMvsZDC / 10.0); | |
106 | return -1; | |
107 | } | |
108 | ||
109 | Int_t AliESDCentrality::GetCentralityClass5(const char *x) | |
110 | { | |
111 | TString method = x; | |
112 | if(method.CompareTo("V0M")==0) return (Int_t) (fCentralityV0M / 5.0); | |
113 | if(method.CompareTo("FMD")==0) return (Int_t) (fCentralityFMD / 5.0); | |
114 | if(method.CompareTo("TRK")==0) return (Int_t) (fCentralityTRK / 5.0); | |
115 | if(method.CompareTo("TKL")==0) return (Int_t) (fCentralityTKL / 5.0); | |
116 | if(method.CompareTo("CL0")==0) return (Int_t) (fCentralityCL0 / 5.0); | |
be0d4e9b | 117 | if(method.CompareTo("CL1")==0) return (Int_t) (fCentralityCL1 / 5.0); |
d15bf53f | 118 | if(method.CompareTo("V0MvsFMD")==0) return (Int_t) (fCentralityV0MvsFMD / 5.0); |
119 | if(method.CompareTo("TKLvsV0M")==0) return (Int_t) (fCentralityTKLvsV0M / 5.0); | |
120 | if(method.CompareTo("ZENvsZDC")==0) return (Int_t) (fCentralityZEMvsZDC / 5.0); | |
121 | return -1; | |
122 | } | |
123 | ||
124 | Bool_t AliESDCentrality::IsEventInCentralityClass(Float_t a, Float_t b, const char *x) | |
125 | { | |
126 | TString method = x; | |
127 | if ((method.CompareTo("V0M")==0) && (fCentralityV0M >=a && fCentralityV0M < b)) return kTRUE; | |
128 | if ((method.CompareTo("FMD")==0) && (fCentralityFMD >=a && fCentralityFMD < b)) return kTRUE; | |
129 | if ((method.CompareTo("TRK")==0) && (fCentralityTRK >=a && fCentralityTRK < b)) return kTRUE; | |
130 | if ((method.CompareTo("TKL")==0) && (fCentralityTKL >=a && fCentralityTKL < b)) return kTRUE; | |
131 | if ((method.CompareTo("CL0")==0) && (fCentralityCL0 >=a && fCentralityCL0 < b)) return kTRUE; | |
be0d4e9b | 132 | if ((method.CompareTo("CL1")==0) && (fCentralityCL1 >=a && fCentralityCL1 < b)) return kTRUE; |
d15bf53f | 133 | if ((method.CompareTo("V0MvsFMD")==0) && (fCentralityV0MvsFMD >=a && fCentralityV0MvsFMD < b)) return kTRUE; |
134 | if ((method.CompareTo("TKLvsV0M")==0) && (fCentralityTKLvsV0M >=a && fCentralityTKLvsV0M < b)) return kTRUE; | |
135 | if ((method.CompareTo("ZEMvsZDC")==0) && (fCentralityZEMvsZDC >=a && fCentralityZEMvsZDC < b)) return kTRUE; | |
136 | else return kFALSE; | |
137 | } | |
138 | ||
139 | ||
140 |