1 #ifndef ALITRDCHECKPID_H
2 #define ALITRDCHECKPID_H
4 //////////////////////////////////////////////////////
6 // PID performance checker of the TRD
8 // Author : Alex Wilk <wilka@uni-muenster.de>
9 // Alex Bercuci <A.Bercuci@gsi.de>
10 // Markus Fasel <M.Fasel@gsi.de>
12 ///////////////////////////////////////////////////////
18 #ifndef ALITRDRECOTASK_H
19 #include "AliTRDrecoTask.h"
27 class AliTRDcheckPID : public AliTRDrecoTask
30 // Plots registered for this task
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
44 ,kV0 = 12 // V0 performance
45 ,kNPlots = 13 // Number of plots for this tasks
48 AliTRDcheckPID(char* name);
49 virtual ~AliTRDcheckPID();
51 virtual void UserCreateOutputObjects();
52 virtual Bool_t GetRefFigure(Int_t ifig);
53 virtual void UserExec(Option_t *opt);
54 virtual Bool_t PostProcess();
56 TH1 *PlotLQ(const AliTRDtrackV1 *track = 0x0);
57 TH1 *PlotNN(const AliTRDtrackV1 *track = 0x0);
58 TH1 *PlotESD(const AliTRDtrackV1 *track = 0x0);
59 TH1 *PlotdEdx(const AliTRDtrackV1 *track = 0x0);
60 TH1 *PlotdEdxSlice(const AliTRDtrackV1 *track = 0x0);
61 TH1 *PlotPH(const AliTRDtrackV1 *track = 0x0);
62 TH1 *PlotNClus(const AliTRDtrackV1 *track = 0x0);
63 TH1 *PlotNTracklets(const AliTRDtrackV1 *track = 0x0);
64 TH1 *PlotMom(const AliTRDtrackV1 *track = 0x0);
65 TH1 *PlotMomBin(const AliTRDtrackV1 *track = 0x0);
66 TH1 *PlotV0(const AliTRDtrackV1 *track = 0x0);
68 void SetRequireMinNTracklets(Int_t mintracklets) { fMinNTracklets = mintracklets; }
69 void SetRequireMaxNTracklets(Int_t maxtracklets) { fMaxNTracklets = maxtracklets; }
71 TObjArray *GetGraphs() const { return fGraph; };
72 static Char_t const* MethodName(Int_t id) { return fgMethod[id]; };
73 //TObjArray *GetHistos() { return fContainer; };
74 virtual TObjArray *Histos();
75 void EvaluateEfficiency(const TObjArray* const histoContainer, TObjArray *results, Int_t species, Float_t electronEfficiency);
76 inline void SetMomentumBinning(Int_t nBins, Double_t *bins);
77 inline Int_t FindBin(Int_t species, Double_t momentum);
78 inline Bool_t IsInRange(Double_t momentum);
81 AliTRDcheckPID(const AliTRDcheckPID&); // not implemented
82 AliTRDcheckPID& operator=(const AliTRDcheckPID&); // not implemented
84 Int_t CalcPDG(AliTRDtrackV1* track = 0x0);
85 Bool_t CheckTrackQuality(const AliTRDtrackV1* track = 0x0) const;
88 static Char_t const *fgMethod[3]; // PID method name
89 AliTRDpidUtil *fUtil; // utility class for PID calculations
90 TObjArray *fGraph; //! array of graphs filled in PostProcess
91 TObjArray *fPID; //! array of PID info/track for calibration
92 TObjArray *fV0s; //! array of V0 info
93 TObjArray *fEfficiency[AliPID::kSPECIES]; //! array of histograms with efficiency
94 TAxis *fMomentumAxis; // helper mementum binning
95 Int_t fMinNTracklets; // minimum number of required Tracklets (for systematic studies)
96 Int_t fMaxNTracklets; // maximum number of required Tracklets (for systematic studies)
97 ClassDef(AliTRDcheckPID, 3); // TRD PID checker
100 //________________________________________________________________________
101 inline void AliTRDcheckPID::SetMomentumBinning(Int_t nBins, Double_t *bins){
103 // Set the Momentum Bins
105 if(fMomentumAxis) delete fMomentumAxis;
106 fMomentumAxis = new TAxis(nBins, bins);
109 //________________________________________________________________________
110 inline Int_t AliTRDcheckPID::FindBin(Int_t species, Double_t momentum){
112 // Find the Bin in the 2D Histogram
114 return species * fMomentumAxis->GetNbins() + (fMomentumAxis->FindBin(momentum) -1);
117 //________________________________________________________________________
118 inline Bool_t AliTRDcheckPID::IsInRange(Double_t momentum){
120 // Check Whether momentum is in the defined Range
122 return (momentum >= fMomentumAxis->GetXmin() && momentum <= fMomentumAxis->GetXmax());