message: Added AliTrackRef check to AliAnalysisPIDTrack (not sure why the latest MC does not contain it?)
diff: @@ -382,17 +382,6 @@ AliAnalysisPIDTrack::Update(AliESDtrack *track, AliMCEvent *mcevent, AliPIDRespo
  fTOFDeltaZ = track->GetTOFsignalDz();
  track->GetTOFLabel(fTOFLabel);
  fTrackCutFlag = TrackCutFlag;
  - //fHMPIDmomentum = track->GetOuterHmpParam() ? track->GetOuterHmpParam()->P() : 0.;
  - /* HMPID signal with cuts */
  - /*Float_t xPc=0., yPc=0., xMip=0., yMip=0., thetaTrk=0., phiTrk=0.;
  - Int_t nPhot=0, qMip=0;
  - track->GetHMPIDtrk(xPc,yPc,thetaTrk,phiTrk);
  - track->GetHMPIDmip(xMip,yMip,qMip,nPhot);
  - Float_t dist = TMath::Sqrt((xPc-xMip)*(xPc-xMip) + (yPc-yMip)*(yPc-yMip));
  - if (dist < 0.7 && nPhot < 30 && qMip > 100)
  - fHMPIDsignal = track->GetHMPIDsignal();
  - else
  - fHMPIDsignal = 0.;*/
  /* info from track references */
  fMCTOFTime = 0.;
  fMCTOFLength = 0.;
  @@ -401,10 +390,7 @@ AliAnalysisPIDTrack::Update(AliESDtrack *track, AliMCEvent *mcevent, AliPIDRespo
  TClonesArray *arrayTR;
  AliTrackReference *trackRef;
  mcevent->GetParticleAndTR(fTOFLabel[0], particle, arrayTR);
  - if(!arrayTR) {
  - AliFatal("AddAnalysisTaskTPCTOFPID needs AliTrackReference!");
  - return;
  - };
  + if(arrayTR) {
  for (Int_t itr = 0; itr < arrayTR->GetEntries(); itr++) {
  trackRef = (AliTrackReference *)arrayTR->At(itr);
  if (!trackRef || trackRef->DetectorId() != AliTrackReference::kTOF) continue;
  @@ -414,6 +400,7 @@ AliAnalysisPIDTrack::Update(AliESDtrack *track, AliMCEvent *mcevent, AliPIDRespo
  break;
  }
  }
  + }
  /* info from stack */
  fMCPrimary = kFALSE;
  fMCPdgCode = 0;
  