AliPhysics  v5-07-18-02 (20ec537)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliAnalysisTaskEMCALTimeCalib.h
Go to the documentation of this file.
1 #ifndef AliAnalysisTaskEMCALTimeCalib_h
2 #define AliAnalysisTaskEMCALTimeCalib_h
3 
4 //_________________________________________________________________________
42 //_________________________________________________________________________
43 
44 class TH1F;
45 class TH1D;
46 class TH2D;
47 
48 //class AliESDEvent;
49 //class AliESDCaloCluster;
50 //class AliAODCaloCluster;
51 class AliVCluster;
52 //class AliAODEvent;
53 class AliVEvent;
54 class AliTOFT0maker;
55 
56 #include "AliAnalysisTaskSE.h"
57 
58 class AliAnalysisTaskEMCALTimeCalib : public AliAnalysisTaskSE
59 {
60  public:
61 
62  enum { kNSM = 20, kNBCmask = 4 };
63 
64  AliAnalysisTaskEMCALTimeCalib() : AliAnalysisTaskSE(),
65  fRunNumber(-1),
66  fTOFmaker(0),
67  fOutputList(0),
68  fgeom(0),
69  fGeometryName(0),
72  fMinNcells(0),
73  fMaxNcells(0),
74  fMinLambda0(0),
75  fMaxLambda0(0),
76  fMinLambda0LG(0),
77  fMaxLambda0LG(0),
78  fMaxRtrack(0),
79  fMinCellEnergy(0),
82  fPileupFromSPD(kFALSE),
83  fMinTime(0),
84  fMaxTime(0),
85  fRawTimeNbins (0),
86  fRawTimeMin (0),
87  fRawTimeMax (0),
88  fPassTimeNbins(0),
89  fPassTimeMin (0),
90  fPassTimeMax (0),
91  fEnergyNbins (0),
92  fEnergyMin(0),
93  fEnergyMax(0),
94  fFineNbins(0),
95  fFineTmin(0),
96  fFineTmax(0),
97  fReferenceFile(0),
98  fhcalcEvtTime(0),
99  fhEvtTimeHeader(0),
100  fhEvtTimeDiff(0),
101  fhEventType(0),
103  fhTcellvsTOFT0(0),
104  fhTcellvsTOFT0HD(0),
105  fhTcellvsSM(0),
106  fhEneVsAbsIdHG(0),
107  fhEneVsAbsIdLG(0),
108  fhTimeVsBC(0),
109  fhTimeSumSq(),
110  fhTimeEnt(),
111  fhTimeSum(),
112  fhTimeLGSumSq(),
113  fhTimeLGEnt(),
114  fhTimeLGSum(),
115  fhAllAverageBC(),
117  fhRefRuns(0),
118  fhTimeDsup(),
119  fhTimeDsupBC(),
120  fhRawTimeVsIdBC(),
121  fhRawTimeSumBC(),
128  { ; }
129 
130  AliAnalysisTaskEMCALTimeCalib(const char *name);
132 
133  // virtual void LocalInit();
134  //virtual Bool_t Notify();
135  virtual void NotifyRun();
136  virtual void UserCreateOutputObjects();
137  virtual void UserExec(Option_t *option);
138  virtual void Terminate(Option_t *);
139 
140  // Getters and setters
141  Double_t GetMinClusterEnergy() { return fMinClusterEnergy ; }
142  Double_t GetMaxClusterEnergy() { return fMaxClusterEnergy ; }
143  Int_t GetMinNcells() { return fMinNcells ; }
144  Int_t GetMaxNcells() { return fMaxNcells ; }
145  Double_t GetMinLambda0() { return fMinLambda0 ; }
146  Double_t GetMaxLambda0() { return fMaxLambda0 ; }
147  Double_t GetMinLambda0LG() { return fMinLambda0LG ; }
148  Double_t GetMaxLambda0LG() { return fMaxLambda0LG ; }
149  Double_t GetMaxRtrack() { return fMaxRtrack ; }
150  Double_t GetMinCellEnergy() { return fMinCellEnergy ; }
153  TString GetGeometryName() { return fGeometryName ; }
154  Double_t GetMinTime() { return fMinTime ; }
155  Double_t GetMaxTime() { return fMaxTime ; }
156 
157  void SetMinClusterEnergy (Double_t v) { fMinClusterEnergy = v ; }
158  void SetMaxClusterEnergy (Double_t v) { fMaxClusterEnergy = v ; }
159  void SetMinNcells (Int_t v) { fMinNcells = v ; }
160  void SetMaxNcells (Int_t v) { fMaxNcells = v ; }
161  void SetMinLambda0 (Double_t v) { fMinLambda0 = v ; }
162  void SetMaxLambda0 (Double_t v) { fMaxLambda0 = v ; }
163  void SetMinLambda0LG (Double_t v) { fMinLambda0LG = v ; }
164  void SetMaxLambda0LG (Double_t v) { fMaxLambda0LG = v ; }
165  void SetMaxRtrack (Double_t v) { fMaxRtrack = v ; }
166  void SetMinCellEnergy (Double_t v) { fMinCellEnergy = v ; }
167  void SetReferenceFileName(TString v) { fReferenceFileName= v ; }
169  void SetGeometryName (TString v) { fGeometryName = v ; }
170  void SetMinTime (Double_t v) { fMinTime = v ; }
171  void SetMaxTime (Double_t v) { fMaxTime = v ; }
172 
173  //histogram settings
174  void SetRawTimeHisto (Int_t nbins,Double_t lower,Double_t upper) {
176  fRawTimeMin = lower ;
177  fRawTimeMax = upper ;
178  }
179  void SetPassTimeHisto (Int_t nbins,Double_t lower,Double_t upper) {
181  fPassTimeMin = lower ;
182  fPassTimeMax = upper ;
183  }
184  void SetEnergyHisto (Int_t nbins,Double_t lower,Double_t upper) {
186  fEnergyMin = lower ;
187  fEnergyMax = upper ;
188  }
189  void SetFineT0Histo (Int_t nbins,Double_t lower,Double_t upper) {
190  fFineNbins = nbins;
191  fFineTmin = lower ;
192  fFineTmax = upper ;
193  }
194 
195 
196  // Switches
199 
200  void SetDefaultCuts();
201  void LoadReferenceHistos();
203 
204  static void ProduceCalibConsts(TString inputFile="time186319testWOL0.root",TString outputFile="Reference.root",Bool_t isFinal=kFALSE);
205  static void ProduceOffsetForSMsV2(Int_t runNumber,TString inputFile="Reference.root",TString outputFile="ReferenceSM.root");
206 
207  private:
208 
209  virtual void PrepareTOFT0maker();
210  Bool_t SetEMCalGeometry();
211  Bool_t AcceptCluster(AliVCluster* clus);
212  Bool_t CheckCellRCU(Int_t nSupMod,Int_t icol,Int_t irow);
213  Bool_t IsLowGainCellInCluster(AliVCluster* clus);
214 
215  // data members
216  Int_t fRunNumber ;
217 
219  AliTOFT0maker *fTOFmaker; //->
220 
222  TList *fOutputList; //->
223 
225  AliEMCALGeometry *fgeom;
226  TString fGeometryName ;
227 
228  // setable variables for cuts
229 
230  Double_t fMinClusterEnergy ;
231  Double_t fMaxClusterEnergy ;
232 
233  Int_t fMinNcells ;
234  Int_t fMaxNcells ;
235 
236  Double_t fMinLambda0 ;
237  Double_t fMaxLambda0 ;
238  Double_t fMinLambda0LG ;
239  Double_t fMaxLambda0LG ;
240 
241  Double_t fMaxRtrack ;
242 
243  Double_t fMinCellEnergy;
244 
247 
248  Bool_t fPileupFromSPD ;
249 
250  Double_t fMinTime ;
251  Double_t fMaxTime ;
252 
253  //histogram settings
254  Int_t fRawTimeNbins ;
255  Double_t fRawTimeMin ;
256  Double_t fRawTimeMax ;
258  Double_t fPassTimeMin ;
259  Double_t fPassTimeMax ;
260  Int_t fEnergyNbins ;
261  Double_t fEnergyMin ;
262  Double_t fEnergyMax ;
263  Int_t fFineNbins ;
264  Double_t fFineTmin ;
265  Double_t fFineTmax ;
266 
267  TFile *fReferenceFile;
268  // histograms
272  TH1F *fhEventType;
276  TH2F *fhTcellvsSM;
279  TH2F *fhTimeVsBC;
280 
281  // histos for storing the time values per cell for further averaging;
283  TH1F *fhTimeEnt [kNBCmask];
284  TH1F *fhTimeSum [kNBCmask];
288 
289  // histos with reference values after the first iteration
292 
293  // histo with reference values run-by-run after the first iteration
294  TH1C *fhRefRuns;
295 
296  // control histos
297  TH2F *fhTimeDsup [kNSM];
299 
300  //main histos for raw time
309 
312 
315 
317  ClassDef(AliAnalysisTaskEMCALTimeCalib, 2) ;
319 };
320 
321 #endif
Bool_t SetEMCalGeometry()
Set the EMCal Geometry.
TH1F * fhRawTimeEntriesLGBC[kNBCmask]
! 4 BCmask LG
TH2F * fhEneVsAbsIdHG
! energy of each cell for high gain cells with strange time
Double_t fPassTimeMax
upper range of histo with time in passX
TH1F * fhRawTimeSumLGBC[kNBCmask]
! 4 BCmask LG
void SetRawTimeHisto(Int_t nbins, Double_t lower, Double_t upper)
Bool_t AcceptCluster(AliVCluster *clus)
Selection criteria of good cluster are set here.
TH2F * fhRawTimeVsIdBC[kNBCmask]
! 4 BCmask HG
Int_t fFineNbins
number of bins of histo with T0 time
TH1F * fhRawTimeSumSqBC[kNBCmask]
! 4 BCmask HG
Double_t fMinLambda0
minimum cluster lambda0
TFile * fReferenceFile
file with reference for SM
TH1F * fhcalcEvtTime
! spectrum calcolot0[0]
Double_t fEnergyMin
lower range of histo with energy
TString fReferenceRunByRunFileName
! name of reference file (run-by-run)
Double_t fMinTime
minimum cluster time after correction
void SetEnergyHisto(Int_t nbins, Double_t lower, Double_t upper)
AliTOFT0maker * fTOFmaker
pointer to get T0 from TOF
Double_t fFineTmax
upper range of histo with T0 time
void SetDefaultCuts()
Set default cuts for calibration.
AliAnalysisTaskEMCALTimeCalib & operator=(const AliAnalysisTaskEMCALTimeCalib &)
Assignment operator not implemented.
Double_t fRawTimeMin
lower range of histo with raw time
TH1F * fhRawTimeSumSqLGBC[kNBCmask]
! 4 BCmask LG
Double_t fMaxRtrack
maximum cluster track distance
Double_t fMaxLambda0
maximum cluster lambda0
AliEMCALGeometry * fgeom
pointer to EMCal geometry
Double_t fRawTimeMax
upper range of histo with raw time
TH2F * fhTcellvsTOFT0HD
! time of cell vs TOF T0 time for higher energy threshold
Bool_t IsLowGainCellInCluster(AliVCluster *clus)
Check if low gain cell is in a cluster.
Double_t fMaxTime
maximum cluster time after correction
static void ProduceOffsetForSMsV2(Int_t runNumber, TString inputFile="Reference.root", TString outputFile="ReferenceSM.root")
Double_t fEnergyMax
upper range of histo with energy
void SetPassTimeHisto(Int_t nbins, Double_t lower, Double_t upper)
Double_t fMinClusterEnergy
minimum cluster energy
Double_t fFineTmin
lower range of histo with T0 time
TString fReferenceFileName
! name of reference file (for one period)
Int_t fMaxNcells
maximum number of cells in cluster
virtual void UserExec(Option_t *option)
Main loop executed for each event.
virtual void PrepareTOFT0maker()
Get T0 time from TOF.
TH1F * fhTOFT0vsEventNumber
! TOF T0 evolution as a function of time
Bool_t fPileupFromSPD
flag to set PileupFromSPD
TH1F * fhRawTimeSumBC[kNBCmask]
! 4 BCmask HG
Double_t fMinCellEnergy
minimum cell energy
Int_t fMinNcells
minimum number of cells in cluster
Task to work on Time Calibration for EMCal/DCal.
Double_t fMinLambda0LG
minimum cluster lambda0 Low Gain
Double_t fMaxClusterEnergy
maximum cluster energy
TH1F * fhEvtTimeHeader
! spectrum time from header
TH1F * fhEvtTimeDiff
! spectrum time difference
void SetFineT0Histo(Int_t nbins, Double_t lower, Double_t upper)
TH2F * fhTcellvsTOFT0
! time of cell vs TOF T0 time
Double_t fPassTimeMin
lower range of histo with time in passX
Double_t fMaxLambda0LG
maximum cluster lambda0 Low Gain
static void ProduceCalibConsts(TString inputFile="time186319testWOL0.root", TString outputFile="Reference.root", Bool_t isFinal=kFALSE)
TH2F * fhEneVsAbsIdLG
! energy of each cell for low gain cells with strange time
Int_t fPassTimeNbins
number of bins of histo with time in passX
TList * fOutputList
pointer to output list
TH1F * fhRawTimeEntriesBC[kNBCmask]
! 4 BCmask HG
Bool_t CheckCellRCU(Int_t nSupMod, Int_t icol, Int_t irow)
Check RCU for cell given by Super Module, column index, row index.
TH2F * fhRawTimeVsIdLGBC[kNBCmask]
! 4 BCmask LG
void LoadReferenceHistos()
Load reference Histograms (for one period) from file.
const Int_t nbins
TH1F * fhAllAverageLGBC[kNBCmask]
4 BCmask High gain
Int_t fEnergyNbins
number of bins of histo with energy
Int_t fRawTimeNbins
number of bins of histo with raw time
TH2F * fhTimeDsup[kNSM]
20 entries per run: nSM
TH2F * fhTimeDsupBC[kNSM][kNBCmask]
! 20 x 4