1 #ifndef ALIHFETRDPIDQA_H
2 #define ALIHFETRDPIDQA_H
4 /**************************************************************************
5 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
7 * Author: The ALICE Off-line Project. *
8 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
22 // QA class for TRD PID
23 // Evaluate TRD PID using well identified reference tracks
24 // For more information see implementation file
30 #ifndef ROOT_THnSparse
31 #include <THnSparse.h>
38 #ifndef ALIHFECOLLECTION_H
39 #include "AliHFEcollection.h"
56 class AliHFEtrdPIDqa : public TNamed{
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();
66 virtual void Browse(TBrowser *b);
67 virtual Bool_t IsFolder() const { return kTRUE; }
69 void ProcessTracks(TObjArray * const l, Int_t species);
70 void ProcessTrack(AliVTrack *track, Int_t species);
73 void FinishAnalysis();
74 void ShowMessages() { fShowMessage = kTRUE; }
75 void StoreResults(const Char_t *filename = "HFEtrdPIDqa.root");
76 void SaveThresholdParameters(const Char_t * filename = "TRD.Thresholds.root");
78 void DrawTracklet(Int_t tracklet, Double_t pmin = 0., Double_t pmax = 0., Bool_t doFit = kFALSE);
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);
85 //---------------------------------------------------
86 // Getters for Histograms
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;
95 AliHFEcollection *GetHistos() const { return fHistos; }
96 //---------------------------------------------------
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
103 enum QuantitiesCommon_t{
107 kQuantitiesCommon = 3
109 enum QuantitiesLike_t{
113 enum QuantitiesQAtrack_t{
114 kNonZeroTrackletCharge = 3,
118 enum QuantitiesdEdx_t{
124 enum QuantitiesTruncMean_t{
128 kQuantitiesTruncMean = 6
131 void ProcessTrackESD(AliESDtrack *track, Int_t species);
132 void ProcessTrackAOD(AliAODTrack * const track, Int_t species);
134 void FillTRDLikelihoods(AliESDtrack *track, Int_t species);
135 void FillTRDQAplots(AliESDtrack *track, Int_t species);
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);
142 void CreateLikelihoodHistogram();
143 void CreateQAHistogram();
144 void CreatedEdxHistogram();
145 void CreateHistoTruncatedMean();
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
156 AliHFEcollection *fHistos; // Histogram collection
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
163 TList *fThresholds; //! List for Threshold Graphs
165 Bool_t fShowMessage; // Display debug messages
167 ClassDef(AliHFEtrdPIDqa, 3) // QA class for TRD PID