]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGHF/hfe/AliHFEpidTRD.h
Update of the hfe package
[u/mrichter/AliRoot.git] / PWGHF / hfe / AliHFEpidTRD.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 // TRD PID Class
17 // Does PID either on a x% electron efficiency basis or on dE/dx
18 // For more information please check the implementation file
19 //
20 #ifndef ALIHFEPIDTRD_H
21 #define ALIHFEPIDTRD_H
22
23  #ifndef ALIHFEPIDBASE_H
24  #include "AliHFEpidBase.h"
25  #endif
26
27 class AliAODTrack;
28 class AliAODMCParticle;
29 class AliESDtrack;
30 class AliHFEcollection;
31 class AliMCParticle;
32 class AliOADBContainer;
33 class AliVParticle;
34 class AliVTrack;
35 class TList;
36 class TH2F;
37
38 class AliHFEpidTRD : public AliHFEpidBase{
39   public:
40     typedef enum{
41       kLQ = 0,
42       kNN = 1
43     } PIDMethodTRD_t;
44     enum{
45       kThreshParams = 4
46     };
47     enum{
48       kHistTRDlikeBefore = 0,
49       kHistTRDlikeAfter = 1,
50       kHistTRDthresholds = 2,
51       kHistTRDSigV1 = 3,
52       kHistTRDSigV2 = 4,
53       kHistOverallSpecies = 5
54     };
55     AliHFEpidTRD();
56     AliHFEpidTRD(const Char_t *name);
57     AliHFEpidTRD(const AliHFEpidTRD &ref);
58     AliHFEpidTRD& operator=(const AliHFEpidTRD &ref);
59     virtual ~AliHFEpidTRD();
60
61     virtual Bool_t InitializePID(Int_t run);
62     virtual Int_t IsSelected(const AliHFEpidObject *track, AliHFEpidQAmanager *pidqa) const;
63
64     Double_t GetTRDSignalV1(const AliESDtrack *track, Float_t truncation = 0.7) const;
65     Double_t GetTRDSignalV2(const AliESDtrack *track, Float_t trucation = 0.7) const;
66
67     Bool_t IsCalculateTRDSignals() const { return TestBit(kTRDsignals); }
68     Bool_t IsRenormalizeElPi() const { return TestBit(kTRDrenormalize); }
69     void SelectCutOnTheFly(Bool_t onFly = kTRUE) { if(onFly) SetBit(kSelectCutOnTheFly, kTRUE); else SetBit(kSelectCutOnTheFly, kFALSE);}
70     void SetOADBThresholds(AliOADBContainer *cont) { fOADBThresholds = cont; }
71     void SetTotalChargeInSlice0() { fTotalChargeInSlice0 = kTRUE; }
72     void SetRenormalizeElPi(Bool_t doRenorm = kTRUE) { if(doRenorm) SetBit(kTRDrenormalize, kTRUE); else SetBit(kTRDrenormalize, kFALSE);}
73     void SetElectronEfficiency(Double_t electronEfficiency) { fElectronEfficiency = electronEfficiency; }
74     void SetNTracklets(Int_t nTracklets) { fNTracklets = nTracklets; }
75     void SetCutNTracklets(Int_t nTracklets, Bool_t exact = kTRUE) { 
76            fCutNTracklets = nTracklets;
77            if(exact) SetBit(kExactTrackletCut, kTRUE); 
78            else SetBit(kExactTrackletCut, kFALSE);
79     }
80     void SetMinP(Double_t p) { fMinP = p; }
81     void CalculateTRDSignals(Bool_t docalc) { SetBit(kTRDsignals, docalc); } 
82
83     Double_t GetElectronLikelihood(const AliVTrack *track, AliHFEpidObject::AnalysisType_t anaType) const;
84     Int_t    GetNTracklets() const { return fNTracklets; }
85     void     GetTRDmomenta(const AliVTrack *track, Double_t *mom) const;
86     Double_t GetP(const AliVParticle *track, AliHFEpidObject::AnalysisType_t anaType) const;
87     Double_t GetTRDthresholds(Double_t p) const;
88     Double_t GetTRDthresholds(Double_t p, UInt_t nTracklets) const;
89     Double_t GetChargeLayer(const AliVParticle *track, UInt_t layer, AliHFEpidObject::AnalysisType_t anatype) const;
90   protected:
91     enum{
92       kTRDsignals = BIT(16),
93       kThresholdsInitialized = BIT(17),
94       kTRDrenormalize = BIT(18),
95       kSelectCutOnTheFly = BIT(19),
96       kExactTrackletCut = BIT(20)
97     };
98     void Copy(TObject &ref) const;
99     Bool_t InitParamsFromOADB(Int_t run);
100     void RenormalizeElPi(const Double_t * const likein, Double_t * const likeout) const;
101
102   private:
103     AliOADBContainer *fOADBThresholds;                      // OADBContainer with thresholds
104     Double_t fMinP;                                         // Minimum momentum above which TRD PID is applied
105     Int_t    fNTracklets;                                   // Select cut for the number of tracklets
106     Int_t    fCutNTracklets;                                // Cut track based on the number of tracklets
107     Int_t    fRunNumber;                                    // Run number
108     Double_t fElectronEfficiency;                           // Cut on electron efficiency
109     Double_t fThreshParams[kThreshParams];                  // Threshold parametrisation
110     Bool_t fTotalChargeInSlice0;                            // Flag for foreward/backward compatibility for the TRD total charge
111   ClassDef(AliHFEpidTRD, 1)     // TRD electron ID class
112 };
113 #endif
114