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