]>
Commit | Line | Data |
---|---|---|
6788af99 | 1 | #ifndef ALIAODTRACKCUTSDIHADRONPID_H |
2 | #define ALIAODTRACKCUTSDIHADRONPID_H | |
97724bd1 | 3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
4 | * See cxx source for full Copyright notice */ | |
5 | /* $Id$ */ | |
6788af99 | 6 | |
7 | #include "TFormula.h" | |
8 | #include "TH1F.h" | |
9 | #include "TH2F.h" | |
10 | #include "TH3F.h" | |
11 | #include "TList.h" | |
a5422983 | 12 | #include "AliTrackDiHadronPID.h" |
6788af99 | 13 | |
14 | class AliAODTrackCutsDiHadronPID : public TNamed | |
15 | ||
16 | { | |
17 | ||
18 | public: | |
19 | enum HistoClass {kAllCharged = 0, kPositive = 1, kNegative = 2, | |
20 | kAllPion = 3, kPosPion = 4, kNegPion = 5, | |
21 | kAllKaon = 6, kPosKaon = 7, kNegKaon = 8, | |
22 | kAllProton = 9, kPosProton = 10, kNegProton = 11}; | |
23 | ||
24 | public: | |
25 | AliAODTrackCutsDiHadronPID(); // Default Constructor | |
26 | AliAODTrackCutsDiHadronPID(const char* name); // Named Constructor | |
27 | virtual ~AliAODTrackCutsDiHadronPID(); // Destructor | |
28 | virtual Long64_t Merge(TCollection* list); // Merger | |
29 | ||
f054df96 | 30 | private: |
31 | AliAODTrackCutsDiHadronPID(const AliAODTrackCutsDiHadronPID&); | |
32 | AliAODTrackCutsDiHadronPID& operator=(const AliAODTrackCutsDiHadronPID&); | |
33 | ||
97724bd1 | 34 | // ----------------------------------------------------------------------- |
6788af99 | 35 | // Interface, methods used to get information about the track cuts, and to |
36 | // retrieve filled histograms. | |
97724bd1 | 37 | // ----------------------------------------------------------------------- |
6788af99 | 38 | |
39 | public: | |
5c01a71f | 40 | void PrintCuts() const; |
6788af99 | 41 | |
5c01a71f | 42 | // List of QA histograms. |
43 | TList* GetListOfDataQAHistos() const; | |
44 | TList* GetListOfPrimRecMCTrackQAHistos() const; | |
45 | TList* GetListOfPrimGenMCTrackQAHistos() const; | |
46 | TList* GetListOfSecRecMCTrackQAHistos() const; | |
47 | TList* GetListOfSecGenMCTrackQAHistos() const; | |
6788af99 | 48 | |
5c01a71f | 49 | // Return a specific member of one of the lists of histograms. |
6788af99 | 50 | TObject* GetHistData(const char* name) const {return fDataTrackQAHistos->FindObject(name);} |
51 | TObject* GetHistPrimRecMC(const char* name) const {return fPrimRecMCTrackQAHistos->FindObject(name);} | |
52 | TObject* GetHistPrimGenMC(const char* name) const {return fPrimGenMCTrackQAHistos->FindObject(name);} | |
53 | TObject* GetHistSecRecMC(const char* name) const {return fSecRecMCTrackQAHistos->FindObject(name);} | |
54 | TObject* GetHistSecGenMC(const char* name) const {return fSecGenMCTrackQAHistos->FindObject(name);} | |
55 | ||
5c01a71f | 56 | // Return a projection of signal or mismatch onto the TOF axis (FIXME: works only data, not yet MC) |
6788af99 | 57 | TH1F* GetHistDataTOFProjection(Int_t charge, Int_t species, Int_t ptbin); |
97724bd1 | 58 | TObjArray* GetDataTOFProjection(Int_t charge, Int_t species); |
6788af99 | 59 | TH1F* GetHistDataTOFMismatch(Int_t charge, Int_t species, Int_t ptbin); |
97724bd1 | 60 | TObjArray* GetDataTOFMismatch(Int_t charge, Int_t species); |
5c01a71f | 61 | |
62 | // Return a projection of signal or mismatch onto the TOF axis (FIXME: works only data, not yet MC) | |
63 | TH2F* GetHistDataTPCTOFProjection(Int_t charge, Int_t species, Int_t ptbin); | |
64 | TObjArray* GetDataTPCTOFProjection(Int_t charge, Int_t species); | |
65 | TH2F* GetHistDataTPCTOFMismatch(Int_t charge, Int_t species, Int_t ptbin); | |
66 | TObjArray* GetDataTPCTOFMismatch(Int_t charge, Int_t species); | |
67 | ||
68 | // Note that there are two p_T axes, one for PID histograms, and one for other histograms. | |
69 | // Methods regarding the "other" p_T axis. | |
70 | Int_t GetNPtBins() const {return fNPtBins;} | |
71 | Double_t* GetPtAxis() {return fPtAxis;} | |
fe463f34 | 72 | Double_t GetPtMin(Int_t bin) const; |
73 | Double_t GetPtMax(Int_t bin) const; | |
6788af99 | 74 | Double_t GetPtBinWidth(Int_t bin) const {return (GetPtMax(bin) - GetPtMin(bin)); } |
75 | ||
5c01a71f | 76 | // Methods regarding the PID p_T axis. |
fe463f34 | 77 | Int_t GetNPtBinsPID(Int_t ptclass = -1) const; |
5c01a71f | 78 | Double_t* GetPtAxisPID() const; |
fe463f34 | 79 | Double_t GetPtMinPID(Int_t bin) const; |
80 | Double_t GetPtMaxPID(Int_t bin) const; | |
5c01a71f | 81 | Double_t GetPtBinWidthPID(Int_t bin) const {return (GetPtMaxPID(bin) - GetPtMinPID(bin));} |
fe463f34 | 82 | Double_t GetPtClassMin(Int_t ptclass) const; |
83 | Double_t GetPtClassMax(Int_t ptclass) const; | |
6788af99 | 84 | |
fe463f34 | 85 | Int_t GetNTOFbins(Int_t ptclass, Int_t species) const {return fTOFbins[ptclass][species];} |
86 | Double_t GetTOFmin(Int_t ptclass, Int_t species) const {return fTOFLowerBound[ptclass][species];} | |
87 | Double_t GetTOFmax(Int_t ptclass, Int_t species) const {return fTOFUpperBound[ptclass][species];} | |
6788af99 | 88 | |
fe463f34 | 89 | Int_t GetNTPCbins(Int_t ptclass, Int_t species) const {return fTPCbins[ptclass][species];} |
90 | Double_t GetTPCmin(Int_t ptclass, Int_t species) const {return fTPCLowerBound[ptclass][species];} | |
91 | Double_t GetTPCmax(Int_t ptclass, Int_t species) const {return fTPCUpperBound[ptclass][species];} | |
5c01a71f | 92 | |
93 | // Getters (Cuts) | |
6788af99 | 94 | UInt_t GetFilterMask() const {return fFilterMask;} |
95 | Double_t GetMaxEta() const {return fMaxEta;} | |
96 | ULong_t GetDemandedFlags() const {return fDemandedFlags;} | |
97 | TFormula* GetPtDeptDCACutFormula() const {return fPtDeptDCAxyCutFormula;} | |
98 | Double_t GetDCAzCut() const {return fDCAzCut;} | |
99 | UInt_t GetMinSPDHitsForPtDeptDCACut() const {return fMinSPDHitsForPtDeptDCAcut;} | |
100 | ||
5c01a71f | 101 | // Getters (Settings) |
6788af99 | 102 | Bool_t GetIsMC() const {return fIsMC;} |
6788af99 | 103 | Int_t GetDebugLevel() const {return fDebug;} |
104 | ||
97724bd1 | 105 | // ----------------------------------------------------------------------- |
6788af99 | 106 | // Methods used to configure the track cuts object, to be called at |
107 | // initialization, i.e., before the object is added to an analysis task. | |
97724bd1 | 108 | // ----------------------------------------------------------------------- |
6788af99 | 109 | |
110 | public: | |
111 | ||
5c01a71f | 112 | // Request Certain QA histograms being filled. |
fe463f34 | 113 | Bool_t RequestQAHistos(Int_t histoclass, Bool_t Enable3DSpectra = kFALSE, Bool_t EnablePIDHistos = kFALSE); |
6788af99 | 114 | |
5c01a71f | 115 | // Setters (Cuts) |
bb2a7c0b | 116 | void SetPtRange(Double_t minpt, Double_t maxpt); |
117 | void SetFilterMask(UInt_t filtermask); | |
118 | void SetMaxEta(Double_t maxeta); | |
119 | void SetMaxRapidity(Double_t maxrapidity); | |
120 | void SetDemandNoMismatch(); | |
121 | void SetDemandFlags(ULong_t demandedflags); | |
122 | void SetMinimumNumberOfTPCClusters(Int_t minimumnumberoftpcclusters); | |
123 | void SetDemandSPDCluster(); | |
124 | void SetPtDeptDCACut(TFormula* DCAxyCutFormula, Double_t DCAzCut, UInt_t MinSPDHits = 1); | |
6788af99 | 125 | |
126 | // Setters (Settings) | |
127 | void SetIsMC(Bool_t ismc = kTRUE) {fIsMC = ismc;} | |
a5422983 | 128 | void SetLowPtNSigmaTOFOnly(Bool_t lowptnsigmatofonly = kFALSE) {fLowPtNSigmaTOFOnly = lowptnsigmatofonly;} |
fe463f34 | 129 | void SetUseNSigmaOnPIDAxes(Bool_t useNSigma = kTRUE) {fUseNSigmaOnPIDAxes = useNSigma;} |
6788af99 | 130 | void SetDebugLevel(Int_t debuglevel) {fDebug = debuglevel;} |
131 | ||
97724bd1 | 132 | // ----------------------------------------------------------------------- |
6788af99 | 133 | // Methods called by the analysis task. |
97724bd1 | 134 | // ----------------------------------------------------------------------- |
6788af99 | 135 | |
136 | public: | |
137 | ||
138 | // These two functions signal the beginning and the end of a new event. | |
139 | void StartNewEvent(); // Some things are set to zero. | |
140 | void EventIsDone(Bool_t IsMC); // Some final histograms are filled. | |
141 | void CreateHistos(); // Should be called by the UserCreateOutput() function of the analysis task. | |
142 | ||
143 | // Is Selected, for different types of tracks. | |
144 | Bool_t IsSelectedData(AliTrackDiHadronPID* track, Double_t randomhittime = -1.e20); | |
145 | Bool_t IsSelectedGeneratedMC(AliAODMCParticle* particle); | |
146 | Bool_t IsSelectedReconstructedMC(AliTrackDiHadronPID* track); | |
147 | ||
97724bd1 | 148 | // ----------------------------------------------------------------------- |
6788af99 | 149 | // Internal methods. |
97724bd1 | 150 | // ----------------------------------------------------------------------- |
6788af99 | 151 | |
152 | public: | |
153 | ||
154 | // For PID histograms we have a certain number of bins in pT, spread out over five | |
155 | // large histograms, i.e., one for the lowest pT, and the biggest range in TOF/TPC, | |
156 | // one for the higher pT and smaller range in TOF/TPC, etc. The following methods | |
157 | // are a mapping between the total pT bin (what the user uses), and the pt bin | |
158 | // within one of the five histograms (what's used internally) | |
fe463f34 | 159 | Int_t GetPtClass(Int_t ptbin) const; |
160 | Int_t GetBinInPtClass(Int_t ptbin) const; | |
6788af99 | 161 | |
162 | private: | |
163 | ||
164 | // Checks, return kTRUE if track passes the cut. | |
bb2a7c0b | 165 | Bool_t CheckPt(Double_t pt) const; |
166 | Bool_t CheckMaxEta(Double_t eta) const; | |
167 | Bool_t CheckRapidity(Double_t rap) const; | |
168 | Bool_t CheckFilterMask(UInt_t filtermap) const; | |
169 | Bool_t CheckFlags(ULong_t flags) const; | |
170 | Bool_t CheckNclsTPC(Int_t ncls) const; | |
171 | Bool_t CheckTOFmismatch(Bool_t ismismatch) const; | |
172 | Bool_t CheckPtDeptDCACut(Double_t dcaz, Double_t dcaxy, Double_t pt, UInt_t SPDhits) const; | |
6788af99 | 173 | |
174 | // Filling QA histograms. | |
175 | Bool_t FillDataHistos(Int_t histoclass, AliTrackDiHadronPID* track); | |
176 | Bool_t FillTOFMismatchHistos(Int_t histoclass, AliTrackDiHadronPID* track, Double_t randomhittime); | |
177 | Bool_t FillGenMCHistos(Int_t histoclass, AliAODMCParticle* particle); | |
178 | Bool_t FillRecMCHistos(Int_t histoclass, AliTrackDiHadronPID* track); | |
179 | ||
180 | // Initializing QA histograms. | |
181 | Bool_t InitializeDataHistos(Int_t histoclass); | |
182 | Bool_t InitializeGenMCHistos(Int_t histoclass); | |
183 | Bool_t InitializeRecMCHistos(Int_t histoclass); | |
184 | ||
185 | void InitializeDefaultHistoNamesAndAxes(); | |
186 | ||
bb2a7c0b | 187 | TH1F* InitializeAcceptedFilterBits(const char* name); |
188 | void SetXaxisAcceptedFilterBits(); | |
6788af99 | 189 | TH1F* InitializePtSpectrum(const char* name, Int_t histoclass); |
a5422983 | 190 | TH2F* InitializeRecPtGenPt(const char* name, Int_t histoclass); |
50dfda71 | 191 | TH3F* InitializePhiEtaPt(const char* name, Int_t histoclass); |
6788af99 | 192 | TH1F* InitializeNTracksHisto(const char* name, Int_t histoclass); |
193 | TH1F* InitializeDCAxyHisto(const char* name, Int_t histoclass); | |
194 | TH1F* InitializeDCAzHisto(const char* name, Int_t histoclass); | |
195 | TH3F* InitializeAcceptanceHisto(const char* /*name*/, Int_t /*histoclass*/); // TO BE IMPLEMENTED. | |
196 | TH2F* InitializeDCASpectrum(const char* name, Int_t histoclass); | |
197 | ||
6788af99 | 198 | TH3F* InitializePIDHisto(const char* name, Int_t histoclass, Int_t expspecies, Int_t ptclass); |
199 | TH2F* InitializeTOFMismatchHisto(const char* name, Int_t histoclass, Int_t expspecies, Int_t ptclass); | |
a5422983 | 200 | TH2F* InitializeTOFHisto(const char* name, Int_t histoclass, Int_t expspecies, Int_t ptclass); |
6788af99 | 201 | |
97724bd1 | 202 | // ----------------------------------------------------------------------- |
6788af99 | 203 | // Data members. |
97724bd1 | 204 | // ----------------------------------------------------------------------- |
6788af99 | 205 | |
206 | private: | |
207 | // Track Cuts | |
208 | Double_t fMinPt; | |
209 | Double_t fMaxPt; | |
210 | UInt_t fFilterMask; // FilterMask to-be-checked. | |
211 | Double_t fMaxEta; // Max Eta of the track. | |
212 | Double_t fMaxRapidity; // Rapidity cut (only done for PID plots!!) | |
6214ec0c | 213 | Int_t fMinimumNumberOfTPCClusters; // NCls of TPC detector. |
6788af99 | 214 | ULong_t fDemandedFlags; // Flags demanded on the track. |
215 | UInt_t fMinSPDHitsForPtDeptDCAcut; // Required number of SPD hits for performing Pt-Dept DCA cut. | |
216 | TFormula* fPtDeptDCAxyCutFormula; // Formula for the Pt-Dept DCA cut. | |
217 | Double_t fDCAzCut; // Max z at DCA. | |
218 | ||
219 | // Settings | |
220 | Bool_t fIsMC; // Is the current event MC or not. | |
a5422983 | 221 | Bool_t fLowPtNSigmaTOFOnly; // |
28161374 | 222 | Bool_t fUseNSigmaOnPIDAxes; // |
6788af99 | 223 | |
224 | // Requested Histograms; | |
225 | Bool_t fHistRequested[12]; // | |
226 | Bool_t f3DSpectraEnabeled[12]; // | |
227 | Bool_t fPIDHistosEnabeled[12]; // | |
228 | ||
229 | // Which Track Cuts will be tested. | |
230 | Bool_t fTestPt; // | |
231 | Bool_t fTestFilterMask; // | |
232 | Bool_t fTestMaxEta; // | |
233 | Bool_t fTestMaxRapidity; // | |
234 | Bool_t fTestFlags; // | |
a5422983 | 235 | Bool_t fTestNumberOfTPCClusters; // |
6214ec0c | 236 | Bool_t fTestSPDAny; // |
6788af99 | 237 | Bool_t fTestTOFmismatch; // |
238 | Bool_t fTestPtDeptDCAcut; // | |
239 | ||
240 | // QA histograms for Data. | |
241 | TList* fDataTrackQAHistos; // | |
bb2a7c0b | 242 | TH1F* fHistAcceptedFilterBits; //! Histogram with the number of accepted tracks as function of filtermask. |
243 | TArrayI* fRelevantBitsArray; //! See method: InitializeAcceptedFilterBits(). | |
6788af99 | 244 | TH1F* fHistDataPt[3]; //! Pt distribution of tracks passing this cut. |
50dfda71 | 245 | TH3F* fHistDataPhiEtaPt[3]; //! Pt, Eta, Phi distribution. |
6788af99 | 246 | TH1F* fHistDataNTracks[3]; //! Number of tracks passing the cut per event (filling by EventIsDone()). |
247 | TH1F* fHistDataDCAxy[3]; //! DCA_{xy} distribution. | |
248 | TH1F* fHistDataDCAz[3]; //! DCA_{z} distribution | |
249 | TH2F* fHistDataDCAxyOneSigma[12]; //! DCA_{xy} distribution of particles as identified by 1 sigma method. | |
7fcceff8 | 250 | Int_t fNTracks[12]; //! Number of tracks |
6788af99 | 251 | |
252 | TH3F* fHistDataPID[3][3][5]; //! TPC/TOF v.s. pT, [charge][mass assumption][ptclass] | |
253 | TH2F* fHistTOFMismatch[3][3][5]; //! TOF Mismatch histograms, [charge][mass assumption][ptclass] | |
97724bd1 | 254 | TH3F* fHistTPCTOFMismatch[3][3][5]; //! TPC/TOF mismatch histograms (Same as TOF, but now the TPC hit of the track is included.) |
6788af99 | 255 | |
a5422983 | 256 | // QA histograms for all reconstructed MC tracks. |
bb2a7c0b | 257 | TH1F* fTOFMatchingStat; // |
a5422983 | 258 | |
6788af99 | 259 | // QA histograms for Primary Reconstructed MC tracks. |
260 | TList* fPrimRecMCTrackQAHistos; // | |
261 | TH1F* fHistPrimRecMCPt[12]; //! Pt distribution of reconstructed MC track passing this cut. | |
a5422983 | 262 | TH3F* fHistPrimRecMCPhiEtaPt[12]; //! Pt, Eta, Phi distribution. |
6788af99 | 263 | TH1F* fHistPrimRecNTracks[12]; //! |
264 | TH2F* fHistPrimRecMCDCA[12]; //! DCA_xy distribution of reconstructed MC track passing this cut. | |
a5422983 | 265 | TH2F* fHistPrimRecPtGenPt[12]; //! Reconstructed Pt versus Generated Pt. |
266 | ||
267 | TH2F* fHistPrimRecPID[3][3][5]; //! TPC/TOF v.s. pT, [charge][mass assumption][ptclass] | |
268 | TH2F* fHistPrimRecMismatch[3][3][5]; //! Tracks with the same ->Label(), as ->TOFLabel(). | |
6788af99 | 269 | |
270 | // QA histograms for Primary Generated MC particles. | |
271 | TList* fPrimGenMCTrackQAHistos; // | |
272 | TH1F* fHistPrimGenMCPt[12]; //! Pt distribution of generated MC particles passing this cut. | |
a5422983 | 273 | TH3F* fHistPrimGenMCPhiEtaPt[12]; //! Pt, Eta, Phi distribution. |
6788af99 | 274 | |
275 | // QA histograms for Secondary Reconstructed MC tracks. | |
276 | TList* fSecRecMCTrackQAHistos; // | |
277 | TH1F* fHistSecRecMCPt[12]; //! Pt distribution of reconstructed MC track passing this cut. | |
a5422983 | 278 | TH3F* fHistSecRecMCPhiEtaPt[12]; //! Pt, Eta, Phi distribution. |
6788af99 | 279 | TH2F* fHistSecRecMCDCAMat[12]; //! DCA_xy distribution of material decay particles. |
280 | TH2F* fHistSecRecMCDCAWeak[12]; //! DCA_xy distribution of weak decay. | |
281 | ||
282 | // QA histograms for Secondary Generated MC particles. | |
283 | TList* fSecGenMCTrackQAHistos; // | |
284 | TH1F* fHistSecGenMCPt[12]; //! Pt distribution of generated MC particles passing this cut. | |
a5422983 | 285 | TH3F* fHistSecGenMCPhiEtaPt[12]; //! Pt, Eta, Phi distribution. |
6788af99 | 286 | |
287 | // Binning of all the histograms. | |
50dfda71 | 288 | Double_t fPtAxis[57]; // Pt axis used in all histograms, except PID and Mismatch histograms. |
6788af99 | 289 | Int_t fNPtBins; // Number of bins in the pt-axis. |
50dfda71 | 290 | Int_t fNEtaBins; // |
291 | Int_t fNPhiBins; // | |
6788af99 | 292 | |
293 | Double_t fPtBoundaryPID[6]; // There are five different PID histo's. This array gives the pT range of these histograms. | |
294 | Int_t fNPtBinsPID[5]; // This array gives the number of pT bins for each of these histograms. | |
295 | ||
296 | Double_t fTOFLowerBound[5][3]; // These arrays give the lower and upper bound of the TOF axes, | |
297 | Double_t fTOFUpperBound[5][3]; // for each species, as well as the number of bins. The numbers | |
298 | Int_t fTOFbins[5][3]; // size of the array is [ptrange][species]. | |
299 | ||
300 | Double_t fTPCLowerBound[5][3]; // The same, but now for TPC. | |
301 | Double_t fTPCUpperBound[5][3]; | |
302 | Int_t fTPCbins[5][3]; | |
303 | ||
304 | // Naming conventions of the histograms. | |
305 | TString fHistoName[12]; // Names of the histogram classes. | |
306 | TString fHistoLatex[12]; // Names of the histogram classes in LaTeX. | |
307 | TString fParticleName[3]; // Names of the particles (Pion, Kaon, Proton) | |
308 | TString fPtClassName[5]; // Names of the ptclasses (should only be for internal use) | |
309 | ||
310 | Int_t fDebug; // Debug flag. | |
311 | ||
28161374 | 312 | ClassDef(AliAODTrackCutsDiHadronPID,9); |
6788af99 | 313 | |
314 | }; | |
315 | ||
316 | #endif |