AliPhysics  vAN-20150924 (e816f45)
 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 //_________________________________________________________________________
38 //_________________________________________________________________________
39 
40 class TH1F;
41 class TH1D;
42 class TH2D;
43 
44 //class AliESDEvent;
45 //class AliESDCaloCluster;
46 //class AliAODCaloCluster;
47 class AliVCluster;
48 //class AliAODEvent;
49 class AliVEvent;
50 class AliTOFT0maker;
51 
52 #include "AliAnalysisTaskSE.h"
53 
54 class AliAnalysisTaskEMCALTimeCalib : public AliAnalysisTaskSE
55 {
56  public:
57 
58  enum { kNSM = 20, kNBCmask = 4 };
59 
60  AliAnalysisTaskEMCALTimeCalib() : AliAnalysisTaskSE(),
61  fRunNumber(-1),
62  fTOFmaker(0),
63  fOutputList(0),
64  fgeom(0),
65  fGeometryName(0),
68  fMinNcells(0),
69  fMaxNcells(0),
70  fMinLambda0(0),
71  fMaxLambda0(0),
72  fMinLambda0LG(0),
73  fMaxLambda0LG(0),
74  fMaxRtrack(0),
75  fMinCellEnergy(0),
77  fPileupFromSPD(kFALSE),
78  fMinTime(0),
79  fMaxTime(0),
80  fhcalcEvtTime(0),
81  fhEvtTimeHeader(0),
82  fhEvtTimeDiff(0),
83  fhEventType(0),
85  fhTcellvsTOFT0(0),
87  fhTcellvsSM(0),
88  fhEneVsAbsIdHG(0),
89  fhEneVsAbsIdLG(0),
90  fhTimeVsBC(0),
91  fhTimeSumSq(),
92  fhTimeEnt(),
93  fhTimeSum(),
94  fhTimeLGSumSq(),
95  fhTimeLGEnt(),
96  fhTimeLGSum(),
99  fhTimeDsup(),
100  fhTimeDsupBC(),
101  fhRawTimeVsIdBC(),
102  fhRawTimeSumBC(),
109  { ; }
110 
111  AliAnalysisTaskEMCALTimeCalib(const char *name);
113 
114  // virtual void LocalInit();
115  virtual Bool_t Notify();
116  virtual void UserCreateOutputObjects();
117  virtual void UserExec(Option_t *option);
118  virtual void Terminate(Option_t *);
119 
120  // Getters and setters
121  Double_t GetMinClusterEnergy() { return fMinClusterEnergy ; }
122  Double_t GetMaxClusterEnergy() { return fMaxClusterEnergy ; }
123  Int_t GetMinNcells() { return fMinNcells ; }
124  Int_t GetMaxNcells() { return fMaxNcells ; }
125  Double_t GetMinLambda0() { return fMinLambda0 ; }
126  Double_t GetMaxLambda0() { return fMaxLambda0 ; }
127  Double_t GetMinLambda0LG() { return fMinLambda0LG ; }
128  Double_t GetMaxLambda0LG() { return fMaxLambda0LG ; }
129  Double_t GetMaxRtrack() { return fMaxRtrack ; }
130  Double_t GetMinCellEnergy() { return fMinCellEnergy ; }
132  TString GetGeometryName() { return fGeometryName ; }
133  Double_t GetMinTime() { return fMinTime ; }
134  Double_t GetMaxTime() { return fMaxTime ; }
135 
136  void SetMinClusterEnergy (Double_t v) { fMinClusterEnergy = v ; }
137  void SetMaxClusterEnergy (Double_t v) { fMaxClusterEnergy = v ; }
138  void SetMinNcells (Int_t v) { fMinNcells = v ; }
139  void SetMaxNcells (Int_t v) { fMaxNcells = v ; }
140  void SetMinLambda0 (Double_t v) { fMinLambda0 = v ; }
141  void SetMaxLambda0 (Double_t v) { fMaxLambda0 = v ; }
142  void SetMinLambda0LG (Double_t v) { fMinLambda0LG = v ; }
143  void SetMaxLambda0LG (Double_t v) { fMaxLambda0LG = v ; }
144  void SetMaxRtrack (Double_t v) { fMaxRtrack = v ; }
145  void SetMinCellEnergy (Double_t v) { fMinCellEnergy = v ; }
146  void SetReferenceFileName(TString v) { fReferenceFileName= v ; }
147  void SetGeometryName (TString v) { fGeometryName = v ; }
148  void SetMinTime (Double_t v) { fMinTime = v ; }
149  void SetMaxTime (Double_t v) { fMaxTime = v ; }
150 
151  // Switches
154 
155 
156  void SetDefaultCuts();
157  void LoadReferenceHistos();
158  static void ProduceCalibConsts(TString inputFile="time186319testWOL0.root",TString outputFile="Reference.root",Bool_t isFinal=kFALSE);
159 
160  private:
161 
162  virtual void PrepareTOFT0maker();
163  Bool_t SetEMCalGeometry();
164  Bool_t AcceptCluster(AliVCluster* clus);
165  Bool_t CheckCellRCU(Int_t nSupMod,Int_t icol,Int_t irow);
166  Bool_t IsLowGainCellInCluster(AliVCluster* clus);
167 
168  // data members
169  Int_t fRunNumber ;
170 
172  AliTOFT0maker *fTOFmaker; //->
173 
175  TList *fOutputList; //->
176 
178  AliEMCALGeometry *fgeom;
179  TString fGeometryName ;
180 
181  // setable variables for cuts
182 
183  Double_t fMinClusterEnergy ;
184  Double_t fMaxClusterEnergy ;
185 
186  Int_t fMinNcells ;
187  Int_t fMaxNcells ;
188 
189  Double_t fMinLambda0 ;
190  Double_t fMaxLambda0 ;
191  Double_t fMinLambda0LG ;
192  Double_t fMaxLambda0LG ;
193 
194  Double_t fMaxRtrack ;
195 
196  Double_t fMinCellEnergy;
197 
199 
200  Bool_t fPileupFromSPD ;
201 
202  Double_t fMinTime ;
203  Double_t fMaxTime ;
204 
205 
206  // histograms
210  TH1F *fhEventType;
214  TH2F *fhTcellvsSM;
217  TH2F *fhTimeVsBC;
218 
219  // histos for storing the time values per cell for further averaging;
221  TH1F *fhTimeEnt [kNBCmask];
222  TH1F *fhTimeSum [kNBCmask];
226 
227  // histos with reference values after the first iteration
230 
231  // control histos
232  TH2F *fhTimeDsup [kNSM];
234 
235  //main histos for raw time
244 
247 
250 
252  ClassDef(AliAnalysisTaskEMCALTimeCalib, 2) ;
254 };
255 
256 #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