]>
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 | ||
58 | Double_t mom = track->P(); | |
59 | AliAODPid *pidObj = track->GetDetPid(); | |
60 | if (pidObj) | |
61 | mom = pidObj->GetTPCmomentum(); | |
62 | return fTPCResponse.GetNumberOfSigmas(mom,pidObj->GetTPCsignal(),0,type); | |
63 | } | |
64 | ||
1c2fc6e0 | 65 | inline Float_t AliAODpidUtil::NumberOfSigmasTOF(const AliAODTrack *track, AliPID::EParticleType type) const { |
1423bac9 | 66 | Double_t times[AliPID::kSPECIES]; |
67 | AliAODPid *pidObj = track->GetDetPid(); | |
68 | pidObj->GetIntegratedTimes(times); | |
1c2fc6e0 | 69 | return (pidObj->GetTOFsignal() - times[type])/fTOFResponse.GetExpectedSigma(track->P(),times[type],AliPID::ParticleMass(type)); |
1423bac9 | 70 | } |
71 | ||
72 | inline Float_t AliAODpidUtil::NumberOfSigmasITS(const AliAODTrack *track, AliPID::EParticleType type) const { | |
73 | AliAODPid *pidObj = track->GetDetPid(); | |
15e979c9 | 74 | Float_t dEdx=pidObj->GetITSsignal(); |
75 | UChar_t clumap=track->GetITSClusterMap(); | |
76 | Int_t nPointsForPid=0; | |
77 | for(Int_t i=2; i<6; i++){ | |
78 | if(clumap&(1<<i)) ++nPointsForPid; | |
79 | } | |
99daa709 | 80 | Float_t mom=track->P(); |
81 | Bool_t isSA=kTRUE; | |
82 | if(track->GetTPCNcls()>0) isSA=kFALSE; | |
83 | return fITSResponse.GetNumberOfSigmas(mom,dEdx,type,nPointsForPid,isSA); | |
1423bac9 | 84 | } |
85 | #endif | |
86 | ||
87 |