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