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