]>
Commit | Line | Data |
---|---|---|
d9b3567c | 1 | #ifndef ALIEMCALRECOUTILS_H |
2 | #define ALIEMCALRECOUTILS_H | |
3 | ||
40891fa2 | 4 | /* $Id: AliEMCALRecoUtils.h | Tue Jul 23 09:11:15 2013 +0000 | gconesab $ */ |
d9b3567c | 5 | |
6 | /////////////////////////////////////////////////////////////////////////////// | |
7 | // | |
8 | // Class AliEMCALRecoUtils | |
9 | // Some utilities to recalculate the cluster position or energy linearity | |
10 | // | |
11 | // | |
12 | // Author: Gustavo Conesa (LPSC- Grenoble) | |
b540d03f | 13 | // Track matching part: Rongrong Ma (Yale) |
d9b3567c | 14 | /////////////////////////////////////////////////////////////////////////////// |
15 | ||
16 | //Root includes | |
01d44f1f | 17 | #include <TNamed.h> |
18 | #include <TMath.h> | |
7cdec71f | 19 | class TObjArray; |
20 | class TArrayI; | |
21 | class TArrayF; | |
01d44f1f | 22 | #include <TH2I.h> |
7cdec71f | 23 | class TH2F; |
01d44f1f | 24 | #include <TRandom3.h> |
d9b3567c | 25 | |
26 | //AliRoot includes | |
27 | class AliVCluster; | |
28 | class AliVCaloCells; | |
bd8c7aef | 29 | class AliVEvent; |
88b96ad8 | 30 | #include "AliLog.h" |
b540d03f | 31 | |
32 | // EMCAL includes | |
094786cc | 33 | class AliEMCALGeometry; |
83bfd77a | 34 | class AliEMCALPIDUtils; |
bd8c7aef | 35 | class AliESDtrack; |
bb6f5f0b | 36 | class AliExternalTrackParam; |
40891fa2 | 37 | class AliVTrack; |
3b4a4334 | 38 | |
d9b3567c | 39 | class AliEMCALRecoUtils : public TNamed { |
40 | ||
41 | public: | |
42 | ||
43 | AliEMCALRecoUtils(); | |
44 | AliEMCALRecoUtils(const AliEMCALRecoUtils&); | |
45 | AliEMCALRecoUtils& operator=(const AliEMCALRecoUtils&); | |
b540d03f | 46 | virtual ~AliEMCALRecoUtils() ; |
88b96ad8 | 47 | |
48 | void InitParameters(); | |
01d44f1f | 49 | void Print(const Option_t*) const; |
b540d03f | 50 | |
51 | //enums | |
d24a0a76 | 52 | enum NonlinearityFunctions{kPi0MC=0,kPi0GammaGamma=1,kPi0GammaConversion=2,kNoCorrection=3,kBeamTest=4,kBeamTestCorrected=5,kPi0MCv2=6,kPi0MCv3=7,kBeamTestCorrectedv2=8,kSDMv5=9,kPi0MCv5=10}; |
01d44f1f | 53 | enum PositionAlgorithms{kUnchanged=-1,kPosTowerIndex=0, kPosTowerGlobal=1}; |
54 | enum ParticleType{kPhoton=0, kElectron=1,kHadron =2, kUnknown=-1}; | |
42ceff04 | 55 | enum { kNCuts = 12 }; //track matching Marcel |
56 | enum TrackCutsType{kTPCOnlyCut=0, kGlobalCut=1, kLooseCut=2, kITSStandAlone=3}; //Marcel | |
b540d03f | 57 | |
58 | //----------------------------------------------------- | |
d9b3567c | 59 | //Position recalculation |
b540d03f | 60 | //----------------------------------------------------- |
a520bcd0 | 61 | void RecalculateClusterPosition (const AliEMCALGeometry *geom, AliVCaloCells* cells, AliVCluster* clu); |
62 | void RecalculateClusterPositionFromTowerIndex (const AliEMCALGeometry *geom, AliVCaloCells* cells, AliVCluster* clu); | |
63 | void RecalculateClusterPositionFromTowerGlobal(const AliEMCALGeometry *geom, AliVCaloCells* cells, AliVCluster* clu); | |
fb8eab96 | 64 | Float_t GetCellWeight(Float_t eCell, Float_t eCluster) const { if (eCell > 0 && eCluster > 0) return TMath::Max( 0., fW0 + TMath::Log( eCell / eCluster )) ; |
c8fcffd3 | 65 | else return 0. ; } |
66 | Float_t GetDepth(Float_t eCluster, Int_t iParticle, Int_t iSM) const; | |
88b96ad8 | 67 | void GetMaxEnergyCell(const AliEMCALGeometry *geom, AliVCaloCells* cells, const AliVCluster* clu, |
cb231979 | 68 | Int_t & absId, Int_t& iSupMod, Int_t& ieta, Int_t& iphi, Bool_t &shared); |
d9b3567c | 69 | |
fb8eab96 | 70 | Float_t GetMisalTransShift(Int_t i) const { if(i < 15 ) { return fMisalTransShift[i] ; } |
c8fcffd3 | 71 | else { AliInfo(Form("Index %d larger than 15, do nothing\n",i)) ; |
72 | return 0. ; } } | |
73 | Float_t* GetMisalTransShiftArray() { return fMisalTransShift ; } | |
74 | void SetMisalTransShift(Int_t i, Float_t shift) { if(i < 15 ) { fMisalTransShift[i] = shift ; } | |
75 | else { AliInfo(Form("Index %d larger than 15, do nothing\n",i)) ; } } | |
76 | void SetMisalTransShiftArray(Float_t * misal) { for(Int_t i = 0; i < 15; i++) fMisalTransShift[i] = misal[i] ; } | |
77 | Float_t GetMisalRotShift(Int_t i) const { if(i < 15 ) { return fMisalRotShift[i] ; } | |
78 | else { AliInfo(Form("Index %d larger than 15, do nothing\n",i)) ; | |
79 | return 0. ; } } | |
80 | Float_t* GetMisalRotShiftArray() { return fMisalRotShift ; } | |
81 | void SetMisalRotShift(Int_t i, Float_t shift) { if(i < 15 ) { fMisalRotShift[i] = shift ; } | |
82 | else { AliInfo(Form("Index %d larger than 15, do nothing\n",i)) ; } } | |
83 | void SetMisalRotShiftArray(Float_t * misal) { for(Int_t i = 0; i < 15; i++)fMisalRotShift[i] = misal[i] ; } | |
01d44f1f | 84 | Int_t GetParticleType() const { return fParticleType ; } |
85 | void SetParticleType(Int_t particle) { fParticleType = particle ; } | |
01d44f1f | 86 | Int_t GetPositionAlgorithm() const { return fPosAlgo ; } |
87 | void SetPositionAlgorithm(Int_t alg) { fPosAlgo = alg ; } | |
01d44f1f | 88 | Float_t GetW0() const { return fW0 ; } |
89 | void SetW0(Float_t w0) { fW0 = w0 ; } | |
094786cc | 90 | |
b540d03f | 91 | //----------------------------------------------------- |
a7e5a381 | 92 | // Non Linearity |
b540d03f | 93 | //----------------------------------------------------- |
01d44f1f | 94 | Float_t CorrectClusterEnergyLinearity(AliVCluster* clu) ; |
fb8eab96 | 95 | Float_t GetNonLinearityParam(Int_t i) const { if(i < 7 && i >=0 ){ return fNonLinearityParams[i] ; } |
c8fcffd3 | 96 | else { AliInfo(Form("Index %d larger than 6 or negative, do nothing\n",i)) ; |
97 | return 0. ; } } | |
98 | void SetNonLinearityParam(Int_t i, Float_t param) { if(i < 7 && i >=0 ){ fNonLinearityParams[i] = param ; } | |
6aad3c6a | 99 | else { AliInfo(Form("Index %d larger than 6 or negative, do nothing\n",i)) ; } } |
01d44f1f | 100 | void InitNonLinearityParam(); |
01d44f1f | 101 | Int_t GetNonLinearityFunction() const { return fNonLinearityFunction ; } |
102 | void SetNonLinearityFunction(Int_t fun) { fNonLinearityFunction = fun ; InitNonLinearityParam() ; } | |
01d44f1f | 103 | void SetNonLinearityThreshold(Int_t threshold) { fNonLinearThreshold = threshold ; } //only for Alexie's non linearity correction |
104 | Int_t GetNonLinearityThreshold() const { return fNonLinearThreshold ; } | |
c8fcffd3 | 105 | |
01d44f1f | 106 | //----------------------------------------------------- |
107 | // MC clusters energy smearing | |
108 | //----------------------------------------------------- | |
88b96ad8 | 109 | Float_t SmearClusterEnergy(const AliVCluster* clu) ; |
01d44f1f | 110 | void SwitchOnClusterEnergySmearing() { fSmearClusterEnergy = kTRUE ; } |
111 | void SwitchOffClusterEnergySmearing() { fSmearClusterEnergy = kFALSE ; } | |
112 | Bool_t IsClusterEnergySmeared() const { return fSmearClusterEnergy ; } | |
113 | void SetSmearingParameters(Int_t i, Float_t param) { if(i < 3){ fSmearClusterParam[i] = param ; } | |
114 | else { AliInfo(Form("Index %d larger than 2, do nothing\n",i)) ; } } | |
b540d03f | 115 | //----------------------------------------------------- |
a7e5a381 | 116 | // Recalibration |
b540d03f | 117 | //----------------------------------------------------- |
fb8eab96 | 118 | Bool_t AcceptCalibrateCell(Int_t absId, Int_t bc, |
a7e5a381 | 119 | Float_t & amp, Double_t & time, AliVCaloCells* cells) ; // Energy and Time |
120 | void RecalibrateCells(AliVCaloCells * cells, Int_t bc) ; // Energy and Time | |
fb8eab96 | 121 | void RecalibrateClusterEnergy(const AliEMCALGeometry* geom, AliVCluster* cluster, AliVCaloCells * cells, Int_t bc=-1) ; // Energy and time |
841dbf60 | 122 | void ResetCellsCalibrated() { fCellsRecalibrated = kFALSE; } |
094786cc | 123 | |
a7e5a381 | 124 | // Energy recalibration |
01d44f1f | 125 | Bool_t IsRecalibrationOn() const { return fRecalibration ; } |
126 | void SwitchOffRecalibration() { fRecalibration = kFALSE ; } | |
127 | void SwitchOnRecalibration() { fRecalibration = kTRUE ; | |
128 | if(!fEMCALRecalibrationFactors)InitEMCALRecalibrationFactors() ; } | |
129 | void InitEMCALRecalibrationFactors() ; | |
50b7a951 | 130 | TObjArray* GetEMCALRecalibrationFactorsArray() const { return fEMCALRecalibrationFactors ; } |
3bfc4732 | 131 | TH2F * GetEMCALChannelRecalibrationFactors(Int_t iSM) const { return (TH2F*)fEMCALRecalibrationFactors->At(iSM) ; } |
132 | void SetEMCALChannelRecalibrationFactors(TObjArray *map) { fEMCALRecalibrationFactors = map ; } | |
133 | void SetEMCALChannelRecalibrationFactors(Int_t iSM , TH2F* h) { fEMCALRecalibrationFactors->AddAt(h,iSM) ; } | |
01d44f1f | 134 | Float_t GetEMCALChannelRecalibrationFactor(Int_t iSM , Int_t iCol, Int_t iRow) const { |
3bfc4732 | 135 | if(fEMCALRecalibrationFactors) |
136 | return (Float_t) ((TH2F*)fEMCALRecalibrationFactors->At(iSM))->GetBinContent(iCol,iRow); | |
137 | else return 1 ; } | |
01d44f1f | 138 | void SetEMCALChannelRecalibrationFactor(Int_t iSM , Int_t iCol, Int_t iRow, Double_t c = 1) { |
3bfc4732 | 139 | if(!fEMCALRecalibrationFactors) InitEMCALRecalibrationFactors() ; |
140 | ((TH2F*)fEMCALRecalibrationFactors->At(iSM))->SetBinContent(iCol,iRow,c) ; } | |
141 | ||
142 | //Recalibrate channels energy with run dependent corrections | |
7bf608c9 | 143 | Bool_t IsRunDepRecalibrationOn() const { return fUseRunCorrectionFactors ; } |
3bfc4732 | 144 | void SwitchOffRunDepCorrection() { fUseRunCorrectionFactors = kFALSE ; } |
145 | void SwitchOnRunDepCorrection() { fUseRunCorrectionFactors = kTRUE ; | |
7bf608c9 | 146 | SwitchOnRecalibration() ; } |
a7e5a381 | 147 | // Time Recalibration |
fb8eab96 | 148 | void RecalibrateCellTime(Int_t absId, Int_t bc, Double_t & time) const; |
3bfc4732 | 149 | |
150 | Bool_t IsTimeRecalibrationOn() const { return fTimeRecalibration ; } | |
151 | void SwitchOffTimeRecalibration() { fTimeRecalibration = kFALSE ; } | |
152 | void SwitchOnTimeRecalibration() { fTimeRecalibration = kTRUE ; | |
c8fcffd3 | 153 | if(!fEMCALTimeRecalibrationFactors)InitEMCALTimeRecalibrationFactors() ; } |
3bfc4732 | 154 | void InitEMCALTimeRecalibrationFactors() ; |
50b7a951 | 155 | TObjArray* GetEMCALTimeRecalibrationFactorsArray() const { return fEMCALTimeRecalibrationFactors ; } |
156 | ||
fb8eab96 | 157 | Float_t GetEMCALChannelTimeRecalibrationFactor(Int_t bc, Int_t absID) const { |
3bfc4732 | 158 | if(fEMCALTimeRecalibrationFactors) |
159 | return (Float_t) ((TH1F*)fEMCALTimeRecalibrationFactors->At(bc))->GetBinContent(absID); | |
a7e5a381 | 160 | else return 0 ; } |
fb8eab96 | 161 | void SetEMCALChannelTimeRecalibrationFactor(Int_t bc, Int_t absID, Double_t c = 0) { |
3bfc4732 | 162 | if(!fEMCALTimeRecalibrationFactors) InitEMCALTimeRecalibrationFactors() ; |
163 | ((TH1F*)fEMCALTimeRecalibrationFactors->At(bc))->SetBinContent(absID,c) ; } | |
164 | ||
fb8eab96 | 165 | TH1F * GetEMCALChannelTimeRecalibrationFactors(Int_t bc)const { return (TH1F*)fEMCALTimeRecalibrationFactors->At(bc) ; } |
a7e5a381 | 166 | void SetEMCALChannelTimeRecalibrationFactors(TObjArray *map) { fEMCALTimeRecalibrationFactors = map ; } |
fb8eab96 | 167 | void SetEMCALChannelTimeRecalibrationFactors(Int_t bc , TH1F* h) { fEMCALTimeRecalibrationFactors->AddAt(h,bc) ; } |
094786cc | 168 | |
b540d03f | 169 | //----------------------------------------------------- |
3bfc4732 | 170 | // Modules fiducial region, remove clusters in borders |
b540d03f | 171 | //----------------------------------------------------- |
a520bcd0 | 172 | Bool_t CheckCellFiducialRegion(const AliEMCALGeometry* geom, |
173 | const AliVCluster* cluster, | |
174 | AliVCaloCells* cells) ; | |
fb8eab96 | 175 | void SetNumberOfCellsFromEMCALBorder(Int_t n){ fNCellsFromEMCALBorder = n ; } |
01d44f1f | 176 | Int_t GetNumberOfCellsFromEMCALBorder() const { return fNCellsFromEMCALBorder ; } |
fd6df01c | 177 | |
01d44f1f | 178 | void SwitchOnNoFiducialBorderInEMCALEta0() { fNoEMCALBorderAtEta0 = kTRUE ; } |
179 | void SwitchOffNoFiducialBorderInEMCALEta0() { fNoEMCALBorderAtEta0 = kFALSE ; } | |
180 | Bool_t IsEMCALNoBorderAtEta0() const { return fNoEMCALBorderAtEta0 ; } | |
fd6df01c | 181 | |
b540d03f | 182 | //----------------------------------------------------- |
fd6df01c | 183 | // Bad channels |
b540d03f | 184 | //----------------------------------------------------- |
01d44f1f | 185 | Bool_t IsBadChannelsRemovalSwitchedOn() const { return fRemoveBadChannels ; } |
186 | void SwitchOffBadChannelsRemoval() { fRemoveBadChannels = kFALSE ; } | |
187 | void SwitchOnBadChannelsRemoval () { fRemoveBadChannels = kTRUE ; | |
188 | if(!fEMCALBadChannelMap)InitEMCALBadChannelStatusMap() ; } | |
01d44f1f | 189 | Bool_t IsDistanceToBadChannelRecalculated() const { return fRecalDistToBadChannels ; } |
190 | void SwitchOffDistToBadChannelRecalculation() { fRecalDistToBadChannels = kFALSE ; } | |
191 | void SwitchOnDistToBadChannelRecalculation() { fRecalDistToBadChannels = kTRUE ; | |
192 | if(!fEMCALBadChannelMap)InitEMCALBadChannelStatusMap() ; } | |
c8fcffd3 | 193 | TObjArray* GetEMCALBadChannelStatusMapArray() const { return fEMCALBadChannelMap ; } |
01d44f1f | 194 | void InitEMCALBadChannelStatusMap() ; |
01d44f1f | 195 | Int_t GetEMCALChannelStatus(Int_t iSM , Int_t iCol, Int_t iRow) const { |
fd6df01c | 196 | if(fEMCALBadChannelMap) return (Int_t) ((TH2I*)fEMCALBadChannelMap->At(iSM))->GetBinContent(iCol,iRow); |
197 | else return 0;}//Channel is ok by default | |
01d44f1f | 198 | void SetEMCALChannelStatus(Int_t iSM , Int_t iCol, Int_t iRow, Double_t c = 1) { |
c8fcffd3 | 199 | if(!fEMCALBadChannelMap)InitEMCALBadChannelStatusMap() ; |
200 | ((TH2I*)fEMCALBadChannelMap->At(iSM))->SetBinContent(iCol,iRow,c) ; } | |
01d44f1f | 201 | TH2I * GetEMCALChannelStatusMap(Int_t iSM) const { return (TH2I*)fEMCALBadChannelMap->At(iSM) ; } |
202 | void SetEMCALChannelStatusMap(TObjArray *map) { fEMCALBadChannelMap = map ; } | |
203 | void SetEMCALChannelStatusMap(Int_t iSM , TH2I* h) { fEMCALBadChannelMap->AddAt(h,iSM) ; } | |
fb8eab96 | 204 | Bool_t ClusterContainsBadChannel(const AliEMCALGeometry* geom, const UShort_t* cellList, Int_t nCells); |
fd6df01c | 205 | |
b540d03f | 206 | //----------------------------------------------------- |
207 | // Recalculate other cluster parameters | |
208 | //----------------------------------------------------- | |
a520bcd0 | 209 | void RecalculateClusterDistanceToBadChannel (const AliEMCALGeometry * geom, AliVCaloCells* cells, AliVCluster * cluster); |
210 | void RecalculateClusterShowerShapeParameters(const AliEMCALGeometry * geom, AliVCaloCells* cells, AliVCluster * cluster); | |
f0e9e976 | 211 | void RecalculateClusterShowerShapeParameters(const AliEMCALGeometry * geom, AliVCaloCells* cells, AliVCluster * cluster, |
212 | Float_t & l0, Float_t & l1, | |
213 | Float_t & disp, Float_t & dEta, Float_t & dPhi, | |
214 | Float_t & sEta, Float_t & sPhi, Float_t & sEtaPhi); | |
01d44f1f | 215 | void RecalculateClusterPID(AliVCluster * cluster); |
83bfd77a | 216 | AliEMCALPIDUtils * GetPIDUtils() { return fPIDUtils;} |
217 | ||
b540d03f | 218 | //---------------------------------------------------- |
219 | // Track matching | |
220 | //---------------------------------------------------- | |
a520bcd0 | 221 | void FindMatches(AliVEvent *event, TObjArray * clusterArr=0x0, const AliEMCALGeometry *geom=0x0); |
222 | Int_t FindMatchedClusterInEvent(const AliESDtrack *track, const AliVEvent *event, | |
223 | const AliEMCALGeometry *geom, Float_t &dEta, Float_t &dPhi); | |
7f5392da | 224 | Int_t FindMatchedClusterInClusterArr(const AliExternalTrackParam *emcalParam, |
225 | AliExternalTrackParam *trkParam, | |
226 | const TObjArray * clusterArr, | |
227 | Float_t &dEta, Float_t &dPhi); | |
40891fa2 | 228 | static Bool_t ExtrapolateTrackToEMCalSurface(AliVTrack *track, /*note, on success the call will change the track*/ |
18a566cc | 229 | Double_t emcalR=440, Double_t mass=0.1396, |
230 | Double_t step=20, Double_t minpT=0.35, | |
231 | Bool_t useMassForTracking = kFALSE); | |
a520bcd0 | 232 | static Bool_t ExtrapolateTrackToEMCalSurface(AliExternalTrackParam *trkParam, |
fb8eab96 | 233 | Double_t emcalR, Double_t mass, Double_t step, |
a29b2a8a | 234 | Float_t &eta, Float_t &phi, Float_t &pt); |
88b96ad8 | 235 | static Bool_t ExtrapolateTrackToPosition(AliExternalTrackParam *trkParam, const Float_t *clsPos, |
fb8eab96 | 236 | Double_t mass, Double_t step, |
a520bcd0 | 237 | Float_t &tmpEta, Float_t &tmpPhi); |
7f5392da | 238 | static Bool_t ExtrapolateTrackToCluster (AliExternalTrackParam *trkParam, const AliVCluster *cluster, |
fb8eab96 | 239 | Double_t mass, Double_t step, |
a520bcd0 | 240 | Float_t &tmpEta, Float_t &tmpPhi); |
7f5392da | 241 | Bool_t ExtrapolateTrackToCluster (AliExternalTrackParam *trkParam, const AliVCluster *cluster, |
88b96ad8 | 242 | Float_t &tmpEta, Float_t &tmpPhi); |
fb8eab96 | 243 | UInt_t FindMatchedPosForCluster(Int_t clsIndex) const; |
244 | UInt_t FindMatchedPosForTrack (Int_t trkIndex) const; | |
fb8eab96 | 245 | void GetMatchedResiduals (Int_t clsIndex, Float_t &dEta, Float_t &dPhi); |
246 | void GetMatchedClusterResiduals(Int_t trkIndex, Float_t &dEta, Float_t &dPhi); | |
01d44f1f | 247 | Int_t GetMatchedTrackIndex(Int_t clsIndex); |
248 | Int_t GetMatchedClusterIndex(Int_t trkIndex); | |
fb8eab96 | 249 | Bool_t IsClusterMatched(Int_t clsIndex) const; |
250 | Bool_t IsTrackMatched (Int_t trkIndex) const; | |
dda65b42 | 251 | void SetClusterMatchedToTrack (const AliVEvent *event); |
252 | void SetTracksMatchedToCluster(const AliVEvent *event); | |
01d44f1f | 253 | void SwitchOnCutEtaPhiSum() { fCutEtaPhiSum = kTRUE ; |
254 | fCutEtaPhiSeparate = kFALSE ; } | |
255 | void SwitchOnCutEtaPhiSeparate() { fCutEtaPhiSeparate = kTRUE ; | |
256 | fCutEtaPhiSum = kFALSE ; } | |
01d44f1f | 257 | Float_t GetCutR() const { return fCutR ; } |
258 | Float_t GetCutEta() const { return fCutEta ; } | |
259 | Float_t GetCutPhi() const { return fCutPhi ; } | |
8fc351e3 | 260 | Double_t GetClusterWindow() const { return fClusterWindow ; } |
01d44f1f | 261 | void SetCutR(Float_t cutR) { fCutR = cutR ; } |
262 | void SetCutEta(Float_t cutEta) { fCutEta = cutEta ; } | |
263 | void SetCutPhi(Float_t cutPhi) { fCutPhi = cutPhi ; } | |
8fc351e3 | 264 | void SetClusterWindow(Double_t window) { fClusterWindow = window ; } |
01d44f1f | 265 | void SetCutZ(Float_t cutZ) { printf("Obsolete fucntion of cutZ=%1.1f\n",cutZ) ; } //Obsolete |
a29b2a8a | 266 | void SetEMCalSurfaceDistance(Double_t d) { fEMCalSurfaceDistance = d ; } |
01d44f1f | 267 | Double_t GetMass() const { return fMass ; } |
8fc351e3 | 268 | Double_t GetStep() const { return fStepCluster ; } |
269 | Double_t GetStepSurface() const { return fStepSurface ; } | |
01d44f1f | 270 | void SetMass(Double_t mass) { fMass = mass ; } |
da34fafe | 271 | void SetStep(Double_t step) { fStepSurface = step ; } |
272 | void SetStepCluster(Double_t step) { fStepCluster = step ; } | |
42ceff04 | 273 | void SetITSTrackSA(Bool_t isITS) { fITSTrackSA = isITS ; } //Special Handle of AliExternTrackParam |
18a566cc | 274 | |
a7e5a381 | 275 | // Exotic cells / clusters |
fb8eab96 | 276 | Bool_t IsExoticCell(Int_t absId, AliVCaloCells* cells, Int_t bc =-1) ; |
a7e5a381 | 277 | void SwitchOnRejectExoticCell() { fRejectExoticCells = kTRUE ; } |
278 | void SwitchOffRejectExoticCell() { fRejectExoticCells = kFALSE ; } | |
ba19aaf1 | 279 | Bool_t IsRejectExoticCell() const { return fRejectExoticCells ; } |
fb8eab96 | 280 | Float_t GetECross(Int_t absID, Double_t tcell, |
281 | AliVCaloCells* cells, Int_t bc); | |
ba19aaf1 | 282 | Float_t GetExoticCellFractionCut() const { return fExoticCellFraction ; } |
283 | Float_t GetExoticCellDiffTimeCut() const { return fExoticCellDiffTime ; } | |
284 | Float_t GetExoticCellMinAmplitudeCut() const { return fExoticCellMinAmplitude ; } | |
a7e5a381 | 285 | void SetExoticCellFractionCut(Float_t f) { fExoticCellFraction = f ; } |
286 | void SetExoticCellDiffTimeCut(Float_t dt) { fExoticCellDiffTime = dt ; } | |
287 | void SetExoticCellMinAmplitudeCut(Float_t ma) { fExoticCellMinAmplitude = ma ; } | |
fb8eab96 | 288 | Bool_t IsExoticCluster(const AliVCluster *cluster, AliVCaloCells* cells, Int_t bc=0) ; |
a7e5a381 | 289 | void SwitchOnRejectExoticCluster() { fRejectExoticCluster = kTRUE ; |
290 | fRejectExoticCells = kTRUE ; } | |
291 | void SwitchOffRejectExoticCluster() { fRejectExoticCluster = kFALSE ; } | |
01d44f1f | 292 | Bool_t IsRejectExoticCluster() const { return fRejectExoticCluster ; } |
c8fcffd3 | 293 | |
a7e5a381 | 294 | //Cluster cut |
a520bcd0 | 295 | Bool_t IsGoodCluster(AliVCluster *cluster, const AliEMCALGeometry *geom, |
fb8eab96 | 296 | AliVCaloCells* cells, Int_t bc =-1); |
bd8c7aef | 297 | |
298 | //Track Cuts | |
01d44f1f | 299 | Bool_t IsAccepted(AliESDtrack *track); |
300 | void InitTrackCuts(); | |
301 | void SetTrackCutsType(Int_t type) { fTrackCutsType = type ; | |
302 | InitTrackCuts() ; } | |
303 | Int_t GetTrackCutsType() const { return fTrackCutsType; } | |
bd8c7aef | 304 | |
a6a1e3ab | 305 | // Define AOD track type for matching |
306 | void SwitchOffAODHybridTracksMatch() { fAODHybridTracks = kFALSE ; } | |
307 | void SwitchOffAODTPCOnlyTracksMatch() { fAODTPCOnlyTracks = kFALSE ; } | |
308 | void SwitchOnAODHybridTracksMatch() { fAODHybridTracks = kTRUE ; SwitchOffAODTPCOnlyTracksMatch() ; } | |
309 | void SwitchOnAODTPCOnlyTracksMatch() { fAODTPCOnlyTracks = kTRUE ; SwitchOffAODHybridTracksMatch() ; } | |
310 | void SetAODTrackFilterMask( UInt_t mask) { fAODFilterMask = mask ; | |
311 | SwitchOffAODTPCOnlyTracksMatch() ; SwitchOffAODHybridTracksMatch() ; } | |
c8fcffd3 | 312 | |
a6a1e3ab | 313 | // track quality cut setters |
01d44f1f | 314 | void SetMinTrackPt(Double_t pt=0) { fCutMinTrackPt = pt ; } |
315 | void SetMinNClustersTPC(Int_t min=-1) { fCutMinNClusterTPC = min ; } | |
316 | void SetMinNClustersITS(Int_t min=-1) { fCutMinNClusterITS = min ; } | |
317 | void SetMaxChi2PerClusterTPC(Float_t max=1e10) { fCutMaxChi2PerClusterTPC = max ; } | |
318 | void SetMaxChi2PerClusterITS(Float_t max=1e10) { fCutMaxChi2PerClusterITS = max ; } | |
319 | void SetRequireTPCRefit(Bool_t b=kFALSE) { fCutRequireTPCRefit = b ; } | |
320 | void SetRequireITSRefit(Bool_t b=kFALSE) { fCutRequireITSRefit = b ; } | |
321 | void SetAcceptKinkDaughters(Bool_t b=kTRUE) { fCutAcceptKinkDaughters = b ; } | |
322 | void SetMaxDCAToVertexXY(Float_t dist=1e10) { fCutMaxDCAToVertexXY = dist ; } | |
323 | void SetMaxDCAToVertexZ(Float_t dist=1e10) { fCutMaxDCAToVertexZ = dist ; } | |
324 | void SetDCAToVertex2D(Bool_t b=kFALSE) { fCutDCAToVertex2D = b ; } | |
42ceff04 | 325 | void SetRequireITSStandAlone(Bool_t b=kFALSE) {fCutRequireITSStandAlone = b;} //Marcel |
326 | void SetRequireITSPureStandAlone(Bool_t b=kFALSE){fCutRequireITSpureSA = b;} | |
a6a1e3ab | 327 | |
fa4287a2 | 328 | // getters |
01d44f1f | 329 | Double_t GetMinTrackPt() const { return fCutMinTrackPt ; } |
330 | Int_t GetMinNClusterTPC() const { return fCutMinNClusterTPC ; } | |
331 | Int_t GetMinNClustersITS() const { return fCutMinNClusterITS ; } | |
332 | Float_t GetMaxChi2PerClusterTPC() const { return fCutMaxChi2PerClusterTPC ; } | |
333 | Float_t GetMaxChi2PerClusterITS() const { return fCutMaxChi2PerClusterITS ; } | |
334 | Bool_t GetRequireTPCRefit() const { return fCutRequireTPCRefit ; } | |
335 | Bool_t GetRequireITSRefit() const { return fCutRequireITSRefit ; } | |
336 | Bool_t GetAcceptKinkDaughters() const { return fCutAcceptKinkDaughters ; } | |
337 | Float_t GetMaxDCAToVertexXY() const { return fCutMaxDCAToVertexXY ; } | |
338 | Float_t GetMaxDCAToVertexZ() const { return fCutMaxDCAToVertexZ ; } | |
339 | Bool_t GetDCAToVertex2D() const { return fCutDCAToVertex2D ; } | |
42ceff04 | 340 | Bool_t GetRequireITSStandAlone() const { return fCutRequireITSStandAlone ; } //Marcel |
fd6df01c | 341 | |
8fc351e3 | 342 | private: |
b540d03f | 343 | //Position recalculation |
96957075 | 344 | Float_t fMisalTransShift[15]; // Shift parameters |
345 | Float_t fMisalRotShift[15]; // Shift parameters | |
96957075 | 346 | Int_t fParticleType; // Particle type for depth calculation |
347 | Int_t fPosAlgo; // Position recalculation algorithm | |
348 | Float_t fW0; // Weight0 | |
01d44f1f | 349 | |
350 | // Non linearity | |
351 | Int_t fNonLinearityFunction; // Non linearity function choice | |
352 | Float_t fNonLinearityParams[7]; // Parameters for the non linearity function | |
7e0ecb89 | 353 | Int_t fNonLinearThreshold; // Non linearity threshold value for kBeamTesh non linearity function |
fd6df01c | 354 | |
01d44f1f | 355 | // Energy smearing for MC |
356 | Bool_t fSmearClusterEnergy; // Smear cluster energy, to be done only for simulated data to match real data | |
357 | Float_t fSmearClusterParam[3]; // Smearing parameters | |
358 | TRandom3 fRandom; // Random generator | |
359 | ||
3bfc4732 | 360 | // Energy Recalibration |
361 | Bool_t fCellsRecalibrated; // Internal bool to check if cells (time/energy) where recalibrated and not recalibrate them when recalculating different things | |
fd6df01c | 362 | Bool_t fRecalibration; // Switch on or off the recalibration |
363 | TObjArray* fEMCALRecalibrationFactors; // Array of histograms with map of recalibration factors, EMCAL | |
01d44f1f | 364 | |
3bfc4732 | 365 | // Time Recalibration |
366 | Bool_t fTimeRecalibration; // Switch on or off the time recalibration | |
367 | TObjArray* fEMCALTimeRecalibrationFactors; // Array of histograms with map of time recalibration factors, EMCAL | |
368 | ||
369 | // Recalibrate with run dependent corrections, energy | |
370 | Bool_t fUseRunCorrectionFactors; // Use Run Dependent Correction | |
01d44f1f | 371 | |
b540d03f | 372 | // Bad Channels |
fd6df01c | 373 | Bool_t fRemoveBadChannels; // Check the channel status provided and remove clusters with bad channels |
78467229 | 374 | Bool_t fRecalDistToBadChannels; // Calculate distance from highest energy tower of cluster to closes bad channel |
fd6df01c | 375 | TObjArray* fEMCALBadChannelMap; // Array of histograms with map of bad channels, EMCAL |
b540d03f | 376 | |
377 | // Border cells | |
fd6df01c | 378 | Int_t fNCellsFromEMCALBorder; // Number of cells from EMCAL border the cell with maximum amplitude has to be. |
379 | Bool_t fNoEMCALBorderAtEta0; // Do fiducial cut in EMCAL region eta = 0? | |
b540d03f | 380 | |
a7e5a381 | 381 | // Exotic cell / cluster |
01d44f1f | 382 | Bool_t fRejectExoticCluster; // Switch on or off exotic cluster rejection |
a7e5a381 | 383 | Bool_t fRejectExoticCells; // Remove exotic cells |
384 | Float_t fExoticCellFraction; // Good cell if fraction < 1-ecross/ecell | |
385 | Float_t fExoticCellDiffTime; // If time of candidate to exotic and close cell is too different (in ns), it must be noisy, set amp to 0 | |
386 | Float_t fExoticCellMinAmplitude; // Check for exotic only if amplitud is larger than this value | |
01d44f1f | 387 | |
388 | // PID | |
389 | AliEMCALPIDUtils * fPIDUtils; // Recalculate PID parameters | |
390 | ||
bb6f5f0b | 391 | //Track matching |
392 | UInt_t fAODFilterMask; // Filter mask to select AOD tracks. Refer to $ALICE_ROOT/ANALYSIS/macros/AddTaskESDFilter.C | |
1af378e6 | 393 | Bool_t fAODHybridTracks; // Match with hybrid |
a6a1e3ab | 394 | Bool_t fAODTPCOnlyTracks; // Match with TPC only tracks |
1af378e6 | 395 | |
b540d03f | 396 | TArrayI * fMatchedTrackIndex; // Array that stores indexes of matched tracks |
96957075 | 397 | TArrayI * fMatchedClusterIndex; // Array that stores indexes of matched clusters |
fa4287a2 | 398 | TArrayF * fResidualEta; // Array that stores the residual eta |
399 | TArrayF * fResidualPhi; // Array that stores the residual phi | |
400 | Bool_t fCutEtaPhiSum; // Place cut on sqrt(dEta^2+dPhi^2) | |
401 | Bool_t fCutEtaPhiSeparate; // Cut on dEta and dPhi separately | |
402 | Float_t fCutR; // sqrt(dEta^2+dPhi^2) cut on matching | |
403 | Float_t fCutEta; // dEta cut on matching | |
404 | Float_t fCutPhi; // dPhi cut on matching | |
8fc351e3 | 405 | Double_t fClusterWindow; // Select clusters in the window to be matched |
bb6f5f0b | 406 | Double_t fMass; // Mass hypothesis of the track |
8fc351e3 | 407 | Double_t fStepSurface; // Length of step to extrapolate tracks to EMCal surface |
408 | Double_t fStepCluster; // Length of step to extrapolate tracks to clusters | |
42ceff04 | 409 | Bool_t fITSTrackSA; // If track matching is to be done with ITS tracks standing alone |
a29b2a8a | 410 | Double_t fEMCalSurfaceDistance; // EMCal surface distance (= 430 by default, the last 10 cm are propagated on a cluster-track pair basis) |
42ceff04 | 411 | |
9741c6a0 | 412 | // Track cuts |
5f7714ad | 413 | Int_t fTrackCutsType; // Esd track cuts type for matching |
fa4287a2 | 414 | Double_t fCutMinTrackPt; // Cut on track pT |
96957075 | 415 | Int_t fCutMinNClusterTPC; // Min number of tpc clusters |
416 | Int_t fCutMinNClusterITS; // Min number of its clusters | |
417 | Float_t fCutMaxChi2PerClusterTPC; // Max tpc fit chi2 per tpc cluster | |
418 | Float_t fCutMaxChi2PerClusterITS; // Max its fit chi2 per its cluster | |
419 | Bool_t fCutRequireTPCRefit; // Require TPC refit | |
420 | Bool_t fCutRequireITSRefit; // Require ITS refit | |
421 | Bool_t fCutAcceptKinkDaughters; // Accepting kink daughters? | |
422 | Float_t fCutMaxDCAToVertexXY; // Track-to-vertex cut in max absolute distance in xy-plane | |
423 | Float_t fCutMaxDCAToVertexZ; // Track-to-vertex cut in max absolute distance in z-plane | |
8fc351e3 | 424 | Bool_t fCutDCAToVertex2D; // If true a 2D DCA cut is made. |
42ceff04 | 425 | Bool_t fCutRequireITSStandAlone; // Require ITSStandAlone |
18a566cc | 426 | Bool_t fCutRequireITSpureSA; // ITS pure standalone tracks |
42ceff04 | 427 | |
18a566cc | 428 | ClassDef(AliEMCALRecoUtils, 22) |
d9b3567c | 429 | }; |
d9b3567c | 430 | #endif // ALIEMCALRECOUTILS_H |
431 | ||
432 |