]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/hfe/AliHFEpidTPC.h
d0c3307b085940df264f555273a9650ae0af10a8
[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 //
16 // Class for TPC PID
17 // Does electron selection based on dE/dx
18 // For more information please check the implementation file
19 //
20 #ifndef ALIHFEPIDTPC_H
21 #define ALIHFEPIDTPC_H
22
23 #ifndef ALIHFEPIDBASE_H
24 #include "AliHFEpidBase.h"
25 #endif
26
27 #ifndef ALIPID_H
28 #include "AliPID.h"
29 #endif
30
31 class TList;
32 class AliAODTrack;
33 class AliAODMCParticle;
34 class AliESDtrack;
35 class AliMCParticle;
36 class AliESDpid;
37 class AliVParticle;
38 class AliHFEcollection;
39
40 class AliHFEpidTPC : public AliHFEpidBase{
41   public:
42     AliHFEpidTPC(const Char_t *name);
43     AliHFEpidTPC(const AliHFEpidTPC &ref);
44     AliHFEpidTPC &operator=(const AliHFEpidTPC &ref);
45     virtual ~AliHFEpidTPC();
46     
47     virtual Bool_t InitializePID();
48     virtual Int_t IsSelected(AliHFEpidObject *track);
49     virtual Bool_t HasQAhistos() const { return kTRUE; };
50
51     Int_t GetCrossingType() const {return fLineCrossingType; }
52
53     void AddTPCdEdxLineCrossing(Int_t species, Double_t sigma);
54     Bool_t HasAsymmetricSigmaCut() const { return TestBit(kAsymmetricSigmaCut);}
55     Bool_t HasParticleRejection() const { return TestBit(kRejection); }
56     void SetTPCnSigma(Short_t nSigma) { fNsigmaTPC = nSigma; };
57     void SetBetheBlochParameters(Double_t *pars);
58     inline void SetAsymmetricTPCsigmaCut(Float_t pmin, Float_t pmax, Float_t sigmaMin, Float_t sigmaMax);
59     inline void SetRejectParticle(Int_t species, Float_t pmin, Float_t sigmaMin, Float_t pmax, Float_t sigmaMax);
60
61   protected:
62     void Copy(TObject &o) const;
63     void AddQAhistograms(TList *qaList);
64     void FillTPChistograms(const AliESDtrack *track, const AliMCParticle *mctrack);
65     Int_t MakePIDaod(AliAODTrack *aodTrack, AliAODMCParticle *mcTrack);
66     Int_t MakePIDesd(AliESDtrack *esdTrack, AliMCParticle *mcTrack);
67     Int_t Reject(AliESDtrack *track);
68     Double_t Likelihood(const AliESDtrack *track, Int_t species, Float_t rsig = 2.);
69     Double_t Suppression(const AliESDtrack *track, Int_t species);
70
71   private:
72     enum{
73       kAsymmetricSigmaCut = BIT(20),
74       kRejection = BIT(21)
75     };
76     Double_t fLineCrossingSigma[AliPID::kSPECIES];          // with of the exclusion point
77     Int_t    fLineCrossingType;                             // 0 for no line crossing, otherwise AliPID of the particle crossing the electron dEdx band
78     UChar_t fLineCrossingsEnabled;                          // Bitmap showing which line crossing is set
79     Float_t fPAsigCut[2];                                   // Momentum region where to perform asymmetric sigma cut
80     Float_t fNAsigmaTPC[2];                                 // Asymmetric TPC Sigma band        
81     Short_t fNsigmaTPC;                                     // TPC sigma band
82     Float_t fRejection[4*AliPID::kSPECIES];                 // All informations for Particle Rejection, order pmin, sigmin, pmax, sigmax
83     UChar_t fRejectionEnabled;                              // Bitmap for enabled particle rejection
84     AliPID *fPID;                                           //! PID Object
85     AliESDpid *fESDpid;                                     //! TPC PID object
86     AliHFEcollection *fQAList;                              //! QA histograms
87
88   ClassDef(AliHFEpidTPC, 1)   // TPC Electron ID class
89 };
90
91 inline void AliHFEpidTPC::SetAsymmetricTPCsigmaCut(Float_t pmin, Float_t pmax, Float_t sigmaMin, Float_t sigmaMax) { 
92   fPAsigCut[0] = pmin; 
93   fPAsigCut[1] = pmax; 
94   fNAsigmaTPC[0] = sigmaMin; 
95   fNAsigmaTPC[1] = sigmaMax; 
96   SetBit(kAsymmetricSigmaCut, kTRUE);
97 }
98
99 inline void AliHFEpidTPC::SetRejectParticle(Int_t species, Float_t pmin, Float_t sigmaMin, Float_t pmax, Float_t sigmaMax){
100   if(species < 0 || species >= AliPID::kSPECIES) return;
101   fRejection[4*species]   = pmin;
102   fRejection[4*species+1] = sigmaMin;
103   fRejection[4*species+2] = pmax;
104   fRejection[4*species+3] = sigmaMax;
105   SETBIT(fRejectionEnabled, species);
106   SetBit(kRejection, kTRUE);
107 }
108  
109 #endif