]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGHF/hfe/AliHFEtrdPIDqa.h
Transition PWG3 --> PWGHF
[u/mrichter/AliRoot.git] / PWGHF / hfe / AliHFEtrdPIDqa.h
CommitLineData
c04c80e6 1/**************************************************************************
2* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3* *
4* Author: The ALICE Off-line Project. *
5* Contributors are mentioned in the code where appropriate. *
6* *
7* Permission to use, copy, modify and distribute this software and its *
8* documentation strictly for non-commercial purposes is hereby granted *
9* without fee, provided that the above copyright notice appears in all *
10* copies and that both the copyright notice and this permission notice *
11* appear in the supporting documentation. The authors make no claims *
12* about the suitability of this software for any purpose. It is *
13* provided "as is" without express or implied warranty. *
14**************************************************************************/
15//
16// QA class for TRD PID
17// Evaluate TRD PID using well identified reference tracks
18// For more information see implementation file
19//
c2690925 20#ifndef ALIHFETRDPIDQA_H
21#define ALIHFETRDPIDQA_H
22
c04c80e6 23#ifndef ROOT_TNamed
24#include <TNamed.h>
25#endif
26
27#ifndef ROOT_THnSparse
28#include <THnSparse.h>
29#endif
30
bf892a6a 31#ifndef ROOT_TH2
32#include <TH2.h>
33#endif
34
35#ifndef ALIHFECOLLECTION_H
36#include "AliHFEcollection.h"
37#endif
38
8c1c76e9 39class TArrayD;
bf892a6a 40class TBrowser;
c04c80e6 41class TCollection;
42class TF1;
43class TGraph;
8c1c76e9 44class TGraphErrors;
c04c80e6 45class TH1;
bf892a6a 46//class TH2;
c04c80e6 47class TList;
48class TObjArray;
49
50class AliAODTrack;
51class AliESDtrack;
52class AliVTrack;
53class AliHFEpidTRD;
54
55class AliHFEtrdPIDqa : public TNamed{
56 public:
57 AliHFEtrdPIDqa();
58 AliHFEtrdPIDqa(const Char_t *name);
59 AliHFEtrdPIDqa(const AliHFEtrdPIDqa &ref);
60 AliHFEtrdPIDqa &operator=(const AliHFEtrdPIDqa &ref);
61 virtual void Copy(TObject &o) const;
62 virtual Long64_t Merge(TCollection *coll);
63 virtual ~AliHFEtrdPIDqa();
bf892a6a 64
65 virtual void Browse(TBrowser *b);
66 virtual Bool_t IsFolder() const { return kTRUE; }
c04c80e6 67
c2690925 68 void ProcessTracks(const TObjArray * const l, Int_t species);
69 void ProcessTrack(const AliVTrack *const track, Int_t species);
c04c80e6 70
71 void Init();
72 void FinishAnalysis();
e3ae862b 73 void ShowMessages() { fShowMessage = kTRUE; }
e156c3bb 74 void SetTotalChargeInSlice0() { fTotalChargeInSlice0 = kTRUE; }
c04c80e6 75 void StoreResults(const Char_t *filename = "HFEtrdPIDqa.root");
e156c3bb 76 void SaveThresholdParameters(const Char_t * filename = "TRD.Thresholds.root", Double_t lowerLimit = 0.5, Double_t upperLimit = 3.5);
c04c80e6 77
8c1c76e9 78 TGraphErrors *GetPionEfficiency(Int_t ntracklets, Int_t eleffpercent);
79 TGraphErrors *GetProtonEfficiency(Int_t ntracklets, Int_t eleffpercent);
80 TGraph *GetThreshold(Int_t ntracklets, Int_t eleffpercent);
81
82 void DrawTracklet(Int_t tracklet, Double_t pmin = -1., Double_t pmax = -1., Bool_t doFit = kFALSE);
c04c80e6 83 void ClearLists();
84
e3ae862b 85 Double_t EvalPionEfficiency(Int_t ntls, Int_t eEff, Double_t p);
86 Double_t EvalProtonEfficiency(Int_t ntls, Int_t eEff, Double_t p);
87 Double_t EvalThreshold(Int_t ntls, Int_t eEff, Double_t p);
88
8c1c76e9 89 Double_t CalculateIntegratedPionEfficiency(UInt_t nTracklets, Double_t electronEff, Double_t pmin, Double_t pmax, Double_t *error = NULL);
90
c04c80e6 91 //---------------------------------------------------
92 // Getters for Histograms
bf892a6a 93 THnSparseF *GetLikelihoodHistogram() const { return fHistos ? dynamic_cast<THnSparseF *>(fHistos->Get("fLikeTRD")) : NULL; }
94 THnSparseF *GetQAHistogram() const { return fHistos ? dynamic_cast<THnSparseF *>(fHistos->Get("fQAtrack")) : NULL; }
95 THnSparseF *GetdEdxHistogram() const { return fHistos ? dynamic_cast<THnSparseF *>(fHistos->Get("fQAdEdx")) : NULL; }
96 THnSparseF *GetHistoTruncMean() const { return fHistos ? dynamic_cast<THnSparseF *>(fHistos->Get("fTRDtruncMean")) : NULL; }
97 TH2 *GetSliceChargePions(Bool_t pions = kTRUE) const {
98 const Char_t * species = pions ? "Pions" : "Electrons";
99 return fHistos ? dynamic_cast<TH2 *>(fHistos->Get(Form("fTRDslices%s", species))) : NULL;
100 }
101 AliHFEcollection *GetHistos() const { return fHistos; }
c04c80e6 102 //---------------------------------------------------
103 protected:
104 // Description of the containers we use to store basic information
105 // we access in the Post Processing. For all containers we have a
106 // common part containing species, momentum and number of tracklets,
107 // and a specific part. For both containers we define the number of
108 // variables too
109 enum QuantitiesCommon_t{
110 kSpecies = 0,
111 kP = 1,
112 kNTracklets = 2,
113 kQuantitiesCommon = 3
114 };
115 enum QuantitiesLike_t{
116 kElectronLike = 3,
8c1c76e9 117 kNClustersLike = 4,
118 kQuantitiesLike = 5
c04c80e6 119 };
120 enum QuantitiesQAtrack_t{
121 kNonZeroTrackletCharge = 3,
122 kNClusters = 4,
123 kQuantitiesQA = 5
124 };
125 enum QuantitiesdEdx_t{
3a72645a 126 kNclusters = 3,
127 kNonZeroSlices = 4,
128 kdEdx = 5,
129 kQuantitiesdEdx = 6
c04c80e6 130 };
131 enum QuantitiesTruncMean_t{
132 kTPCdEdx = 3,
133 kTRDdEdxMethod1 = 4,
134 kTRDdEdxMethod2 = 5,
135 kQuantitiesTruncMean = 6
136 };
137
c2690925 138 void ProcessTrackESD(const AliESDtrack * const track, Int_t species);
139 void ProcessTrackAOD(const AliAODTrack * const track, Int_t species);
c04c80e6 140
c2690925 141 void FillTRDLikelihoods(const AliESDtrack * const track, Int_t species);
142 void FillTRDQAplots(const AliESDtrack *const track, Int_t species);
c04c80e6 143
144 void AnalyseNTracklets(Int_t nTracklets);
8c1c76e9 145 Double_t CalculateHadronEfficiency(const TH1 * const hadron, const TH1 *const electron, Double_t eff, Int_t &threshbin, Double_t &error);
e156c3bb 146 TF1 *MakeThresholds(TGraph *input, Double_t lowerLimit, Double_t upperLimit);
c04c80e6 147
148 void CreateLikelihoodHistogram();
149 void CreateQAHistogram();
150 void CreatedEdxHistogram();
151 void CreateHistoTruncatedMean();
152
153 private:
154 enum{
155 kNElectronEffs = 6
156 };
157 static const Double_t fgkElectronEff[kNElectronEffs]; // Electron efficiency bins
158 static const Int_t fgkNBinsCommon[kQuantitiesCommon]; // Number of bins for common quantities
159 static const Double_t fgkMinBinCommon[kQuantitiesCommon]; // Bin Limits for common quantities (lower limit)
160 static const Double_t fgkMaxBinCommon[kQuantitiesCommon]; // Bin Limits for common quantities (upper limit)
161 AliHFEpidTRD *fTRDpid; // HFE PID for TRD
bf892a6a 162 AliHFEcollection *fHistos; // Histogram collection
c04c80e6 163
164 // List for Histograms:
165 TList *fPionEfficiencies; //! List for Pion efficiencies
166 TList *fProtonEfficiencies; //! List for Proton efficiencies
167 TList *fKaonEfficiencies; //! List for Kaon efficiencies
168
169 TList *fThresholds; //! List for Threshold Graphs
e3ae862b 170
171 Bool_t fShowMessage; // Display debug messages
e156c3bb 172 Bool_t fTotalChargeInSlice0; // Flag for Foreward/Backward compatibility in TRD total charge calculation
c04c80e6 173
bf892a6a 174 ClassDef(AliHFEtrdPIDqa, 3) // QA class for TRD PID
c04c80e6 175};
176#endif
177