Changes for #95543: request to commit to trunk: TOF code supporting PID for light...
[u/mrichter/AliRoot.git] / STEER / ESD / AliESDpid.h
CommitLineData
8c6a71ab 1#ifndef ALIESDPID_H
2#define ALIESDPID_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
4f679a16 6/* $Id$ */
7
8c6a71ab 8//-------------------------------------------------------
9// Combined PID class
4f679a16 10// for the Event Summary Data class
8c6a71ab 11// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
fca752cb 12// Modified: Jens Wiechula, Uni Tuebingen, jens.wiechula@cern.ch
8c6a71ab 13//-------------------------------------------------------
14#include <Rtypes.h>
10d100d4 15#include "AliESDtrack.h" // Needed for inline functions
fca752cb 16
10d100d4 17//#include "HMPID/AliHMPID.h"
18//#include "TRD/AliTRDpidESD.h"
8c6a71ab 19
fca752cb 20#include "AliPIDResponse.h"
21
af885e0f 22class AliESDEvent;
fca752cb 23class AliVEvent;
24class AliVParticle;
8c6a71ab 25
fca752cb 26class AliESDpid : public AliPIDResponse {
8c6a71ab 27public:
fd21ec8d 28 AliESDpid(Bool_t forMC=kFALSE): AliPIDResponse(forMC), fRangeTOFMismatch(5.) {;}
44ce6bbe 29 virtual ~AliESDpid() {}
fca752cb 30
f858b00e 31 Int_t MakePID(AliESDEvent *event, Bool_t TPCOnly = kFALSE, Float_t timeZeroTOF=9999) const;
10d100d4 32 void MakeTPCPID(AliESDtrack *track) const;
33 void MakeITSPID(AliESDtrack *track) const;
f858b00e 34 void MakeTOFPID(AliESDtrack *track, Float_t /*timeZeroTOF*/) const;
35 Bool_t CheckTOFMatching(AliESDtrack *track) const;
10d100d4 36 // void MakeHMPIDPID(AliESDtrack *track);
b439f460 37 void MakeTRDPID(AliESDtrack *track) const;
10d100d4 38 void CombinePID(AliESDtrack *track) const;
fca752cb 39
40 virtual Float_t NumberOfSigmasTOF(const AliVParticle *vtrack, AliPID::EParticleType type, const Float_t timeZeroTOF) const;
41 virtual Float_t NumberOfSigmasTOF(const AliVParticle *vtrack, AliPID::EParticleType type) const {return NumberOfSigmasTOF(vtrack,type,0); }
42
7170298c 43 void SetNMaxSigmaTOFTPCMismatch(Float_t range) {fRangeTOFMismatch=range;}
44 Float_t GetNMaxSigmaTOFTPCMismatch() const {return fRangeTOFMismatch;}
45
8c6a71ab 46private:
7170298c 47 Float_t fRangeTOFMismatch; // nSigma max for TOF matching with TPC
10d100d4 48
29d9710e 49 ClassDef(AliESDpid,6) // PID calculation class
8c6a71ab 50};
51
10d100d4 52
fca752cb 53inline Float_t AliESDpid::NumberOfSigmasTOF(const AliVParticle *vtrack, AliPID::EParticleType type, const Float_t /*timeZeroTOF*/) const {
54 AliESDtrack *track=(AliESDtrack*)vtrack;
67376d1d 55 // Double_t times[AliPID::kSPECIES];
56 // track->GetIntegratedTimes(times);
57 Double_t expTime = fTOFResponse.GetExpectedSignal((AliVTrack*)vtrack,type);
58 // return (track->GetTOFsignal() - fTOFResponse.GetStartTime(track->GetP()) - times[type])/fTOFResponse.GetExpectedSigma(track->GetP(),times[type],AliPID::ParticleMass(type));
59 return (track->GetTOFsignal() - fTOFResponse.GetStartTime(track->GetP()) - expTime)/fTOFResponse.GetExpectedSigma(track->GetP(),expTime,AliPID::ParticleMassZ(type));
10d100d4 60}
61
8c6a71ab 62#endif
63
64