1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 // QA class for TRD PID
17 // Evaluate TRD PID using well identified reference tracks
18 // For more information see implementation file
20 #ifndef ALIHFETRDPIDQA_H
21 #define ALIHFETRDPIDQA_H
27 #ifndef ROOT_THnSparse
28 #include <THnSparse.h>
35 #ifndef ALIHFECOLLECTION_H
36 #include "AliHFEcollection.h"
53 class AliHFEtrdPIDqa : public TNamed{
56 AliHFEtrdPIDqa(const Char_t *name);
57 AliHFEtrdPIDqa(const AliHFEtrdPIDqa &ref);
58 AliHFEtrdPIDqa &operator=(const AliHFEtrdPIDqa &ref);
59 virtual void Copy(TObject &o) const;
60 virtual Long64_t Merge(TCollection *coll);
61 virtual ~AliHFEtrdPIDqa();
63 virtual void Browse(TBrowser *b);
64 virtual Bool_t IsFolder() const { return kTRUE; }
66 void ProcessTracks(TObjArray * const l, Int_t species);
67 void ProcessTrack(AliVTrack *track, Int_t species);
70 void FinishAnalysis();
71 void ShowMessages() { fShowMessage = kTRUE; }
72 void StoreResults(const Char_t *filename = "HFEtrdPIDqa.root");
73 void SaveThresholdParameters(const Char_t * filename = "TRD.Thresholds.root");
75 void DrawTracklet(Int_t tracklet, Double_t pmin = 0., Double_t pmax = 0., Bool_t doFit = kFALSE);
78 Double_t EvalPionEfficiency(Int_t ntls, Int_t eEff, Double_t p);
79 Double_t EvalProtonEfficiency(Int_t ntls, Int_t eEff, Double_t p);
80 Double_t EvalThreshold(Int_t ntls, Int_t eEff, Double_t p);
82 //---------------------------------------------------
83 // Getters for Histograms
84 THnSparseF *GetLikelihoodHistogram() const { return fHistos ? dynamic_cast<THnSparseF *>(fHistos->Get("fLikeTRD")) : NULL; }
85 THnSparseF *GetQAHistogram() const { return fHistos ? dynamic_cast<THnSparseF *>(fHistos->Get("fQAtrack")) : NULL; }
86 THnSparseF *GetdEdxHistogram() const { return fHistos ? dynamic_cast<THnSparseF *>(fHistos->Get("fQAdEdx")) : NULL; }
87 THnSparseF *GetHistoTruncMean() const { return fHistos ? dynamic_cast<THnSparseF *>(fHistos->Get("fTRDtruncMean")) : NULL; }
88 TH2 *GetSliceChargePions(Bool_t pions = kTRUE) const {
89 const Char_t * species = pions ? "Pions" : "Electrons";
90 return fHistos ? dynamic_cast<TH2 *>(fHistos->Get(Form("fTRDslices%s", species))) : NULL;
92 AliHFEcollection *GetHistos() const { return fHistos; }
93 //---------------------------------------------------
95 // Description of the containers we use to store basic information
96 // we access in the Post Processing. For all containers we have a
97 // common part containing species, momentum and number of tracklets,
98 // and a specific part. For both containers we define the number of
100 enum QuantitiesCommon_t{
104 kQuantitiesCommon = 3
106 enum QuantitiesLike_t{
110 enum QuantitiesQAtrack_t{
111 kNonZeroTrackletCharge = 3,
115 enum QuantitiesdEdx_t{
121 enum QuantitiesTruncMean_t{
125 kQuantitiesTruncMean = 6
128 void ProcessTrackESD(AliESDtrack *track, Int_t species);
129 void ProcessTrackAOD(AliAODTrack * const track, Int_t species);
131 void FillTRDLikelihoods(AliESDtrack *track, Int_t species);
132 void FillTRDQAplots(AliESDtrack *track, Int_t species);
134 void AnalyseNTracklets(Int_t nTracklets);
135 Int_t GetThresholdBin(TH1 * const input, Double_t efficiency);
136 Bool_t CalculateEfficiency(TH1 * const input, Int_t threshbin, Double_t *params);
137 TF1 *MakeThresholds(TGraph *input);
139 void CreateLikelihoodHistogram();
140 void CreateQAHistogram();
141 void CreatedEdxHistogram();
142 void CreateHistoTruncatedMean();
148 static const Double_t fgkElectronEff[kNElectronEffs]; // Electron efficiency bins
149 static const Int_t fgkNBinsCommon[kQuantitiesCommon]; // Number of bins for common quantities
150 static const Double_t fgkMinBinCommon[kQuantitiesCommon]; // Bin Limits for common quantities (lower limit)
151 static const Double_t fgkMaxBinCommon[kQuantitiesCommon]; // Bin Limits for common quantities (upper limit)
152 AliHFEpidTRD *fTRDpid; // HFE PID for TRD
153 AliHFEcollection *fHistos; // Histogram collection
155 // List for Histograms:
156 TList *fPionEfficiencies; //! List for Pion efficiencies
157 TList *fProtonEfficiencies; //! List for Proton efficiencies
158 TList *fKaonEfficiencies; //! List for Kaon efficiencies
160 TList *fThresholds; //! List for Threshold Graphs
162 Bool_t fShowMessage; // Display debug messages
164 ClassDef(AliHFEtrdPIDqa, 3) // QA class for TRD PID