Skip to content

Commit

Permalink
New analysis tag /v5-03-36-AN
Browse files Browse the repository at this point in the history
  • Loading branch information
morsch committed Jul 3, 2012
2 parents 34a3b35 + 9f170ca commit 6a961c0
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions STEER/AOD/AliAODpidUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
//-------------------------------------------------------
#include <Rtypes.h>
#include <TMatrixD.h>
#include <AliLog.h>
#include "AliAODEvent.h" // Needed for inline functions
#include "AliAODTrack.h" // Needed for inline functions
#include "AliAODPid.h" // Needed for inline functions
Expand Down Expand Up @@ -47,23 +48,28 @@ class AliAODpidUtil : public AliPIDResponse {

inline Float_t AliAODpidUtil::NumberOfSigmasTOF(const AliVParticle *vtrack, AliPID::EParticleType type) const {
AliAODTrack *track=(AliAODTrack*)vtrack;
Bool_t oldAod=kTRUE;
Double_t sigTOF;
AliAODPid *pidObj = track->GetDetPid();
if (!pidObj) return -999.;
Double_t tofTime=pidObj->GetTOFsignal();
Double_t expTime=fTOFResponse.GetExpectedSignal((AliVTrack*)vtrack,type);
Double_t sigmaTOFPid[AliPID::kSPECIES];
pidObj->GetTOFpidResolution(sigmaTOFPid);
AliAODEvent *event=(AliAODEvent*)track->GetAODEvent();
if (event) { // protection
if (event) { // protection if the user didn't call GetTrack, which sets the internal pointer
AliTOFHeader* tofH=(AliTOFHeader*)event->GetTOFHeader();
if (tofH) { // new AOD
sigTOF=fTOFResponse.GetExpectedSigma(track->P(),expTime,AliPID::ParticleMassZ(type)); //fTOFResponse is set in InitialiseEvent
tofTime -= fTOFResponse.GetStartTime(vtrack->P());
if (tofH && (TMath::Abs(sigmaTOFPid[0]) <= 1.E-16) ) { // new AOD
sigTOF=fTOFResponse.GetExpectedSigma(track->P(),expTime,AliPID::ParticleMassZ(type)); //fTOFResponse is set in InitialiseEvent
tofTime -= fTOFResponse.GetStartTime(vtrack->P());
oldAod=kFALSE;
}
} else {
AliError("pointer to AliAODEvent not found, please call GetTrack to set it");
return -996.;
}
else { // old AOD
if (oldAod) { // old AOD
if (type <= AliPID::kProton) {
Double_t sigmaTOFPid[AliPID::kSPECIES];
pidObj->GetTOFpidResolution(sigmaTOFPid);
sigTOF=sigmaTOFPid[type];
} else return -998.; // light nuclei cannot be supported on old AOD because we don't have timeZero resolution
}
Expand Down

0 comments on commit 6a961c0

Please sign in to comment.