]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG1/background/AliAnalysisTaskBGvsTime.h
new code from Alberica.
[u/mrichter/AliRoot.git] / PWG1 / background / AliAnalysisTaskBGvsTime.h
CommitLineData
dbec3946 1#ifndef ALIANALYSISTASKBGVSTIME_H
2#define ALIANALYSISTASKBGVSTIME_H
3
4
5
6#include "AliAnalysisTaskSE.h"
7#include "TH2F.h"
8
9
10//-------------------------------------------------------------------------
11// AliAnalysisTaskBGvsTime
12//
13// This Task produces histograms of rate of events vs time and
14// distributions (pt,vz,multiplicity) for all trigger classes and for
15// different selections. Those are used for luminosity and background
16// studies. The class does not need to know in advance the trigger
17// classes: histos are created on the fly. This complicates the
18// merging a bit, which is taken care of by AliHistoListWrapper
19//
20// Author: Michele Floris, CERN
21//-------------------------------------------------------------------------
22
23
24class AliESDEvent;
25class TF1;
26class AliMCParticle;
27class AliVParticle;
28class AliESDVertex;
29class AliHistoListWrapper;
30class AliPhysicsSelection;
31class AliESDtrack;
32class AliAnalysisTaskBGvsTime : public AliAnalysisTaskSE {
33
34public:
35
d5f1fb98 36 enum {kDistSPDMult, kDistTPCMult, kDistPtLoose, kDistPt, kDistVertex, kDistVertexZ, kDistVertex3D, kDistDCATPC, kDistClsITSLayer}; // Used to get and book histograms of "distributions" (not vs time")
dbec3946 37
38 enum {kEffPt05, kEffPt1, kNEff}; // used to bin histo for efficiency calculation.
39
d5f1fb98 40 enum {kEffStepGen, kEffStepTrig, kEffStepRec, kEffNSteps}; // used to bin histo for efficiency calculation.
41
dbec3946 42 AliAnalysisTaskBGvsTime();
43 AliAnalysisTaskBGvsTime(const char * name);
44 AliAnalysisTaskBGvsTime(const AliAnalysisTaskBGvsTime& obj) ;
45 ~AliAnalysisTaskBGvsTime();
46
47 virtual void UserCreateOutputObjects();
48 virtual void UserExec(Option_t *option);
49 virtual void Terminate(Option_t *);
50
d5f1fb98 51 const char * GetVsTimeHistoName(const char * triggerClass, Int_t nclusters, Int_t bx, const char * v0flag, const char * prefix = "");
52 const char * GetVsTimeHistoNameAll(const char * triggerClass);
dbec3946 53
d5f1fb98 54 const char * GetVsTimeHistoForLuminosityName(const char * triggerClass, Float_t ptmin);
dbec3946 55
d5f1fb98 56 TH1F * GetVsTimeHisto(const char * triggerClass, Int_t nclusters, Int_t bx, const char * v0flag, const char * prefix = "")
57 {return GetVsTimeHisto(GetVsTimeHistoName(triggerClass,nclusters,bx,v0flag,prefix));}
58 TH1F * GetVsTimeHistoAll(const char * triggerClass)
59 {return GetVsTimeHisto(GetVsTimeHistoNameAll(triggerClass));}
dbec3946 60
61 TH1F * GetVsTimeHisto(const char * name) ;
62
63 TH1F * BookVsTimeHisto(const char * name, const char * title);
64
d5f1fb98 65// TH1F * GetMultHisto(const char * triggerClass) ;
dbec3946 66// TH1F * BookMultHisto(const char * name, const char * title);
67
d5f1fb98 68 TH1F * GetDistributionHisto (const char * triggerClass, Int_t dist, const char * suffix = 0) ;
ca3f2e06 69 TH1F * BookDistributionHisto(const char * name, const char * title,const char * xtitle, Int_t nbin, Float_t min, Float_t max);
dbec3946 70
d5f1fb98 71 TH1F * GetDeadTimeHisto(const char * triggerClass); //dead time vs time stamp
72// TH2F * BookDeadTimeHisto(const char * name, const char * title);
dbec3946 73
74 void SetTimes(UInt_t start, UInt_t end) { fStartTime=start; fEndTime =end; }
75 void SetMultBins(Int_t nbins, Int_t * bins) { fNMultBins = nbins; fMultBins = bins;}
76 void SetBinWidth(Int_t deltatime) { fBinWidth = deltatime;} // set bin width in seconds
77
78 void SetNoCuts(Bool_t cuts = kTRUE) { fNoCuts = cuts;}
79 void SetUsePhysicsSelection(Bool_t sel = kTRUE) { fUsePhysicsSelection = sel;}
80 void SetUseZeroBin(Bool_t sel = kTRUE) { fUseZeroBin = sel;}
81 void SetSkipV0(Bool_t sel = kTRUE) { fSkipV0 = sel;}
82 void SetSkipZeroBin(Bool_t sel = kTRUE) { fSkipZeroBin = sel;} // skip zero bin events
83 void SetMC(Bool_t sel = kTRUE) { fIsMC = sel;} // analyze MC
84 void SetUseBI(Bool_t useBunchInt = kTRUE){fUseBunchInt=useBunchInt;}
85
86 Bool_t IsEventInBinZero(); // returns true if the event has to be put in the bin0.
87 Bool_t SelectOnImpPar(AliESDtrack* t) ;
88
d5f1fb98 89 TH1F * GetEfficiencyHisto(Int_t step); // if the first argument is 0, returns the histo at generation level, 1 returns the histo after the HW trigger, 2 returns the histo at rec level. Fill this histo with elements of the enum kEffPt1, kEffPt05, ...
dbec3946 90
91
92private:
93
94 //
95 AliESDEvent * fESD; //! ESD object AliVEvent* fEvent;
96 TList * fListHisto; // list of output object
97 AliHistoListWrapper * fListWrapper; // wrapper for the list, takes care of merging
98
99 UInt_t fStartTime; // run start time, used to fill and book histos
100 UInt_t fEndTime; // run end time, used to book histos
101
102 Int_t fNMultBins; // number of multiplicity bins
103 Int_t * fMultBins; //[fNMultBins] edges of multiplicity bins
104
105 Long64_t fFirstTimeStamp; // time stamp of first event found (works only locally)
106 Long64_t fLastTimeStamp; // time stamp of first event found (works only locally)
107
108 Int_t fBinWidth; // Bin width of the histos vs time (in seconds)
109
110 Bool_t fNoCuts; // if true, no selection is applied
111
112 AliPhysicsSelection * fPhysicsSelection; // physics selection
113 Bool_t fUsePhysicsSelection; // use physics selection to actually select events
114 Bool_t fUseZeroBin; // use only the zero bin
115 Bool_t fIsMC; // true if running on MC
116 Bool_t fSkipV0; // Ignore V0 information
117 Bool_t fSkipZeroBin; // skip the events in the zero bin
118 Bool_t fUseBunchInt; // use the BI information to compute Background
119
120 TH2F * fHistoTimeStampVsUTC; // correlation between timestamp computed with bx, period, orbit and GDC time
121 TH1F * fHistoTimeStampDiffUTC; // difference between timestamp computed with bx, period, orbit and GDC time
122
123 AliAnalysisTaskBGvsTime& operator=(const AliAnalysisTaskBGvsTime& task);
124
d5f1fb98 125 ClassDef(AliAnalysisTaskBGvsTime, 2)
dbec3946 126
127
128};
129
130#endif