]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGHF/hfe/AliHFEtrdPIDqa.h
Possibility to select the Lc resonant channel in the MC analysis (Rossella)
[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();
e17c1f86 72 void FinishAnalysis(Int_t fCentrality = -1, Bool_t isGreaterEqual = kFALSE);
e3ae862b 73 void ShowMessages() { fShowMessage = kTRUE; }
e156c3bb 74 void SetTotalChargeInSlice0() { fTotalChargeInSlice0 = kTRUE; }
e17c1f86 75 void SetCentralityBin(Int_t centrality) { fCentralityBin = centrality; };
c04c80e6 76 void StoreResults(const Char_t *filename = "HFEtrdPIDqa.root");
e17c1f86 77 void SaveThresholdParameters(const Char_t * filename = "TRD.Thresholds.root", Double_t lowerLimit = 0.5, Double_t upperLimit = 3.5, Int_t fCentrality = -1);
c04c80e6 78
e17c1f86 79 TGraphErrors *GetPionEfficiency(Int_t ntracklets, Int_t eleffpercent, Int_t centrality = -1);
80 TGraphErrors *GetProtonEfficiency(Int_t ntracklets, Int_t eleffpercent, Int_t centrality = -1);
81 TGraph *GetThreshold(Int_t ntracklets, Int_t eleffpercent, Int_t centrality = -1);
8c1c76e9 82
e17c1f86 83 void DrawTracklet(Int_t tracklet, Double_t pmin = -1., Double_t pmax = -1., Int_t centrality = -1, Bool_t doFit = kFALSE);
84 void DrawTrackletsame(Int_t tracklet, Double_t pmin = -1., Double_t pmax = -1., Bool_t doFit = kFALSE);
c04c80e6 85 void ClearLists();
86
e17c1f86 87 Double_t EvalPionEfficiency(Int_t ntls, Int_t eEff, Double_t p, Int_t centrality = -1);
88 Double_t EvalProtonEfficiency(Int_t ntls, Int_t eEff, Double_t p, Int_t centrality = -1);
89 Double_t EvalThreshold(Int_t ntls, Int_t eEff, Double_t p, Int_t centrality = -1);
90
91 Double_t CalculateIntegratedPionEfficiency(UInt_t nTracklets, Double_t electronEff, Double_t pmin, Double_t pmax, Int_t icentrality =-1, Double_t *error = NULL);
92
e3ae862b 93
8c1c76e9 94
c04c80e6 95 //---------------------------------------------------
96 // Getters for Histograms
bf892a6a 97 THnSparseF *GetLikelihoodHistogram() const { return fHistos ? dynamic_cast<THnSparseF *>(fHistos->Get("fLikeTRD")) : NULL; }
98 THnSparseF *GetQAHistogram() const { return fHistos ? dynamic_cast<THnSparseF *>(fHistos->Get("fQAtrack")) : NULL; }
99 THnSparseF *GetdEdxHistogram() const { return fHistos ? dynamic_cast<THnSparseF *>(fHistos->Get("fQAdEdx")) : NULL; }
100 THnSparseF *GetHistoTruncMean() const { return fHistos ? dynamic_cast<THnSparseF *>(fHistos->Get("fTRDtruncMean")) : NULL; }
101 TH2 *GetSliceChargePions(Bool_t pions = kTRUE) const {
102 const Char_t * species = pions ? "Pions" : "Electrons";
103 return fHistos ? dynamic_cast<TH2 *>(fHistos->Get(Form("fTRDslices%s", species))) : NULL;
104 }
105 AliHFEcollection *GetHistos() const { return fHistos; }
c04c80e6 106 //---------------------------------------------------
107 protected:
108 // Description of the containers we use to store basic information
109 // we access in the Post Processing. For all containers we have a
110 // common part containing species, momentum and number of tracklets,
111 // and a specific part. For both containers we define the number of
112 // variables too
113 enum QuantitiesCommon_t{
114 kSpecies = 0,
115 kP = 1,
116 kNTracklets = 2,
117 kQuantitiesCommon = 3
118 };
119 enum QuantitiesLike_t{
120 kElectronLike = 3,
8c1c76e9 121 kNClustersLike = 4,
a8ef1999 122 kCentralityBinLike = 5,
e17c1f86 123 kQuantitiesLike = 6
c04c80e6 124 };
125 enum QuantitiesQAtrack_t{
126 kNonZeroTrackletCharge = 3,
127 kNClusters = 4,
a8ef1999 128 kCentralityBinQA = 5,
129 kQuantitiesQA = 6
c04c80e6 130 };
131 enum QuantitiesdEdx_t{
3a72645a 132 kNclusters = 3,
133 kNonZeroSlices = 4,
134 kdEdx = 5,
a8ef1999 135 kCentralityBindEdx = 6,
136 kQuantitiesdEdx = 7
c04c80e6 137 };
138 enum QuantitiesTruncMean_t{
139 kTPCdEdx = 3,
140 kTRDdEdxMethod1 = 4,
141 kTRDdEdxMethod2 = 5,
a8ef1999 142 kCentralityBinTruncMean = 6,
143 kQuantitiesTruncMean = 7
c04c80e6 144 };
145
c2690925 146 void ProcessTrackESD(const AliESDtrack * const track, Int_t species);
147 void ProcessTrackAOD(const AliAODTrack * const track, Int_t species);
c04c80e6 148
c2690925 149 void FillTRDLikelihoods(const AliESDtrack * const track, Int_t species);
150 void FillTRDQAplots(const AliESDtrack *const track, Int_t species);
c04c80e6 151
e17c1f86 152 void AnalyseNTracklets(Int_t nTracklets, Int_t fCentrality = -1, Bool_t isGreaterEqual = kFALSE);
8c1c76e9 153 Double_t CalculateHadronEfficiency(const TH1 * const hadron, const TH1 *const electron, Double_t eff, Int_t &threshbin, Double_t &error);
e17c1f86 154 Double_t EstimateThresholdError(const TH1 * const electron, Int_t threshbin);
e156c3bb 155 TF1 *MakeThresholds(TGraph *input, Double_t lowerLimit, Double_t upperLimit);
c04c80e6 156
157 void CreateLikelihoodHistogram();
158 void CreateQAHistogram();
159 void CreatedEdxHistogram();
160 void CreateHistoTruncatedMean();
161
162 private:
163 enum{
164 kNElectronEffs = 6
165 };
166 static const Double_t fgkElectronEff[kNElectronEffs]; // Electron efficiency bins
167 static const Int_t fgkNBinsCommon[kQuantitiesCommon]; // Number of bins for common quantities
168 static const Double_t fgkMinBinCommon[kQuantitiesCommon]; // Bin Limits for common quantities (lower limit)
169 static const Double_t fgkMaxBinCommon[kQuantitiesCommon]; // Bin Limits for common quantities (upper limit)
170 AliHFEpidTRD *fTRDpid; // HFE PID for TRD
bf892a6a 171 AliHFEcollection *fHistos; // Histogram collection
c04c80e6 172
173 // List for Histograms:
174 TList *fPionEfficiencies; //! List for Pion efficiencies
175 TList *fProtonEfficiencies; //! List for Proton efficiencies
176 TList *fKaonEfficiencies; //! List for Kaon efficiencies
177
178 TList *fThresholds; //! List for Threshold Graphs
e3ae862b 179
e17c1f86 180 Bool_t fShowMessage; // Display debug messages
e156c3bb 181 Bool_t fTotalChargeInSlice0; // Flag for Foreward/Backward compatibility in TRD total charge calculation
e17c1f86 182
183 Int_t fCentralityBin; // Centrality Bin
184
bf892a6a 185 ClassDef(AliHFEtrdPIDqa, 3) // QA class for TRD PID
c04c80e6 186};
187#endif
188