]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ANALYSIS/TenderSupplies/AliEMCALTenderSupply.h
0ba22674203dbc7432ac03fef28cd171e0fead96
[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 AliEMCALRecParam;
29 class AliEMCALAfterBurnerUF;
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
40   virtual void Init();
41   virtual void ProcessEvent();
42   
43   void     SetEMCALGeometryName(TString name)             { fEMCALGeoName = name             ;}
44   TString  EMCALGeometryName()                      const { return fEMCALGeoName             ;}
45
46   void     SetDebugLevel(Int_t level)                     { fDebugLevel=level                ;}
47
48   void     SetBasePath(const Char_t *basePath)            { fBasePath = basePath             ;}
49  
50   void     SetConfigFileName(TString name)                { fConfigName = name               ;}
51
52   void     SetNonLinearityFunction(Int_t fun)             { fNonLinearFunc = fun             ;}
53   Int_t    GetNonLinearityFunction() const                { return fNonLinearFunc            ;}
54   
55   void     SetNonLinearityThreshold(Int_t threshold)      { fNonLinearThreshold = threshold  ;} //only for Alexei's non linearity correction
56   Int_t    GetNonLinearityThreshold()               const { return fNonLinearThreshold       ;}
57
58   void     SwitchOnReCalibrateCluster()                   { fReCalibCluster = kTRUE          ;}
59   void     SwitchOffReCalibrateCluster()                  { fReCalibCluster = kFALSE         ;}
60
61   void     SwitchOnReCalibrateCell()                      { fReCalibCell = kTRUE             ;}
62   void     SwitchOffReCalibrateCell()                     { fReCalibCell = kFALSE            ;}
63
64   void     SwitchOnRecalculateClusPos()                   { fRecalClusPos = kTRUE            ;}
65   void     SwitchOffRecalculateClusPos()                  { fRecalClusPos = kFALSE           ;}
66
67   void     SwitchOnCellFiducialRegion()                   { fFiducial = kTRUE                ;}
68   void     SwitchOffCellFiducialRegion()                  { fFiducial = kFALSE               ;}
69
70   void     SetNumberOfcellsFromEMCALBorder(Int_t n)       { fNCellsFromEMCALBorder = n       ;}
71   Int_t    GetNumberOfcellsFromEMCALBorder()        const { return fNCellsFromEMCALBorder    ;}
72
73   void     SwitchOnRecalDistBadChannel()                  { fRecalDistToBadChannels = kTRUE  ;}
74   void     SwitchOffRecalDistBadChannel()                 { fRecalDistToBadChannels = kFALSE ;}
75
76   Float_t  GetRCut()                                const { return fRcut                     ;}
77   void     SetRCut(Float_t rcut)                          { fRcut = rcut                     ;}
78
79   Double_t GetMass()                                const { return fMass                     ;}
80   void     SetMass(Double_t mass)                         { fMass = mass                     ;}
81
82   Double_t GetStep()                                const { return fStep                     ;}
83   void     SetStep(Double_t step)                         { fStep = step                     ;}
84
85   Double_t GetEtaCut()                              const { return fEtacut                   ;}
86   void     SetEtaCut(Double_t eta)                        { fEtacut = eta                    ;}
87
88   Double_t GetPhiCut()                              const { return fPhicut                   ;}
89   void     SetPhiCut(Double_t phi)                        { fPhicut = phi                    ;}
90
91   void     SwitchOnReclustering()                         { fReClusterize = kTRUE            ;}
92   void     SwitchOffReclustering()                        { fReClusterize = kFALSE           ;}
93
94   void     SwitchOnCutEtaPhiSum()                         { fCutEtaPhiSum=kTRUE;      fCutEtaPhiSeparate=kFALSE ;}
95   void     SwitchOnCutEtaPhiSeparate()                    { fCutEtaPhiSeparate=kTRUE; fCutEtaPhiSum=kFALSE      ;}
96   
97   void     SwitchOnLoadOwnGeometryMatrices()              { fLoadGeomMatrices = kTRUE        ;}
98   void     SwitchOffLoadOwnGeometryMatrices()             { fLoadGeomMatrices = kFALSE       ;}
99   void     SetGeometryMatrixInSM(TGeoHMatrix* m, Int_t i) { fEMCALMatrix[i]    = m           ;}
100  
101   AliEMCALRecParam   *GetRecParam()                 const { return fRecParam                 ;}
102   
103   AliEMCALRecoUtils  *GetRecoUtils()                const { return fEMCALRecoUtils           ;}
104
105   void     SetOCDBPath(const char *path)                  { fOCDBpath = path                 ;}
106  
107 private:
108
109   Bool_t   InitBadChannels();
110
111   Bool_t   InitClusterization();
112
113   Bool_t   InitMisalignMatrix();
114
115   Bool_t   InitRecalib();
116
117   void     Clusterize();
118
119   void     FillDigitsArray();
120
121   void     GetPass();
122
123   void     RecPoints2Clusters(TClonesArray *clus);
124
125   void     RecalibrateCells();
126
127   void     SetClusterMatchedToTrack (AliESDEvent *event);
128
129   void     SetTracksMatchedToCluster(AliESDEvent *event);
130
131   void     UpdateClusters();
132
133   AliEMCALGeometry      *fEMCALGeo;               //! EMCAL geometry
134   TString                fEMCALGeoName;           //  name of geometry to use.
135   AliEMCALRecoUtils     *fEMCALRecoUtils;         //  pointer to EMCAL utilities for clusterization
136   TString                fConfigName;             //  name of analysis configuration file
137   Int_t                  fDebugLevel;             //  debug level
138   Int_t                  fNonLinearFunc;          //  non linearity function 
139   Int_t                  fNonLinearThreshold;     //  non linearity threshold value for kBeamTesh non linearity function   
140   Bool_t                 fReCalibCluster;         //  switch for Recalibrate clusters
141   Bool_t                 fReCalibCell;            //  switch for Recalibrate cell
142   TGeoHMatrix           *fEMCALMatrix[10];        //  geometry matrices with misalignments
143   Bool_t                 fRecalClusPos;           //  switch for applying missalignment
144   Bool_t                 fFiducial;               //  switch for checking cells in the fiducial region
145   Int_t                  fNCellsFromEMCALBorder;  //  number os cells from EMCAL border 
146   Bool_t                 fRecalDistToBadChannels; //  switch for recalculation cluster position from bad channel          
147   TTree                 *fInputTree;              //! input data tree
148   TFile                 *fInputFile;              //! input data file 
149   TString                fFilepass;               //! input data pass number
150   Double_t               fMass;                   //  mass for track matching
151   Double_t               fStep;                   //  step size during track matching
152   Bool_t                 fCutEtaPhiSum;           //  swicth to apply residual cut together
153   Bool_t                 fCutEtaPhiSeparate;      //  swicth to apply residual cut separately
154   Float_t                fRcut;                   //  residual cut for track matching  
155   Float_t                fEtacut;                 //  eta cut for track matching  
156   Float_t                fPhicut;                 //  phi cut for track matching  
157   TString                fBasePath;               //  base folder path to get root files 
158   Bool_t                 fReClusterize;           //  switch for reclustering
159   AliEMCALClusterizer   *fClusterizer;            //! clusterizer 
160   Bool_t                 fGeomMatrixSet;          //  set geometry matrices only once, for the first event.         
161   Bool_t                 fLoadGeomMatrices;       //  matrices set from configuration, not get from geometry.root or from ESDs/AODs
162   AliEMCALRecParam      *fRecParam;               //  reconstruction parameters container
163   TString                fOCDBpath;               //  path with OCDB location
164   AliEMCALAfterBurnerUF *fUnfolder;               //! unfolding procedure
165   TClonesArray          *fDigitsArr;              //! digits array
166   TObjArray             *fClusterArr;             //! recpoints array
167
168   AliEMCALTenderSupply(const AliEMCALTenderSupply&c);
169   AliEMCALTenderSupply& operator= (const AliEMCALTenderSupply&c);
170   
171   ClassDef(AliEMCALTenderSupply, 5); // EMCAL tender task
172 };
173 #endif
174