]>
Commit | Line | Data |
---|---|---|
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 | // Modified: Jens Wiechula, Uni Tuebingen, jens.wiechula@cern.ch | |
13 | // Modified: Pietro Antonioli, INFN BO, pietro.antonioli@bo.infn.it | |
14 | //------------------------------------------------------- | |
15 | #include <Rtypes.h> | |
16 | #include <TMatrixD.h> | |
17 | #include "AliAODEvent.h" // Needed for inline functions | |
18 | #include "AliAODTrack.h" // Needed for inline functions | |
19 | #include "AliAODPid.h" // Needed for inline functions | |
20 | #include "AliTOFHeader.h" //Needed for inline functions | |
21 | //#include "HMPID/AliHMPID.h" | |
22 | ||
23 | #include "AliPIDResponse.h" | |
24 | ||
25 | class AliAODEvent; | |
26 | class AliVParticle; | |
27 | ||
28 | class AliAODpidUtil : public AliPIDResponse { | |
29 | public: | |
30 | //TODO: isMC??? | |
31 | AliAODpidUtil(Bool_t isMC = kFALSE): AliPIDResponse(isMC) {;} | |
32 | virtual ~AliAODpidUtil() {;} | |
33 | ||
34 | Int_t MakePID(const AliAODTrack *track,Double_t *p) const; | |
35 | void MakeTPCPID(const AliAODTrack *track,Double_t *p) const; | |
36 | void MakeITSPID(const AliAODTrack *track,Double_t *p) const; | |
37 | void MakeTOFPID(const AliAODTrack *track,Double_t *p) const; | |
38 | // void MakeHMPIDPID(AliESDtrack *track); | |
39 | void MakeTRDPID(const AliAODTrack *track,Double_t *p) const; | |
40 | ||
41 | virtual Float_t NumberOfSigmasTOF(const AliVParticle *vtrack, AliPID::EParticleType type) const; | |
42 | ||
43 | private: | |
44 | ||
45 | ClassDef(AliAODpidUtil,3) // PID calculation class | |
46 | }; | |
47 | ||
48 | inline Float_t AliAODpidUtil::NumberOfSigmasTOF(const AliVParticle *vtrack, AliPID::EParticleType type) const { | |
49 | AliAODTrack *track=(AliAODTrack*)vtrack; | |
50 | Double_t sigTOF; | |
51 | AliAODPid *pidObj = track->GetDetPid(); | |
52 | if (!pidObj) return -999.; | |
53 | Double_t tofTime=pidObj->GetTOFsignal(); | |
54 | Double_t expTime=fTOFResponse.GetExpectedSignal((AliVTrack*)vtrack,type); | |
55 | AliAODEvent *event=(AliAODEvent*)track->GetAODEvent(); | |
56 | if (event) { // protection | |
57 | AliTOFHeader* tofH=(AliTOFHeader*)event->GetTOFHeader(); | |
58 | if (tofH) { // new AOD | |
59 | sigTOF=fTOFResponse.GetExpectedSigma(track->P(),expTime,AliPID::ParticleMassZ(type)); //fTOFResponse is set in InitialiseEvent | |
60 | tofTime -= fTOFResponse.GetStartTime(vtrack->P()); | |
61 | } | |
62 | } | |
63 | else { // old AOD | |
64 | if (type <= AliPID::kProton) { | |
65 | Double_t sigmaTOFPid[AliPID::kSPECIES]; | |
66 | pidObj->GetTOFpidResolution(sigmaTOFPid); | |
67 | sigTOF=sigmaTOFPid[type]; | |
68 | } else return -998.; // light nuclei cannot be supported on old AOD because we don't have timeZero resolution | |
69 | } | |
70 | if (sigTOF>0) return (tofTime - expTime)/sigTOF; | |
71 | else return -997.; | |
72 | } | |
73 | ||
74 | #endif | |
75 | ||
76 |