e THnSparse structure to store MC residuals
[u/mrichter/AliRoot.git] / PWG1 / TRD / AliTRDcheckPID.h
CommitLineData
1ee39b3a 1#ifndef ALITRDCHECKPID_H
2#define ALITRDCHECKPID_H
3
4//////////////////////////////////////////////////////
5//
6// PID performance checker of the TRD
7//
8// Author : Alex Wilk <wilka@uni-muenster.de>
9// Alex Bercuci <A.Bercuci@gsi.de>
10// Markus Fasel <M.Fasel@gsi.de>
11//
12///////////////////////////////////////////////////////
13
14#ifndef ROOT_TAxis
15#include "TAxis.h"
16#endif
17
18#ifndef ALITRDRECOTASK_H
19#include "AliTRDrecoTask.h"
20#endif
21
2e6aa247 22#ifndef ALIPID_H
23#include "AliPID.h"
24#endif
25
1ee39b3a 26class AliTRDpidUtil;
27class AliTRDcheckPID : public AliTRDrecoTask
28{
29public:
30 // Plots registered for this task
31 enum{
2e6aa247 32 kEfficiency = 0 // e Efficiency plot
33 ,kdEdx = 1 // dE/dx spectra
34 ,kdEdxSlice = 2 // dE/dx spectra
35 ,kPH = 3 // pulse height spectra
36 ,kNClus = 4 // number of clusters per track
37 ,kMomentum = 5 // momentum distribution
38 ,kMomentumBin = 6 // momentum distribution
39 ,kNTracklets = 7 // Number of tracklets per track
40 ,kEfficiencyMu = 8 // mu Efficiency plot
41 ,kEfficiencyPi = 9 // pi Efficiency plot
42 ,kEfficiencyKa = 10 // K Efficiency plot
43 ,kEfficiencyPr = 11 // pr Efficiency plot
b9ddd472 44 ,kV0 = 12 // V0 performance
9232567a 45 ,kdQdl = 13 // Plot total charge used for the 1D-Likelihood calculation
46 ,kNPlots = 14 // Number of plots for this tasks
47 };
1ee39b3a 48 AliTRDcheckPID();
f8f46e4d 49 AliTRDcheckPID(char* name);
1ee39b3a 50 virtual ~AliTRDcheckPID();
51
f8f46e4d 52 virtual void UserCreateOutputObjects();
1ee39b3a 53 virtual Bool_t GetRefFigure(Int_t ifig);
f8f46e4d 54 virtual void UserExec(Option_t *opt);
1ee39b3a 55 virtual Bool_t PostProcess();
56
57 TH1 *PlotLQ(const AliTRDtrackV1 *track = 0x0);
58 TH1 *PlotNN(const AliTRDtrackV1 *track = 0x0);
59 TH1 *PlotESD(const AliTRDtrackV1 *track = 0x0);
9232567a 60 TH1 *PlotdQdl(const AliTRDtrackV1 *track = 0x0);
1ee39b3a 61 TH1 *PlotdEdx(const AliTRDtrackV1 *track = 0x0);
62 TH1 *PlotdEdxSlice(const AliTRDtrackV1 *track = 0x0);
63 TH1 *PlotPH(const AliTRDtrackV1 *track = 0x0);
64 TH1 *PlotNClus(const AliTRDtrackV1 *track = 0x0);
65 TH1 *PlotNTracklets(const AliTRDtrackV1 *track = 0x0);
66 TH1 *PlotMom(const AliTRDtrackV1 *track = 0x0);
67 TH1 *PlotMomBin(const AliTRDtrackV1 *track = 0x0);
b9ddd472 68 TH1 *PlotV0(const AliTRDtrackV1 *track = 0x0);
1ee39b3a 69
70 void SetRequireMinNTracklets(Int_t mintracklets) { fMinNTracklets = mintracklets; }
71 void SetRequireMaxNTracklets(Int_t maxtracklets) { fMaxNTracklets = maxtracklets; }
72
73 TObjArray *GetGraphs() const { return fGraph; };
2e6aa247 74 static Char_t const* MethodName(Int_t id) { return fgMethod[id]; };
1ee39b3a 75 //TObjArray *GetHistos() { return fContainer; };
76 virtual TObjArray *Histos();
64d57299 77 void EvaluateEfficiency(const TObjArray* const histoContainer, TObjArray *results, Int_t species, Float_t electronEfficiency);
1ee39b3a 78 inline void SetMomentumBinning(Int_t nBins, Double_t *bins);
79 inline Int_t FindBin(Int_t species, Double_t momentum);
80 inline Bool_t IsInRange(Double_t momentum);
81
82private:
83 AliTRDcheckPID(const AliTRDcheckPID&); // not implemented
84 AliTRDcheckPID& operator=(const AliTRDcheckPID&); // not implemented
85
86 Int_t CalcPDG(AliTRDtrackV1* track = 0x0);
87 Bool_t CheckTrackQuality(const AliTRDtrackV1* track = 0x0) const;
2c5222ab 88 void LocalInit();
89
2e6aa247 90 static Char_t const *fgMethod[3]; // PID method name
5935a6da 91 AliTRDpidUtil *fUtil; // utility class for PID calculations
1ee39b3a 92 TObjArray *fGraph; //! array of graphs filled in PostProcess
b91fdd71 93 TObjArray *fPID; //! array of PID info/track for calibration
3d19c1b0 94 TObjArray *fV0s; //! array of V0 info
2e6aa247 95 TObjArray *fEfficiency[AliPID::kSPECIES]; //! array of histograms with efficiency
5723c09a 96 TAxis *fMomentumAxis; // helper mementum binning
1ee39b3a 97 Int_t fMinNTracklets; // minimum number of required Tracklets (for systematic studies)
98 Int_t fMaxNTracklets; // maximum number of required Tracklets (for systematic studies)
fd7ffd88 99 ClassDef(AliTRDcheckPID, 3); // TRD PID checker
1ee39b3a 100};
101
102//________________________________________________________________________
103inline void AliTRDcheckPID::SetMomentumBinning(Int_t nBins, Double_t *bins){
104 //
105 // Set the Momentum Bins
106 //
107 if(fMomentumAxis) delete fMomentumAxis;
108 fMomentumAxis = new TAxis(nBins, bins);
109}
110
111//________________________________________________________________________
112inline Int_t AliTRDcheckPID::FindBin(Int_t species, Double_t momentum){
113 //
114 // Find the Bin in the 2D Histogram
115 //
116 return species * fMomentumAxis->GetNbins() + (fMomentumAxis->FindBin(momentum) -1);
117}
118
119//________________________________________________________________________
120inline Bool_t AliTRDcheckPID::IsInRange(Double_t momentum){
121 //
122 // Check Whether momentum is in the defined Range
123 //
124 return (momentum >= fMomentumAxis->GetXmin() && momentum <= fMomentumAxis->GetXmax());
125}
126
127#endif