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