]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGDQ/dielectron/AliDielectronTRDpidCut.h
including switch to set on/off iso-track core removal, cleaning and bug fix
[u/mrichter/AliRoot.git] / PWGDQ / dielectron / AliDielectronTRDpidCut.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 Cut 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 ALIDIELECTRONTRDPIDCUT_H
21 #define ALIDIELECTRONTRDPIDCUT_H
22
23 #include <AliAnalysisCuts.h>
24
25 class AliESDtrack;
26 class AliVParticle;
27
28 class AliDielectronTRDpidCut : public AliAnalysisCuts{
29 public:
30   typedef enum{
31     kLQ = 0,
32     kNN = 1
33   } PIDMethodTRD_t;
34   enum{
35     kThreshParams = 24
36   };
37   enum{
38     kHistTRDlikeBefore = 0,
39     kHistTRDlikeAfter = 1,
40     kHistTRDthresholds = 2,
41     kHistTRDSigV1 = 3,
42     kHistTRDSigV2 = 4,
43     kHistOverallSpecies = 5
44   };
45   enum PIDbitType {kIgnore=0, kRequire, kIfAvailable};
46   AliDielectronTRDpidCut();
47   AliDielectronTRDpidCut(const Char_t *name);
48   AliDielectronTRDpidCut(const AliDielectronTRDpidCut &ref);
49   AliDielectronTRDpidCut& operator=(const AliDielectronTRDpidCut &ref);
50   virtual ~AliDielectronTRDpidCut();
51
52   virtual Bool_t InitializePID();
53
54   Double_t GetTRDSignalV1(const AliESDtrack *track, Float_t truncation = 0.7) const;
55   Double_t GetTRDSignalV2(const AliESDtrack *track, Float_t trucation = 0.7) const;
56
57   Bool_t IsCalculateTRDSignals() const { return TestBit(kTRDsignals); }
58   Bool_t IsRenormalizeElPi() const { return TestBit(kTRDrenormalize); }
59   void SetPIDBitType(UInt_t pidBitType=AliDielectronTRDpidCut::kRequire) { fRequirePIDbit = pidBitType; };
60   void SetPIDMethod(PIDMethodTRD_t method) { fPIDMethod = method; };
61   void SetRenormalizeElPi(Bool_t doRenorm = kTRUE) { if(doRenorm) SetBit(kTRDrenormalize, kTRUE); else SetBit(kTRDrenormalize, kFALSE);}
62   void SetElectronEfficiency(Double_t electronEfficiency) { fElectronEfficiency = electronEfficiency; }
63   void SetThresholdParameters(Double_t electronEff, Double_t *params);
64   void SetMinP(Double_t p) { fMinP = p; }
65   void CalculateTRDSignals(Bool_t docalc) { SetBit(kTRDsignals, docalc); }
66
67   Double_t GetElectronLikelihood(const AliVParticle *track) const;
68   void     GetTRDmomenta(const AliVParticle *track, Double_t *mom) const;
69   Double_t GetP(const AliVParticle *track) const;
70   Double_t GetTRDthresholds(Double_t electronEff, Double_t p) const;
71   Double_t GetChargeLayer(const AliVParticle *track, UInt_t layer) const;
72
73   //
74   //Analysis cuts interface
75   //
76   virtual Bool_t IsSelected(TObject* track);
77   virtual Bool_t IsSelected(TList*   /* list */ ) {return kFALSE;}
78   
79 protected:
80   enum{
81     kTRDsignals = BIT(16),
82     kTRDdefaultThresholds = BIT(17),
83     kTRDrenormalize = BIT(18)
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   void RenormalizeElPi(const Double_t *likein, Double_t *likeout) const;
92
93 private:
94   static const Double_t fgkVerySmall;                     // Check for 0
95   Double_t fMinP;                                         // Minimum momentum above which TRD PID is applied
96   Double_t fElectronEfficiency;                           // Cut on electron efficiency
97   PIDMethodTRD_t fPIDMethod;                              // PID Method: 2D Likelihood or Neural Network
98   UChar_t  fRequirePIDbit;                                //How to make use of the pid bit (see)
99   Double_t fThreshParams[kThreshParams];                  // Threshold parametrisation
100   ClassDef(AliDielectronTRDpidCut, 1)     // TRD electron ID class
101 };
102
103 #endif