AliPhysics  vAN-20151012 (2287573)
 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 //_________________________________________________________________________
40 //_________________________________________________________________________
41 
42 class TH1F;
43 class TH1D;
44 class TH2D;
45 
46 //class AliESDEvent;
47 //class AliESDCaloCluster;
48 //class AliAODCaloCluster;
49 class AliVCluster;
50 //class AliAODEvent;
51 class AliVEvent;
52 class AliTOFT0maker;
53 
54 #include "AliAnalysisTaskSE.h"
55 
56 class AliAnalysisTaskEMCALTimeCalib : public AliAnalysisTaskSE
57 {
58  public:
59 
60  enum { kNSM = 20, kNBCmask = 4 };
61 
62  AliAnalysisTaskEMCALTimeCalib() : AliAnalysisTaskSE(),
63  fRunNumber(-1),
64  fTOFmaker(0),
65  fOutputList(0),
66  fgeom(0),
67  fGeometryName(0),
70  fMinNcells(0),
71  fMaxNcells(0),
72  fMinLambda0(0),
73  fMaxLambda0(0),
74  fMinLambda0LG(0),
75  fMaxLambda0LG(0),
76  fMaxRtrack(0),
77  fMinCellEnergy(0),
79  fPileupFromSPD(kFALSE),
80  fMinTime(0),
81  fMaxTime(0),
82  fhcalcEvtTime(0),
83  fhEvtTimeHeader(0),
84  fhEvtTimeDiff(0),
85  fhEventType(0),
87  fhTcellvsTOFT0(0),
89  fhTcellvsSM(0),
90  fhEneVsAbsIdHG(0),
91  fhEneVsAbsIdLG(0),
92  fhTimeVsBC(0),
93  fhTimeSumSq(),
94  fhTimeEnt(),
95  fhTimeSum(),
96  fhTimeLGSumSq(),
97  fhTimeLGEnt(),
98  fhTimeLGSum(),
101  fhTimeDsup(),
102  fhTimeDsupBC(),
103  fhRawTimeVsIdBC(),
104  fhRawTimeSumBC(),
111  { ; }
112 
113  AliAnalysisTaskEMCALTimeCalib(const char *name);
115 
116  // virtual void LocalInit();
117  virtual Bool_t Notify();
118  virtual void UserCreateOutputObjects();
119  virtual void UserExec(Option_t *option);
120  virtual void Terminate(Option_t *);
121 
122  // Getters and setters
123  Double_t GetMinClusterEnergy() { return fMinClusterEnergy ; }
124  Double_t GetMaxClusterEnergy() { return fMaxClusterEnergy ; }
125  Int_t GetMinNcells() { return fMinNcells ; }
126  Int_t GetMaxNcells() { return fMaxNcells ; }
127  Double_t GetMinLambda0() { return fMinLambda0 ; }
128  Double_t GetMaxLambda0() { return fMaxLambda0 ; }
129  Double_t GetMinLambda0LG() { return fMinLambda0LG ; }
130  Double_t GetMaxLambda0LG() { return fMaxLambda0LG ; }
131  Double_t GetMaxRtrack() { return fMaxRtrack ; }
132  Double_t GetMinCellEnergy() { return fMinCellEnergy ; }
134  TString GetGeometryName() { return fGeometryName ; }
135  Double_t GetMinTime() { return fMinTime ; }
136  Double_t GetMaxTime() { return fMaxTime ; }
137 
138  void SetMinClusterEnergy (Double_t v) { fMinClusterEnergy = v ; }
139  void SetMaxClusterEnergy (Double_t v) { fMaxClusterEnergy = v ; }
140  void SetMinNcells (Int_t v) { fMinNcells = v ; }
141  void SetMaxNcells (Int_t v) { fMaxNcells = v ; }
142  void SetMinLambda0 (Double_t v) { fMinLambda0 = v ; }
143  void SetMaxLambda0 (Double_t v) { fMaxLambda0 = v ; }
144  void SetMinLambda0LG (Double_t v) { fMinLambda0LG = v ; }
145  void SetMaxLambda0LG (Double_t v) { fMaxLambda0LG = v ; }
146  void SetMaxRtrack (Double_t v) { fMaxRtrack = v ; }
147  void SetMinCellEnergy (Double_t v) { fMinCellEnergy = v ; }
148  void SetReferenceFileName(TString v) { fReferenceFileName= v ; }
149  void SetGeometryName (TString v) { fGeometryName = v ; }
150  void SetMinTime (Double_t v) { fMinTime = v ; }
151  void SetMaxTime (Double_t v) { fMaxTime = v ; }
152 
153  // Switches
156 
157 
158  void SetDefaultCuts();
159  void LoadReferenceHistos();
160  static void ProduceCalibConsts(TString inputFile="time186319testWOL0.root",TString outputFile="Reference.root",Bool_t isFinal=kFALSE);
161 
162  private:
163 
164  virtual void PrepareTOFT0maker();
165  Bool_t SetEMCalGeometry();
166  Bool_t AcceptCluster(AliVCluster* clus);
167  Bool_t CheckCellRCU(Int_t nSupMod,Int_t icol,Int_t irow);
168  Bool_t IsLowGainCellInCluster(AliVCluster* clus);
169 
170  // data members
171  Int_t fRunNumber ;
172 
174  AliTOFT0maker *fTOFmaker; //->
175 
177  TList *fOutputList; //->
178 
180  AliEMCALGeometry *fgeom;
181  TString fGeometryName ;
182 
183  // setable variables for cuts
184 
185  Double_t fMinClusterEnergy ;
186  Double_t fMaxClusterEnergy ;
187 
188  Int_t fMinNcells ;
189  Int_t fMaxNcells ;
190 
191  Double_t fMinLambda0 ;
192  Double_t fMaxLambda0 ;
193  Double_t fMinLambda0LG ;
194  Double_t fMaxLambda0LG ;
195 
196  Double_t fMaxRtrack ;
197 
198  Double_t fMinCellEnergy;
199 
201 
202  Bool_t fPileupFromSPD ;
203 
204  Double_t fMinTime ;
205  Double_t fMaxTime ;
206 
207 
208  // histograms
212  TH1F *fhEventType;
216  TH2F *fhTcellvsSM;
219  TH2F *fhTimeVsBC;
220 
221  // histos for storing the time values per cell for further averaging;
223  TH1F *fhTimeEnt [kNBCmask];
224  TH1F *fhTimeSum [kNBCmask];
228 
229  // histos with reference values after the first iteration
232 
233  // control histos
234  TH2F *fhTimeDsup [kNSM];
236 
237  //main histos for raw time
246 
249 
252 
254  ClassDef(AliAnalysisTaskEMCALTimeCalib, 2) ;
256 };
257 
258 #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
TH1F * fhcalcEvtTime
! spectrum calcolot0[0]
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
Double_t fMinClusterEnergy
minimum cluster energy
TString fReferenceFileName
! name of reference file
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 from file.
TH1F * fhAllAverageLGBC[kNBCmask]
4 BCmask High gain
TH2F * fhTimeDsup[kNSM]
4 BCmask Low gain
TH2F * fhTimeDsupBC[kNSM][kNBCmask]
! 20 x 4