From: zampolli Date: Wed, 6 Aug 2014 09:15:13 +0000 (+0200) Subject: ALIROOT-5564: fix in TOF calibration to account for new data structure X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=a4d2609a7655e80b8c7f3f0c26d530d47261062c ALIROOT-5564: fix in TOF calibration to account for new data structure --- diff --git a/TOF/AliTOFcalib.cxx b/TOF/AliTOFcalib.cxx index b52764e57ea..b1b1f6cc633 100644 --- a/TOF/AliTOFcalib.cxx +++ b/TOF/AliTOFcalib.cxx @@ -2383,45 +2383,42 @@ AliTOFcalib::CalibrateESD(AliESDEvent *event) return; } - /* loop over tracks */ - AliESDtrack *track = NULL; Int_t index, l0l1, deltaBC; - Double_t time, tot, corr, texp[AliPID::kSPECIESC]; + Double_t time, tot, corr; UInt_t timestamp = event->GetTimeStamp(); - for (Int_t itrk = 0; itrk < event->GetNumberOfTracks(); itrk++) { - /* get track */ - track = event->GetTrack(itrk); - if (!track || !(track->GetStatus() & AliESDtrack::kTOFout)) continue; - - /* calibrate TOF signal */ - if (fCalibrateTOFsignal) { - /* get info */ - index = track->GetTOFCalChannel(); - time = track->GetTOFsignalRaw(); - tot = track->GetTOFsignalToT(); - l0l1 = track->GetTOFL0L1(); - deltaBC = track->GetTOFDeltaBC(); - /* get correction */ - corr = GetTimeCorrection(index, tot, deltaBC, l0l1, timestamp); - /* apply correction */ - time -= corr; - /* set new TOF signal */ - track->SetTOFsignal(time); + // calibrating TOF hits + + AliESDTOFHit* hit = NULL; + TClonesArray* esdTOFhits = event->GetESDTOFHits(); + for (Int_t ihit = 0; ihit < esdTOFhits->GetEntriesFast(); ihit++) { + + /* get track */ + hit = (AliESDTOFHit*)esdTOFhits->At(ihit); + //if (!track || !(track->GetStatus() & AliESDtrack::kTOFout)) continue; + if (!hit) continue; + + /* calibrate TOF signal */ + if (fCalibrateTOFsignal) { + /* get info */ + index = hit->GetTOFchannel(); + time = hit->GetTimeRaw(); + tot = hit->GetTOT(); + l0l1 = hit->GetL0L1Latency(); + deltaBC = hit->GetDeltaBC(); + /* get correction */ + corr = GetTimeCorrection(index, tot, deltaBC, l0l1, timestamp); + /* apply correction */ + time -= corr; + /* set new TOF signal */ + hit->SetTime(time); + } + } - - /* correct expected time */ if (fCorrectTExp) { - /* get integrated times */ - track->GetIntegratedTimes(texp,AliPID::kSPECIESC); - /* loop over particle types and correct expected time */ - for (Int_t ipart = 0; ipart < AliPID::kSPECIES; ipart++) - texp[ipart] += fResponseParams->EvalTExpCorr(ipart, track->P()); - /* set integrated times */ - track->SetIntegratedTimes(texp); + AliWarning("\n\nfCorrectTExp is a DEPRECATED flag, it will do NOTHING\n\n"); } - } } @@ -2535,6 +2532,9 @@ AliTOFcalib::TuneForMC(AliESDEvent *event, Double_t resolution) * tune for MC */ + AliFatal("This method is DEPRECATED, doing NOTHING"); + return 0.; + /* get vertex spread and define T0-spread */ Double_t diamond2 = TMath::Abs(event->GetSigma2DiamondZ()); Double_t t0spread = TMath::Sqrt(diamond2) / 2.99792457999999984e-02;