AliPhysics  29d4213 (29d4213)
 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 //_________________________________________________________________________
41 //_________________________________________________________________________
42 
43 class TH1F;
44 class TH1D;
45 class TH2D;
46 
47 //class AliESDEvent;
48 //class AliESDCaloCluster;
49 //class AliAODCaloCluster;
50 class AliVCluster;
51 //class AliAODEvent;
52 class AliVEvent;
53 class AliTOFT0maker;
54 
55 #include "AliAnalysisTaskSE.h"
56 
57 class AliAnalysisTaskEMCALTimeCalib : public AliAnalysisTaskSE
58 {
59  public:
60 
61  enum { kNSM = 20, kNBCmask = 4 };
62 
63  AliAnalysisTaskEMCALTimeCalib() : AliAnalysisTaskSE(),
64  fRunNumber(-1),
65  fTOFmaker(0),
66  fOutputList(0),
67  fgeom(0),
68  fGeometryName(0),
71  fMinNcells(0),
72  fMaxNcells(0),
73  fMinLambda0(0),
74  fMaxLambda0(0),
75  fMinLambda0LG(0),
76  fMaxLambda0LG(0),
77  fMaxRtrack(0),
78  fMinCellEnergy(0),
81  fPileupFromSPD(kFALSE),
82  fMinTime(0),
83  fMaxTime(0),
84  fReferenceFile(0),
85  fhcalcEvtTime(0),
86  fhEvtTimeHeader(0),
87  fhEvtTimeDiff(0),
88  fhEventType(0),
90  fhTcellvsTOFT0(0),
92  fhTcellvsSM(0),
93  fhEneVsAbsIdHG(0),
94  fhEneVsAbsIdLG(0),
95  fhTimeVsBC(0),
96  fhTimeSumSq(),
97  fhTimeEnt(),
98  fhTimeSum(),
99  fhTimeLGSumSq(),
100  fhTimeLGEnt(),
101  fhTimeLGSum(),
102  fhAllAverageBC(),
104  fhRefRuns(0),
105  fhTimeDsup(),
106  fhTimeDsupBC(),
107  fhRawTimeVsIdBC(),
108  fhRawTimeSumBC(),
115  { ; }
116 
117  AliAnalysisTaskEMCALTimeCalib(const char *name);
119 
120  // virtual void LocalInit();
121  //virtual Bool_t Notify();
122  virtual void NotifyRun();
123  virtual void UserCreateOutputObjects();
124  virtual void UserExec(Option_t *option);
125  virtual void Terminate(Option_t *);
126 
127  // Getters and setters
128  Double_t GetMinClusterEnergy() { return fMinClusterEnergy ; }
129  Double_t GetMaxClusterEnergy() { return fMaxClusterEnergy ; }
130  Int_t GetMinNcells() { return fMinNcells ; }
131  Int_t GetMaxNcells() { return fMaxNcells ; }
132  Double_t GetMinLambda0() { return fMinLambda0 ; }
133  Double_t GetMaxLambda0() { return fMaxLambda0 ; }
134  Double_t GetMinLambda0LG() { return fMinLambda0LG ; }
135  Double_t GetMaxLambda0LG() { return fMaxLambda0LG ; }
136  Double_t GetMaxRtrack() { return fMaxRtrack ; }
137  Double_t GetMinCellEnergy() { return fMinCellEnergy ; }
140  TString GetGeometryName() { return fGeometryName ; }
141  Double_t GetMinTime() { return fMinTime ; }
142  Double_t GetMaxTime() { return fMaxTime ; }
143 
144  void SetMinClusterEnergy (Double_t v) { fMinClusterEnergy = v ; }
145  void SetMaxClusterEnergy (Double_t v) { fMaxClusterEnergy = v ; }
146  void SetMinNcells (Int_t v) { fMinNcells = v ; }
147  void SetMaxNcells (Int_t v) { fMaxNcells = v ; }
148  void SetMinLambda0 (Double_t v) { fMinLambda0 = v ; }
149  void SetMaxLambda0 (Double_t v) { fMaxLambda0 = v ; }
150  void SetMinLambda0LG (Double_t v) { fMinLambda0LG = v ; }
151  void SetMaxLambda0LG (Double_t v) { fMaxLambda0LG = v ; }
152  void SetMaxRtrack (Double_t v) { fMaxRtrack = v ; }
153  void SetMinCellEnergy (Double_t v) { fMinCellEnergy = v ; }
154  void SetReferenceFileName(TString v) { fReferenceFileName= v ; }
156  void SetGeometryName (TString v) { fGeometryName = v ; }
157  void SetMinTime (Double_t v) { fMinTime = v ; }
158  void SetMaxTime (Double_t v) { fMaxTime = v ; }
159 
160  // Switches
163 
164  void SetDefaultCuts();
165  void LoadReferenceHistos();
167 
168  static void ProduceCalibConsts(TString inputFile="time186319testWOL0.root",TString outputFile="Reference.root",Bool_t isFinal=kFALSE);
169  static void ProduceOffsetForSMsV2(Int_t runNumber,TString inputFile="Reference.root",TString outputFile="ReferenceSM.root");
170 
171  private:
172 
173  virtual void PrepareTOFT0maker();
174  Bool_t SetEMCalGeometry();
175  Bool_t AcceptCluster(AliVCluster* clus);
176  Bool_t CheckCellRCU(Int_t nSupMod,Int_t icol,Int_t irow);
177  Bool_t IsLowGainCellInCluster(AliVCluster* clus);
178 
179  // data members
180  Int_t fRunNumber ;
181 
183  AliTOFT0maker *fTOFmaker; //->
184 
186  TList *fOutputList; //->
187 
189  AliEMCALGeometry *fgeom;
190  TString fGeometryName ;
191 
192  // setable variables for cuts
193 
194  Double_t fMinClusterEnergy ;
195  Double_t fMaxClusterEnergy ;
196 
197  Int_t fMinNcells ;
198  Int_t fMaxNcells ;
199 
200  Double_t fMinLambda0 ;
201  Double_t fMaxLambda0 ;
202  Double_t fMinLambda0LG ;
203  Double_t fMaxLambda0LG ;
204 
205  Double_t fMaxRtrack ;
206 
207  Double_t fMinCellEnergy;
208 
211 
212  Bool_t fPileupFromSPD ;
213 
214  Double_t fMinTime ;
215  Double_t fMaxTime ;
216 
217  TFile *fReferenceFile;
218  // histograms
222  TH1F *fhEventType;
226  TH2F *fhTcellvsSM;
229  TH2F *fhTimeVsBC;
230 
231  // histos for storing the time values per cell for further averaging;
233  TH1F *fhTimeEnt [kNBCmask];
234  TH1F *fhTimeSum [kNBCmask];
238 
239  // histos with reference values after the first iteration
242 
243  // histo with reference values run-by-run after the first iteration
244  TH1F *fhRefRuns;
245 
246  // control histos
247  TH2F *fhTimeDsup [kNSM];
249 
250  //main histos for raw time
259 
262 
265 
267  ClassDef(AliAnalysisTaskEMCALTimeCalib, 2) ;
269 };
270 
271 #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
TH1F * fhRawTimeSumLGBC[kNBCmask]
! 4 BCmask LG
Bool_t AcceptCluster(AliVCluster *clus)
Selection criteria of good cluster are set here.
TH2F * fhRawTimeVsIdBC[kNBCmask]
! 4 BCmask HG
TH1F * fhRawTimeSumSqBC[kNBCmask]
! 4 BCmask HG
Double_t fMinLambda0
minimum cluster lambda0
TFile * fReferenceFile
file with reference for SM
TH1F * fhcalcEvtTime
! spectrum calcolot0[0]
TString fReferenceRunByRunFileName
! name of reference file (run-by-run)
Double_t fMinTime
minimum cluster time after correction
AliTOFT0maker * fTOFmaker
pointer to get T0 from TOF
void SetDefaultCuts()
Set default cuts for calibration.
AliAnalysisTaskEMCALTimeCalib & operator=(const AliAnalysisTaskEMCALTimeCalib &)
Assignment operator not implemented.
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
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 fMinClusterEnergy
minimum cluster energy
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
TH2F * fhTcellvsTOFT0
! time of cell vs TOF T0 time
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
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.
TH1F * fhAllAverageLGBC[kNBCmask]
4 BCmask High gain
TH2F * fhTimeDsup[kNSM]
20 entries per run: nSM
TH2F * fhTimeDsupBC[kNSM][kNBCmask]
! 20 x 4