]>
Commit | Line | Data |
---|---|---|
1ee39b3a | 1 | #ifndef ALITRDCHECKESD_H |
2 | #define ALITRDCHECKESD_H | |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
6 | /* $Id: AliTRDcheckESD.h 27496 2008-07-22 08:35:45Z cblume $ */ | |
7 | ||
8 | ///////////////////////////////////////////////////// | |
9 | // | |
10 | // Check basic detector results at ESD level | |
11 | // | |
12 | // Author | |
13 | // Alex Bercuci <A.Bercuci@gsi.de> | |
14 | // | |
15 | ////////////////////////////////////////////////////// | |
16 | ||
17 | #ifndef ALIANALYSISTASK_H | |
f8f46e4d | 18 | #include "AliAnalysisTaskSE.h" |
1ee39b3a | 19 | #endif |
20 | ||
21 | class AliESDEvent; | |
22 | class AliMCEvent; | |
fb65de21 | 23 | class AliESDpid; |
7698e7a4 | 24 | class AliCFContainer; |
25 | class AliAnalysisCuts; | |
1ee39b3a | 26 | class TH1; |
f2e89a4c | 27 | class TH2; |
64d57299 | 28 | class TH1F; |
7698e7a4 | 29 | class TH1D; |
64d57299 | 30 | class TH2F; |
31 | class TH3F; | |
bd97a050 | 32 | class TH3; |
1ee39b3a | 33 | class TObjArray; |
34 | class TGraph; | |
35 | class TGraphErrors; | |
33d501fa | 36 | class TAxis; |
7698e7a4 | 37 | |
f8f46e4d | 38 | class AliTRDcheckESD : public AliAnalysisTaskSE { |
1ee39b3a | 39 | public: |
40 | enum ETRDcheckESDstatus { | |
36d21092 | 41 | kMC = BIT(0) // use MC info |
97d0ccba | 42 | ,kCollision = BIT(1) // |
1ee39b3a | 43 | }; |
44 | enum ETRDcheckESDhistos { | |
2bf6d80c | 45 | kNCl = 1 // number of clusters per track |
f76b8071 | 46 | ,kTRDstat // TRD tracks status |
47 | ,kTRDmom // TRD track momentum | |
48 | ,kPtRes // Pt resolution @ vertex for TRD | |
49 | ,kTPCVertex // event vertex from TPC | |
50 | ,kEventVertex // event vertex | |
51 | ,kNTracksAll // ntracks - all | |
52 | ,kNTracksAcc // ntracks - inside acc. and DCA cut | |
53 | ,kNTracksTPC // additional cut on number of TPC clusters | |
54 | ,kDCAxy // transverse DCA | |
55 | ,kDCAz // z - DCA | |
56 | ,kPt1 // Pt distribution, eta and ptmin cuts | |
57 | ,kPt2 // Pt distribution, cuts from kPt1 and DCA cuts | |
58 | ,kPt3pos // Pt distribution, cuts from kPt2 and cut on TPC clusters for positives (>100) | |
59 | ,kPt3neg // Pt distribution, cuts from kPt2 and cut on TPC clusters for negatives (>100) | |
60 | ,kPt4pos // Pt distribution, cuts from kPt3pos and at least one TRD tracklet | |
61 | ,kPt4neg // Pt distribution, cuts from kPt3neg and at least one TRD tracklet | |
62 | ,kTheta // distribution of theta for tracks passing the cuts from kPt4pos and kPt4neg | |
63 | ,kPhi // distribution of phi for tracks passing the cuts from kPt4pos and kPt4neg | |
64 | ,kNTPCCl // number of TPC clusters, cuts from kPt2 | |
65 | ,kNTPCCl2 // number of TPC clusters, cuts from kPt2 + pt>1 GeV/c | |
66 | ,kTPCDedx // TPC dE/dx, cuts from kPt3pos or kPt3neg | |
67 | ,kEtaPhi // (eta,phi) distrib. for tracks after the cuts from kPt3pos or kPt3neg | |
68 | ,kEtaNclsTPC // (TPC_Ncls,eta) distrib. for tracks after the cuts from kPt3pos or kPt3neg | |
69 | ,kPhiNclsTPC // (TPC_Ncls,phi) distrib. for tracks after the cuts from kPt3pos or kPt3neg | |
2bf6d80c | 70 | ,kSPDMult // SPD multiplicity |
f76b8071 | 71 | ,kNTrackletsTRD // (TRD tracklets per track, P) distribution, after cuts from kPt4pos or kPt4neg |
2bf6d80c | 72 | ,kNClsTrackTRD=kNTrackletsTRD+6 // (TRD clusters per track, P) distribution, after cuts from kPt4pos or kPt4neg |
73 | ,kPHSlice=kNClsTrackTRD+6 // (slicePH,sliceNo) distribution, after cuts from kPt4pos or kPt4neg | |
74 | ,kPHSliceTPCpions=kPHSlice+6 // (slicePH,sliceNo) distribution for TPC pions, after cuts from kPt4pos or kPt4neg | |
75 | ,kTPCdedxPions=kPHSliceTPCpions+6 // (TPC dedx,P) for selected TPC pions | |
76 | ,kPHSliceTPCelectrons=kTPCdedxPions+6 // (slicePH,sliceNo) distribution for TPC electrons, after cuts from kPt4pos or kPt4neg | |
77 | ,kTPCdedxElectrons=kPHSliceTPCelectrons+6 // (TPC dedx,P) for selected TPC electrons | |
78 | ,kQtotP=kTPCdedxElectrons+6 // (total Q from slices, momentum) distribution, after cuts from kPt4pos or kPt4neg | |
79 | ,kPropagXYvsP=kQtotP+6 // (X,Y,momentum) distribution after AliESDtrack::PropagateTo(r=300.) | |
f76b8071 | 80 | ,kPropagRZvsP // (R,Z,momentum) distribution after AliESDtrack::PropagateTo(r=300.) |
bd97a050 | 81 | ,kTPCRefTracksPos // (eta,detector phi,Pt) distribution of reference TPC positive tracks (fulfill cuts from kPt3pos) |
2bf6d80c | 82 | ,kTPCRefTracksNeg=kTPCRefTracksPos+6 // (eta,detector phi,Pt) distribution of reference TPC negative tracks (fulfill cuts from kPt3neg) |
83 | ,kTRDRefTracksPos=kTPCRefTracksNeg+6 // (eta,detector phi,Pt) distribution of reference TRD positive tracks (fulfill cuts from kPt4pos) | |
84 | ,kTRDRefTracksNeg=kTRDRefTracksPos+6 // (eta,detector phi,Pt) distribution of reference TRD negative tracks (fulfill cuts from kPt4neg) | |
85 | ,kTRDRefTracksPos4=kTRDRefTracksNeg+6 // (eta,detector phi,Pt) distribution of reference TRD positive tracks with 4 tracklets (fulfill cuts from kPt4pos) | |
86 | ,kTRDRefTracksNeg4=kTRDRefTracksPos4+6 // (eta,detector phi,Pt) distribution of reference TRD negative tracks with 4 tracklets (fulfill cuts from kPt4neg) | |
87 | ,kTRDRefTracksPos5=kTRDRefTracksNeg4+6 | |
88 | ,kTRDRefTracksNeg5=kTRDRefTracksPos5+6 | |
89 | ,kTRDRefTracksPos6=kTRDRefTracksNeg5+6 | |
90 | ,kTRDRefTracksNeg6=kTRDRefTracksPos6+6 | |
91 | ,kTRDEtaPhiAvNtrkl=kTRDRefTracksNeg6+6 // (eta, detector phi) profile of average number of tracklets | |
92 | ,kTRDEtaDeltaPhiAvNtrkl=kTRDEtaPhiAvNtrkl+6 // (eta, delta-phi) profile of average number of tracklets | |
93 | // delta-phi is the angle made by the track with the normal to the chamber entrance plane | |
94 | ,kTRDEtaPhiAvQtot=kTRDEtaDeltaPhiAvNtrkl+6 // (eta, detector phi) profile of total tracklet charge from slices | |
52f55ddb | 95 | ,kTriggerDefs=kTRDEtaPhiAvQtot+36 |
96 | ,kMatchingPhiEtaCF | |
97 | ,kMatchingPtCF | |
98 | ,kBunchCrossingsCF | |
99 | ,kCentralityCF | |
100 | ,kQtotCF | |
101 | ,kPulseHeightCF | |
102 | ,kExpertCF | |
103 | ,kNhistos // number of histograms | |
2bf6d80c | 104 | ,kNrefs = 4 // number of reference plots |
1ee39b3a | 105 | }; |
7698e7a4 | 106 | enum ETrdCfVariables { |
107 | kEventVtxZ=0, | |
108 | kEventMult, | |
52f55ddb | 109 | kEventTrigger, |
7698e7a4 | 110 | kEventBC, |
33d501fa | 111 | kTrackTOFBC, |
112 | kTrackDCAxy, | |
113 | kTrackDCAz, | |
7698e7a4 | 114 | kTrackCharge, |
115 | kTrackPhi, | |
116 | kTrackEta, | |
117 | kTrackPt, | |
118 | kTrackP, | |
119 | kTrackTrdTracklets, | |
120 | kTrackTrdClusters, | |
52f55ddb | 121 | kTrackPHslice, |
122 | kTrackQtot=kTrackPHslice+8, | |
123 | kNTrdCfVariables=kTrackQtot+6, | |
124 | kNMaxAssignedTriggers = 50 | |
7698e7a4 | 125 | }; |
1ee39b3a | 126 | enum ETRDcheckESDbits { |
127 | kTPCout = 1 // track left TPC | |
128 | ,kTRDin // track reach TRD fiducial volume | |
129 | ,kTRDout // track reconstructed in TRD | |
130 | ,kTRDpid // PID calculated in TRD | |
131 | ,kTRDref // track refitted in TRD | |
1ee39b3a | 132 | }; |
52f55ddb | 133 | |
1ee39b3a | 134 | AliTRDcheckESD(); |
f8f46e4d | 135 | AliTRDcheckESD(char* name); |
1ee39b3a | 136 | virtual ~AliTRDcheckESD(); |
137 | ||
f8f46e4d | 138 | void UserCreateOutputObjects(); |
e2e3cec2 | 139 | Bool_t GetRefFigure(Int_t ifig); |
36d21092 | 140 | Int_t GetNRefFigures() const { return fNRefFigures; } |
f8f46e4d | 141 | void UserExec(Option_t *); |
1ee39b3a | 142 | |
7698e7a4 | 143 | void SetRefTrackFilter(AliAnalysisCuts* const filter) {fReferenceTrackFilter = filter;} |
144 | ||
1ee39b3a | 145 | Bool_t HasMC() const { return TESTBIT(fStatus, kMC);} |
36d21092 | 146 | Bool_t IsCollision() const {return TESTBIT(fStatus, kCollision);} |
147 | void SetCollision(Bool_t set=kTRUE) {set ? SETBIT(fStatus, kCollision) : CLRBIT(fStatus, kCollision);} | |
1ee39b3a | 148 | TObjArray* Histos(); |
52f55ddb | 149 | AliCFContainer* GetMatchingPhiEtaCF() const {return fMatchingPhiEtaCF;} |
150 | AliCFContainer* GetMatchingPtCF() const {return fMatchingPtCF;} | |
151 | AliCFContainer* GetBunchCrossingsCF() const {return fBunchCrossingsCF;} | |
152 | AliCFContainer* GetCentralityCF() const {return fCentralityCF;} | |
153 | AliCFContainer* GetQtotCF() const {return fQtotCF;} | |
154 | AliCFContainer* GetPulseHeightCF() const {return fPulseHeightCF;} | |
155 | AliCFContainer* GetExpertCF() const {return fExpertCF;} | |
156 | Int_t GetTriggerCounter(const Char_t* triggerName) const; | |
157 | void PrintTriggers() const; | |
97d0ccba | 158 | Bool_t Load(const Char_t *fn="AnalysisResults.root", const Char_t *dir="TRD_Performance", const Char_t *name=NULL); |
1ee39b3a | 159 | void SetMC(Bool_t mc = kTRUE) { mc ? SETBIT(fStatus, kMC) : CLRBIT(fStatus, kMC);} |
160 | Bool_t PutTrendValue(const Char_t *name, Double_t val); | |
161 | void Terminate(Option_t *); | |
33d501fa | 162 | void MakeSummary(Double_t* trendValues=0x0); |
52f55ddb | 163 | void MakeSummaryFromCF(Double_t* trendValues=0x0, const Char_t* triggerName="", Bool_t useIsolatedBC=kFALSE, Bool_t cutTOFbc=kFALSE); |
164 | //virtual Long64_t Merge(TCollection* list); | |
165 | Int_t GetNAssignedTriggers(); | |
166 | void AddUserTrigger(const Char_t* name) {fUserEnabledTriggers += name; fUserEnabledTriggers += ";";} | |
167 | ||
168 | // configure the expert CF container | |
169 | void AddExpertCFVar(AliTRDcheckESD::ETrdCfVariables var, Int_t nbins, Double_t lowLim, Double_t highLim); | |
170 | void AddExpertCFVar(AliTRDcheckESD::ETrdCfVariables var, const Char_t* bins); | |
8642d6d9 | 171 | void EnableExpertCFStep(Int_t step) {if(step>=0 && step<3) fExpertCFEnabledSteps[step] = kTRUE;} |
52f55ddb | 172 | |
1ee39b3a | 173 | private: |
174 | static const Float_t fgkxTPC; // end radial position of TPC | |
175 | static const Float_t fgkxTOF; // start radial position of TOF | |
629ae9b8 | 176 | static const UChar_t fgkNgraph[kNrefs]; // number of graphs/ref plot |
1ee39b3a | 177 | |
33d501fa | 178 | Bool_t PlotTrackingSummary(Int_t centralityClass=1, Double_t* trendValues=0x0); // 1 <= centralityClass <= 5; 0-all centrality classes together |
179 | Bool_t PlotPidSummary(Int_t centralityClass=1, Double_t* trendValues=0x0); // 1 <= centralityClass <= 5; 0-all centrality classes together | |
180 | Bool_t PlotCentSummary(Double_t* trendValues=0x0); // centrality dependent plots | |
2bf6d80c | 181 | |
52f55ddb | 182 | void PlotTrackingSummaryFromCF(Double_t* trendValues=0x0, |
183 | const Char_t* triggerName="", | |
33d501fa | 184 | Bool_t useIsolatedBC=kFALSE, Bool_t cutTOFbc=kFALSE); // 1 <= centralityClass <= 5; 0-all centrality classes together |
52f55ddb | 185 | void PlotPidSummaryFromCF(Double_t* trendValues=0x0, |
186 | const Char_t* triggerName="", | |
33d501fa | 187 | Bool_t useIsolatedBC=kFALSE, Bool_t cutTOFbc=kFALSE); // 1 <= centralityClass <= 5; 0-all centrality classes together |
52f55ddb | 188 | void PlotCentSummaryFromCF(Double_t* trendValues=0x0, const Char_t* triggerName="", |
33d501fa | 189 | Bool_t useIsolatedBC=kFALSE, Bool_t cutTOFbc=kFALSE); // centrality dependent plots |
52f55ddb | 190 | |
1ee39b3a | 191 | AliTRDcheckESD(const AliTRDcheckESD&); |
192 | AliTRDcheckESD& operator=(const AliTRDcheckESD&); | |
f3ef94fc | 193 | Int_t Pdg2Idx(Int_t pdg) const; |
1ee39b3a | 194 | void Process(TH1 **h, TGraphErrors *g); |
629ae9b8 | 195 | void Process2D(TH2 * const h, TGraphErrors **g); |
1ee39b3a | 196 | void PrintStatus(ULong_t s); |
7698e7a4 | 197 | TH2F* Proj3D(TH3* hist, TH2* accMap, Int_t binLow, Int_t binHigh, Float_t &entries); |
52f55ddb | 198 | TH1D* Proj2D(TH2* hist, TH1* fitErr=0x0); |
7698e7a4 | 199 | TH1F* EfficiencyTRD(TH3* tpc3D, TH3* trd3D, Bool_t useAcceptance=kTRUE); |
52f55ddb | 200 | TH1F* EfficiencyFromPhiPt(AliCFContainer* cf, Int_t stepNom, Int_t stepDenom, const Char_t* varStr="pt"); |
7698e7a4 | 201 | void DrawTRDGrid(); |
33d501fa | 202 | void SetStyle(TH1* hist, Int_t lineStyle, Int_t lineColor, Int_t lineWidth, |
4114abc1 | 203 | Int_t markerStyle, Int_t markerColor, Int_t markerSize); |
33d501fa | 204 | void SetStyle(TAxis* axis, const Char_t* title, Float_t titleSize, Float_t titleOffset, Bool_t centerTitle, |
205 | Float_t labelSize); | |
7698e7a4 | 206 | void CheckActiveSM(TH1D* phiProj, Bool_t activeSM[18]); |
33d501fa | 207 | void FindIsolatedBCs(TH1D* bcHist, Bool_t isIsolated[3500]); |
52f55ddb | 208 | void InitializeCFContainers(); |
209 | AliCFContainer* CreateCFContainer(const Char_t* name, const Char_t *title); | |
210 | Int_t GetTriggerIndex(const Char_t* name, Bool_t createNew=kTRUE); | |
bd97a050 | 211 | |
1ee39b3a | 212 | Int_t fStatus; // bit mask for controlling the task |
629ae9b8 | 213 | Int_t fNRefFigures; // number of current ref plots |
a96ac33a | 214 | AliESDEvent *fESD; //! ESD event |
215 | AliMCEvent *fMC; //! MC event | |
fb65de21 | 216 | AliESDpid *fESDpid; // ESD pid object |
a96ac33a | 217 | TObjArray *fHistos; //! QA histos |
1ee39b3a | 218 | TObjArray *fResults; // QA graphs |
629ae9b8 | 219 | static FILE *fgFile; //! trend file streamer |
7698e7a4 | 220 | |
52f55ddb | 221 | AliCFContainer* fExpertCF; // CF container configured for expert checks |
222 | Int_t fExpertCFVars[kNTrdCfVariables]; | |
223 | Bool_t fExpertCFVarsEnabled[kNTrdCfVariables]; | |
224 | Int_t fExpertCFVarNBins[kNTrdCfVariables]; | |
225 | Double_t fExpertCFVarRanges[kNTrdCfVariables][2]; | |
226 | TString fExpertCFVarBins[kNTrdCfVariables]; | |
227 | Bool_t fExpertCFEnabledSteps[3]; // enabled steps 0-TPC; 1-TRD; 2-TOF | |
228 | ||
229 | AliCFContainer* fMatchingPhiEtaCF; // Small CF containers tuned for running over central QA | |
230 | Int_t fMatchingPhiEtaCFVars[kNTrdCfVariables]; | |
231 | AliCFContainer* fMatchingPtCF; // Small CF containers tuned for running over central QA | |
232 | Int_t fMatchingPtCFVars[kNTrdCfVariables]; | |
233 | AliCFContainer* fBunchCrossingsCF; // | |
234 | Int_t fBunchCrossingsCFVars[kNTrdCfVariables]; | |
235 | AliCFContainer* fCentralityCF; // Small CF containers tuned for running over central QA | |
236 | Int_t fCentralityCFVars[kNTrdCfVariables]; | |
237 | AliCFContainer* fQtotCF; // | |
238 | Int_t fQtotCFVars[kNTrdCfVariables]; | |
239 | AliCFContainer* fPulseHeightCF; // | |
240 | Int_t fPulseHeightCFVars[kNTrdCfVariables]; | |
7698e7a4 | 241 | |
52f55ddb | 242 | AliAnalysisCuts* fReferenceTrackFilter; // reference track filter |
52f55ddb | 243 | Bool_t fPhysSelTriggersEnabled; // flag wheter physics selection triggers were enabled |
244 | TString fUserEnabledTriggers; // list of user enabled triggers | |
245 | Int_t fNAssignedTriggers; // number of assigned triggers | |
246 | ||
36d21092 | 247 | // Vertex selection |
248 | static const Float_t fgkEvVertexZ;// cm | |
249 | static const Int_t fgkEvVertexN;// cm | |
250 | // Track selection | |
251 | static const Float_t fgkTrkDCAxy; // cm | |
252 | static const Float_t fgkTrkDCAz; // cm | |
253 | static const Int_t fgkNclTPC; // N clusters TPC | |
254 | static const Float_t fgkPt; // min. pt | |
255 | static const Float_t fgkEta; // eta range | |
f76b8071 | 256 | |
257 | static const Float_t fgkQs; // scale for the total charge | |
97d0ccba | 258 | |
8642d6d9 | 259 | ClassDef(AliTRDcheckESD, 9) // user oriented TRD analysis based on ESD-MC data |
1ee39b3a | 260 | }; |
02281b83 | 261 | #endif |