]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG3/hfe/AliHFEpidTPC.h
Added default pass=2 value to AddTaskCentrality.C. Fatal error if the pass is not...
[u/mrichter/AliRoot.git] / PWG3 / hfe / AliHFEpidTPC.h
1 #ifndef ALIHFEPIDTPC_H
2 #define ALIHFEPIDTPC_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 // Class for TPC PID
23 // Does electron selection based 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 #ifndef ALIPID_H
31 #include "AliPID.h"
32 #endif
33
34 class TList;
35 class AliAODTrack;
36 class AliAODMCParticle;
37 class AliESDtrack;
38 class AliMCParticle;
39 class AliVParticle;
40 class AliHFEcollection;
41 class AliHFEpidQAmanager;
42
43 class AliHFEpidTPC : public AliHFEpidBase{
44   public:
45     AliHFEpidTPC();
46     AliHFEpidTPC(const Char_t *name);
47     AliHFEpidTPC(const AliHFEpidTPC &ref);
48     AliHFEpidTPC &operator=(const AliHFEpidTPC &ref);
49     virtual ~AliHFEpidTPC();
50     
51     virtual Bool_t InitializePID();
52     virtual Int_t IsSelected(const AliHFEpidObject *track, AliHFEpidQAmanager *pidqa) const;
53
54     void AddTPCdEdxLineCrossing(Int_t species, Double_t sigma);
55     Bool_t HasAsymmetricSigmaCut() const { return TestBit(kAsymmetricSigmaCut);}
56     Bool_t HasParticleRejection() const { return TestBit(kRejection); }
57     void SetElectronMeanCorrection(TF1 *electronLineCorrection) { fElectronMeanCorrection = electronLineCorrection; }
58     void SetTPCnSigma(Short_t nSigma) { fNsigmaTPC = nSigma; };
59     inline void SetAsymmetricTPCsigmaCut(Float_t pmin, Float_t pmax, Float_t sigmaMin, Float_t sigmaMax);
60     inline void SetRejectParticle(Int_t species, Float_t pmin, Float_t sigmaMin, Float_t pmax, Float_t sigmaMax);
61
62     void SetUpperSigmaCut(TF1 * const model) { fUpperSigmaCut = model; }
63     void SetLowerSigmaCut(TF1 * const model) { fLowerSigmaCut = model; }
64
65     Double_t NumberOfSigmas(const AliVParticle *track, AliPID::EParticleType species, AliHFEpidObject::AnalysisType_t) const;
66     Double_t GetP(const AliVParticle *track, AliHFEpidObject::AnalysisType_t anaType) const;
67
68   protected:
69     void Copy(TObject &o) const;
70     Int_t Reject(const AliVParticle *track, AliHFEpidObject::AnalysisType_t anaType) const;
71
72     Bool_t CutSigmaModel(const AliVParticle *track, AliHFEpidObject::AnalysisType_t anaType) const;
73
74   private:
75     enum{
76       kAsymmetricSigmaCut = BIT(20),
77       kRejection = BIT(21)
78     };
79     Double_t fLineCrossingSigma[AliPID::kSPECIES];          // with of the exclusion point
80     UChar_t fLineCrossingsEnabled;                          // Bitmap showing which line crossing is set
81     TF1 *fUpperSigmaCut;                                    // Upper Sigma Cut
82     TF1 *fLowerSigmaCut;                                    // Lower Sigma Cut
83     TF1 *fElectronMeanCorrection;                           // Correct the mean of the electron line position as function  of the momentum
84     Float_t fPAsigCut[2];                                   // Momentum region where to perform asymmetric sigma cut
85     Float_t fNAsigmaTPC[2];                                 // Asymmetric TPC Sigma band        
86     Short_t fNsigmaTPC;                                     // TPC sigma band
87     Float_t fRejection[4*AliPID::kSPECIES];                 // All informations for Particle Rejection, order pmin, sigmin, pmax, sigmax
88     UChar_t fRejectionEnabled;                              // Bitmap for enabled particle rejection
89     AliPID *fPID;                                           //! PID Object
90
91   ClassDef(AliHFEpidTPC, 1)   // TPC Electron ID class
92 };
93
94 inline void AliHFEpidTPC::SetAsymmetricTPCsigmaCut(Float_t pmin, Float_t pmax, Float_t sigmaMin, Float_t sigmaMax) { 
95   fPAsigCut[0] = pmin; 
96   fPAsigCut[1] = pmax; 
97   fNAsigmaTPC[0] = sigmaMin; 
98   fNAsigmaTPC[1] = sigmaMax; 
99   SetBit(kAsymmetricSigmaCut, kTRUE);
100 }
101
102 inline void AliHFEpidTPC::SetRejectParticle(Int_t species, Float_t pmin, Float_t sigmaMin, Float_t pmax, Float_t sigmaMax){
103   if(species < 0 || species >= AliPID::kSPECIES) return;
104   fRejection[4*species]   = pmin;
105   fRejection[4*species+1] = sigmaMin;
106   fRejection[4*species+2] = pmax;
107   fRejection[4*species+3] = sigmaMax;
108   SETBIT(fRejectionEnabled, species);
109   SetBit(kRejection, kTRUE);
110 }
111  
112 #endif