]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/qaRec/AliTRDpidChecker.h
Batch analysis on the grid without the tags enabled
[u/mrichter/AliRoot.git] / TRD / qaRec / AliTRDpidChecker.h
CommitLineData
1a6d7c9a 1#ifndef ALITRDPIDCHECKER_H
2#define ALITRDPIDCHECKER_H
3
4//////////////////////////////////////////////////////
5//
6// Task to check PID performance of the TRD
7//
8// Author : Alex Wilk <wilka@uni-muenster.de>
0d83b3a5 9// Alex Bercuci <A.Bercuci@gsi.de>
10// Markus Fasel <M.Fasel@gsi.de>
1a6d7c9a 11//
12///////////////////////////////////////////////////////
13
0d83b3a5 14#ifndef ROOT_TAxis
15#include "TAxis.h"
16#endif
17
3d86166d 18#ifndef ALITRDRECOTASK_H
19#include "AliTRDrecoTask.h"
20#endif
1a6d7c9a 21
1a6d7c9a 22class AliTRDReconstructor;
74b2e03d 23class AliTRDpidUtil;
3d86166d 24class AliTRDpidChecker : public AliTRDrecoTask
1a6d7c9a 25{
c46a7947 26 // Plots registered for this task
c7cf2032 27 enum{
c46a7947 28 kEfficiency = 0 // pi Efficiency plot
29 ,kdEdx = 1 // dE/dx spectra
30 ,kdEdxSlice = 2 // dE/dx spectra
31 ,kPH = 3 // pulse height spectra
32 ,kNClus = 4 // number of clusters per track
33 ,kMomentum = 5 // momentum distribution
34 ,kMomentumBin = 6 // momentum distribution
35 ,kThresh = 7 // threshold in efficiency
c7cf2032 36 };
1a6d7c9a 37public:
3d86166d 38 AliTRDpidChecker();
1a6d7c9a 39 virtual ~AliTRDpidChecker();
40
74b2e03d 41 virtual void CreateOutputObjects();
e15179be 42 virtual Bool_t GetRefFigure(Int_t ifig);
74b2e03d 43 virtual Bool_t PostProcess();
44 virtual void Terminate(Option_t *);
45
46 TH1 *PlotLQ(const AliTRDtrackV1 *track = 0x0);
47 TH1 *PlotNN(const AliTRDtrackV1 *track = 0x0);
c46a7947 48 TH1 *PlotESD(const AliTRDtrackV1 *track = 0x0);
74b2e03d 49 TH1 *PlotdEdx(const AliTRDtrackV1 *track = 0x0);
50 TH1 *PlotdEdxSlice(const AliTRDtrackV1 *track = 0x0);
51 TH1 *PlotPH(const AliTRDtrackV1 *track = 0x0);
52 TH1 *PlotNClus(const AliTRDtrackV1 *track = 0x0);
53 TH1 *PlotMom(const AliTRDtrackV1 *track = 0x0);
54 TH1 *PlotMomBin(const AliTRDtrackV1 *track = 0x0);
1a6d7c9a 55
18035ab0 56 void SetRequireMinNTracklets(Int_t mintracklets) { fMinNTracklets = mintracklets; }
57 void SetRequireMaxNTracklets(Int_t maxtracklets) { fMaxNTracklets = maxtracklets; }
58
b8174058 59 TObjArray *GetGraphs() { return fGraph; };
74b2e03d 60 virtual TObjArray *Histos();
1bd44ae8 61 void EvaluatePionEfficiency(TObjArray *histoContainer, TObjArray *results, Float_t electron_efficiency);
0d83b3a5 62 inline void SetMomentumBinning(Int_t nBins, Double_t *bins);
63 inline Int_t FindBin(Int_t species, Double_t momentum);
64 inline Bool_t IsInRange(Double_t momentum);
c4c5bbfb 65
1a6d7c9a 66private:
c4c5bbfb 67 AliTRDpidChecker(const AliTRDpidChecker&); // not implemented
68 AliTRDpidChecker& operator=(const AliTRDpidChecker&); // not implemented
1a6d7c9a 69
74b2e03d 70 Int_t CalcPDG(AliTRDtrackV1* track = 0x0);
71 Bool_t CheckTrackQuality(const AliTRDtrackV1* track = 0x0);
72
1a6d7c9a 73 AliTRDReconstructor *fReconstructor; //! reconstructor needed for recalculation the PID
74b2e03d 74 AliTRDpidUtil *fUtil; //! utility class for PID calculations
c46a7947 75 TObjArray *fGraph; //! array of graphs filled in PostProcess
76 TObjArray *fEfficiency; //! array of histograms with efficiency
0d83b3a5 77 TAxis *fMomentumAxis; //! helper mementum binning
18035ab0 78 Int_t fMinNTracklets; // minimum number of required Tracklets (for systematic studies)
79 Int_t fMaxNTracklets; // maximum number of required Tracklets (for systematic studies)
1a6d7c9a 80 ClassDef(AliTRDpidChecker, 1); // TRD PID checker
81};
82
0d83b3a5 83//________________________________________________________________________
84inline void AliTRDpidChecker::SetMomentumBinning(Int_t nBins, Double_t *bins){
85 //
86 // Set the Momentum Bins
87 //
88 if(fMomentumAxis) delete fMomentumAxis;
89 fMomentumAxis = new TAxis(nBins, bins);
90}
91
92//________________________________________________________________________
93inline Int_t AliTRDpidChecker::FindBin(Int_t species, Double_t momentum){
94 //
95 // Find the Bin in the 2D Histogram
96 //
52bb079b 97 return species * fMomentumAxis->GetNbins() + (fMomentumAxis->FindBin(momentum) -1);
0d83b3a5 98}
99
100//________________________________________________________________________
101inline Bool_t AliTRDpidChecker::IsInRange(Double_t momentum){
102 //
103 // Check Whether momentum is in the defined Range
104 //
105 return (momentum >= fMomentumAxis->GetXmin() && momentum <= fMomentumAxis->GetXmax());
106}
107
1a6d7c9a 108#endif