message: add protection in case of missing TM residual histograms
diff: @@ -96,7 +96,7 @@ Bool_t GetFileAndList(TString fileName, TString listName, TString trigName);
  /// productions name used in legends
  //TString prodLeg[] = {"DCA off - PID off","DCA on - PID off","DCA off - PID on","DCA on - PID on"};
  -TString prod [] = {"LHC17l3b_fast_TM","LHC17l4b_fast_TM"};
  +TString prod [] = {"LHC17l3b_fast_TM","LHC17l4b_fast_TM};
  TString prodLeg[] = {"Geant3, b FAST","Geant4, b FAST"};
  const Int_t nProd = 2; /// total number of productions to compare
  @@ -361,6 +361,18 @@ void Cluster(Int_t icalo)
  h2TrackMatchResPhiNeg[iprod] = (TH2F*) GetHisto(Form("AnaPhoton_Calo%d_hTrackMatchedDPhiNegNoCut",icalo),iprod);
  h2TrackMatchResPhiPos[iprod] = (TH2F*) GetHisto(Form("AnaPhoton_Calo%d_hTrackMatchedDPhiPosNoCut",icalo),iprod);
  + h2TrackMatchResEtaNegTrackPt[iprod] = (TH2F*) GetHisto(Form("AnaPhoton_Calo%d_hTrackMatchedDEtaNegTrackPtNoCut",icalo),iprod);
  + h2TrackMatchResEtaPosTrackPt[iprod] = (TH2F*) GetHisto(Form("AnaPhoton_Calo%d_hTrackMatchedDEtaPosTrackPtNoCut",icalo),iprod);
  + h2TrackMatchResPhiNegTrackPt[iprod] = (TH2F*) GetHisto(Form("AnaPhoton_Calo%d_hTrackMatchedDPhiNegTrackPtNoCut",icalo),iprod);
  + h2TrackMatchResPhiPosTrackPt[iprod] = (TH2F*) GetHisto(Form("AnaPhoton_Calo%d_hTrackMatchedDPhiPosTrackPtNoCut",icalo),iprod);
  +
  + if ( !h2TrackMatchResEtaNeg[iprod] || !h2TrackMatchResEtaPos[iprod] ||
  + !h2TrackMatchResPhiNeg[iprod] || !h2TrackMatchResPhiPos[iprod] )
  + {
  + printf("No TM residual histograms \n");
  + continue;
  + }
  +
  Float_t emin = 0.5;
  Float_t emax = 2.5;
  if ( histoTag.Contains("L0") )
  @@ -459,10 +471,6 @@ void Cluster(Int_t icalo)
  }
  // pt track bin
  - h2TrackMatchResEtaNegTrackPt[iprod] = (TH2F*) GetHisto(Form("AnaPhoton_Calo%d_hTrackMatchedDEtaNegTrackPtNoCut",icalo),iprod);
  - h2TrackMatchResEtaPosTrackPt[iprod] = (TH2F*) GetHisto(Form("AnaPhoton_Calo%d_hTrackMatchedDEtaPosTrackPtNoCut",icalo),iprod);
  - h2TrackMatchResPhiNegTrackPt[iprod] = (TH2F*) GetHisto(Form("AnaPhoton_Calo%d_hTrackMatchedDPhiNegTrackPtNoCut",icalo),iprod);
  - h2TrackMatchResPhiPosTrackPt[iprod] = (TH2F*) GetHisto(Form("AnaPhoton_Calo%d_hTrackMatchedDPhiPosTrackPtNoCut",icalo),iprod);
  if ( !h2TrackMatchResEtaNegTrackPt[iprod] ) continue;
  @@ -617,6 +625,8 @@ void Cluster(Int_t icalo)
  }
  // Cluster-Track Matching Residual
  + if ( h2TrackMatchResEtaNeg[0] && h2TrackMatchResEtaPos[0] &&
  + h2TrackMatchResPhiNeg[0] && h2TrackMatchResPhiPos[0] )
  {
  TGaxis::SetMaxDigits(3);
  