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