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