]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ANALYSIS/TenderSupplies/AliEMCALTenderSupply.h
Parameters set for centrality selection
[u/mrichter/AliRoot.git] / ANALYSIS / TenderSupplies / AliEMCALTenderSupply.h
1 #ifndef ALIEMCALTENDERSUPPLY_H
2 #define ALIEMCALTENDERSUPPLY_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 ////////////////////////////////////////////////////////////////////////
8 //                                                                    //
9 //  EMCAL tender, apply corrections to EMCAl clusters                 //
10 //  and do track matching.                                            //
11 //  Author: Deepa Thomas (Utrecht University)                         //
12 //  Later mods/rewrite: Jiri Kral (University of Jyvaskyla)           //
13 //                                                                    //
14 ////////////////////////////////////////////////////////////////////////
15
16 #include "AliTenderSupply.h"
17
18 class TTree;
19 class TClonesArray;
20
21 class AliVCluster;
22 class AliEMCALRecoUtils;
23 class AliEMCALGeometry;
24 class TGeoHMatrix;
25 class TTree;
26 class TFile;
27 class TString;
28 class AliEMCALClusterizer;
29 class AliEMCALAfterBurnerUF;
30 class AliEMCALRecParam;
31
32 class AliEMCALTenderSupply: public AliTenderSupply {
33   
34 public:
35   AliEMCALTenderSupply();
36   AliEMCALTenderSupply(const char *name, const AliTender *tender=NULL);
37   virtual ~AliEMCALTenderSupply();
38
39   enum NonlinearityFunctions{kPi0MC=0,kPi0GammaGamma=1,kPi0GammaConversion=2,kNoCorrection=3,kBeamTest=4,kBeamTestCorrected=5};
40   enum MisalignSettings{kdefault=0,kSurveybyS=1,kSurveybyM=2};
41
42   virtual void Init();
43   virtual void ProcessEvent();
44   
45   void     SetEMCALGeometryName(const char *name)         { fEMCALGeoName = name             ;}
46   TString  EMCALGeometryName()                      const { return fEMCALGeoName             ;}
47
48   void     SetDebugLevel(Int_t level)                     { fDebugLevel=level                ;}
49
50   void     SetBasePath(const Char_t *basePath)            { fBasePath = basePath             ;}
51  
52   void     SetConfigFileName(const char *name)            { fConfigName = name               ;}
53
54   void     SetNonLinearityFunction(Int_t fun)             { fNonLinearFunc = fun             ;}
55   Int_t    GetNonLinearityFunction() const                { return fNonLinearFunc            ;}
56   
57   void     SetNonLinearityThreshold(Int_t threshold)      { fNonLinearThreshold = threshold  ;} //only for Alexei's non linearity correction
58   Int_t    GetNonLinearityThreshold()               const { return fNonLinearThreshold       ;}
59
60   void     SwitchOnNonLinearityCorrection()               { fDoNonLinearity = kTRUE          ;}
61   void     SwitchOffNonLinearityCorrection()              { fDoNonLinearity = kFALSE         ;}
62
63   void     SwitchOnReCalibrateCluster()                   { fReCalibCluster = kTRUE          ;}
64   void     SwitchOffReCalibrateCluster()                  { fReCalibCluster = kFALSE         ;}
65
66   void     SwitchOnRecalculateClusPos()                   { fRecalClusPos = kTRUE            ;}
67   void     SwitchOffRecalculateClusPos()                  { fRecalClusPos = kFALSE           ;}
68
69   void      SetMisalignmentMatrixSurvey(Int_t misalignSurvey) { fMisalignSurvey = misalignSurvey ;}
70   Int_t     GetMisalignmentMatrixSurvey() const               { return fMisalignSurvey           ;}    
71
72   void     SwitchOnCellFiducialRegion()                   { fFiducial = kTRUE                ;}
73   void     SwitchOffCellFiducialRegion()                  { fFiducial = kFALSE               ;}
74
75   void     SetNumberOfCellsFromEMCALBorder(Int_t n)       { fNCellsFromEMCALBorder = n       ;}
76   Int_t    GetNumberOfCellsFromEMCALBorder()        const { return fNCellsFromEMCALBorder    ;}
77
78   void     SwitchOnRecalDistBadChannel()                  { fRecalDistToBadChannels = kTRUE  ;}
79   void     SwitchOffRecalDistBadChannel()                 { fRecalDistToBadChannels = kFALSE ;}
80
81   void     SwitchOnRecalShowerShape()                     { fRecalShowerShape = kTRUE        ;}
82   void     SwitchOffRecalShowerShape()                    { fRecalShowerShape = kFALSE       ;}
83
84   Float_t  GetRCut()                                const { return fRcut                     ;}
85   void     SetRCut(Float_t rcut)                          { fRcut = rcut                     ;}
86
87   Double_t GetMass()                                const { return fMass                     ;}
88   void     SetMass(Double_t mass)                         { fMass = mass                     ;}
89
90   Double_t GetStep()                                const { return fStep                     ;}
91   void     SetStep(Double_t step)                         { fStep = step                     ;}
92
93   Double_t GetEtaCut()                              const { return fEtacut                   ;}
94   void     SetEtaCut(Double_t eta)                        { fEtacut = eta                    ;}
95
96   Double_t GetPhiCut()                              const { return fPhicut                   ;}
97   void     SetPhiCut(Double_t phi)                        { fPhicut = phi                    ;}
98
99   Float_t  GetExoticCellFraction()                  const { return fExoticCellFraction       ;}
100   void     SetExoticCellFraction(Float_t f)               { fExoticCellFraction = f          ;}
101
102   Float_t  GetExoticCellDiffTime()                  const { return fExoticCellDiffTime       ;}
103   void     SetExoticCellDiffTime(Float_t f)               { fExoticCellDiffTime = f          ;}
104
105   Float_t  GetExoticCellMinAmplitude()              const { return fExoticCellMinAmplitude   ;}
106   void     SetExoticCellMinAmplitude(Float_t f)           { fExoticCellMinAmplitude = f      ;}
107
108   void     SwitchOnReclustering()                         { fReClusterize = kTRUE            ;}
109   void     SwitchOffReclustering()                        { fReClusterize = kFALSE           ;}
110
111   void     SwitchOnCutEtaPhiSum()                         { fCutEtaPhiSum=kTRUE;      fCutEtaPhiSeparate=kFALSE ;}
112   void     SwitchOnCutEtaPhiSeparate()                    { fCutEtaPhiSeparate=kTRUE; fCutEtaPhiSum=kFALSE      ;}
113   
114   void     SwitchOnLoadOwnGeometryMatrices()              { fLoadGeomMatrices = kTRUE        ;}
115   void     SwitchOffLoadOwnGeometryMatrices()             { fLoadGeomMatrices = kFALSE       ;}
116   void     SetGeometryMatrixInSM(TGeoHMatrix* m, Int_t i) { fEMCALMatrix[i]    = m           ;}
117   
118   AliEMCALRecParam   *GetRecParam() const                 { return fRecParam                 ;} 
119   void                SetRecParam(AliEMCALRecParam *p)    { fRecParam = p                    ;}
120  
121   AliEMCALRecoUtils  *GetRecoUtils() const                { return fEMCALRecoUtils           ;}
122
123   //Will update cell list by removing bad channels and recalibration + reclusterize  
124   void     SwitchOnUpdateCell()                           { fUpdateCell = kTRUE              ;} 
125   void     SwitchOffUpdateCell()                          { fUpdateCell = kFALSE             ;}  
126
127   void     SwitchOnBadCellRemove()                        { fBadCellRemove = kTRUE           ;} 
128   void     SwitchOffBadCellRemove()                       { fBadCellRemove = kFALSE          ;}  
129
130   void     SwitchOnClusterBadChannelCheck()               { fClusterBadChannelCheck = kTRUE  ;} 
131   void     SwitchOffClusterBadChannelCheck()              { fClusterBadChannelCheck = kFALSE ;}  
132
133   void     SwitchOnExoticCellRemove()                     { fRejectExoticCells = kTRUE       ;} 
134   void     SwitchOffExoticCellRemove()                    { fRejectExoticCells = kFALSE      ;}  
135
136   void     SwitchOnClusterExoticChannelCheck()            { fRejectExoticClusters = kTRUE    ;} 
137   void     SwitchOffClusterExoticChannelCheck()           { fRejectExoticClusters = kFALSE   ;}  
138
139   void     SwitchOnCalibrateEnergy()                      { fCalibrateEnergy = kTRUE         ;} 
140   void     SwitchOffCalibrateEnergy()                     { fCalibrateEnergy = kFALSE        ;}  
141
142   void     SwitchOnCalibrateTime()                        { fCalibrateTime = kTRUE           ;} 
143   void     SwitchOffCalibrateTime()                       { fCalibrateTime = kFALSE          ;}  
144
145   void     SwitchOnUpdateCellOnly()                       { fDoUpdateOnly = kTRUE            ;} 
146   void     SwitchOffUpdateCellOnly()                      { fDoUpdateOnly = kFALSE           ;}  
147
148   void     SwitchOnTrackMatch()                           { fDoTrackMatch = kTRUE            ;} 
149   void     SwitchOffTrackMatch()                          { fDoTrackMatch = kFALSE           ;}  
150  
151 private:
152
153   Int_t    InitBadChannels();
154
155   Bool_t   InitClusterization();
156
157   Int_t   InitRecParam();
158
159   Bool_t   InitMisalignMatrix();
160
161   Int_t    InitRecalib();
162   
163   Int_t    InitTimeCalibration();
164
165   void     Clusterize();
166
167   void     FillDigitsArray();
168
169   void     GetPass();
170
171   void     RecPoints2Clusters(TClonesArray *clus);
172
173   void     RecalibrateCells();
174
175   void     UpdateCells();
176
177   void     UpdateClusters();
178
179   AliEMCALGeometry      *fEMCALGeo;               // EMCAL geometry
180   TString                fEMCALGeoName;           //  name of geometry to use.
181   AliEMCALRecoUtils     *fEMCALRecoUtils;         //  pointer to EMCAL utilities for clusterization
182   TString                fConfigName;             //  name of analysis configuration file
183   Int_t                  fDebugLevel;             //  debug level
184   Int_t                  fNonLinearFunc;          //  non linearity function 
185   Int_t                  fNonLinearThreshold;     //  non linearity threshold value for kBeamTesh non linearity function   
186   Bool_t                 fReCalibCluster;         //  switch for Recalibrate clusters
187   Bool_t                 fUpdateCell;             //  Flag cell update
188   Bool_t                 fCalibrateEnergy;        //  Flag cell energy clibration
189   Bool_t                 fCalibrateTime;          //  Flag cell time clSibration
190   Bool_t                 fDoNonLinearity;         //  Non linearity correction flag
191   Bool_t                 fBadCellRemove;          // Zero bad cells
192   Bool_t                 fRejectExoticCells;      // reject exotic cells
193   Bool_t                 fRejectExoticClusters;   // recect clusters with exotic cells
194   Bool_t                 fClusterBadChannelCheck; // Check clusters for bad channels
195   TGeoHMatrix           *fEMCALMatrix[10];        //  geometry matrices with misalignments
196   Bool_t                 fRecalClusPos;           //  switch for applying missalignment
197   Bool_t                 fFiducial;               //  switch for checking cells in the fiducial region
198   Int_t                  fNCellsFromEMCALBorder;  //  number os cells from EMCAL border  
199   Bool_t                 fRecalDistToBadChannels; //  switch for recalculation cluster position from bad channel    
200   Bool_t                 fRecalShowerShape;       //  switch for recalculation of the shower shape
201   TTree                 *fInputTree;              //! input data tree
202   TFile                 *fInputFile;              //! input data file 
203   TString                fFilepass;               //! input data pass number
204   Double_t               fMass;                   //  mass for track matching
205   Double_t               fStep;                   //  step size during track matching
206   Bool_t                 fCutEtaPhiSum;           //  swicth to apply residual cut together
207   Bool_t                 fCutEtaPhiSeparate;      //  swicth to apply residual cut separately
208   Float_t                fRcut;                   //  residual cut for track matching  
209   Float_t                fEtacut;                 //  eta cut for track matching  
210   Float_t                fPhicut;                 //  phi cut for track matching  
211   TString                fBasePath;               //  base folder path to get root files 
212   Bool_t                 fReClusterize;           //  switch for reclustering
213   AliEMCALClusterizer   *fClusterizer;            //! clusterizer 
214   Bool_t                 fGeomMatrixSet;          //  set geometry matrices only once, for the first event.         
215   Bool_t                 fLoadGeomMatrices;       //  matrices set from configuration, not get from geometry.root or from ESDs/AODs
216   AliEMCALRecParam      *fRecParam;               //  reconstruction parameters container
217   Bool_t                 fDoTrackMatch;           //  do track matching
218   Bool_t                 fDoUpdateOnly;           //  do only update of cells
219   AliEMCALAfterBurnerUF *fUnfolder;               //! unfolding procedure
220   TClonesArray          *fDigitsArr;              //! digits array
221   TObjArray             *fClusterArr;             //! recpoints array
222   Int_t                  fMisalignSurvey;         // misalignment matrix survey  
223   Float_t                fExoticCellFraction;     // Good cell if fraction < 1-ecross/ecell
224   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
225   Float_t                fExoticCellMinAmplitude; // Check for exotic only if amplitud is larger than this value
226   Bool_t                 fRecoParamsOCDBLoaded;   // flag if reco params were loaded from OCDB
227
228
229
230   AliEMCALTenderSupply(const AliEMCALTenderSupply&c);
231   AliEMCALTenderSupply& operator= (const AliEMCALTenderSupply&c);
232   
233   ClassDef(AliEMCALTenderSupply, 10); // EMCAL tender task
234 };
235
236 #endif