]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGHF/hfe/AliHFEpidTPC.h
changed output dir name
[u/mrichter/AliRoot.git] / PWGHF / 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 TF1;
33 class TH2D;
34 class AliAODTrack;
35 class AliAODMCParticle;
36 class AliESDtrack;
37 class AliMCParticle;
38 class AliVParticle;
39 class AliHFEcollection;
40 class AliHFEpidQAmanager;
41
42 class AliHFEpidTPC : public AliHFEpidBase{
43   public:
44     AliHFEpidTPC();
45     AliHFEpidTPC(const Char_t *name);
46     AliHFEpidTPC(const AliHFEpidTPC &ref);
47     AliHFEpidTPC &operator=(const AliHFEpidTPC &ref);
48     virtual ~AliHFEpidTPC();
49     
50     virtual Bool_t InitializePID(Int_t /*run*/);
51     virtual Int_t IsSelected(const AliHFEpidObject *track, AliHFEpidQAmanager *pidqa) const;
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 SetUseOnlyOROC(Bool_t useOnlyOROC) { fUseOnlyOROC = useOnlyOROC; };
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     void SetUpperSigmaCutDefault(const TF1 * const model) { fkUpperSigmaCut[0] = model; fHasCutModel = kTRUE; }
62     void SetUpperSigmaCutCentrality(const TF1 * const model, Int_t centralityBin) { if(centralityBin < 11) fkUpperSigmaCut[centralityBin+1] = model; fHasCutModel = kTRUE; }
63     void SetLowerSigmaCutDefault(const TF1 * const model) { fkLowerSigmaCut[0] = model; fHasCutModel = kTRUE; }
64     void SetLowerSigmaCutCentrality(const TF1 * const model, Int_t centralityBin) { if(centralityBin < 11) fkLowerSigmaCut[centralityBin+1] = model; fHasCutModel = kTRUE; }
65     void SetEtaCorrection(const TF1 *const param) { fkEtaCorrection = param; }
66     void SetCentralityCorrection(const TF1 *const param){ fkCentralityCorrection = param; }
67     void SetEtaCorrections(const TF1 *const mean, const TF1 *const wdth) { fkEtaMeanCorrection = mean; fkEtaWidthCorrection = wdth; }
68     void SetCentralityCorrections(const TF1 *const mean, const TF1 *const wdth) { fkCentralityMeanCorrection = mean; fkCentralityWidthCorrection = wdth; }
69     void SetJpsiCorrections(const TH2D *const mean, const TH2D *const wdth) { fkCentralityEtaCorrectionMeanJpsi = mean; fkCentralityEtaCorrectionWidthJpsi = wdth; }
70     void UsedEdx() { fUsedEdx = kTRUE; }
71     void UseNSigma() { fUsedEdx = kFALSE; }
72     Bool_t HasEtaCorrection() const { return fkEtaCorrection != NULL; }
73     Bool_t HasCentralityCorrection() const { return fkCentralityCorrection != NULL; } 
74     Bool_t IsUsingdEdx() const { return fUsedEdx; }
75
76     Double_t GetP(const AliVParticle *track, AliHFEpidObject::AnalysisType_t anaType) const;
77     void ApplyEtaCorrection(AliVTrack *track, AliHFEpidObject::AnalysisType_t anatype) const;
78     void ApplyCentralityCorrection(AliVTrack *track, Double_t centralityEstimator, AliHFEpidObject::AnalysisType_t anatype) const;
79     Double_t GetCorrectedTPCnSigma(Double_t eta, Double_t centralityEstimator, Double_t tpcNsigma) const;
80     Double_t GetCorrectedTPCnSigmaJpsi(Double_t eta, Double_t centralityEstimator, Double_t tpcNsigma) const;
81     void UseOROC(AliVTrack *track, AliHFEpidObject::AnalysisType_t anatype) const;
82
83   protected:
84     void Copy(TObject &o) const;
85     Int_t Reject(const AliVParticle *track, AliHFEpidObject::AnalysisType_t anaType) const;
86
87     Bool_t CutSigmaModel(const AliHFEpidObject *anaType) const;
88
89   private:
90     enum{
91       kAsymmetricSigmaCut = BIT(20),
92       kRejection = BIT(21)
93     };
94     Double_t fLineCrossingSigma[AliPID::kSPECIES];          // with of the exclusion point
95     UChar_t fLineCrossingsEnabled;                          // Bitmap showing which line crossing is set
96     const TF1 *fkUpperSigmaCut[12];                         // Upper Sigma Cut
97     const TF1 *fkLowerSigmaCut[12];                         // Lower Sigma Cut
98     const TF1 *fkEtaCorrection;                             // Correction for the eta dependence
99     const TF1 *fkCentralityCorrection;                      // Correction for the centrality dependence
100     const TF1 *fkEtaMeanCorrection;                         // Correct eta dependence of the mean of the TPC n sigma
101     const TF1 *fkEtaWidthCorrection;                        // Correct eta dependence of the width of the TPC n sigma
102     const TF1 *fkCentralityMeanCorrection;                  // Correct centrality dependence of the mean of the TPC n sigma
103     const TF1 *fkCentralityWidthCorrection;                 // Correct centrality dependence of the width of the TPC n sigma
104     const TH2D *fkCentralityEtaCorrectionMeanJpsi;          // Correction from J/psi group for the mean
105     const TH2D *fkCentralityEtaCorrectionWidthJpsi;         // Correction from J/psi group for the width
106     Bool_t fHasCutModel;                                    // Has cut model functions
107     Bool_t fUseOnlyOROC;                                    // Use only OROC
108     Float_t fPAsigCut[2];                                   // Momentum region where to perform asymmetric sigma cut
109     Float_t fNAsigmaTPC[2];                                 // Asymmetric TPC Sigma band        
110     Short_t fNsigmaTPC;                                     // TPC sigma band
111     Float_t fRejection[4*AliPID::kSPECIES];                 // All informations for Particle Rejection, order pmin, sigmin, pmax, sigmax
112     UChar_t fRejectionEnabled;                              // Bitmap for enabled particle rejection
113     Bool_t  fUsedEdx;                                       // Apply cut on dE/dx instead of number of sigmas
114
115   ClassDef(AliHFEpidTPC, 3)   // TPC Electron ID class
116 };
117
118 inline void AliHFEpidTPC::SetAsymmetricTPCsigmaCut(Float_t pmin, Float_t pmax, Float_t sigmaMin, Float_t sigmaMax) { 
119   fPAsigCut[0] = pmin; 
120   fPAsigCut[1] = pmax; 
121   fNAsigmaTPC[0] = sigmaMin; 
122   fNAsigmaTPC[1] = sigmaMax; 
123   SetBit(kAsymmetricSigmaCut, kTRUE);
124 }
125
126 inline void AliHFEpidTPC::SetRejectParticle(Int_t species, Float_t pmin, Float_t sigmaMin, Float_t pmax, Float_t sigmaMax){
127   if(species < 0 || species >= AliPID::kSPECIES) return;
128   fRejection[4*species]   = pmin;
129   fRejection[4*species+1] = sigmaMin;
130   fRejection[4*species+2] = pmax;
131   fRejection[4*species+3] = sigmaMax;
132   SETBIT(fRejectionEnabled, species);
133   SetBit(kRejection, kTRUE);
134 }
135  
136 #endif