message: Fix filling of histos with MC truth and disable time-range cut for MC
diff: @@ -488,7 +488,7 @@ void AliAnalysisTaskSEHFSystPID::UserExec(Option_t */*option*/)
  }
  }
  else {
  - if(fUseTimeRangeCutForPbPb2018){
  + if(fUseTimeRangeCutForPbPb2018 && !fIsMC){
  if(fAOD->GetRunNumber() != fRunNumberPrevEvent){
  fTimeRangeCut.InitFromRunNumber(fAOD->GetRunNumber());
  }
  @@ -501,7 +501,6 @@ void AliAnalysisTaskSEHFSystPID::UserExec(Option_t */*option*/)
  }
  fHistNEvents->Fill(11);
  -
  // load MC particles
  TClonesArray *arrayMC=0;
  if(fIsMC){
  @@ -761,31 +760,38 @@ void AliAnalysisTaskSEHFSystPID::UserExec(Option_t */*option*/)
  if(fIsMC) {
  fPDGcode = GetPDGcodeFromMC(track,arrayMC);
  - AliPIDResponse::EDetector det[3] = {AliPIDResponse::kITS,AliPIDResponse::kTPC,AliPIDResponse::kTOF};
  + AliPIDResponse::EDetector det[kNMaxDet] = {AliPIDResponse::kITS,AliPIDResponse::kTPC,AliPIDResponse::kTOF,AliPIDResponse::kHMPID};
  for(int iDet=0; iDet<kNMaxDet; iDet++) {
  if(!fEnabledDet[iDet])
  continue;
  switch(fPDGcode) {
  case 211:
  + if(fEnabledSpecies[kPion])
  fHistNsigmaVsPt[iDet][kPion]->Fill(track->Pt(),fPIDresp->NumberOfSigmas(det[iDet],track,AliPID::kPion));
  break;
  case 321:
  + if(fEnabledSpecies[kKaon])
  fHistNsigmaVsPt[iDet][kKaon]->Fill(track->Pt(),fPIDresp->NumberOfSigmas(det[iDet],track,AliPID::kKaon));
  break;
  case 2212:
  + if(fEnabledSpecies[kProton])
  fHistNsigmaVsPt[iDet][kProton]->Fill(track->Pt(),fPIDresp->NumberOfSigmas(det[iDet],track,AliPID::kProton));
  break;
  case 11:
  + if(fEnabledSpecies[kElectron])
  fHistNsigmaVsPt[iDet][kElectron]->Fill(track->Pt(),fPIDresp->NumberOfSigmas(det[iDet],track,AliPID::kElectron));
  break;
  case 1000010020:
  + if(fEnabledSpecies[kDeuteron])
  fHistNsigmaVsPt[iDet][kDeuteron]->Fill(track->Pt(),fPIDresp->NumberOfSigmas(det[iDet],track,AliPID::kDeuteron));
  break;
  case 1000010030:
  + if(fEnabledSpecies[kTriton])
  fHistNsigmaVsPt[iDet][kTriton]->Fill(track->Pt(),fPIDresp->NumberOfSigmas(det[iDet],track,AliPID::kTriton));
  break;
  case 1000020030:
  + if(fEnabledSpecies[kHe3])
  fHistNsigmaVsPt[iDet][kHe3]->Fill(track->Pt(),fPIDresp->NumberOfSigmas(det[iDet],track,AliPID::kHe3));
  break;
  }
  @@ -975,6 +981,7 @@ short AliAnalysisTaskSEHFSystPID::GetPDGcodeFromMC(AliAODTrack* track, TClonesAr
  {
  // Get pdg code
  short pdg = -1;
  + if(!track) return pdg;
  int label = track->GetLabel();
  if(label<0) return pdg;
  AliAODMCParticle* partMC = dynamic_cast<AliAODMCParticle*>(arrayMC->At(label));
  