]>
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 */ | |
5 | /* $Id: $ */ | |
6 | ||
7 | //_________________________________________________________________________ | |
bdd2a262 | 8 | // Class for PID selection with calorimeters |
9 | // The Output of the 2 main methods GetPdg is a PDG number identifying the cluster, | |
10 | // being kPhoton, kElectron, kPi0 ... as defined in the header file | |
11 | // - GetPdg(const TString calo, const Double_t * pid, const Float_t energy) | |
12 | // Reads the PID weights array of the ESDs and depending on its magnitude identifies the particle | |
0ae57829 | 13 | // - GetPdg(const TString calo,const TLorentzVector mom, const AliVCluster * cluster) |
bdd2a262 | 14 | // Recalcultes PID, the bayesian or any new one to be implemented in the future |
15 | // Right now only the possibility to recalculate EMCAL with bayesian and simple PID. | |
16 | // In order to recalculate Bayesian, it is necessary to load the EMCALUtils library | |
17 | // and do SwitchOnBayesianRecalculation(). | |
18 | // To change the PID parameters from Low to High like the ones by default, use the constructor | |
19 | // AliCaloPID(flux) | |
20 | // where flux is AliCaloPID::kLow or AliCaloPID::kHigh | |
21 | // If it is necessary to change the parameters use the constructor | |
22 | // AliCaloPID(AliEMCALPIDUtils *utils) and set the parameters before. | |
9a6fa057 | 23 | // - SetPIDBits: Simple PID, depending on the thresholds fLOCut fTOFCut and even the |
bdd2a262 | 24 | // result of the PID bayesian a different PID bit is set. |
25 | // | |
26 | // All these methods can be called in the analysis you are interested. | |
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; |
1c5acb87 | 40 | class AliAODPWG4Particle; |
6adad443 | 41 | #include "AliEMCALPIDUtils.h" |
f2ccb5b8 | 42 | class AliCalorimeterUtils; |
1c5acb87 | 43 | |
44 | class AliCaloPID : public TObject { | |
45 | ||
477d6cee | 46 | public: |
47 | ||
48 | AliCaloPID() ; // ctor | |
bdd2a262 | 49 | AliCaloPID(const Int_t particleFlux) ; // ctor, to be used when recalculating bayesian PID |
f21fc003 | 50 | AliCaloPID(const TNamed * emcalpid) ; // ctor, to be used when recalculating bayesian PID and need different parameters |
477d6cee | 51 | virtual ~AliCaloPID() ;//virtual dtor |
d39cba7e | 52 | |
614701c6 | 53 | private: |
54 | AliCaloPID & operator = (const AliCaloPID & g) ;//cpy assignment | |
d39cba7e | 55 | AliCaloPID(const AliCaloPID & g) ; // cpy ctor |
56 | ||
614701c6 | 57 | public: |
58 | ||
477d6cee | 59 | enum PidType { |
a5fb4114 | 60 | kPhoton = 22, |
61 | kPi0 = 111, | |
62 | kEta = 221, | |
63 | kElectron = 11, | |
64 | kEleCon =-11, | |
65 | kNeutralHadron = 2112, | |
66 | kChargedHadron = 211, | |
477d6cee | 67 | kNeutralUnknown = 130, |
a5fb4114 | 68 | kChargedUnknown = 321 |
477d6cee | 69 | }; |
70 | ||
71 | enum TagType {kPi0Decay, kEtaDecay, kOtherDecay, kConversion, kNoTag = -1}; | |
72 | ||
a5fb4114 | 73 | TList * GetCreateOutputObjects(); |
d39cba7e | 74 | |
a5fb4114 | 75 | void InitParameters(); |
d39cba7e | 76 | |
9a6fa057 | 77 | Bool_t IsPHOSPhoton(const Double_t l0, const Double_t l1) ; |
78 | ||
bbb09837 | 79 | Int_t GetIdentifiedParticleType(const TString calo, const Double_t * pid, const Float_t energy) ; |
477d6cee | 80 | |
bbb09837 | 81 | Int_t GetIdentifiedParticleType(const TString calo, const TLorentzVector mom, const AliVCluster * cluster) ; |
477d6cee | 82 | |
9a6fa057 | 83 | TString GetPIDParametersList(); |
477d6cee | 84 | |
a5fb4114 | 85 | void SetPIDBits(const TString calo, const AliVCluster * cluster, AliAODPWG4Particle *aodph, const AliCalorimeterUtils* cu); |
477d6cee | 86 | |
a5fb4114 | 87 | void Print(const Option_t * opt)const; |
88 | ||
89 | AliEMCALPIDUtils * GetEMCALPIDUtils() {if(!fEMCALPIDUtils) fEMCALPIDUtils = new AliEMCALPIDUtils; return fEMCALPIDUtils ; } | |
477d6cee | 90 | |
91 | //Weight getters | |
a5fb4114 | 92 | Float_t GetEMCALPhotonWeight() const { return fEMCALPhotonWeight ; } |
93 | Float_t GetEMCALPi0Weight() const { return fEMCALPi0Weight ; } | |
94 | Float_t GetEMCALElectronWeight() const { return fEMCALElectronWeight; } | |
95 | Float_t GetEMCALChargeWeight() const { return fEMCALChargeWeight ; } | |
96 | Float_t GetEMCALNeutralWeight() const { return fEMCALNeutralWeight ; } | |
97 | Float_t GetPHOSPhotonWeight() const { return fPHOSPhotonWeight ; } | |
98 | Float_t GetPHOSPi0Weight() const { return fPHOSPi0Weight ; } | |
99 | Float_t GetPHOSElectronWeight() const { return fPHOSElectronWeight ; } | |
100 | Float_t GetPHOSChargeWeight() const { return fPHOSChargeWeight ; } | |
101 | Float_t GetPHOSNeutralWeight() const { return fPHOSNeutralWeight ; } | |
102 | ||
103 | Bool_t IsPHOSPIDWeightFormulaOn() const { return fPHOSWeightFormula ; } | |
104 | ||
105 | TFormula * GetPHOSPhotonWeightFormula() { | |
106 | if(!fPHOSPhotonWeightFormula) | |
107 | fPHOSPhotonWeightFormula = new TFormula("phos_photon_weight", | |
108 | fPHOSPhotonWeightFormulaExpression); | |
109 | return fPHOSPhotonWeightFormula ; } | |
477d6cee | 110 | |
a5fb4114 | 111 | TFormula * GetPHOSPi0WeightFormula() { |
112 | if(!fPHOSPi0WeightFormula) | |
113 | fPHOSPi0WeightFormula = new TFormula("phos_pi0_weight", | |
114 | fPHOSPi0WeightFormulaExpression); | |
115 | return fPHOSPi0WeightFormula ; } | |
5ae09196 | 116 | |
a5fb4114 | 117 | TString GetPHOSPhotonWeightFormulaExpression() const { return fPHOSPhotonWeightFormulaExpression ; } |
118 | TString GetPHOSPi0WeightFormulaExpression() const { return fPHOSPi0WeightFormulaExpression ; } | |
5ae09196 | 119 | |
a5fb4114 | 120 | //Weight setters |
121 | void SetEMCALPhotonWeight (Float_t w) { fEMCALPhotonWeight = w ; } | |
122 | void SetEMCALPi0Weight (Float_t w) { fEMCALPi0Weight = w ; } | |
123 | void SetEMCALElectronWeight(Float_t w) { fEMCALElectronWeight = w ; } | |
124 | void SetEMCALChargeWeight (Float_t w) { fEMCALChargeWeight = w ; } | |
125 | void SetEMCALNeutralWeight (Float_t w) { fEMCALNeutralWeight = w ; } | |
126 | void SetPHOSPhotonWeight (Float_t w) { fPHOSPhotonWeight = w ; } | |
127 | void SetPHOSPi0Weight (Float_t w) { fPHOSPi0Weight = w ; } | |
128 | void SetPHOSElectronWeight (Float_t w) { fPHOSElectronWeight = w ; } | |
129 | void SetPHOSChargeWeight (Float_t w) { fPHOSChargeWeight = w ; } | |
130 | void SetPHOSNeutralWeight (Float_t w) { fPHOSNeutralWeight = w ; } | |
131 | ||
9a6fa057 | 132 | void UsePHOSPIDWeightFormula (Bool_t ok ) { fPHOSWeightFormula = ok ; } |
133 | void SetPHOSPhotonWeightFormulaExpression(TString ph) { fPHOSPhotonWeightFormulaExpression = ph ; } | |
134 | void SetPHOSPi0WeightFormulaExpression (TString pi) { fPHOSPi0WeightFormulaExpression = pi ; } | |
a5fb4114 | 135 | |
136 | //PID bits setters and getters | |
477d6cee | 137 | |
9a6fa057 | 138 | void SetLambda0CutMax(Float_t lcut ) { fL0CutMax = lcut ; } |
139 | Float_t GetLambda0CutMax() const { return fL0CutMax ; } | |
140 | ||
141 | void SetLambda0CutMin(Float_t lcut ) { fL0CutMin = lcut ; } | |
142 | Float_t GetLambda0CutMin() const { return fL0CutMin ; } | |
143 | ||
477d6cee | 144 | |
9a6fa057 | 145 | void SetTOFCut(Float_t tcut ) { fTOFCut = tcut ; } |
146 | Float_t GetTOFCut() const { return fTOFCut ; } | |
477d6cee | 147 | |
ae182e60 | 148 | void SetRCutPHOS(Float_t rcut ) { fRcutPHOS = rcut ; } |
149 | Float_t GetRCutPHOS() const { return fRcutPHOS ; } | |
150 | ||
9a6fa057 | 151 | void SetDebug(Int_t deb) { fDebug=deb ; } |
152 | Int_t GetDebug() const { return fDebug ; } | |
a5fb4114 | 153 | |
154 | //Bayesian recalculation (EMCAL) | |
155 | void SwitchOnBayesianRecalculation() { fRecalculateBayesian = kTRUE ; } | |
156 | void SwitchOffBayesianRecalculation() { fRecalculateBayesian = kFALSE; } | |
157 | enum eventType{kLow,kHigh}; | |
158 | void SetLowParticleFlux() { fParticleFlux = kLow ; } | |
159 | void SetHighParticleFlux() { fParticleFlux = kHigh ; } | |
bdd2a262 | 160 | |
d39cba7e | 161 | |
a5fb4114 | 162 | // Track matching |
d39cba7e | 163 | |
a5fb4114 | 164 | Bool_t IsTrackMatched(const AliVCluster * cluster, const AliCalorimeterUtils* cu) const ; |
165 | ||
166 | // Track matching histogrammes setters and getters | |
d39cba7e | 167 | |
168 | virtual void SetHistoERangeAndNBins(Float_t min, Float_t max, Int_t n) { | |
a5fb4114 | 169 | fHistoNEBins = n ; fHistoEMax = max ; fHistoEMin = min ; |
d39cba7e | 170 | } |
171 | ||
172 | virtual void SetHistoDEtaRangeAndNBins(Float_t min, Float_t max, Int_t n) { | |
a5fb4114 | 173 | fHistoNDEtaBins = n ; fHistoDEtaMax = max ; fHistoDEtaMin = min ; |
d39cba7e | 174 | } |
175 | ||
d39cba7e | 176 | virtual void SetHistoDPhiRangeAndNBins(Float_t min, Float_t max, Int_t n) { |
a5fb4114 | 177 | fHistoNDPhiBins = n ; fHistoDPhiMax = max ; fHistoDPhiMin = min ; |
d39cba7e | 178 | } |
a5fb4114 | 179 | |
d39cba7e | 180 | |
f2ccb5b8 | 181 | private: |
477d6cee | 182 | |
a5fb4114 | 183 | Float_t fEMCALPhotonWeight; // Bayesian PID weight for photons in EMCAL |
184 | Float_t fEMCALPi0Weight; // Bayesian PID weight for pi0 in EMCAL | |
185 | Float_t fEMCALElectronWeight; // Bayesian PID weight for electrons in EMCAL | |
186 | Float_t fEMCALChargeWeight; // Bayesian PID weight for charged hadrons in EMCAL | |
187 | Float_t fEMCALNeutralWeight; // Bayesian PID weight for neutral hadrons in EMCAL | |
188 | Float_t fPHOSPhotonWeight; // Bayesian PID weight for photons in PHOS | |
189 | Float_t fPHOSPi0Weight; // Bayesian PID weight for pi0 in PHOS | |
190 | Float_t fPHOSElectronWeight; // Bayesian PID weight for electrons in PHOS | |
191 | Float_t fPHOSChargeWeight; // Bayesian PID weight for charged hadrons in PHOS | |
192 | Float_t fPHOSNeutralWeight; // Bayesian PID weight for neutral hadrons in PHOS | |
193 | ||
9a6fa057 | 194 | Bool_t fPHOSWeightFormula ; // Use parametrized weight threshold, function of energy |
195 | TFormula *fPHOSPhotonWeightFormula ; // Formula for photon weight | |
196 | TFormula *fPHOSPi0WeightFormula ; // Formula for pi0 weight | |
a5fb4114 | 197 | TString fPHOSPhotonWeightFormulaExpression; // Photon weight formula in string |
198 | TString fPHOSPi0WeightFormulaExpression; // Pi0 weight formula in string | |
199 | ||
9a6fa057 | 200 | Float_t fL0CutMax; // Max Cut on shower shape lambda0, used in PID evaluation, used only for EMCAL now |
201 | Float_t fL0CutMin; // Min Cut on shower shape lambda0, used in PID evaluation, used only for EMCAL now | |
202 | Float_t fTOFCut; // Cut on TOF, used in PID evaluation | |
ae182e60 | 203 | Float_t fRcutPHOS; // Track-Cluster distance cut for track matching in PHOS |
204 | ||
9a6fa057 | 205 | Int_t fDebug; // Debug level |
bdd2a262 | 206 | |
a5fb4114 | 207 | //Bayesian |
208 | Bool_t fRecalculateBayesian; // Recalculate PID bayesian or use simple PID? | |
209 | Int_t fParticleFlux; // Particle flux for setting PID parameters | |
9a6fa057 | 210 | AliEMCALPIDUtils * fEMCALPIDUtils; // Pointer to EMCALPID to redo the PID Bayesian calculation |
bdd2a262 | 211 | |
ae182e60 | 212 | |
a5fb4114 | 213 | // Track matching control histograms |
9a6fa057 | 214 | Int_t fHistoNEBins ; // Number of bins in cluster E axis |
215 | Float_t fHistoEMax ; // Maximum value of cluster E histogram range | |
216 | Float_t fHistoEMin ; // Minimum value of cluster E histogram range | |
217 | Int_t fHistoNDEtaBins ; // Number of bins in dEta (cluster-track) axis | |
218 | Float_t fHistoDEtaMax ; // Maximum value of dEta (cluster-track) histogram range | |
219 | Float_t fHistoDEtaMin ; // Minimum value of dEta (cluster-track) histogram range | |
220 | Int_t fHistoNDPhiBins ; // Number of bins in dPhi axis | |
221 | Float_t fHistoDPhiMax ; // Maximum value of dPhi (cluster-track) histogram range | |
222 | Float_t fHistoDPhiMin ; // Minimum value of dPhi (cluster-track) histogram range | |
223 | ||
224 | TH2F * fhTrackMatchedDEta ; //! Eta distance between track and cluster vs cluster E | |
225 | TH2F * fhTrackMatchedDPhi ; //! Phi distance between track and cluster vs cluster E | |
226 | TH2F * fhTrackMatchedDEtaDPhi ; //! Eta vs Phi distance between track and cluster, E cluster > 0.5 GeV | |
227 | ||
ae182e60 | 228 | ClassDef(AliCaloPID,9) |
e5dbdaf0 | 229 | } ; |
1c5acb87 | 230 | |
231 | ||
232 | #endif //ALICALOPID_H | |
233 | ||
234 | ||
235 |