1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
17 // Does electron selection based on dE/dx
18 // For more information please check the implementation file
20 #ifndef ALIHFEPIDTPC_H
21 #define ALIHFEPIDTPC_H
23 #ifndef ALIHFEPIDBASE_H
24 #include "AliHFEpidBase.h"
34 class AliAODMCParticle;
38 class AliHFEcollection;
39 class AliHFEpidQAmanager;
41 class AliHFEpidTPC : public AliHFEpidBase{
44 AliHFEpidTPC(const Char_t *name);
45 AliHFEpidTPC(const AliHFEpidTPC &ref);
46 AliHFEpidTPC &operator=(const AliHFEpidTPC &ref);
47 virtual ~AliHFEpidTPC();
49 virtual Bool_t InitializePID(Int_t /*run*/);
50 virtual Int_t IsSelected(const AliHFEpidObject *track, AliHFEpidQAmanager *pidqa) const;
52 void AddTPCdEdxLineCrossing(Int_t species, Double_t sigma);
53 Bool_t HasAsymmetricSigmaCut() const { return TestBit(kAsymmetricSigmaCut);}
54 Bool_t HasParticleRejection() const { return TestBit(kRejection); }
55 void SetTPCnSigma(Short_t nSigma) { fNsigmaTPC = nSigma; };
56 void SetUseOnlyOROC(Bool_t useOnlyOROC) { fUseOnlyOROC = useOnlyOROC; };
57 inline void SetAsymmetricTPCsigmaCut(Float_t pmin, Float_t pmax, Float_t sigmaMin, Float_t sigmaMax);
58 inline void SetRejectParticle(Int_t species, Float_t pmin, Float_t sigmaMin, Float_t pmax, Float_t sigmaMax);
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; }
64 void SetEtaCorrection(const TF1 *const param) { fkEtaCorrection = param; }
65 void SetCentralityCorrection(const TF1 *const param){ fkCentralityCorrection = param; }
66 void UsedEdx() { fUsedEdx = kTRUE; }
67 void UseNSigma() { fUsedEdx = kFALSE; }
68 Bool_t HasEtaCorrection() const { return fkEtaCorrection != NULL; }
69 Bool_t HasCentralityCorrection() const { return fkCentralityCorrection != NULL; }
70 Bool_t IsUsingdEdx() const { return fUsedEdx; }
72 Double_t GetP(const AliVParticle *track, AliHFEpidObject::AnalysisType_t anaType) const;
73 void ApplyEtaCorrection(AliVTrack *track, AliHFEpidObject::AnalysisType_t anatype) const;
74 void ApplyCentralityCorrection(AliVTrack *track, Double_t centralityEstimator, AliHFEpidObject::AnalysisType_t anatype) const;
75 void UseOROC(AliVTrack *track, AliHFEpidObject::AnalysisType_t anatype) const;
78 void Copy(TObject &o) const;
79 Int_t Reject(const AliVParticle *track, AliHFEpidObject::AnalysisType_t anaType) const;
81 Bool_t CutSigmaModel(const AliHFEpidObject *anaType) const;
85 kAsymmetricSigmaCut = BIT(20),
88 Double_t fLineCrossingSigma[AliPID::kSPECIES]; // with of the exclusion point
89 UChar_t fLineCrossingsEnabled; // Bitmap showing which line crossing is set
90 const TF1 *fkUpperSigmaCut[12]; // Upper Sigma Cut
91 const TF1 *fkLowerSigmaCut[12]; // Lower Sigma Cut
92 const TF1 *fkEtaCorrection; // Correction for the eta dependence
93 const TF1 *fkCentralityCorrection; // Correction for the centrality dependence
94 Bool_t fHasCutModel; // Has cut model functions
95 Bool_t fUseOnlyOROC; // Use only OROC
96 Float_t fPAsigCut[2]; // Momentum region where to perform asymmetric sigma cut
97 Float_t fNAsigmaTPC[2]; // Asymmetric TPC Sigma band
98 Short_t fNsigmaTPC; // TPC sigma band
99 Float_t fRejection[4*AliPID::kSPECIES]; // All informations for Particle Rejection, order pmin, sigmin, pmax, sigmax
100 UChar_t fRejectionEnabled; // Bitmap for enabled particle rejection
101 Bool_t fUsedEdx; // Apply cut on dE/dx instead of number of sigmas
103 ClassDef(AliHFEpidTPC, 1) // TPC Electron ID class
106 inline void AliHFEpidTPC::SetAsymmetricTPCsigmaCut(Float_t pmin, Float_t pmax, Float_t sigmaMin, Float_t sigmaMax) {
109 fNAsigmaTPC[0] = sigmaMin;
110 fNAsigmaTPC[1] = sigmaMax;
111 SetBit(kAsymmetricSigmaCut, kTRUE);
114 inline void AliHFEpidTPC::SetRejectParticle(Int_t species, Float_t pmin, Float_t sigmaMin, Float_t pmax, Float_t sigmaMax){
115 if(species < 0 || species >= AliPID::kSPECIES) return;
116 fRejection[4*species] = pmin;
117 fRejection[4*species+1] = sigmaMin;
118 fRejection[4*species+2] = pmax;
119 fRejection[4*species+3] = sigmaMax;
120 SETBIT(fRejectionEnabled, species);
121 SetBit(kRejection, kTRUE);