]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/hfe/AliHFEtrdPIDqa.h
Major update of the HFE package (comments inside the code
[u/mrichter/AliRoot.git] / PWG3 / hfe / AliHFEtrdPIDqa.h
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 //
20 #ifndef ALIHFETRDPIDQA_H
21 #define ALIHFETRDPIDQA_H
22
23 #ifndef ROOT_TNamed
24 #include <TNamed.h>
25 #endif
26
27 #ifndef ROOT_THnSparse
28 #include <THnSparse.h>
29 #endif
30
31 class TCollection;
32 class TF1;
33 class TGraph;
34 class TH1;
35 class TList;
36 class TObjArray;
37
38 class AliAODTrack;
39 class AliESDtrack;
40 class AliVTrack;
41 class AliHFEpidTRD;
42
43 class AliHFEtrdPIDqa : public TNamed{
44   public:
45     AliHFEtrdPIDqa();
46     AliHFEtrdPIDqa(const Char_t *name);
47     AliHFEtrdPIDqa(const AliHFEtrdPIDqa &ref);
48     AliHFEtrdPIDqa &operator=(const AliHFEtrdPIDqa &ref);
49     virtual void Copy(TObject &o) const;
50     virtual Long64_t Merge(TCollection *coll);
51     virtual ~AliHFEtrdPIDqa();
52
53     void ProcessTracks(TObjArray * const  l, Int_t species);
54     void ProcessTrack(AliVTrack *track, Int_t species);
55
56     void Init();
57     void FinishAnalysis();
58     void StoreResults(const Char_t *filename = "HFEtrdPIDqa.root");
59     void SaveThresholdParameters(const Char_t * filename = "TRD.Thresholds.root");
60
61     void DrawTracklet(Int_t tracklet);
62     void ClearLists();
63
64     //---------------------------------------------------
65     // Getters for Histograms
66     THnSparseF *GetLikelihoodHistogram() const { return fLikeTRD; }
67     THnSparseF *GetQAHistogram() const { return fQAtrack; }
68     THnSparseF *GetdEdxHistogram() const { return fQAdEdx; }
69     THnSparseF *GetHistoTruncMean() const { return fTRDtruncMean; }
70     //---------------------------------------------------
71   protected:
72     // Description of the containers we use to store basic information
73     // we access in the Post Processing. For all containers we have a 
74     // common part containing species, momentum and number of tracklets,
75     // and a specific part. For both containers we define the number of 
76     // variables too
77     enum QuantitiesCommon_t{
78       kSpecies = 0,
79       kP = 1,
80       kNTracklets = 2,
81       kQuantitiesCommon = 3
82     };
83     enum QuantitiesLike_t{
84       kElectronLike = 3,
85       kQuantitiesLike = 4
86     };
87     enum QuantitiesQAtrack_t{
88       kNonZeroTrackletCharge = 3,
89       kNClusters = 4,
90       kQuantitiesQA = 5
91     };
92     enum QuantitiesdEdx_t{
93       kNclusters = 3,
94       kNonZeroSlices = 4,
95       kdEdx = 5,
96       kQuantitiesdEdx = 6
97     };
98     enum QuantitiesTruncMean_t{
99       kTPCdEdx = 3,
100       kTRDdEdxMethod1 = 4,
101       kTRDdEdxMethod2 = 5,
102       kQuantitiesTruncMean = 6
103     };
104
105     void ProcessTrackESD(AliESDtrack *track, Int_t species);
106     void ProcessTrackAOD(AliAODTrack * const track, Int_t species);
107
108     void FillTRDLikelihoods(AliESDtrack *track, Int_t species);
109     void FillTRDQAplots(AliESDtrack *track, Int_t species);
110
111     void AnalyseNTracklets(Int_t nTracklets);
112     Int_t GetThresholdBin(TH1 * const input, Double_t efficiency);
113     Bool_t CalculateEfficiency(TH1 * const input, Int_t threshbin, Double_t *params);
114     TF1 *MakeThresholds(TGraph *input);
115
116     void CreateLikelihoodHistogram();
117     void CreateQAHistogram();
118     void CreatedEdxHistogram();
119     void CreateHistoTruncatedMean();
120
121   private:
122     enum{
123       kNElectronEffs = 6
124     };
125     static const Double_t fgkElectronEff[kNElectronEffs];       // Electron efficiency bins
126     static const Int_t    fgkNBinsCommon[kQuantitiesCommon];    // Number of bins for common quantities
127     static const Double_t fgkMinBinCommon[kQuantitiesCommon];   // Bin Limits for common quantities (lower limit)
128     static const Double_t fgkMaxBinCommon[kQuantitiesCommon];   // Bin Limits for common quantities (upper limit)
129     AliHFEpidTRD *fTRDpid;        // HFE PID for TRD
130     THnSparseF *fLikeTRD;         // Histo for Likelihoods
131     THnSparseF *fQAtrack;         // QA histo for quantities based on track level
132     THnSparseF *fQAdEdx;          // QA for tracklet charge
133     THnSparseF *fTRDtruncMean;    // QA for truncated mean
134
135     // List for Histograms:
136     TList *fPionEfficiencies;     //! List for Pion efficiencies
137     TList *fProtonEfficiencies;   //! List for Proton efficiencies
138     TList *fKaonEfficiencies;     //! List for Kaon efficiencies
139
140     TList *fThresholds;           //! List for Threshold Graphs
141   
142   ClassDef(AliHFEtrdPIDqa, 2)     // QA class for TRD PID 
143 };
144 #endif
145