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) //
14 ////////////////////////////////////////////////////////////////////////
16 #include "AliTenderSupply.h"
22 class AliEMCALRecoUtils;
23 class AliEMCALGeometry;
28 class AliEMCALClusterizer;
29 class AliEMCALAfterBurnerUF;
30 class AliEMCALRecParam;
32 class AliEMCALTenderSupply: public AliTenderSupply {
35 AliEMCALTenderSupply();
36 AliEMCALTenderSupply(const char *name, const AliTender *tender=NULL);
37 virtual ~AliEMCALTenderSupply();
39 enum NonlinearityFunctions{kPi0MC=0,kPi0GammaGamma=1,kPi0GammaConversion=2,kNoCorrection=3,kBeamTest=4,kBeamTestCorrected=5};
40 enum MisalignSettings{kdefault=0,kSurveybyS=1,kSurveybyM=2};
43 virtual void ProcessEvent();
45 void SetEMCALGeometryName(const char *name) { fEMCALGeoName = name ;}
46 TString EMCALGeometryName() const { return fEMCALGeoName ;}
48 void SetDebugLevel(Int_t level) { fDebugLevel=level ;}
50 void SetBasePath(const Char_t *basePath) { fBasePath = basePath ;}
52 void SetConfigFileName(const char *name) { fConfigName = name ;}
54 void SetNonLinearityFunction(Int_t fun) { fNonLinearFunc = fun ;}
55 Int_t GetNonLinearityFunction() const { return fNonLinearFunc ;}
57 void SetNonLinearityThreshold(Int_t threshold) { fNonLinearThreshold = threshold ;} //only for Alexei's non linearity correction
58 Int_t GetNonLinearityThreshold() const { return fNonLinearThreshold ;}
60 void SwitchOnNonLinearityCorrection() { fDoNonLinearity = kTRUE ;}
61 void SwitchOffNonLinearityCorrection() { fDoNonLinearity = kFALSE ;}
63 void SwitchOnReCalibrateCluster() { fReCalibCluster = kTRUE ;}
64 void SwitchOffReCalibrateCluster() { fReCalibCluster = kFALSE ;}
66 void SwitchOnRecalculateClusPos() { fRecalClusPos = kTRUE ;}
67 void SwitchOffRecalculateClusPos() { fRecalClusPos = kFALSE ;}
69 void SetMisalignmentMatrixSurvey(Int_t misalignSurvey) { fMisalignSurvey = misalignSurvey ;}
70 Int_t GetMisalignmentMatrixSurvey() const { return fMisalignSurvey ;}
72 void SwitchOnCellFiducialRegion() { fFiducial = kTRUE ;}
73 void SwitchOffCellFiducialRegion() { fFiducial = kFALSE ;}
75 void SetNumberOfCellsFromEMCALBorder(Int_t n) { fNCellsFromEMCALBorder = n ;}
76 Int_t GetNumberOfCellsFromEMCALBorder() const { return fNCellsFromEMCALBorder ;}
78 void SwitchOnRecalDistBadChannel() { fRecalDistToBadChannels = kTRUE ;}
79 void SwitchOffRecalDistBadChannel() { fRecalDistToBadChannels = kFALSE ;}
81 void SwitchOnRecalShowerShape() { fRecalShowerShape = kTRUE ;}
82 void SwitchOffRecalShowerShape() { fRecalShowerShape = kFALSE ;}
84 Float_t GetRCut() const { return fRcut ;}
85 void SetRCut(Float_t rcut) { fRcut = rcut ;}
87 Double_t GetMass() const { return fMass ;}
88 void SetMass(Double_t mass) { fMass = mass ;}
90 Double_t GetStep() const { return fStep ;}
91 void SetStep(Double_t step) { fStep = step ;}
93 Double_t GetEtaCut() const { return fEtacut ;}
94 void SetEtaCut(Double_t eta) { fEtacut = eta ;}
96 Double_t GetPhiCut() const { return fPhicut ;}
97 void SetPhiCut(Double_t phi) { fPhicut = phi ;}
99 Float_t GetExoticCellFraction() const { return fExoticCellFraction ;}
100 void SetExoticCellFraction(Float_t f) { fExoticCellFraction = f ;}
102 Float_t GetExoticCellDiffTime() const { return fExoticCellDiffTime ;}
103 void SetExoticCellDiffTime(Float_t f) { fExoticCellDiffTime = f ;}
105 Float_t GetExoticCellMinAmplitude() const { return fExoticCellMinAmplitude ;}
106 void SetExoticCellMinAmplitude(Float_t f) { fExoticCellMinAmplitude = f ;}
108 void SwitchOnReclustering() { fReClusterize = kTRUE ;}
109 void SwitchOffReclustering() { fReClusterize = kFALSE ;}
111 void SwitchOnCutEtaPhiSum() { fCutEtaPhiSum=kTRUE; fCutEtaPhiSeparate=kFALSE ;}
112 void SwitchOnCutEtaPhiSeparate() { fCutEtaPhiSeparate=kTRUE; fCutEtaPhiSum=kFALSE ;}
114 void SwitchOnLoadOwnGeometryMatrices() { fLoadGeomMatrices = kTRUE ;}
115 void SwitchOffLoadOwnGeometryMatrices() { fLoadGeomMatrices = kFALSE ;}
116 void SetGeometryMatrixInSM(TGeoHMatrix* m, Int_t i) { fEMCALMatrix[i] = m ;}
118 AliEMCALRecParam *GetRecParam() const { return fRecParam ;}
119 void SetRecParam(AliEMCALRecParam *p) { fRecParam = p ;}
121 AliEMCALRecoUtils *GetRecoUtils() const { return fEMCALRecoUtils ;}
123 //Will update cell list by removing bad channels and recalibration + reclusterize
124 void SwitchOnUpdateCell() { fUpdateCell = kTRUE ;}
125 void SwitchOffUpdateCell() { fUpdateCell = kFALSE ;}
127 void SwitchOnBadCellRemove() { fBadCellRemove = kTRUE ;}
128 void SwitchOffBadCellRemove() { fBadCellRemove = kFALSE ;}
130 void SwitchOnClusterBadChannelCheck() { fClusterBadChannelCheck = kTRUE ;}
131 void SwitchOffClusterBadChannelCheck() { fClusterBadChannelCheck = kFALSE ;}
133 void SwitchOnExoticCellRemove() { fRejectExoticCells = kTRUE ;}
134 void SwitchOffExoticCellRemove() { fRejectExoticCells = kFALSE ;}
136 void SwitchOnClusterExoticChannelCheck() { fRejectExoticClusters = kTRUE ;}
137 void SwitchOffClusterExoticChannelCheck() { fRejectExoticClusters = kFALSE ;}
139 void SwitchOnCalibrateEnergy() { fCalibrateEnergy = kTRUE ;}
140 void SwitchOffCalibrateEnergy() { fCalibrateEnergy = kFALSE ;}
142 void SwitchOnCalibrateTime() { fCalibrateTime = kTRUE ;}
143 void SwitchOffCalibrateTime() { fCalibrateTime = kFALSE ;}
145 void SwitchOnUpdateCellOnly() { fDoUpdateOnly = kTRUE ;}
146 void SwitchOffUpdateCellOnly() { fDoUpdateOnly = kFALSE ;}
148 void SwitchOnTrackMatch() { fDoTrackMatch = kTRUE ;}
149 void SwitchOffTrackMatch() { fDoTrackMatch = kFALSE ;}
153 Int_t InitBadChannels();
155 Bool_t InitClusterization();
157 Int_t InitRecParam();
159 Bool_t InitMisalignMatrix();
163 Int_t InitTimeCalibration();
167 void FillDigitsArray();
171 void RecPoints2Clusters(TClonesArray *clus);
173 void RecalibrateCells();
177 void UpdateClusters();
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
230 AliEMCALTenderSupply(const AliEMCALTenderSupply&c);
231 AliEMCALTenderSupply& operator= (const AliEMCALTenderSupply&c);
233 ClassDef(AliEMCALTenderSupply, 10); // EMCAL tender task