]>
Commit | Line | Data |
---|---|---|
1c5acb87 | 1 | #ifndef ALICALOPID_H |
2 | #define ALICALOPID_H | |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
4 | * See cxx source for full Copyright notice */ | |
1c5acb87 | 5 | |
6 | //_________________________________________________________________________ | |
bdd2a262 | 7 | // Class for PID selection with calorimeters |
49b5c49b | 8 | // The Output of the main method GetIdentifiedParticleType is a PDG number identifying the cluster, |
bdd2a262 | 9 | // being kPhoton, kElectron, kPi0 ... as defined in the header file |
3c1d9afb | 10 | // - GetIdentifiedParticleType(const AliVCluster * cluster) |
49b5c49b | 11 | // Assignes a PID tag to the cluster, right now there is the possibility to : use bayesian weights from reco, |
12 | // recalculate them (EMCAL) or use other procedures not used in reco. | |
bdd2a262 | 13 | // In order to recalculate Bayesian, it is necessary to load the EMCALUtils library |
14 | // and do SwitchOnBayesianRecalculation(). | |
15 | // To change the PID parameters from Low to High like the ones by default, use the constructor | |
16 | // AliCaloPID(flux) | |
17 | // where flux is AliCaloPID::kLow or AliCaloPID::kHigh | |
18 | // If it is necessary to change the parameters use the constructor | |
19 | // AliCaloPID(AliEMCALPIDUtils *utils) and set the parameters before. | |
49b5c49b | 20 | |
3c1d9afb | 21 | // - GetGetIdentifiedParticleTypeFromBayesian(const Double_t * pid, const Float_t energy) |
49b5c49b | 22 | // Reads the PID weights array of the ESDs and depending on its magnitude identifies the particle, |
3c1d9afb | 23 | // executed when bayesian is ON by GetIdentifiedParticleType(const AliVCluster * cluster) |
9a6fa057 | 24 | // - SetPIDBits: Simple PID, depending on the thresholds fLOCut fTOFCut and even the |
bdd2a262 | 25 | // result of the PID bayesian a different PID bit is set. |
26 | // | |
1c5acb87 | 27 | // |
28 | //*-- Author: Gustavo Conesa (INFN-LNF) | |
29 | ||
30 | // --- ROOT system --- | |
31 | #include <TObject.h> | |
32 | class TString ; | |
33 | class TLorentzVector ; | |
a5fb4114 | 34 | #include <TFormula.h> |
f21fc003 | 35 | class TList; |
d39cba7e | 36 | class TH2F ; |
1c5acb87 | 37 | |
38 | //--- AliRoot system --- | |
0ae57829 | 39 | class AliVCluster; |
3c1d9afb | 40 | class AliVCaloCells; |
1c5acb87 | 41 | class AliAODPWG4Particle; |
c5693f62 | 42 | class AliEMCALPIDUtils; |
f2ccb5b8 | 43 | class AliCalorimeterUtils; |
49b5c49b | 44 | class AliVEvent; |
1c5acb87 | 45 | |
46 | class AliCaloPID : public TObject { | |
47 | ||
477d6cee | 48 | public: |
49 | ||
50 | AliCaloPID() ; // ctor | |
bdd2a262 | 51 | AliCaloPID(const Int_t particleFlux) ; // ctor, to be used when recalculating bayesian PID |
f21fc003 | 52 | AliCaloPID(const TNamed * emcalpid) ; // ctor, to be used when recalculating bayesian PID and need different parameters |
477d6cee | 53 | virtual ~AliCaloPID() ;//virtual dtor |
c5693f62 | 54 | |
3c1d9afb | 55 | enum PidType |
56 | { | |
a5fb4114 | 57 | kPhoton = 22, |
58 | kPi0 = 111, | |
59 | kEta = 221, | |
60 | kElectron = 11, | |
61 | kEleCon =-11, | |
62 | kNeutralHadron = 2112, | |
63 | kChargedHadron = 211, | |
477d6cee | 64 | kNeutralUnknown = 130, |
a5fb4114 | 65 | kChargedUnknown = 321 |
477d6cee | 66 | }; |
67 | ||
68 | enum TagType {kPi0Decay, kEtaDecay, kOtherDecay, kConversion, kNoTag = -1}; | |
69 | ||
49b5c49b | 70 | // Main methods |
71 | ||
a5fb4114 | 72 | TList * GetCreateOutputObjects(); |
d39cba7e | 73 | |
a5fb4114 | 74 | void InitParameters(); |
9a6fa057 | 75 | |
995c6150 | 76 | Bool_t IsInPi0SplitAsymmetryRange(const Float_t energy, const Float_t asy, const Int_t nlm); |
77 | ||
78 | Bool_t IsInPi0SplitMassRange (const Float_t energy, const Float_t mass, const Int_t nlm); | |
79 | ||
80 | Bool_t IsInMergedM02Range (const Float_t energy, const Float_t m02, const Int_t nlm); | |
5a72d9af | 81 | |
5a72d9af | 82 | |
3c1d9afb | 83 | Int_t GetIdentifiedParticleTypeFromBayesWeights(const Bool_t isEMCAL, const Double_t * pid, const Float_t energy) ; |
84 | ||
85 | Int_t GetIdentifiedParticleTypeFromClusterSplitting(AliVCluster * cluster, AliVCaloCells* cells, | |
86 | AliCalorimeterUtils * caloutils, | |
87 | Double_t vertex[3], | |
bfdcf7fb | 88 | Int_t & nLocMax, Double_t & mass, Double_t & angle, |
89 | Double_t & e1 , Double_t & e2 ) ; | |
477d6cee | 90 | |
3c1d9afb | 91 | Int_t GetIdentifiedParticleType(const AliVCluster * cluster) ; |
477d6cee | 92 | |
9a6fa057 | 93 | TString GetPIDParametersList(); |
477d6cee | 94 | |
49b5c49b | 95 | Bool_t IsTrackMatched(AliVCluster * cluster, AliCalorimeterUtils* cu, AliVEvent* event) const ; |
96 | ||
3c1d9afb | 97 | void SetPIDBits(AliVCluster * cluster, AliAODPWG4Particle *aodph, |
49b5c49b | 98 | AliCalorimeterUtils* cu, AliVEvent* event); |
477d6cee | 99 | |
a5fb4114 | 100 | void Print(const Option_t * opt)const; |
101 | ||
3c1d9afb | 102 | void PrintClusterPIDWeights(const Double_t * pid) const; |
103 | ||
49b5c49b | 104 | //Check if cluster photon-like. Uses photon cluster parameterization in real pp data |
105 | //Returns distance in sigmas. Recommended cut 2.5 | |
106 | Float_t TestPHOSDispersion(const Double_t pt, const Double_t m20, const Double_t m02) const ; | |
107 | //Checks distance to the closest track. Takes into account | |
108 | //non-perpendicular incidence of tracks. | |
109 | Float_t TestPHOSChargedVeto(const Double_t dx, const Double_t dz, const Double_t ptTrack, | |
110 | const Int_t chargeTrack, const Double_t mf) const ; | |
111 | ||
112 | // Setters, getters | |
113 | ||
114 | void SetDebug(Int_t deb) { fDebug = deb ; } | |
115 | Int_t GetDebug() const { return fDebug ; } | |
116 | ||
117 | enum eventType{kLow,kHigh}; | |
118 | void SetLowParticleFlux() { fParticleFlux = kLow ; } | |
119 | void SetHighParticleFlux() { fParticleFlux = kHigh ; } | |
120 | // not really used, only for bayesian recalculation in EMCAL, but could be useful in future | |
121 | ||
122 | // Bayesian | |
123 | ||
124 | void SwitchOnBayesian() { fUseBayesianWeights = kTRUE ; } | |
125 | void SwitchOffBayesian() { fUseBayesianWeights = kFALSE; } | |
126 | void SwitchOnBayesianRecalculation() { fRecalculateBayesian = kTRUE ; fUseBayesianWeights = kTRUE ;} // EMCAL | |
127 | void SwitchOffBayesianRecalculation() { fRecalculateBayesian = kFALSE; } // EMCAL | |
128 | ||
c5693f62 | 129 | AliEMCALPIDUtils * GetEMCALPIDUtils() ; |
477d6cee | 130 | |
131 | //Weight getters | |
49b5c49b | 132 | Float_t GetEMCALPhotonWeight() const { return fEMCALPhotonWeight ; } |
133 | Float_t GetEMCALPi0Weight() const { return fEMCALPi0Weight ; } | |
134 | Float_t GetEMCALElectronWeight() const { return fEMCALElectronWeight ; } | |
135 | Float_t GetEMCALChargeWeight() const { return fEMCALChargeWeight ; } | |
136 | Float_t GetEMCALNeutralWeight() const { return fEMCALNeutralWeight ; } | |
137 | Float_t GetPHOSPhotonWeight() const { return fPHOSPhotonWeight ; } | |
138 | Float_t GetPHOSPi0Weight() const { return fPHOSPi0Weight ; } | |
139 | Float_t GetPHOSElectronWeight() const { return fPHOSElectronWeight ; } | |
140 | Float_t GetPHOSChargeWeight() const { return fPHOSChargeWeight ; } | |
141 | Float_t GetPHOSNeutralWeight() const { return fPHOSNeutralWeight ; } | |
142 | ||
143 | Bool_t IsPHOSPIDWeightFormulaOn() const { return fPHOSWeightFormula ; } | |
144 | ||
145 | TFormula * GetPHOSPhotonWeightFormula() { | |
a5fb4114 | 146 | if(!fPHOSPhotonWeightFormula) |
147 | fPHOSPhotonWeightFormula = new TFormula("phos_photon_weight", | |
148 | fPHOSPhotonWeightFormulaExpression); | |
49b5c49b | 149 | return fPHOSPhotonWeightFormula ; } |
477d6cee | 150 | |
49b5c49b | 151 | TFormula * GetPHOSPi0WeightFormula() { |
a5fb4114 | 152 | if(!fPHOSPi0WeightFormula) |
153 | fPHOSPi0WeightFormula = new TFormula("phos_pi0_weight", | |
154 | fPHOSPi0WeightFormulaExpression); | |
49b5c49b | 155 | return fPHOSPi0WeightFormula ; } |
5ae09196 | 156 | |
49b5c49b | 157 | TString GetPHOSPhotonWeightFormulaExpression() const { return fPHOSPhotonWeightFormulaExpression ; } |
158 | TString GetPHOSPi0WeightFormulaExpression() const { return fPHOSPi0WeightFormulaExpression ; } | |
5ae09196 | 159 | |
a5fb4114 | 160 | //Weight setters |
49b5c49b | 161 | void SetEMCALPhotonWeight (Float_t w) { fEMCALPhotonWeight = w ; } |
162 | void SetEMCALPi0Weight (Float_t w) { fEMCALPi0Weight = w ; } | |
163 | void SetEMCALElectronWeight(Float_t w) { fEMCALElectronWeight = w ; } | |
164 | void SetEMCALChargeWeight (Float_t w) { fEMCALChargeWeight = w ; } | |
165 | void SetEMCALNeutralWeight (Float_t w) { fEMCALNeutralWeight = w ; } | |
166 | void SetPHOSPhotonWeight (Float_t w) { fPHOSPhotonWeight = w ; } | |
167 | void SetPHOSPi0Weight (Float_t w) { fPHOSPi0Weight = w ; } | |
168 | void SetPHOSElectronWeight (Float_t w) { fPHOSElectronWeight = w ; } | |
169 | void SetPHOSChargeWeight (Float_t w) { fPHOSChargeWeight = w ; } | |
170 | void SetPHOSNeutralWeight (Float_t w) { fPHOSNeutralWeight = w ; } | |
171 | ||
172 | void UsePHOSPIDWeightFormula (Bool_t ok ) { fPHOSWeightFormula = ok ; } | |
173 | void SetPHOSPhotonWeightFormulaExpression(TString ph) { fPHOSPhotonWeightFormulaExpression = ph ; } | |
174 | void SetPHOSPi0WeightFormulaExpression (TString pi) { fPHOSPi0WeightFormulaExpression = pi ; } | |
d39cba7e | 175 | |
49b5c49b | 176 | //PID cuts |
d39cba7e | 177 | |
49b5c49b | 178 | void SetEMCALLambda0CutMax(Float_t lcut ) { fEMCALL0CutMax = lcut ; } |
179 | Float_t GetEMCALLambda0CutMax() const { return fEMCALL0CutMax ; } | |
180 | ||
181 | void SetEMCALLambda0CutMin(Float_t lcut ) { fEMCALL0CutMin = lcut ; } | |
182 | Float_t GetEMCALLambda0CutMin() const { return fEMCALL0CutMin ; } | |
183 | ||
184 | void SetEMCALDEtaCut(Float_t dcut ) { fEMCALDEtaCut = dcut ; } | |
185 | Float_t GetEMCALDEtaCut() const { return fEMCALDEtaCut ; } | |
186 | ||
187 | void SetEMCALDPhiCut(Float_t dcut ) { fEMCALDPhiCut = dcut ; } | |
188 | Float_t GetEMCALDPhiCut() const { return fEMCALDPhiCut ; } | |
189 | ||
190 | void SetTOFCut(Float_t tcut ) { fTOFCut = tcut ; } | |
191 | Float_t GetTOFCut() const { return fTOFCut ; } | |
192 | ||
193 | void SetPHOSRCut(Float_t rcut ) { fPHOSRCut = rcut ; } | |
194 | Float_t GetPHOSRCut() const { return fPHOSRCut ; } | |
a5fb4114 | 195 | |
49b5c49b | 196 | void SetPHOSDispersionCut(Float_t dcut ) { fPHOSDispersionCut = dcut ; } |
197 | Float_t GetPHOSDispersionCut() const { return fPHOSDispersionCut ; } | |
198 | ||
3c1d9afb | 199 | // Cluster splitting analysis |
200 | ||
201 | void SwitchOnClusterSplittingPID() { fDoClusterSplitting = kTRUE ; } | |
202 | void SwitchOffClusterplittingPID() { fDoClusterSplitting = kFALSE ; } | |
5a72d9af | 203 | |
204 | void SwitchOnSimpleSplitMassCut() { fUseSimpleMassCut = kTRUE ; } | |
205 | void SwitchOffSimpleSplitMassCut() { fUseSimpleMassCut = kFALSE ; } | |
3c1d9afb | 206 | |
5a72d9af | 207 | void SwitchOnSimpleSplitM02Cut() { fUseSimpleM02Cut = kTRUE ; } |
208 | void SwitchOffSimpleSplitM02Cut() { fUseSimpleM02Cut = kFALSE ; } | |
209 | ||
3c1d9afb | 210 | void SetClusterSplittingM02Cut(Float_t min=0, Float_t max=100) |
211 | { fSplitM02MinCut = min ; fSplitM02MaxCut = max ; } | |
212 | ||
213 | void SetClusterSplittingMinNCells(Int_t cut) { fSplitMinNCells = cut ; } | |
214 | ||
5a72d9af | 215 | Float_t GetPi0MinMass() const { return fMassPi0Min ; } // Simple cut case |
216 | Float_t GetEtaMinMass() const { return fMassEtaMin ; } // Simple cut case | |
3c1d9afb | 217 | Float_t GetPhotonMinMass() const { return fMassPhoMin ; } |
218 | Float_t GetPi0MaxMass() const { return fMassPi0Max ; } | |
219 | Float_t GetEtaMaxMass() const { return fMassEtaMax ; } | |
220 | Float_t GetPhotonMaxMass() const { return fMassPhoMax ; } | |
221 | ||
5a72d9af | 222 | void SetSplitWidthSigma(Float_t s) { fSplitWidthSigma = s ; } |
995c6150 | 223 | void SetPi0MassWidthSelectionParameters (Int_t iparam, Float_t param) { if(iparam < 7 ) fMassWidthPi0Param[iparam] = param ; } |
224 | void SetM02MinimumSelectionParameters (Int_t iparam, Float_t param) { if(iparam < 5 ) fM02MinParam [iparam] = param ; } | |
225 | void SetAsymmetryMinimumSelectionParameters(Int_t iparam, Float_t param) { if(iparam < 3 ) fAsyMinParam [iparam] = param ; } | |
5a72d9af | 226 | |
227 | void SetPi0MassRange(Float_t min, Float_t max) { fMassPi0Min = min ; fMassPi0Max = max ; } // Simple case | |
228 | void SetEtaMassRange(Float_t min, Float_t max) { fMassEtaMin = min ; fMassEtaMax = max ; } | |
229 | void SetPhotonMassRange(Float_t min, Float_t max) { fMassPhoMin = min ; fMassPhoMax = max ; } | |
230 | ||
231 | void SetSplitEnergyFractionMinimum(Float_t min) { fSplitEFracMin = min ; } | |
232 | ||
d39cba7e | 233 | |
f2ccb5b8 | 234 | private: |
477d6cee | 235 | |
49b5c49b | 236 | Int_t fDebug; // Debug level |
237 | Int_t fParticleFlux; // Particle flux for setting PID parameters | |
238 | ||
239 | // Bayesian | |
240 | AliEMCALPIDUtils * fEMCALPIDUtils; // Pointer to EMCALPID to redo the PID Bayesian calculation | |
241 | Bool_t fUseBayesianWeights; // Select clusters based on weights calculated in reconstruction | |
242 | Bool_t fRecalculateBayesian; // Recalculate PID bayesian or use simple PID? | |
243 | ||
244 | Float_t fEMCALPhotonWeight; // Bayesian PID weight for photons in EMCAL | |
245 | Float_t fEMCALPi0Weight; // Bayesian PID weight for pi0 in EMCAL | |
246 | Float_t fEMCALElectronWeight; // Bayesian PID weight for electrons in EMCAL | |
247 | Float_t fEMCALChargeWeight; // Bayesian PID weight for charged hadrons in EMCAL | |
248 | Float_t fEMCALNeutralWeight; // Bayesian PID weight for neutral hadrons in EMCAL | |
249 | Float_t fPHOSPhotonWeight; // Bayesian PID weight for photons in PHOS | |
250 | Float_t fPHOSPi0Weight; // Bayesian PID weight for pi0 in PHOS | |
251 | Float_t fPHOSElectronWeight; // Bayesian PID weight for electrons in PHOS | |
252 | Float_t fPHOSChargeWeight; // Bayesian PID weight for charged hadrons in PHOS | |
253 | Float_t fPHOSNeutralWeight; // Bayesian PID weight for neutral hadrons in PHOS | |
a5fb4114 | 254 | |
9a6fa057 | 255 | Bool_t fPHOSWeightFormula ; // Use parametrized weight threshold, function of energy |
256 | TFormula *fPHOSPhotonWeightFormula ; // Formula for photon weight | |
257 | TFormula *fPHOSPi0WeightFormula ; // Formula for pi0 weight | |
a5fb4114 | 258 | TString fPHOSPhotonWeightFormulaExpression; // Photon weight formula in string |
259 | TString fPHOSPi0WeightFormulaExpression; // Pi0 weight formula in string | |
260 | ||
49b5c49b | 261 | // PID calculation |
262 | Float_t fEMCALL0CutMax; // Max Cut on shower shape lambda0, used in PID evaluation, only EMCAL | |
263 | Float_t fEMCALL0CutMin; // Min Cut on shower shape lambda0, used in PID evaluation, only EMCAL | |
264 | Float_t fEMCALDEtaCut; // Track matching cut on Dz | |
265 | Float_t fEMCALDPhiCut; // Track matching cut on Dx | |
ae182e60 | 266 | |
49b5c49b | 267 | Float_t fTOFCut; // Cut on TOF, used in PID evaluation |
268 | ||
269 | Float_t fPHOSDispersionCut; // Shower shape elipse radious cut | |
270 | Float_t fPHOSRCut; // Track-Cluster distance cut for track matching in PHOS | |
49b5c49b | 271 | |
3c1d9afb | 272 | // Cluster splitting mass ranges |
273 | Bool_t fDoClusterSplitting; // Cluster splitting analysis | |
5a72d9af | 274 | Bool_t fUseSimpleMassCut; // Use simple min-max pi0 mass cut |
275 | Bool_t fUseSimpleM02Cut; // Use simple min-max M02 cut | |
276 | Float_t fSplitM02MaxCut ; // Study clusters with l0 smaller than cut | |
277 | Float_t fSplitM02MinCut ; // Study clusters with l0 larger than cut // simple case | |
3c1d9afb | 278 | Int_t fSplitMinNCells ; // Study clusters with ncells larger than cut |
279 | Float_t fMassEtaMin ; // Min Eta mass | |
280 | Float_t fMassEtaMax ; // Max Eta mass | |
5a72d9af | 281 | Float_t fMassPi0Min ; // Min Pi0 mass // simple cut case |
282 | Float_t fMassPi0Max ; // Min Pi0 mass // simple cut case | |
3c1d9afb | 283 | Float_t fMassPhoMin ; // Min Photon mass |
284 | Float_t fMassPhoMax ; // Min Photon mass | |
5a72d9af | 285 | Float_t fMassWidthPi0Param[7] ; // 3 param for pol2 fit on width, 2 param for mass position NLM=1 and NLM>1 for pi0 selection |
286 | Float_t fM02MinParam[5] ; // 3 param for pol2 fit on M02 minimum | |
995c6150 | 287 | Float_t fAsyMinParam[5] ; // 3 param for pol2 fit on asymmetry minimum, split |
5a72d9af | 288 | Float_t fSplitEFracMin ; // Do not use clusters with too large energy in cluster compared |
289 | // to energy in splitted clusters | |
290 | Float_t fSplitWidthSigma; // Cut on mass+-width*fSplitWidthSigma | |
291 | ||
292 | ||
3c1d9afb | 293 | |
5a72d9af | 294 | AliCaloPID & operator = (const AliCaloPID & cpid) ; // cpy assignment |
295 | AliCaloPID( const AliCaloPID & cpid) ; // cpy ctor | |
c5693f62 | 296 | |
995c6150 | 297 | ClassDef(AliCaloPID,15) |
3c1d9afb | 298 | |
e5dbdaf0 | 299 | } ; |
1c5acb87 | 300 | |
301 | ||
302 | #endif //ALICALOPID_H | |
303 | ||
304 | ||
305 |