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) //
13 ////////////////////////////////////////////////////////////////////////
15 #include "AliTenderSupply.h"
21 class AliEMCALRecoUtils;
22 class AliEMCALGeometry;
27 class AliEMCALClusterizer;
28 class AliEMCALAfterBurnerUF;
29 class AliEMCALRecParam;
31 class AliEMCALTenderSupply: public AliTenderSupply {
34 AliEMCALTenderSupply();
35 AliEMCALTenderSupply(const char *name, const AliTender *tender=NULL);
36 virtual ~AliEMCALTenderSupply();
38 enum NonlinearityFunctions{kPi0MC=0,kPi0GammaGamma=1,kPi0GammaConversion=2,kNoCorrection=3,kBeamTest=4,kBeamTestCorrected=5};
39 enum MisalignSettings{kdefault=0,kSurveybyS=1,kSurveybyM=2};
42 virtual void ProcessEvent();
44 void SetEMCALGeometryName(const char *name) { fEMCALGeoName = name ;}
45 TString EMCALGeometryName() const { return fEMCALGeoName ;}
47 void SetDebugLevel(Int_t level) { fDebugLevel=level ;}
49 void SetBasePath(const Char_t *basePath) { fBasePath = basePath ;}
51 void SetConfigFileName(const char *name) { fConfigName = name ;}
53 void SetNonLinearityFunction(Int_t fun) { fNonLinearFunc = fun ;}
54 Int_t GetNonLinearityFunction() const { return fNonLinearFunc ;}
56 void SetNonLinearityThreshold(Int_t threshold) { fNonLinearThreshold = threshold ;} //only for Alexei's non linearity correction
57 Int_t GetNonLinearityThreshold() const { return fNonLinearThreshold ;}
59 void SwitchOnNonLinearityCorrection() { fDoNonLinearity = kTRUE ;}
60 void SwitchOffNonLinearityCorrection() { fDoNonLinearity = kFALSE ;}
62 void SwitchOnReCalibrateCluster() { fReCalibCluster = kTRUE ;}
63 void SwitchOffReCalibrateCluster() { fReCalibCluster = kFALSE ;}
65 void SwitchOnRecalculateClusPos() { fRecalClusPos = kTRUE ;}
66 void SwitchOffRecalculateClusPos() { fRecalClusPos = kFALSE ;}
68 void SetMisalignmentMatrixSurvey(Int_t misalignSurvey) { fMisalignSurvey = misalignSurvey ;}
69 Int_t GetMisalignmentMatrixSurvey() const { return fMisalignSurvey ;}
71 void SwitchOnCellFiducialRegion() { fFiducial = kTRUE ;}
72 void SwitchOffCellFiducialRegion() { fFiducial = kFALSE ;}
74 void SetNumberOfCellsFromEMCALBorder(Int_t n) { fNCellsFromEMCALBorder = n ;}
75 Int_t GetNumberOfCellsFromEMCALBorder() const { return fNCellsFromEMCALBorder ;}
77 void SwitchOnRecalDistBadChannel() { fRecalDistToBadChannels = kTRUE ;}
78 void SwitchOffRecalDistBadChannel() { fRecalDistToBadChannels = kFALSE ;}
80 void SwitchOnRecalShowerShape() { fRecalShowerShape = kTRUE ;}
81 void SwitchOffRecalShowerShape() { fRecalShowerShape = kFALSE ;}
83 Float_t GetRCut() const { return fRcut ;}
84 void SetRCut(Float_t rcut) { fRcut = rcut ;}
86 Double_t GetMass() const { return fMass ;}
87 void SetMass(Double_t mass) { fMass = mass ;}
89 Double_t GetStep() const { return fStep ;}
90 void SetStep(Double_t step) { fStep = step ;}
92 Double_t GetEtaCut() const { return fEtacut ;}
93 void SetEtaCut(Double_t eta) { fEtacut = eta ;}
95 Double_t GetPhiCut() const { return fPhicut ;}
96 void SetPhiCut(Double_t phi) { fPhicut = phi ;}
98 Float_t GetExoticCellFraction() const { return fExoticCellFraction ;}
99 void SetExoticCellFraction(Float_t f) { fExoticCellFraction = f ;}
101 Float_t GetExoticCellDiffTime() const { return fExoticCellDiffTime ;}
102 void SetExoticCellDiffTime(Float_t f) { fExoticCellDiffTime = f ;}
104 Float_t GetExoticCellMinAmplitude() const { return fExoticCellMinAmplitude ;}
105 void SetExoticCellMinAmplitude(Float_t f) { fExoticCellMinAmplitude = f ;}
107 void SwitchOnReclustering() { fReClusterize = kTRUE ;}
108 void SwitchOffReclustering() { fReClusterize = kFALSE ;}
110 void SwitchOnCutEtaPhiSum() { fCutEtaPhiSum=kTRUE; fCutEtaPhiSeparate=kFALSE ;}
111 void SwitchOnCutEtaPhiSeparate() { fCutEtaPhiSeparate=kTRUE; fCutEtaPhiSum=kFALSE ;}
113 void SwitchOnLoadOwnGeometryMatrices() { fLoadGeomMatrices = kTRUE ;}
114 void SwitchOffLoadOwnGeometryMatrices() { fLoadGeomMatrices = kFALSE ;}
115 void SetGeometryMatrixInSM(TGeoHMatrix* m, Int_t i) { fEMCALMatrix[i] = m ;}
117 AliEMCALRecParam *GetRecParam() const { return fRecParam ;}
118 void SetRecParam(AliEMCALRecParam *p) { fRecParam = p ;}
120 AliEMCALRecoUtils *GetRecoUtils() const { return fEMCALRecoUtils ;}
122 //Will update cell list by removing bad channels and recalibration + reclusterize
123 void SwitchOnUpdateCell() { fUpdateCell = kTRUE ;}
124 void SwitchOffUpdateCell() { fUpdateCell = kFALSE ;}
126 void SwitchOnBadCellRemove() { fBadCellRemove = kTRUE ;}
127 void SwitchOffBadCellRemove() { fBadCellRemove = kFALSE ;}
129 void SwitchOnClusterBadChannelCheck() { fClusterBadChannelCheck = kTRUE ;}
130 void SwitchOffClusterBadChannelCheck() { fClusterBadChannelCheck = kFALSE ;}
132 void SwitchOnExoticCellRemove() { fRejectExoticCells = kTRUE ;}
133 void SwitchOffExoticCellRemove() { fRejectExoticCells = kFALSE ;}
135 void SwitchOnClusterExoticChannelCheck() { fRejectExoticClusters = kTRUE ;}
136 void SwitchOffClusterExoticChannelCheck() { fRejectExoticClusters = kFALSE ;}
138 void SwitchOnCalibrateEnergy() { fCalibrateEnergy = kTRUE ;}
139 void SwitchOffCalibrateEnergy() { fCalibrateEnergy = kFALSE ;}
141 void SwitchOnCalibrateTime() { fCalibrateTime = kTRUE ;}
142 void SwitchOffCalibrateTime() { fCalibrateTime = kFALSE ;}
144 void SwitchOnUpdateCellOnly() { fDoUpdateOnly = kTRUE ;}
145 void SwitchOffUpdateCellOnly() { fDoUpdateOnly = kFALSE ;}
147 void SwitchOnTrackMatch() { fDoTrackMatch = kTRUE ;}
148 void SwitchOffTrackMatch() { fDoTrackMatch = kFALSE ;}
152 Int_t InitBadChannels();
154 Bool_t InitClusterization();
158 Bool_t InitMisalignMatrix();
162 Int_t InitTimeCalibration();
166 void FillDigitsArray();
170 void RecPoints2Clusters(TClonesArray *clus);
172 void RecalibrateCells();
176 void UpdateClusters();
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
228 AliEMCALTenderSupply(const AliEMCALTenderSupply&c);
229 AliEMCALTenderSupply& operator= (const AliEMCALTenderSupply&c);
231 ClassDef(AliEMCALTenderSupply, 10); // EMCAL tender task