1 #ifndef ALIEMCALTENDERSUPPLY_H
2 #define ALIEMCALTENDERSUPPLY_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
7 ////////////////////////////////////////////////////////////////////////
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 // S. Aiola, C. Loizides : Make it work for AODs //
15 ////////////////////////////////////////////////////////////////////////
17 #include "AliTenderSupply.h"
23 class AliEMCALRecoUtils;
24 class AliEMCALGeometry;
29 class AliEMCALClusterizer;
30 class AliEMCALAfterBurnerUF;
31 class AliEMCALRecParam;
32 class AliAnalysisTaskSE;
35 class AliEMCALTenderSupply: public AliTenderSupply {
38 AliEMCALTenderSupply();
39 AliEMCALTenderSupply(const char *name, const AliTender *tender=NULL);
40 AliEMCALTenderSupply(const char *name, AliAnalysisTaskSE *task);
41 virtual ~AliEMCALTenderSupply();
43 enum NonlinearityFunctions{kPi0MC=0,kPi0GammaGamma=1,kPi0GammaConversion=2,kNoCorrection=3,kBeamTest=4,kBeamTestCorrected=5};
44 enum MisalignSettings{kdefault=0,kSurveybyS=1,kSurveybyM=2};
47 virtual void ProcessEvent();
49 void SetTask(AliAnalysisTaskSE *task) { fTask = task ;}
52 void SetEMCALGeometryName(const char *name) { fEMCALGeoName = name ;}
53 TString EMCALGeometryName() const { return fEMCALGeoName ;}
55 void SetDebugLevel(Int_t level) { fDebugLevel=level ;}
57 void SetBasePath(const Char_t *basePath) { fBasePath = basePath ;}
59 void SetConfigFileName(const char *name) { fConfigName = name ;}
61 void SetNonLinearityFunction(Int_t fun) { fNonLinearFunc = fun ;}
62 Int_t GetNonLinearityFunction() const { return fNonLinearFunc ;}
64 void SetNonLinearityThreshold(Int_t threshold) { fNonLinearThreshold = threshold ;} //only for Alexei's non linearity correction
65 Int_t GetNonLinearityThreshold() const { return fNonLinearThreshold ;}
67 void SwitchOnNonLinearityCorrection() { fDoNonLinearity = kTRUE ;}
68 void SwitchOffNonLinearityCorrection() { fDoNonLinearity = kFALSE ;}
70 void SwitchOnReCalibrateCluster() { fReCalibCluster = kTRUE ;}
71 void SwitchOffReCalibrateCluster() { fReCalibCluster = kFALSE ;}
73 void SwitchOnRecalculateClusPos() { fRecalClusPos = kTRUE ;}
74 void SwitchOffRecalculateClusPos() { fRecalClusPos = kFALSE ;}
76 void SetMisalignmentMatrixSurvey(Int_t misalignSurvey) { fMisalignSurvey = misalignSurvey ;}
77 Int_t GetMisalignmentMatrixSurvey() const { return fMisalignSurvey ;}
79 void SwitchOnCellFiducialRegion() { fFiducial = kTRUE ;}
80 void SwitchOffCellFiducialRegion() { fFiducial = kFALSE ;}
82 void SetNumberOfCellsFromEMCALBorder(Int_t n) { fNCellsFromEMCALBorder = n ;}
83 Int_t GetNumberOfCellsFromEMCALBorder() const { return fNCellsFromEMCALBorder ;}
85 void SwitchOnRecalDistBadChannel() { fRecalDistToBadChannels = kTRUE ;}
86 void SwitchOffRecalDistBadChannel() { fRecalDistToBadChannels = kFALSE ;}
88 void SwitchOnRecalShowerShape() { fRecalShowerShape = kTRUE ;}
89 void SwitchOffRecalShowerShape() { fRecalShowerShape = kFALSE ;}
91 Float_t GetRCut() const { return fRcut ;}
92 void SetRCut(Float_t rcut) { fRcut = rcut ;}
94 Double_t GetMass() const { return fMass ;}
95 void SetMass(Double_t mass) { fMass = mass ;}
97 Double_t GetStep() const { return fStep ;}
98 void SetStep(Double_t step) { fStep = step ;}
100 Double_t GetEtaCut() const { return fEtacut ;}
101 void SetEtaCut(Double_t eta) { fEtacut = eta ;}
103 Double_t GetPhiCut() const { return fPhicut ;}
104 void SetPhiCut(Double_t phi) { fPhicut = phi ;}
106 Float_t GetExoticCellFraction() const { return fExoticCellFraction ;}
107 void SetExoticCellFraction(Float_t f) { fExoticCellFraction = f ;}
109 Float_t GetExoticCellDiffTime() const { return fExoticCellDiffTime ;}
110 void SetExoticCellDiffTime(Float_t f) { fExoticCellDiffTime = f ;}
112 Float_t GetExoticCellMinAmplitude() const { return fExoticCellMinAmplitude ;}
113 void SetExoticCellMinAmplitude(Float_t f) { fExoticCellMinAmplitude = f ;}
115 void SwitchOnReclustering() { fReClusterize = kTRUE ;}
116 void SwitchOffReclustering() { fReClusterize = kFALSE ;}
118 void SwitchOnCutEtaPhiSum() { fCutEtaPhiSum=kTRUE; fCutEtaPhiSeparate=kFALSE ;}
119 void SwitchOnCutEtaPhiSeparate() { fCutEtaPhiSeparate=kTRUE; fCutEtaPhiSum=kFALSE ;}
121 void SwitchOnLoadOwnGeometryMatrices() { fLoadGeomMatrices = kTRUE ;}
122 void SwitchOffLoadOwnGeometryMatrices() { fLoadGeomMatrices = kFALSE ;}
123 void SetGeometryMatrixInSM(TGeoHMatrix* m, Int_t i) { fEMCALMatrix[i] = m ;}
125 AliEMCALRecParam *GetRecParam() const { return fRecParam ;}
126 void SetRecParam(AliEMCALRecParam *p) { fRecParam = p ;}
128 AliEMCALRecoUtils *GetRecoUtils() const { return fEMCALRecoUtils ;}
130 void SwitchOnUpdateCell() { fUpdateCell = kTRUE ;}
131 void SwitchOffUpdateCell() { fUpdateCell = kFALSE ;}
133 void SwitchOnBadCellRemove() { fBadCellRemove = kTRUE ;}
134 void SwitchOffBadCellRemove() { fBadCellRemove = kFALSE ;}
136 void SwitchOnClusterBadChannelCheck() { fClusterBadChannelCheck = kTRUE ;}
137 void SwitchOffClusterBadChannelCheck() { fClusterBadChannelCheck = kFALSE ;}
139 void SwitchOnExoticCellRemove() { fRejectExoticCells = kTRUE ;}
140 void SwitchOffExoticCellRemove() { fRejectExoticCells = kFALSE ;}
142 void SwitchOnClusterExoticChannelCheck() { fRejectExoticClusters = kTRUE ;}
143 void SwitchOffClusterExoticChannelCheck() { fRejectExoticClusters = kFALSE ;}
145 void SwitchOnCalibrateEnergy() { fCalibrateEnergy = kTRUE ;}
146 void SwitchOffCalibrateEnergy() { fCalibrateEnergy = kFALSE ;}
148 void SwitchOnCalibrateTime() { fCalibrateTime = kTRUE ;}
149 void SwitchOffCalibrateTime() { fCalibrateTime = kFALSE ;}
151 void SwitchOnUpdateCellOnly() { fDoUpdateOnly = kTRUE ;}
152 void SwitchOffUpdateCellOnly() { fDoUpdateOnly = kFALSE ;}
154 void SwitchOnTrackMatch() { fDoTrackMatch = kTRUE ;}
155 void SwitchOffTrackMatch() { fDoTrackMatch = kFALSE ;}
159 AliVEvent* GetEvent();
160 TString GetBeamType();
161 Bool_t RunChanged() const;
162 Int_t InitBadChannels();
163 Bool_t InitClusterization();
164 Int_t InitRecParam();
165 Bool_t InitMisalignMatrix();
167 Int_t InitTimeCalibration();
169 void FillDigitsArray();
171 void RecPoints2Clusters(TClonesArray *clus);
172 void RecalibrateCells();
174 void UpdateClusters();
176 AliAnalysisTaskSE *fTask; // analysis task
177 Int_t fRun; // current run number
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; // nNon 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[12]; // 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
226 AliEMCALTenderSupply(const AliEMCALTenderSupply&c);
227 AliEMCALTenderSupply& operator= (const AliEMCALTenderSupply&c);
229 ClassDef(AliEMCALTenderSupply, 12); // EMCAL tender task