]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG3/dielectron/AliDielectronPID.h
Changes for background calculations for jet spectrum, setting of track filter bits...
[u/mrichter/AliRoot.git] / PWG3 / dielectron / AliDielectronPID.h
CommitLineData
8df8e382 1#ifndef ALIDIELECTRONPID_H
2#define ALIDIELECTRONPID_H
3
4/* Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7//#############################################################
8//# #
9//# Class AliDielectronPID #
10//# #
11//# Authors: #
12//# Anton Andronic, GSI / A.Andronic@gsi.de #
13//# Ionut C. Arsene, GSI / I.C.Arsene@gsi.de #
14//# Julian Book, Uni Ffm / Julian.Book@cern.ch #
15//# Frederick Kramer, Uni Ffm, / Frederick.Kramer@cern.ch #
16//# Magnus Mager, CERN / Magnus.Mager@cern.ch #
17//# WooJin J. Park, GSI / W.J.Park@gsi.de #
18//# Jens Wiechula, Uni HD / Jens.Wiechula@cern.ch #
19//# #
20//#############################################################
21
22#include <AliPID.h>
23#include <AliESDpid.h>
24#include <AliAODTrack.h>
25#include <AliAODPid.h>
26
27#include <AliAnalysisCuts.h>
28
29class TF1;
8df8e382 30class TList;
164bfb53 31class AliVTrack;
8df8e382 32
33class AliDielectronPID : public AliAnalysisCuts {
34public:
35 enum DetType {kITS, kTPC, kTRD, kTOF};
61d106d3 36 enum PIDbitTupe {kIgnore=0, kRequire, kIfAvailable};
8df8e382 37
38 AliDielectronPID();
39 AliDielectronPID(const char*name, const char* title);
40
41 virtual ~AliDielectronPID();
42
43 void AddCut(DetType det, AliPID::EParticleType type, Double_t nSigmaLow, Double_t nSigmaUp=-99999.,
61d106d3 44 Double_t pMin=0, Double_t pMax=0, Bool_t exclude=kFALSE, UInt_t pidBitType=AliDielectronPID::kRequire);
8df8e382 45
46 void AddCut(DetType det, AliPID::EParticleType type, Double_t nSigmaLow, TF1 * const funUp,
61d106d3 47 Double_t pMin=0, Double_t pMax=0, Bool_t exclude=kFALSE, UInt_t pidBitType=AliDielectronPID::kRequire);
8df8e382 48
49 void AddCut(DetType det, AliPID::EParticleType type, TF1 * const funLow, Double_t nSigmaUp,
61d106d3 50 Double_t pMin=0, Double_t pMax=0, Bool_t exclude=kFALSE, UInt_t pidBitType=AliDielectronPID::kRequire);
8df8e382 51
52 void AddCut(DetType det, AliPID::EParticleType type, TF1 * const funLow, TF1 * const funUp,
61d106d3 53 Double_t pMin=0, Double_t pMax=0, Bool_t exclude=kFALSE, UInt_t pidBitType=AliDielectronPID::kRequire);
8df8e382 54
55 void SetDefaults(Int_t def);
56
8df8e382 57 //
58 //Analysis cuts interface
59 //const
60 virtual Bool_t IsSelected(TObject* track);
61 virtual Bool_t IsSelected(TList* /* list */ ) {return kFALSE;}
62
63private:
64 enum {kNmaxPID=10};
65
66 DetType fDetType[kNmaxPID]; //detector type of nsigma cut
67 AliPID::EParticleType fPartType[kNmaxPID]; //particle type
68 Float_t fNsigmaLow[kNmaxPID]; //lower nsigma bound
69 Float_t fNsigmaUp[kNmaxPID]; //upper nsigma bound
70 Double_t fPmin[kNmaxPID]; //lower momentum
71 Double_t fPmax[kNmaxPID]; //upper momentum
72 Bool_t fExclude[kNmaxPID]; //use as exclusion band
73 TF1 *fFunUpperCut[kNmaxPID];//use function as upper cut
74 TF1 *fFunLowerCut[kNmaxPID];//use function as lower cut
75 UChar_t fNcuts; //number of cuts
61d106d3 76 UChar_t fRequirePIDbit[kNmaxPID]; //How to make use of the pid bit (see)
8df8e382 77
78 AliESDpid *fESDpid; //! esd pid object
79
80
164bfb53 81 Bool_t IsSelectedITS(AliVTrack * const part, Int_t icut) const;
82 Bool_t IsSelectedTPC(AliVTrack * const part, Int_t icut) const;
83 Bool_t IsSelectedTRD(AliVTrack * const part, Int_t icut) const;
84 Bool_t IsSelectedTOF(AliVTrack * const part, Int_t icut) const;
8df8e382 85
86 Float_t NumberOfSigmasITS(const AliAODTrack *track, AliPID::EParticleType type) const;
87 Float_t NumberOfSigmasTPC(const AliAODTrack *track, AliPID::EParticleType type) const;
88 Float_t NumberOfSigmasTOF(const AliAODTrack *track, AliPID::EParticleType type) const;
89
90 AliDielectronPID(const AliDielectronPID &c);
91 AliDielectronPID &operator=(const AliDielectronPID &c);
92
61d106d3 93 ClassDef(AliDielectronPID,2) // Dielectron PID
8df8e382 94};
95
96
97//
98// Inline functions for AOD as long as ther is no AOD pid object we have to fake it
99//
100
101inline Float_t AliDielectronPID::NumberOfSigmasITS(const AliAODTrack *track, AliPID::EParticleType type) const {
102 AliAODPid *pid=track->GetDetPid();
103 if (!pid) return -1000.;
104
105 return fESDpid->GetITSResponse().GetNumberOfSigmas(track->P(),pid->GetITSsignal(),type);
106}
107
108inline Float_t AliDielectronPID::NumberOfSigmasTPC(const AliAODTrack *track, AliPID::EParticleType type) const {
109 AliAODPid *pid=track->GetDetPid();
110 if (!pid) return -1000.;
111
112 Double_t mom = pid->GetTPCmomentum();
113 if (mom<0) mom=track->P();
114
115 //FIXME: rough estimate of the number of clusters used for PID. Needs to be fixed!!!
116 Int_t ncl=(Int_t)track->GetTPCClusterMap().CountBits();
117 return fESDpid->GetTPCResponse().GetNumberOfSigmas(mom,pid->GetTPCsignal(),ncl,type);
118}
119
120inline Float_t AliDielectronPID::NumberOfSigmasTOF(const AliAODTrack *track, AliPID::EParticleType type) const {
121 AliAODPid *pid=track->GetDetPid();
122 if (!pid) return -1000.;
123
124 Double_t times[AliPID::kSPECIES];
125 pid->GetIntegratedTimes(times);
126 Double_t tofRes = fESDpid->GetTOFResponse().GetExpectedSigma(track->P(),times[type],AliPID::ParticleMass(type));
127 return (pid->GetTOFsignal() - times[type])/ tofRes;
128}
129
130
131
132#endif