In AddTaskPHOSPi0Flow.C set Cent. Bin past event buffers/lists,
[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
a864479b 16#include "AliMCEventHandler.h"
fca752cb 17
10d100d4 18//#include "HMPID/AliHMPID.h"
19//#include "TRD/AliTRDpidESD.h"
8c6a71ab 20
fca752cb 21#include "AliPIDResponse.h"
22
af885e0f 23class AliESDEvent;
fca752cb 24class AliVEvent;
25class AliVParticle;
8c6a71ab 26
fca752cb 27class AliESDpid : public AliPIDResponse {
8c6a71ab 28public:
a864479b 29 AliESDpid(Bool_t forMC=kFALSE): AliPIDResponse(forMC), fRangeTOFMismatch(5.), fEventHandler(NULL) {;}
30AliESDpid(const AliESDpid&a): AliPIDResponse(a), fRangeTOFMismatch(a.fRangeTOFMismatch), fEventHandler(NULL){;};
31 AliESDpid& operator=(const AliESDpid& a){AliPIDResponse::operator=(a); fRangeTOFMismatch=a.fRangeTOFMismatch; fEventHandler=NULL; return *this;};
44ce6bbe 32 virtual ~AliESDpid() {}
fca752cb 33
f858b00e 34 Int_t MakePID(AliESDEvent *event, Bool_t TPCOnly = kFALSE, Float_t timeZeroTOF=9999) const;
10d100d4 35 void MakeTPCPID(AliESDtrack *track) const;
36 void MakeITSPID(AliESDtrack *track) const;
f858b00e 37 void MakeTOFPID(AliESDtrack *track, Float_t /*timeZeroTOF*/) const;
38 Bool_t CheckTOFMatching(AliESDtrack *track) const;
10d100d4 39 // void MakeHMPIDPID(AliESDtrack *track);
b439f460 40 void MakeTRDPID(AliESDtrack *track) const;
10d100d4 41 void CombinePID(AliESDtrack *track) const;
fca752cb 42
43 virtual Float_t NumberOfSigmasTOF(const AliVParticle *vtrack, AliPID::EParticleType type, const Float_t timeZeroTOF) const;
44 virtual Float_t NumberOfSigmasTOF(const AliVParticle *vtrack, AliPID::EParticleType type) const {return NumberOfSigmasTOF(vtrack,type,0); }
45
7170298c 46 void SetNMaxSigmaTOFTPCMismatch(Float_t range) {fRangeTOFMismatch=range;}
47 Float_t GetNMaxSigmaTOFTPCMismatch() const {return fRangeTOFMismatch;}
48
539a5a59 49 Float_t GetTPCsignalTunedOnData(const AliVTrack *t) const;
50
a864479b 51 void SetEventHandler(AliVEventHandler *event){fEventHandler=event;};
52
8c6a71ab 53private:
10d100d4 54
a864479b 55 Float_t fRangeTOFMismatch; // nSigma max for TOF matching with TPC
56 AliVEventHandler *fEventHandler; //! MC event handler
57
58 ClassDef(AliESDpid,7) // PID calculation class
8c6a71ab 59};
60
10d100d4 61
fca752cb 62inline Float_t AliESDpid::NumberOfSigmasTOF(const AliVParticle *vtrack, AliPID::EParticleType type, const Float_t /*timeZeroTOF*/) const {
63 AliESDtrack *track=(AliESDtrack*)vtrack;
67376d1d 64 // Double_t times[AliPID::kSPECIES];
65 // track->GetIntegratedTimes(times);
66 Double_t expTime = fTOFResponse.GetExpectedSignal((AliVTrack*)vtrack,type);
67 // return (track->GetTOFsignal() - fTOFResponse.GetStartTime(track->GetP()) - times[type])/fTOFResponse.GetExpectedSigma(track->GetP(),times[type],AliPID::ParticleMass(type));
68 return (track->GetTOFsignal() - fTOFResponse.GetStartTime(track->GetP()) - expTime)/fTOFResponse.GetExpectedSigma(track->GetP(),expTime,AliPID::ParticleMassZ(type));
10d100d4 69}
70
8c6a71ab 71#endif
72
73