]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/hfe/AliHFEpidTRD.h
Adding Id to PWG3 classes for better tracking of the coverity defect fixes (Ivana)
[u/mrichter/AliRoot.git] / PWG3 / hfe / AliHFEpidTRD.h
1 #ifndef ALIHFEPIDTRD_H
2 #define ALIHFEPIDTRD_H
3
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 **************************************************************************/
18
19 /* $Id$ */ 
20
21 //
22 // TRD PID Class
23 // Does PID either on a x% electron efficiency basis or on dE/dx
24 // For more information please check the implementation file
25 //
26  #ifndef ALIHFEPIDBASE_H
27  #include "AliHFEpidBase.h"
28  #endif
29
30 class AliAODTrack;
31 class AliAODMCParticle;
32 class AliESDtrack;
33 class AliHFEcollection;
34 class AliMCParticle;
35 class AliVParticle;
36 class TList;
37 class TH2F;
38
39 class AliHFEpidTRD : public AliHFEpidBase{
40   public:
41     typedef enum{
42       kLQ = 0,
43       kNN = 1
44     } PIDMethodTRD_t;
45     enum{
46       kThreshParams = 24
47     };
48     enum{
49       kHistTRDlikeBefore = 0,
50       kHistTRDlikeAfter = 1,
51       kHistTRDthresholds = 2,
52       kHistTRDSigV1 = 3,
53       kHistTRDSigV2 = 4,
54       kHistOverallSpecies = 5
55     };
56     AliHFEpidTRD();
57     AliHFEpidTRD(const Char_t *name);
58     AliHFEpidTRD(const AliHFEpidTRD &ref);
59     AliHFEpidTRD& operator=(const AliHFEpidTRD &ref);
60     virtual ~AliHFEpidTRD();
61
62     virtual Bool_t InitializePID();
63     virtual Int_t IsSelected(const AliHFEpidObject *track, AliHFEpidQAmanager *pidqa) const;
64
65     Double_t GetTRDSignalV1(const AliESDtrack *track, Float_t truncation = 0.7) const;
66     Double_t GetTRDSignalV2(const AliESDtrack *track, Float_t trucation = 0.7) const;
67
68     Bool_t IsCalculateTRDSignals() const { return TestBit(kTRDsignals); }
69     void SetPIDMethod(PIDMethodTRD_t method) { fPIDMethod = method; };
70     void SetElectronEfficiency(Double_t electronEfficiency) { fElectronEfficiency = electronEfficiency; }
71     void SetThresholdParameters(Double_t electronEff, Double_t *params);
72     void SetMinP(Double_t p) { fMinP = p; }
73     void CalculateTRDSignals(Bool_t docalc) { SetBit(kTRDsignals, docalc); } 
74
75     Double_t GetElectronLikelihood(const AliVParticle *track, AliHFEpidObject::AnalysisType_t anaType) const;
76     void     GetTRDmomenta(const AliVParticle *track, AliHFEpidObject::AnalysisType_t anaType, Double_t *mom) const;
77     Double_t GetP(const AliVParticle *track, AliHFEpidObject::AnalysisType_t anaType) const;
78     Double_t GetTRDthresholds(Double_t electronEff, Double_t p) const;
79     Double_t GetChargeLayer(const AliVParticle *track, UInt_t layer, AliHFEpidObject::AnalysisType_t anatype) const;
80   protected:
81     enum{
82       kTRDsignals = BIT(16),
83       kTRDdefaultThresholds = BIT(17)
84     };
85     void Copy(TObject &ref) const;
86     void InitParameters();
87     void InitParameters1DLQ();
88     void GetParameters(Double_t electronEff, Double_t *parameters) const;
89     void SetUseDefaultParameters(Bool_t useDefault = kTRUE) { SetBit(kTRDdefaultThresholds, useDefault); }
90     Bool_t UseDefaultParameters() const { return TestBit(kTRDdefaultThresholds); }
91
92   private:
93     static const Double_t fgkVerySmall;                       // Check for 0
94     Double_t fMinP;                                         // Minimum momentum above which TRD PID is applied
95     Double_t fElectronEfficiency;                           // Cut on electron efficiency
96     PIDMethodTRD_t fPIDMethod;                              // PID Method: 2D Likelihood or Neural Network
97     Double_t fThreshParams[kThreshParams];                  // Threshold parametrisation
98   ClassDef(AliHFEpidTRD, 1)     // TRD electron ID class
99 };
100
101 #endif