3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
7 //_________________________________________________________________________
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
13 // - GetPdg(const TString calo,const TLorentzVector mom, const AliVCluster * cluster)
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
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.
23 // - SetPIDBits: Simple PID, depending on the thresholds fDispCut fTOFCut and even the
24 // result of the PID bayesian a different PID bit is set.
26 // All these methods can be called in the analysis you are interested.
28 //*-- Author: Gustavo Conesa (INFN-LNF)
30 // --- ROOT system ---
33 class TLorentzVector ;
38 //--- AliRoot system ---
40 class AliAODPWG4Particle;
41 #include "AliEMCALPIDUtils.h";
42 class AliCalorimeterUtils;
44 class AliCaloPID : public TObject {
48 AliCaloPID() ; // ctor
49 AliCaloPID(const Int_t particleFlux) ; // ctor, to be used when recalculating bayesian PID
50 AliCaloPID(const TTask * emcalpid) ; // ctor, to be used when recalculating bayesian PID and need different parameters
51 virtual ~AliCaloPID() ;//virtual dtor
54 AliCaloPID & operator = (const AliCaloPID & g) ;//cpy assignment
55 AliCaloPID(const AliCaloPID & g) ; // cpy ctor
65 kNeutralHadron = 2112,
67 kNeutralUnknown = 130,
71 enum TagType {kPi0Decay, kEtaDecay, kOtherDecay, kConversion, kNoTag = -1};
73 TList * GetCreateOutputObjects();
75 void InitParameters();
77 Int_t GetPdg(const TString calo, const Double_t * pid, const Float_t energy) ;
79 Int_t GetPdg(const TString calo, const TLorentzVector mom, const AliVCluster * cluster) ;
81 TString GetPIDParametersList();
83 void SetPIDBits(const TString calo, const AliVCluster * cluster, AliAODPWG4Particle *aodph, const AliCalorimeterUtils* cu);
85 void Print(const Option_t * opt)const;
87 AliEMCALPIDUtils * GetEMCALPIDUtils() {if(!fEMCALPIDUtils) fEMCALPIDUtils = new AliEMCALPIDUtils; return fEMCALPIDUtils ; }
90 Float_t GetEMCALPhotonWeight() const { return fEMCALPhotonWeight ; }
91 Float_t GetEMCALPi0Weight() const { return fEMCALPi0Weight ; }
92 Float_t GetEMCALElectronWeight() const { return fEMCALElectronWeight; }
93 Float_t GetEMCALChargeWeight() const { return fEMCALChargeWeight ; }
94 Float_t GetEMCALNeutralWeight() const { return fEMCALNeutralWeight ; }
95 Float_t GetPHOSPhotonWeight() const { return fPHOSPhotonWeight ; }
96 Float_t GetPHOSPi0Weight() const { return fPHOSPi0Weight ; }
97 Float_t GetPHOSElectronWeight() const { return fPHOSElectronWeight ; }
98 Float_t GetPHOSChargeWeight() const { return fPHOSChargeWeight ; }
99 Float_t GetPHOSNeutralWeight() const { return fPHOSNeutralWeight ; }
101 Bool_t IsPHOSPIDWeightFormulaOn() const { return fPHOSWeightFormula ; }
103 TFormula * GetPHOSPhotonWeightFormula() {
104 if(!fPHOSPhotonWeightFormula)
105 fPHOSPhotonWeightFormula = new TFormula("phos_photon_weight",
106 fPHOSPhotonWeightFormulaExpression);
107 return fPHOSPhotonWeightFormula ; }
109 TFormula * GetPHOSPi0WeightFormula() {
110 if(!fPHOSPi0WeightFormula)
111 fPHOSPi0WeightFormula = new TFormula("phos_pi0_weight",
112 fPHOSPi0WeightFormulaExpression);
113 return fPHOSPi0WeightFormula ; }
115 TString GetPHOSPhotonWeightFormulaExpression() const { return fPHOSPhotonWeightFormulaExpression ; }
116 TString GetPHOSPi0WeightFormulaExpression() const { return fPHOSPi0WeightFormulaExpression ; }
119 void SetEMCALPhotonWeight (Float_t w) { fEMCALPhotonWeight = w ; }
120 void SetEMCALPi0Weight (Float_t w) { fEMCALPi0Weight = w ; }
121 void SetEMCALElectronWeight(Float_t w) { fEMCALElectronWeight = w ; }
122 void SetEMCALChargeWeight (Float_t w) { fEMCALChargeWeight = w ; }
123 void SetEMCALNeutralWeight (Float_t w) { fEMCALNeutralWeight = w ; }
124 void SetPHOSPhotonWeight (Float_t w) { fPHOSPhotonWeight = w ; }
125 void SetPHOSPi0Weight (Float_t w) { fPHOSPi0Weight = w ; }
126 void SetPHOSElectronWeight (Float_t w) { fPHOSElectronWeight = w ; }
127 void SetPHOSChargeWeight (Float_t w) { fPHOSChargeWeight = w ; }
128 void SetPHOSNeutralWeight (Float_t w) { fPHOSNeutralWeight = w ; }
130 void UsePHOSPIDWeightFormula (Bool_t ok ) { fPHOSWeightFormula = ok; }
131 void SetPHOSPhotonWeightFormulaExpression(TString ph) { fPHOSPhotonWeightFormulaExpression = ph; }
132 void SetPHOSPi0WeightFormulaExpression (TString pi) { fPHOSPi0WeightFormulaExpression = pi; }
134 //PID bits setters and getters
136 void SetDispersionCut(Float_t dcut ) { fDispCut = dcut ; }
137 Float_t GetDispersionCut() const { return fDispCut ; }
139 void SetTOFCut(Float_t tcut ) { fTOFCut = tcut ; }
140 Float_t GetTOFCut() const { return fTOFCut ; }
142 void SetDebug(Int_t deb) { fDebug=deb ; }
143 Int_t GetDebug() const { return fDebug ; }
145 //Bayesian recalculation (EMCAL)
146 void SwitchOnBayesianRecalculation() { fRecalculateBayesian = kTRUE ; }
147 void SwitchOffBayesianRecalculation() { fRecalculateBayesian = kFALSE; }
148 enum eventType{kLow,kHigh};
149 void SetLowParticleFlux() { fParticleFlux = kLow ; }
150 void SetHighParticleFlux() { fParticleFlux = kHigh ; }
155 Bool_t IsTrackMatched(const AliVCluster * cluster, const AliCalorimeterUtils* cu) const ;
157 // Track matching histogrammes setters and getters
159 virtual void SetHistoERangeAndNBins(Float_t min, Float_t max, Int_t n) {
160 fHistoNEBins = n ; fHistoEMax = max ; fHistoEMin = min ;
163 virtual void SetHistoDEtaRangeAndNBins(Float_t min, Float_t max, Int_t n) {
164 fHistoNDEtaBins = n ; fHistoDEtaMax = max ; fHistoDEtaMin = min ;
167 virtual void SetHistoDPhiRangeAndNBins(Float_t min, Float_t max, Int_t n) {
168 fHistoNDPhiBins = n ; fHistoDPhiMax = max ; fHistoDPhiMin = min ;
174 Float_t fEMCALPhotonWeight; // Bayesian PID weight for photons in EMCAL
175 Float_t fEMCALPi0Weight; // Bayesian PID weight for pi0 in EMCAL
176 Float_t fEMCALElectronWeight; // Bayesian PID weight for electrons in EMCAL
177 Float_t fEMCALChargeWeight; // Bayesian PID weight for charged hadrons in EMCAL
178 Float_t fEMCALNeutralWeight; // Bayesian PID weight for neutral hadrons in EMCAL
179 Float_t fPHOSPhotonWeight; // Bayesian PID weight for photons in PHOS
180 Float_t fPHOSPi0Weight; // Bayesian PID weight for pi0 in PHOS
181 Float_t fPHOSElectronWeight; // Bayesian PID weight for electrons in PHOS
182 Float_t fPHOSChargeWeight; // Bayesian PID weight for charged hadrons in PHOS
183 Float_t fPHOSNeutralWeight; // Bayesian PID weight for neutral hadrons in PHOS
185 Bool_t fPHOSWeightFormula ; // Use parametrized weight threshold, function of energy
186 TFormula *fPHOSPhotonWeightFormula ; // Formula for photon weight
187 TFormula *fPHOSPi0WeightFormula ; // Formula for pi0 weight
188 TString fPHOSPhotonWeightFormulaExpression; // Photon weight formula in string
189 TString fPHOSPi0WeightFormulaExpression; // Pi0 weight formula in string
191 Float_t fDispCut; //Cut on shower shape lambda0, used in PID evaluation
192 Float_t fTOFCut; //Cut on TOF, used in PID evaluation
194 Int_t fDebug; //Debug level
197 Bool_t fRecalculateBayesian; // Recalculate PID bayesian or use simple PID?
198 Int_t fParticleFlux; // Particle flux for setting PID parameters
199 AliEMCALPIDUtils * fEMCALPIDUtils; // Pointer to EMCALPID to redo the PID Bayesian calculation
201 // Track matching control histograms
202 Int_t fHistoNEBins ; // Number of bins in cluster E axis
203 Float_t fHistoEMax ; // Maximum value of cluster E histogram range
204 Float_t fHistoEMin ; // Minimum value of cluster E histogram range
205 Int_t fHistoNDEtaBins ; // Number of bins in dEta (cluster-track) axis
206 Float_t fHistoDEtaMax ; // Maximum value of dEta (cluster-track) histogram range
207 Float_t fHistoDEtaMin ; // Minimum value of dEta (cluster-track) histogram range
208 Int_t fHistoNDPhiBins ; // Number of bins in dPhi axis
209 Float_t fHistoDPhiMax ; // Maximum value of dPhi (cluster-track) histogram range
210 Float_t fHistoDPhiMin ; // Minimum value of dPhi (cluster-track) histogram range
212 TH2F * fhTrackMatchedDEta ; //! Eta distance between track and cluster vs cluster E
213 TH2F * fhTrackMatchedDPhi ; //! Phi distance between track and cluster vs cluster E
214 TH2F * fhTrackMatchedDEtaDPhi ; //! Eta vs Phi distance between track and cluster, E cluster > 0.5 GeV
217 ClassDef(AliCaloPID,6)
221 #endif //ALICALOPID_H