]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG4/PartCorrBase/AliCaloPID.h
Possibility to recalculate cluster position and correct for the non linearity of...
[u/mrichter/AliRoot.git] / PWG4 / PartCorrBase / AliCaloPID.h
CommitLineData
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.
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.
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>
32class TString ;
33class TLorentzVector ;
a33b76ed 34//class TFormula ;
bdd2a262 35class TTask;
1c5acb87 36
37//--- AliRoot system ---
0ae57829 38class AliVCluster;
1c5acb87 39class AliAODPWG4Particle;
bdd2a262 40class AliEMCALPIDUtils;
1c5acb87 41
42class AliCaloPID : public TObject {
43
477d6cee 44 public:
45
46 AliCaloPID() ; // ctor
bdd2a262 47 AliCaloPID(const Int_t particleFlux) ; // ctor, to be used when recalculating bayesian PID
48 AliCaloPID(const TTask * emcalpid) ; // ctor, to be used when recalculating bayesian PID and need different parameters
477d6cee 49 AliCaloPID(const AliCaloPID & g) ; // cpy ctor
477d6cee 50 virtual ~AliCaloPID() ;//virtual dtor
614701c6 51
52private:
53 AliCaloPID & operator = (const AliCaloPID & g) ;//cpy assignment
477d6cee 54
614701c6 55public:
56
477d6cee 57 enum PidType {
58 kPhoton = 22,
59 kPi0 = 111,
60 kEta = 221,
61 kElectron = 11,
62 kEleCon = -11,
63 kNeutralHadron = 2112,
64 kChargedHadron = 211,
65 kNeutralUnknown = 130,
66 kChargedUnknown=321
67 };
68
69 enum TagType {kPi0Decay, kEtaDecay, kOtherDecay, kConversion, kNoTag = -1};
70
71 void InitParameters();
72
73 Int_t GetPdg(const TString calo, const Double_t * pid, const Float_t energy) const ;
74
0ae57829 75 Int_t GetPdg(const TString calo,const TLorentzVector mom, const AliVCluster * cluster) const ;
477d6cee 76
77 TString GetPIDParametersList();
78
0ae57829 79 void SetPIDBits(const TString calo, const AliVCluster * cluster, AliAODPWG4Particle *aodph);
477d6cee 80
81 void Print(const Option_t * opt)const;
82
83 //Weight getters
84 Float_t GetEMCALPhotonWeight() const { return fEMCALPhotonWeight ; }
85 Float_t GetEMCALPi0Weight() const { return fEMCALPi0Weight ; }
86 Float_t GetEMCALElectronWeight() const { return fEMCALElectronWeight ; }
87 Float_t GetEMCALChargeWeight() const { return fEMCALChargeWeight ; }
88 Float_t GetEMCALNeutralWeight() const { return fEMCALNeutralWeight ; }
89 Float_t GetPHOSPhotonWeight() const { return fPHOSPhotonWeight ; }
90 Float_t GetPHOSPi0Weight() const { return fPHOSPi0Weight ; }
91 Float_t GetPHOSElectronWeight() const { return fPHOSElectronWeight ; }
92 Float_t GetPHOSChargeWeight() const { return fPHOSChargeWeight ; }
93 Float_t GetPHOSNeutralWeight() const { return fPHOSNeutralWeight ; }
94
a33b76ed 95// Bool_t IsPHOSPIDWeightFormulaOn() const { return fPHOSWeightFormula ; }
96// TFormula * GetPHOSPhotonWeightFormula() const { return fPHOSPhotonWeightFormula ; }
97// TFormula * GetPHOSPi0WeightFormula() const { return fPHOSPi0WeightFormula ; }
98//
477d6cee 99 //Weight setters
100 void SetEMCALPhotonWeight(Float_t w){ fEMCALPhotonWeight = w ; }
101 void SetEMCALPi0Weight(Float_t w){ fEMCALPi0Weight = w ; }
102 void SetEMCALElectronWeight(Float_t w){ fEMCALElectronWeight = w ; }
103 void SetEMCALChargeWeight(Float_t w){ fEMCALChargeWeight = w ; }
104 void SetEMCALNeutralWeight(Float_t w){ fEMCALNeutralWeight = w ; }
105 void SetPHOSPhotonWeight(Float_t w){ fPHOSPhotonWeight = w ; }
106 void SetPHOSPi0Weight(Float_t w){ fPHOSPi0Weight = w ; }
107 void SetPHOSElectronWeight(Float_t w){ fPHOSElectronWeight = w ; }
108 void SetPHOSChargeWeight(Float_t w){ fPHOSChargeWeight = w ; }
109 void SetPHOSNeutralWeight(Float_t w){ fPHOSNeutralWeight = w ; }
110
a33b76ed 111// void UsePHOSPIDWeightFormula(Bool_t par) { fPHOSWeightFormula = par; }
112// void SetPHOSPhotonWeightFormula(TFormula * const photon) { fPHOSPhotonWeightFormula = photon; }
113// void SetPHOSPi0WeightFormula(TFormula * const pi0) { fPHOSPi0WeightFormula = pi0; }
477d6cee 114
115 //PID bits setters and getters
5ae09196 116
117 Bool_t IsTrackMatched(const AliVCluster * cluster) const ;
118
477d6cee 119 void SetDispersionCut(Float_t dcut ) {fDispCut = dcut; }
120 Float_t GetDispersionCut() const {return fDispCut ;}
121
122 void SetTOFCut(Float_t tcut ) {fTOFCut = tcut; }
123 Float_t GetTOFCut() const {return fTOFCut ;}
124
125 void SetDebug(Int_t deb) {fDebug=deb;}
126 Int_t GetDebug() const {return fDebug;}
127
bdd2a262 128 void SwitchOnBayesianRecalculation() {fRecalculateBayesian = kTRUE ; }
129 void SwitchOffBayesianRecalculation() {fRecalculateBayesian = kFALSE; }
130 enum eventType{kLow,kHigh};
131 void SetLowParticleFlux() {fParticleFlux = kLow;}
132 void SetHighParticleFlux() {fParticleFlux = kHigh;}
133
477d6cee 134 private:
135
136 Float_t fEMCALPhotonWeight; //Bayesian PID weight for photons in EMCAL
137 Float_t fEMCALPi0Weight; //Bayesian PID weight for pi0 in EMCAL
138 Float_t fEMCALElectronWeight; //Bayesian PID weight for electrons in EMCAL
139 Float_t fEMCALChargeWeight; //Bayesian PID weight for charged hadrons in EMCAL
140 Float_t fEMCALNeutralWeight; //Bayesian PID weight for neutral hadrons in EMCAL
141 Float_t fPHOSPhotonWeight; //Bayesian PID weight for photons in PHOS
142 Float_t fPHOSPi0Weight; //Bayesian PID weight for pi0 in PHOS
143 Float_t fPHOSElectronWeight; //Bayesian PID weight for electrons in PHOS
144 Float_t fPHOSChargeWeight; //Bayesian PID weight for charged hadrons in PHOS
145 Float_t fPHOSNeutralWeight; //Bayesian PID weight for neutral hadrons in PHOS
146
a33b76ed 147// Bool_t fPHOSWeightFormula ; //Use parametrized weight threshold, function of energy
148// TFormula * fPHOSPhotonWeightFormula ; //Formula for photon weight
149// TFormula * fPHOSPi0WeightFormula ; //Formula for pi0 weight
477d6cee 150
151 Float_t fDispCut; //Cut on dispersion, used in PID evaluation
152 Float_t fTOFCut; //Cut on TOF, used in PID evaluation
153
154 Int_t fDebug; //Debug level
bdd2a262 155
156 Bool_t fRecalculateBayesian; // Recalculate PID bayesian or use simple PID?
157 Int_t fParticleFlux; // Particle flux for setting PID parameters
e5dbdaf0 158 AliEMCALPIDUtils * fEMCALPIDUtils; //Pointer to EMCALPID to redo the PID Bayesian calculation
bdd2a262 159
160
161 ClassDef(AliCaloPID,4)
e5dbdaf0 162} ;
1c5acb87 163
164
165#endif //ALICALOPID_H
166
167
168