]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/hfe/AliHFEpidTPC.h
Updates in PID usage (Markus)
[u/mrichter/AliRoot.git] / PWG3 / hfe / AliHFEpidTPC.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 #ifndef ALIHFEPIDTPC_H
16 #define ALIHFEPIDTPC_H
17
18 #ifndef ALIHFEPIDBASE_H
19 #include "AliHFEpidBase.h"
20 #endif
21
22 #ifndef ALIPID_H
23 #include "AliPID.h"
24 #endif
25
26 class TList;
27 class AliAODTrack;
28 class AliAODMCParticle;
29 class AliESDtrack;
30 class AliMCParticle;
31 class AliTPCpidESD;
32 class AliVParticle;
33
34 class AliHFEpidTPC : public AliHFEpidBase{
35   typedef enum{
36     kHistTPCelectron = 0,
37     kHistTPCpion = 1,
38     kHistTPCmuon = 2,
39     kHistTPCkaon = 3,
40     kHistTPCproton = 4,
41     kHistTPCothers = 5,
42     kHistTPCall = 6,
43     kHistTPCselected = 7,
44     kHistTPCprobEl = 8,
45     kHistTPCprobPi = 9,
46     kHistTPCprobMu = 10,
47     kHistTPCprobKa = 11,
48     kHistTPCprobPro = 12,
49     kHistTPCprobOth = 13,
50     kHistTPCprobAll = 14,
51     kHistTPCsuppressPi = 15,
52     kHistTPCsuppressMu = 16,
53     kHistTPCsuppressKa = 17,
54     kHistTPCsuppressPro = 18,
55     kHistTPCenhanceElPi = 19,
56     kHistTPCenhanceElMu = 20,
57     kHistTPCenhanceElKa = 21,
58     kHistTPCenhanceElPro = 22,
59     kHistTPCElprobPi = 23,
60     kHistTPCElprobMu = 24,
61     kHistTPCElprobKa = 25,
62     kHistTPCElprobPro = 26
63   } QAHist_t;
64   enum{
65     kAsymmetricSigmaCut = BIT(20),
66     kRejection = BIT(21)
67   };
68   public:
69     AliHFEpidTPC(const Char_t *name);
70     AliHFEpidTPC(const AliHFEpidTPC &ref);
71     AliHFEpidTPC &operator=(const AliHFEpidTPC &ref);
72     virtual ~AliHFEpidTPC();
73     
74     virtual Bool_t InitializePID();
75     virtual Int_t IsSelected(AliHFEpidObject *track);
76     virtual Bool_t HasQAhistos() const { return kTRUE; };
77
78     void AddTPCdEdxLineCrossing(Int_t species, Double_t sigma);
79     Bool_t HasAsymmetricSigmaCut() const { return TestBit(kAsymmetricSigmaCut);}
80     Bool_t HasParticleRejection() const { return TestBit(kRejection); }
81     void SetTPCnSigma(Short_t nSigma) { fNsigmaTPC = nSigma; };
82     inline void SetAsymmetricTPCsigmaCut(Float_t pmin, Float_t pmax, Float_t sigmaMin, Float_t sigmaMax);
83     inline void SetRejectParticle(Int_t species, Float_t pmin, Float_t sigmaMin, Float_t pmax, Float_t sigmaMax);
84
85   protected:
86     void Copy(TObject &o) const;
87     void AddQAhistograms(TList *qaList);
88     void FillTPChistograms(const AliESDtrack *track, const AliMCParticle *mctrack);
89     Int_t MakePIDaod(AliAODTrack *aodTrack, AliAODMCParticle *mcTrack);
90     Int_t MakePIDesd(AliESDtrack *esdTrack, AliMCParticle *mcTrack);
91     Int_t Reject(AliESDtrack *track);
92     Double_t Likelihood(const AliESDtrack *track, Int_t species, Float_t rsig = 2.);
93     Double_t Suppression(const AliESDtrack *track, Int_t species);
94
95   private:
96     Double_t fLineCrossingSigma[AliPID::kSPECIES];          // with of the exclusion point
97     UChar_t fLineCrossingsEnabled;                          // Bitmap showing which line crossing is set
98     Float_t fPAsigCut[2];                                   // Momentum region where to perform asymmetric sigma cut
99     Float_t fNAsigmaTPC[2];                                 // Asymmetric TPC Sigma band        
100     Short_t fNsigmaTPC;                                     // TPC sigma band
101     Float_t fRejection[4*AliPID::kSPECIES];                 // All informations for Particle Rejection, order pmin, sigmin, pmax, sigmax
102     UChar_t fRejectionEnabled;                              // Bitmap for enabled particle rejection
103     AliPID *fPID;                                           //! PID Object
104     AliTPCpidESD *fPIDtpcESD;                               //! TPC PID object
105     TList *fQAList;                                         //! QA histograms
106
107   ClassDef(AliHFEpidTPC, 1)   // TPC Electron ID class
108 };
109
110 inline void AliHFEpidTPC::SetAsymmetricTPCsigmaCut(Float_t pmin, Float_t pmax, Float_t sigmaMin, Float_t sigmaMax) { 
111   fPAsigCut[0] = pmin; 
112   fPAsigCut[1] = pmax; 
113   fNAsigmaTPC[0] = sigmaMin; 
114   fNAsigmaTPC[1] = sigmaMax; 
115   SetBit(kAsymmetricSigmaCut, kTRUE);
116 }
117
118 inline void AliHFEpidTPC::SetRejectParticle(Int_t species, Float_t pmin, Float_t sigmaMin, Float_t pmax, Float_t sigmaMax){
119   if(species < 0 || species >= AliPID::kSPECIES) return;
120   fRejection[4*species]   = pmin;
121   fRejection[4*species+1] = sigmaMin;
122   fRejection[4*species+2] = pmax;
123   fRejection[4*species+3] = sigmaMax;
124   SETBIT(fRejectionEnabled, species);
125   SetBit(kRejection, kTRUE);
126 }
127  
128 #endif