AliPhysics  914d8ff (914d8ff)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskEMCALTimeCalib.h
Go to the documentation of this file.
1 #ifndef AliAnalysisTaskEMCALTimeCalib_h
2 #define AliAnalysisTaskEMCALTimeCalib_h
3 
4 //_________________________________________________________________________
49 //_________________________________________________________________________
50 
51 class TH1F;
52 class TH1D;
53 class TH2D;
54 class TH1C;
55 
56 //class AliESDEvent;
57 //class AliESDCaloCluster;
58 //class AliAODCaloCluster;
59 class AliVCluster;
60 //class AliAODEvent;
61 class AliVEvent;
62 class AliTOFT0maker;
63 
64 #include "AliAnalysisTaskSE.h"
65 
67 {
68  public:
69 
70  enum { kNSM = 20, kNBCmask = 4 };
71 
73  fRunNumber(-1),
74  fTOFmaker(0),
75  fOutputList(0),
76  fgeom(0),
77  fGeometryName(0),
80  fMinNcells(0),
81  fMaxNcells(0),
82  fMinLambda0(0),
83  fMaxLambda0(0),
84  fMinLambda0LG(0),
85  fMaxLambda0LG(0),
86  fMaxRtrack(0),
87  fMinCellEnergy(0),
90  fPileupFromSPD(kFALSE),
91  fMinTime(0),
92  fMaxTime(0),
93  fRawTimeNbins (0),
94  fRawTimeMin (0),
95  fRawTimeMax (0),
96  fPassTimeNbins(0),
97  fPassTimeMin (0),
98  fPassTimeMax (0),
99  fEnergyNbins (0),
100  fEnergyMin(0),
101  fEnergyMax(0),
102  fEnergyLGNbins (0),
103  fEnergyLGMin(0),
104  fEnergyLGMax(0),
105  fFineNbins(0),
106  fFineTmin(0),
107  fFineTmax(0),
108  fL1PhaseList(0),
109  fBadReco(kFALSE),
110  fFillHeavyHisto(kFALSE),
112  fBadChannelMapSet(kFALSE),
115  fhcalcEvtTime(0),
116  fhEvtTimeHeader(0),
117  fhEvtTimeDiff(0),
118  fhEventType(0),
120  fhTcellvsTOFT0(0),
121  fhTcellvsTOFT0HD(0),
122  fhTcellvsSM(0),
123  fhEneVsAbsIdHG(0),
124  fhEneVsAbsIdLG(0),
125  fhTimeVsBC(0),
126  fhTimeSumSq(),
127  fhTimeEnt(),
128  fhTimeSum(),
129  fhTimeLGSumSq(),
130  fhTimeLGEnt(),
131  fhTimeLGSum(),
132  fhAllAverageBC(),
134  fhRefRuns(0),
135  fhTimeDsup(),
136  fhTimeDsupBC(),
137  fhTimeDsupLG(),
138  fhTimeDsupLGBC(),
139  fhRawTimeVsIdBC(),
140  fhRawTimeSumBC(),
149  fhTimeVsIdBC(),
151  { ; }
152 
153  AliAnalysisTaskEMCALTimeCalib(const char *name);
155 
156  // virtual void LocalInit();
157  //virtual Bool_t Notify();
158  virtual void NotifyRun();
159  virtual void UserCreateOutputObjects();
160  virtual void UserExec(Option_t *option);
161  virtual void Terminate(Option_t *);
162 
163  // Getters and setters
178  Double_t GetMinTime() { return fMinTime ; }
179  Double_t GetMaxTime() { return fMaxTime ; }
181 
182  void SetRunNumber (Int_t v) { fRunNumber = v ; }
185  void SetMinNcells (Int_t v) { fMinNcells = v ; }
186  void SetMaxNcells (Int_t v) { fMaxNcells = v ; }
187  void SetMinLambda0 (Double_t v) { fMinLambda0 = v ; }
188  void SetMaxLambda0 (Double_t v) { fMaxLambda0 = v ; }
191  void SetMaxRtrack (Double_t v) { fMaxRtrack = v ; }
196  void SetMinTime (Double_t v) { fMinTime = v ; }
197  void SetMaxTime (Double_t v) { fMaxTime = v ; }
199 
200  //histogram settings
203  fRawTimeMin = lower ;
204  fRawTimeMax = upper ;
205  }
208  fPassTimeMin = lower ;
209  fPassTimeMax = upper ;
210  }
213  fEnergyMin = lower ;
214  fEnergyMax = upper ;
215  }
218  fEnergyLGMin = lower ;
219  fEnergyLGMax = upper ;
220  }
221 
223  fFineNbins = nbins;
224  fFineTmin = lower ;
225  fFineTmax = upper ;
226  }
227 
228 
229  // Switches
232 
233  void SwitchOnBadReco() { fBadReco = kTRUE ; }
234  void SwitchOffBadReco() { fBadReco = kFALSE ; }
235 
238 
241 
242  void SetDefaultCuts();
243  void LoadReferenceHistos(); //loaded once per period to the memory
244 
245  void LoadReferenceRunByRunHistos(); //loaded once to the memory at the beginning, phases for all runs
246  void SetL1PhaseReferenceForGivenRun();//set refernce L1phase per run
247 
248  void LoadBadChannelMap(); //load bad channel map, main
249  void LoadBadChannelMapFile(); //load bad channel map from file
250  void LoadBadChannelMapOADB();//load bad channel map from OADB
251  Int_t GetEMCALChannelStatus(Int_t iSM , Int_t iCol, Int_t iRow) const {
252  if(fBadChannelMapArray) return (Int_t) ((TH2I*)fBadChannelMapArray->At(iSM))->GetBinContent(iCol,iRow);
253  else return 0;}//Channel is ok by default
255  if(fBadChannelMapArray) return (Int_t) ((TH2I*)fBadChannelMapArray->At(0))->GetBinContent(absId+1);
256  else return 0;}//Channel is ok by default
257 
258  static void ProduceCalibConsts(TString inputFile="time186319testWOL0.root",TString outputFile="Reference.root",Bool_t isFinal=kFALSE);
259  static void ProduceOffsetForSMsV2(Int_t runNumber,TString inputFile="Reference.root",TString outputFile="ReferenceSM.root",Bool_t offset100=kTRUE, Bool_t justL1phase=kTRUE);
260 
261  private:
262 
263  virtual void PrepareTOFT0maker();
265  Bool_t AcceptCluster(AliVCluster* clus);
266  Bool_t CheckCellRCU(Int_t nSupMod,Int_t icol,Int_t irow);
267  Bool_t IsLowGainCellInCluster(AliVCluster* clus);
268 
269  // data members
271 
273  AliTOFT0maker *fTOFmaker; //->
274 
277 
279  AliEMCALGeometry *fgeom;
281 
282  // setable variables for cuts
283 
286 
289 
294 
296 
298 
301 
303 
306 
307  //histogram settings
323 
326 
328 
329  // bad channel map
334 
335  // histograms
339  TH1F *fhEventType;
347 
348  // histos for storing the time values per cell for further averaging;
350  TH1F *fhTimeEnt [kNBCmask];
351  TH1F *fhTimeSum [kNBCmask];
355 
356  // histos with reference values after the first iteration
359 
360  // histo with reference values run-by-run after the first iteration
361  TH1C *fhRefRuns;
362 
363  // control histos
368 
369  //main histos for raw time
378 
379  //histos for raw time after wrong reconstruction correction (100ns and L1 phase)
382 
383  //histos for raw time after wrong reconstruction correction (100ns and L1 phase) and new L1 phase
386 
389 
392 
394  ClassDef(AliAnalysisTaskEMCALTimeCalib, 3) ;
396 };
397 
398 #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
double Double_t
Definition: External.C:58
Int_t fFineNbins
number of bins of histo with T0 time
Definition: External.C:236
TH1F * fhRawTimeSumSqBC[kNBCmask]
! 4 BCmask HG
Double_t fMinLambda0
minimum cluster lambda0
Int_t fEnergyLGNbins
number of bins of histo with energy LG
Int_t GetEMCALChannelStatus(Int_t iSM, Int_t iCol, Int_t iRow) const
TH1F * fhcalcEvtTime
! spectrum calcolot0[0]
Bool_t fBadReco
flag to apply 100ns shift and L1 shift
Double_t fEnergyMin
lower range of histo with energy HG
TString fReferenceRunByRunFileName
name of reference file (run-by-run)
TObjArray * fL1PhaseList
array with phases for set of runs
Double_t fMinTime
minimum cluster time after correction
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.
Int_t fSetBadChannelMapSource
switch to load BC map 0-no BC,1-OADB,2-file
AliAnalysisTaskEMCALTimeCalib & operator=(const AliAnalysisTaskEMCALTimeCalib &)
Assignment operator not implemented.
void LoadBadChannelMap()
Load Bad Channel Map from different source.
Double_t fRawTimeMin
lower range of histo with raw time
TH2F * fhTimeDsupLG[kNSM]
! 20 SM low gain
TH1F * fhRawTimeSumSqLGBC[kNBCmask]
! 4 BCmask LG
void SetEnergyHistoLG(Int_t nbins, Double_t lower, Double_t upper)
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
TH2F * fhRawCorrTimeVsIdBC[kNBCmask]
! 4 BCmask HG
TH2F * fhRawCorrTimeVsIdLGBC[kNBCmask]
! 4 BCmask LG
Bool_t IsLowGainCellInCluster(AliVCluster *clus)
Check if low gain cell is in a cluster.
Double_t fMaxTime
maximum cluster time after correction
int Int_t
Definition: External.C:63
Double_t fEnergyMax
upper range of histo with energy HG
void SetPassTimeHisto(Int_t nbins, Double_t lower, Double_t upper)
Double_t fMinClusterEnergy
minimum cluster energy
static void ProduceOffsetForSMsV2(Int_t runNumber, TString inputFile="Reference.root", TString outputFile="ReferenceSM.root", Bool_t offset100=kTRUE, Bool_t justL1phase=kTRUE)
Int_t GetEMCALChannelStatus(Int_t absId) const
TObjArray * fBadChannelMapArray
bad channel map array
Double_t fEnergyLGMax
upper range of histo with energy LG
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
Definition: External.C:228
Definition: External.C:212
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
Double_t fEnergyLGMin
lower range of histo with energy LG
Task to work on Time Calibration for EMCal/DCal.
Double_t fMinLambda0LG
minimum cluster lambda0 Low Gain
Double_t fMaxClusterEnergy
maximum cluster energy
Bool_t fBadChannelMapSet
flag whether bad channel map is set
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
TH2F * fhTimeVsIdBC[kNBCmask]
! 4 BCmask HG
void SetEnergyHistoHG(Int_t nbins, Double_t lower, Double_t upper)
TH2F * fhTimeVsIdLGBC[kNBCmask]
! 4 BCmask LG
const char Option_t
Definition: External.C:48
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
bool Bool_t
Definition: External.C:53
TString fBadChannelFileName
name of file with bad channels
TH1F * fhAllAverageLGBC[kNBCmask]
4 BCmask High gain
Bool_t fFillHeavyHisto
flag to fill heavy histograms
Int_t fEnergyNbins
number of bins of histo with energy HG
Int_t fRawTimeNbins
number of bins of histo with raw time
TH2F * fhTimeDsup[kNSM]
! 20 SM high gain
TH2F * fhTimeDsupBC[kNSM][kNBCmask]
! 20 x 4 high gain
TH2F * fhTimeDsupLGBC[kNSM][kNBCmask]
! 20 x 4 low gain