]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ANALYSIS/TenderSupplies/AliEMCALTenderSupply.h
Add non linearity function setting
[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 //Jens Wiechula
15 //make data members which are initialised locally non streamable. 
16
17 #include <AliTenderSupply.h>
18
19 class TTree;
20 class TClonesArray;
21
22 class AliVCluster;
23 class AliEMCALRecoUtils;
24 class AliEMCALGeometry;
25 class TGeoHMatrix;
26 class TTree;
27 class TFile;
28 class TString;
29 class AliEMCALClusterizer;
30 class AliEMCALRecParam;
31 class AliEMCALAfterBurnerUF;
32
33 class AliEMCALTenderSupply: public AliTenderSupply {
34   
35 public:
36   AliEMCALTenderSupply();
37   AliEMCALTenderSupply(const char *name, const AliTender *tender=NULL);
38   virtual ~AliEMCALTenderSupply();
39
40   enum NonlinearityFunctions{kPi0MC=0,kPi0GammaGamma=1,kPi0GammaConversion=2,kNoCorrection=3,kBeamTest=4,kBeamTestCorrected=5};
41
42   virtual void   Init();
43   virtual void   ProcessEvent();
44   
45   void SetEMCALGeometryName(TString 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; }                 // mfasel: add function to set a path where to find the root files
51  
52   void  SetConfigFileName(TString 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  SwitchOnReCalibrateCluster()       { fReCalibCluster = kTRUE  ;}
61   void  SwitchOffReCalibrateCluster()      { fReCalibCluster = kFALSE ;}
62
63   void  SwitchOnReCalibrateCell()          { fReCalibCell = kTRUE  ;}
64   void  SwitchOffReCalibrateCell()         { fReCalibCell = kFALSE ;}
65
66   void  SwitchOnRecalculateClusPos()       { fRecalClusPos = kTRUE  ;}
67   void  SwitchOffRecalculateClusPos()      { fRecalClusPos = kFALSE ;}
68
69   void  SwitchOnCellFiducialRegion()       { fFiducial = kTRUE  ;}
70   void  SwitchOffCellFiducialRegion()      { fFiducial = kFALSE ;}
71
72   void  SetNumberOfcellsFromEMCALBorder(Int_t n) { fNCellsFromEMCALBorder = n    ;}
73   Int_t GetNumberOfcellsFromEMCALBorder() const  { return fNCellsFromEMCALBorder ;}
74
75   void  SwitchOnRecalDistBadChannel()      { fRecalDistToBadChannels = kTRUE  ;}
76   void  SwitchOffRecalDistBadChannel()     { fRecalDistToBadChannels = kFALSE ;}
77
78   Float_t  GetRCut()       const { return fRcut ;}
79   void     SetRCut(Float_t Rcut) { fRcut = Rcut ;}
80
81   Double_t GetMass()       const { return fMass ;}
82   void     SetMass(Double_t mass){ fMass=mass   ;}
83
84   Double_t GetStep()       const { return fStep ;}
85   void     SetStep(Double_t step){ fStep=step   ;}
86
87   void SwitchOnReclustering()   {fReClusterize = kTRUE;}
88   void SwitchOffReclustering()  {fReClusterize = kFALSE;}
89   
90   void           SwitchOnLoadOwnGeometryMatrices()              { fLoadGeomMatrices = kTRUE    ; }
91   void           SwitchOffLoadOwnGeometryMatrices()             { fLoadGeomMatrices = kFALSE   ; }
92    void          SetGeometryMatrixInSM(TGeoHMatrix* m, Int_t i) { fGeomMatrix[i]    = m        ; } 
93   AliEMCALRecParam  *GetRecParam()  const  { return fRecParam; }
94
95   void           SetOCDBPath(const char *path)                  { fOCDBpath = path ; }
96  
97 private:
98
99   Bool_t  InitBadChannels();
100   Bool_t  InitRecalib();
101   Bool_t  InitMisalignMatrix();
102     
103   void SetClusterMatchedToTrack(AliESDEvent *event);
104   void SetTracksMatchedToCluster(AliESDEvent *event);
105
106   void RecalibrateCells();                      //Recalibrate cells 
107
108   void InitClusterization();
109   void FillDigitsArray();
110   void Clusterize();
111   void UpdateClusters();
112   void RecPoints2Clusters(TClonesArray *clus);
113
114   AliEMCALGeometry   *fEMCALGeo;               //! EMCAL geometry
115   TString       fEMCALGeoName;           // Name of geometry to use.
116   
117   AliEMCALRecoUtils  *fEMCALRecoUtils;         //! Pointer to EMCAL utilities for clusterization
118   TString       fConfigName;             // Name of analysis configuration file
119   
120   Int_t         fDebugLevel;             // debug level
121
122   Int_t         fNonLinearFunc;          // Non linearity function 
123   Int_t         fNonLinearThreshold;     // Non linearity threshold value for kBeamTesh non linearity function   
124
125   Bool_t        fReCalibCluster;               // switch for Recalibrate clusters
126   Bool_t        fReCalibCell;          // switch for Recalibrate cell
127
128   TGeoHMatrix  *fEMCALMatrix[10];        //! Geometry matrices with misalignments
129   Bool_t        fRecalClusPos;         // switch for applying missalignment
130
131   Bool_t        fFiducial;             // switch for checking cells in the fiducial region
132   Int_t         fNCellsFromEMCALBorder;  // number os cells from EMCAL border   
133   Bool_t        fRecalDistToBadChannels; // switch for recalculation cluster position from bad channel    
134
135   TTree        *fInputTree;              //! input data tree
136   TFile        *fInputFile;              //! input data file 
137   TString       fFilepass;               // input data pass number
138
139   Double_t      fMass;                   // mass for track matching
140   Double_t      fStep;                   // step size during track matching
141   Float_t       fRcut;                   // residual cut for track matching  
142   
143   TString       fBasePath;                   // mfasel: Base Folder path to get root files 
144
145   Bool_t        fReClusterize;           // switch for reclustering
146   AliEMCALClusterizer   *fClusterizer;   //!clusterizer 
147   
148   Bool_t                 fGeomMatrixSet;    // set geometry matrices only once, for the first event.         
149   TGeoHMatrix           *fGeomMatrix[10];   //! geometry matrices with alignments
150
151   Bool_t                 fLoadGeomMatrices; // Matrices set from configuration, not get from geometry.root or from ESDs/AODs
152
153   AliEMCALRecParam      *fRecParam;         //! reconstruction parameters container
154   TString                fOCDBpath;         // Path with OCDB location
155
156   AliEMCALAfterBurnerUF *fUnfolder;         //! Unfolding procedure
157
158   TClonesArray          *fDigitsArr;        //-> Digits array
159   TObjArray             *fClusterArr;       //-> Recpoints array
160
161   AliEMCALTenderSupply(const AliEMCALTenderSupply&c);
162   AliEMCALTenderSupply& operator= (const AliEMCALTenderSupply&c);
163   
164   ClassDef(AliEMCALTenderSupply, 3); // TPC tender task
165 };
166
167
168 #endif
169