]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGHF/hfe/AliHFEpidTPC.h
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / PWGHF / hfe / AliHFEpidTPC.h
CommitLineData
809a4336 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**************************************************************************/
50685501 15//
16// Class for TPC PID
17// Does electron selection based on dE/dx
18// For more information please check the implementation file
19//
c2690925 20#ifndef ALIHFEPIDTPC_H
21#define ALIHFEPIDTPC_H
22
75d81601 23#ifndef ALIHFEPIDBASE_H
809a4336 24#include "AliHFEpidBase.h"
25#endif
26
27#ifndef ALIPID_H
28#include "AliPID.h"
29#endif
30
31class TList;
4437a0d2 32class TF1;
722347d8 33class AliAODTrack;
34class AliAODMCParticle;
809a4336 35class AliESDtrack;
722347d8 36class AliMCParticle;
809a4336 37class AliVParticle;
70da6c5a 38class AliHFEcollection;
3a72645a 39class AliHFEpidQAmanager;
809a4336 40
41class AliHFEpidTPC : public AliHFEpidBase{
809a4336 42 public:
3a72645a 43 AliHFEpidTPC();
809a4336 44 AliHFEpidTPC(const Char_t *name);
45 AliHFEpidTPC(const AliHFEpidTPC &ref);
46 AliHFEpidTPC &operator=(const AliHFEpidTPC &ref);
47 virtual ~AliHFEpidTPC();
48
8c1c76e9 49 virtual Bool_t InitializePID(Int_t /*run*/);
6555e2ad 50 virtual Int_t IsSelected(const AliHFEpidObject *track, AliHFEpidQAmanager *pidqa) const;
9bcfd1ab 51
75d81601 52 void AddTPCdEdxLineCrossing(Int_t species, Double_t sigma);
722347d8 53 Bool_t HasAsymmetricSigmaCut() const { return TestBit(kAsymmetricSigmaCut);}
0792aa82 54 Bool_t HasParticleRejection() const { return TestBit(kRejection); }
809a4336 55 void SetTPCnSigma(Short_t nSigma) { fNsigmaTPC = nSigma; };
cedf0381 56 void SetUseOnlyOROC(Bool_t useOnlyOROC) { fUseOnlyOROC = useOnlyOROC; };
722347d8 57 inline void SetAsymmetricTPCsigmaCut(Float_t pmin, Float_t pmax, Float_t sigmaMin, Float_t sigmaMax);
0792aa82 58 inline void SetRejectParticle(Int_t species, Float_t pmin, Float_t sigmaMin, Float_t pmax, Float_t sigmaMax);
809a4336 59
e156c3bb 60 void SetUpperSigmaCutDefault(const TF1 * const model) { fkUpperSigmaCut[0] = model; fHasCutModel = kTRUE; }
61 void SetUpperSigmaCutCentrality(const TF1 * const model, Int_t centralityBin) { if(centralityBin < 11) fkUpperSigmaCut[centralityBin+1] = model; fHasCutModel = kTRUE; }
62 void SetLowerSigmaCutDefault(const TF1 * const model) { fkLowerSigmaCut[0] = model; fHasCutModel = kTRUE; }
63 void SetLowerSigmaCutCentrality(const TF1 * const model, Int_t centralityBin) { if(centralityBin < 11) fkLowerSigmaCut[centralityBin+1] = model; fHasCutModel = kTRUE; }
11ff28c5 64 void SetEtaCorrection(const TF1 *const param) { fkEtaCorrection = param; }
959ea9d8 65 void SetCentralityCorrection(const TF1 *const param){ fkCentralityCorrection = param; }
38be5083 66 void SetEtaCorrections(const TF1 *const mean, const TF1 *const wdth) { fkEtaMeanCorrection = mean; fkEtaWidthCorrection = wdth; }
67 void SetCentralityCorrections(const TF1 *const mean, const TF1 *const wdth) { fkCentralityMeanCorrection = mean; fkCentralityWidthCorrection = wdth; }
4437a0d2 68 void UsedEdx() { fUsedEdx = kTRUE; }
69 void UseNSigma() { fUsedEdx = kFALSE; }
11ff28c5 70 Bool_t HasEtaCorrection() const { return fkEtaCorrection != NULL; }
959ea9d8 71 Bool_t HasCentralityCorrection() const { return fkCentralityCorrection != NULL; }
4437a0d2 72 Bool_t IsUsingdEdx() const { return fUsedEdx; }
faee3b18 73
6555e2ad 74 Double_t GetP(const AliVParticle *track, AliHFEpidObject::AnalysisType_t anaType) const;
11ff28c5 75 void ApplyEtaCorrection(AliVTrack *track, AliHFEpidObject::AnalysisType_t anatype) const;
959ea9d8 76 void ApplyCentralityCorrection(AliVTrack *track, Double_t centralityEstimator, AliHFEpidObject::AnalysisType_t anatype) const;
38be5083 77 Double_t GetCorrectedTPCnSigma(Double_t eta, Double_t centralityEstimator, Double_t tpcNsigma) const;
cedf0381 78 void UseOROC(AliVTrack *track, AliHFEpidObject::AnalysisType_t anatype) const;
6555e2ad 79
809a4336 80 protected:
81 void Copy(TObject &o) const;
6555e2ad 82 Int_t Reject(const AliVParticle *track, AliHFEpidObject::AnalysisType_t anaType) const;
722347d8 83
e156c3bb 84 Bool_t CutSigmaModel(const AliHFEpidObject *anaType) const;
faee3b18 85
809a4336 86 private:
50685501 87 enum{
88 kAsymmetricSigmaCut = BIT(20),
89 kRejection = BIT(21)
90 };
809a4336 91 Double_t fLineCrossingSigma[AliPID::kSPECIES]; // with of the exclusion point
92 UChar_t fLineCrossingsEnabled; // Bitmap showing which line crossing is set
e156c3bb 93 const TF1 *fkUpperSigmaCut[12]; // Upper Sigma Cut
94 const TF1 *fkLowerSigmaCut[12]; // Lower Sigma Cut
11ff28c5 95 const TF1 *fkEtaCorrection; // Correction for the eta dependence
959ea9d8 96 const TF1 *fkCentralityCorrection; // Correction for the centrality dependence
38be5083 97 const TF1 *fkEtaMeanCorrection; // Correct eta dependence of the mean of the TPC n sigma
98 const TF1 *fkEtaWidthCorrection; // Correct eta dependence of the width of the TPC n sigma
99 const TF1 *fkCentralityMeanCorrection; // Correct centrality dependence of the mean of the TPC n sigma
100 const TF1 *fkCentralityWidthCorrection; // Correct centrality dependence of the width of the TPC n sigma
e156c3bb 101 Bool_t fHasCutModel; // Has cut model functions
cedf0381 102 Bool_t fUseOnlyOROC; // Use only OROC
722347d8 103 Float_t fPAsigCut[2]; // Momentum region where to perform asymmetric sigma cut
104 Float_t fNAsigmaTPC[2]; // Asymmetric TPC Sigma band
809a4336 105 Short_t fNsigmaTPC; // TPC sigma band
0792aa82 106 Float_t fRejection[4*AliPID::kSPECIES]; // All informations for Particle Rejection, order pmin, sigmin, pmax, sigmax
107 UChar_t fRejectionEnabled; // Bitmap for enabled particle rejection
4437a0d2 108 Bool_t fUsedEdx; // Apply cut on dE/dx instead of number of sigmas
809a4336 109
38be5083 110 ClassDef(AliHFEpidTPC, 2) // TPC Electron ID class
809a4336 111};
722347d8 112
113inline void AliHFEpidTPC::SetAsymmetricTPCsigmaCut(Float_t pmin, Float_t pmax, Float_t sigmaMin, Float_t sigmaMax) {
114 fPAsigCut[0] = pmin;
115 fPAsigCut[1] = pmax;
116 fNAsigmaTPC[0] = sigmaMin;
117 fNAsigmaTPC[1] = sigmaMax;
118 SetBit(kAsymmetricSigmaCut, kTRUE);
119}
0792aa82 120
121inline void AliHFEpidTPC::SetRejectParticle(Int_t species, Float_t pmin, Float_t sigmaMin, Float_t pmax, Float_t sigmaMax){
122 if(species < 0 || species >= AliPID::kSPECIES) return;
123 fRejection[4*species] = pmin;
124 fRejection[4*species+1] = sigmaMin;
125 fRejection[4*species+2] = pmax;
126 fRejection[4*species+3] = sigmaMax;
127 SETBIT(fRejectionEnabled, species);
128 SetBit(kRejection, kTRUE);
129}
722347d8 130
809a4336 131#endif