]>
Commit | Line | Data |
---|---|---|
1423bac9 | 1 | #ifndef ALIAODPIDUTIL_H |
2 | #define ALIAODPIDUTIL_H | |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
6 | /* $Id: AliAODpidUtil.h 38493 2010-01-26 16:33:03Z hristov $ */ | |
7 | ||
8 | //------------------------------------------------------- | |
9 | // Combined PID class | |
10 | // for the AOD class | |
11 | // Origin: Rosa Romita, GSI, r.romita@gsi.de | |
12 | //------------------------------------------------------- | |
13 | #include <Rtypes.h> | |
14 | #include <TMatrixD.h> | |
15 | #include "AliAODTrack.h" // Needed for inline functions | |
16 | #include "AliAODPid.h" // Needed for inline functions | |
17 | #include "AliTPCPIDResponse.h" | |
18 | #include "AliITSPIDResponse.h" | |
19 | #include "AliTOFPIDResponse.h" | |
20 | #include "AliTRDPIDResponse.h" | |
21 | //#include "HMPID/AliHMPID.h" | |
22 | ||
23 | class AliAODEvent; | |
24 | ||
25 | class AliAODpidUtil { | |
26 | public: | |
30d69fa9 | 27 | AliAODpidUtil(): fRange(5.), fTPCResponse(), fITSResponse(), fTOFResponse(), fTRDResponse() {;} |
1423bac9 | 28 | virtual ~AliAODpidUtil() {;} |
29 | ||
30 | ||
1c2fc6e0 | 31 | Int_t MakePID(AliAODTrack *track,Double_t *p) const; |
1423bac9 | 32 | void MakeTPCPID(AliAODTrack *track,Double_t *p) const; |
33 | void MakeITSPID(AliAODTrack *track,Double_t *p) const; | |
1c2fc6e0 | 34 | void MakeTOFPID(AliAODTrack *track,Double_t *p) const; |
1423bac9 | 35 | // void MakeHMPIDPID(AliESDtrack *track); |
36 | void MakeTRDPID(AliAODTrack *track,Double_t *p) const; | |
37 | ||
38 | Float_t NumberOfSigmasTPC(const AliAODTrack *track, AliPID::EParticleType type) const; | |
1c2fc6e0 | 39 | Float_t NumberOfSigmasTOF(const AliAODTrack *track, AliPID::EParticleType type) const; |
1423bac9 | 40 | Float_t NumberOfSigmasITS(const AliAODTrack *track, AliPID::EParticleType type) const; |
41 | ||
42 | AliITSPIDResponse &GetITSResponse() {return fITSResponse;} | |
43 | AliTPCPIDResponse &GetTPCResponse() {return fTPCResponse;} | |
44 | AliTOFPIDResponse &GetTOFResponse() {return fTOFResponse;} | |
45 | ||
46 | private: | |
47 | Float_t fRange; // nSigma max in likelihood | |
48 | AliTPCPIDResponse fTPCResponse; | |
49 | AliITSPIDResponse fITSResponse; | |
50 | AliTOFPIDResponse fTOFResponse; | |
30d69fa9 | 51 | AliTRDPIDResponse fTRDResponse; |
1423bac9 | 52 | |
53 | ClassDef(AliAODpidUtil,1) // PID calculation class | |
54 | }; | |
55 | ||
56 | inline Float_t AliAODpidUtil::NumberOfSigmasTPC(const AliAODTrack *track, AliPID::EParticleType type) const { | |
57 | ||
bd4d5059 | 58 | UShort_t nTPCClus=track->GetTPCNcls(); |
1423bac9 | 59 | Double_t mom = track->P(); |
60 | AliAODPid *pidObj = track->GetDetPid(); | |
61 | if (pidObj) | |
62 | mom = pidObj->GetTPCmomentum(); | |
bd4d5059 | 63 | return fTPCResponse.GetNumberOfSigmas(mom,pidObj->GetTPCsignal(),nTPCClus,type); |
1423bac9 | 64 | } |
65 | ||
1c2fc6e0 | 66 | inline Float_t AliAODpidUtil::NumberOfSigmasTOF(const AliAODTrack *track, AliPID::EParticleType type) const { |
1423bac9 | 67 | Double_t times[AliPID::kSPECIES]; |
68 | AliAODPid *pidObj = track->GetDetPid(); | |
69 | pidObj->GetIntegratedTimes(times); | |
1c2fc6e0 | 70 | return (pidObj->GetTOFsignal() - times[type])/fTOFResponse.GetExpectedSigma(track->P(),times[type],AliPID::ParticleMass(type)); |
1423bac9 | 71 | } |
72 | ||
73 | inline Float_t AliAODpidUtil::NumberOfSigmasITS(const AliAODTrack *track, AliPID::EParticleType type) const { | |
74 | AliAODPid *pidObj = track->GetDetPid(); | |
15e979c9 | 75 | Float_t dEdx=pidObj->GetITSsignal(); |
76 | UChar_t clumap=track->GetITSClusterMap(); | |
77 | Int_t nPointsForPid=0; | |
78 | for(Int_t i=2; i<6; i++){ | |
79 | if(clumap&(1<<i)) ++nPointsForPid; | |
80 | } | |
99daa709 | 81 | Float_t mom=track->P(); |
82 | Bool_t isSA=kTRUE; | |
83 | if(track->GetTPCNcls()>0) isSA=kFALSE; | |
84 | return fITSResponse.GetNumberOfSigmas(mom,dEdx,type,nPointsForPid,isSA); | |
1423bac9 | 85 | } |
86 | #endif | |
87 | ||
88 |