From 2501aed5cf66143adf0a7aa15efa37ba5e33e4e1 Mon Sep 17 00:00:00 2001 From: zampolli Date: Fri, 29 Aug 2014 09:52:44 +0200 Subject: [PATCH] ALIROOT-5572 Allow use of AliTOFcalib::TuneForMC() when old ESD TOF data structure detected, AliFatal otherwise (R. Preghenella) --- TOF/AliTOFcalib.cxx | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/TOF/AliTOFcalib.cxx b/TOF/AliTOFcalib.cxx index 37beac8c2e1..e24882ed110 100644 --- a/TOF/AliTOFcalib.cxx +++ b/TOF/AliTOFcalib.cxx @@ -2442,12 +2442,11 @@ AliTOFcalib::CalibrateESD(AliESDEvent *event) track->SetTOFsignal(time); } } + + if (fCorrectTExp) + CalibrateTExp(event); } - - if (fCorrectTExp) { - AliWarning("\n\nfCorrectTExp is a DEPRECATED flag, it will do NOTHING\n\n"); - } - + } //---------------------------------------------------------------------------- @@ -2525,6 +2524,13 @@ AliTOFcalib::CalibrateTExp(AliESDEvent *event) const * calibrate TExp */ + /* check if new TOF data structure, crash in case */ + TClonesArray* esdTOFhits = event->GetESDTOFHits(); + if (esdTOFhits) { + AliFatal("This method is DEPRECATED, doing NOTHING"); + return ; + } + if (!fInitFlag) { AliError("class not yet initialized. Initialize it before."); return; @@ -2560,8 +2566,12 @@ AliTOFcalib::TuneForMC(AliESDEvent *event, Double_t resolution) * tune for MC */ - AliFatal("This method is DEPRECATED, doing NOTHING"); - return 0.; + /* check if new TOF data structure, crash in case */ + TClonesArray* esdTOFhits = event->GetESDTOFHits(); + if (esdTOFhits) { + AliFatal("This method is DEPRECATED, doing NOTHING"); + return 0.; + } /* get vertex spread and define T0-spread */ Double_t diamond2 = TMath::Abs(event->GetSigma2DiamondZ());