diff --git a/Modules/PID/src/TaskFT0TOF.cxx b/Modules/PID/src/TaskFT0TOF.cxx index 38abf56933..2811725ed3 100644 --- a/Modules/PID/src/TaskFT0TOF.cxx +++ b/Modules/PID/src/TaskFT0TOF.cxx @@ -353,16 +353,17 @@ void TaskFT0TOF::monitorData(o2::framework::ProcessingContext& ctx) mMyTracks.clear(); // Get FT0 RecPointss - // const gsl::span* ft0rec = nullptr; - const std::vector* ft0rec = nullptr; + std::vector ft0Sorted; if (mUseFT0) { auto& obj = ctx.inputs().get>("recpoints"); - // const auto& obj = mRecoCont.getFT0RecPoints(); - ft0rec = &obj; + for (const auto& o : obj) { + // ILOG(Info, Support) << "cand -> " << o.mIntRecord.orbit < tracks; - std::vector ft0Sorted; - if (mUseFT0) { - ft0Sorted = *ft0rec; - } std::vector ft0Cand; // sorting matching in time @@ -481,7 +478,7 @@ void TaskFT0TOF::monitorData(o2::framework::ProcessingContext& ctx) [](MyTrack a, MyTrack b) { return a.tofSignalDouble() < b.tofSignalDouble(); }); std::sort(ft0Sorted.begin(), ft0Sorted.end(), - [](o2::ft0::RecPoints a, o2::ft0::RecPoints b) { return a.getInteractionRecord().bc2ns() < b.getInteractionRecord().bc2ns(); }); + [](o2::ft0::RecPoints a, o2::ft0::RecPoints b) { return a.mIntRecord.bc2ns() < b.mIntRecord.bc2ns(); }); int ift0 = 0; @@ -513,12 +510,15 @@ void TaskFT0TOF::monitorData(o2::framework::ProcessingContext& ctx) double firstTime = tracks[0].tofSignalDouble() - 8 * o2::tof::Geo::BC_TIME_INPS; double lastTime = tracks[ntrk - 1].tofSignalDouble() + 8 * o2::tof::Geo::BC_TIME_INPS; for (int j = ift0; j < ft0Sorted.size(); j++) { - auto& obj = ft0Sorted[j]; - if (obj.getInteractionRecord().orbit < ft0firstOrbit) { + const auto& obj = ft0Sorted[j]; + if (obj.mIntRecord.orbit < ft0firstOrbit) { + ILOG(Info, Support) << "FT0 orbit comes first the first sampled one -> " << obj.mIntRecord.orbit << " - " << ft0firstOrbit << ENDM; continue; // skip FT0 objects from previous orbits } - uint32_t orbit = obj.getInteractionRecord().orbit - ft0firstOrbit; - double BCtimeFT0 = ((orbit)*o2::constants::lhc::LHCMaxBunches + obj.getInteractionRecord().bc) * o2::tof::Geo::BC_TIME_INPS; + uint32_t orbit = obj.mIntRecord.orbit - ft0firstOrbit; + double BCtimeFT0 = ((orbit)*o2::constants::lhc::LHCMaxBunches + obj.mIntRecord.bc) * o2::tof::Geo::BC_TIME_INPS; + + // ILOG(Info, Support) << "orbit " << orbit << "-> time (ps) " << BCtimeFT0 <startPublishing(mDeltaTwMC); + } + if (mSrc[GID::Source::TPCTOF] == 1) { getObjectsManager()->startPublishing(mInTracksPt[matchType::TPC]); getObjectsManager()->startPublishing(mInTracksEta[matchType::TPC]); @@ -193,6 +212,9 @@ void TOFMatchedTracks::initialize(o2::framework::InitContext& /*ctx*/) getObjectsManager()->startPublishing(mFakeMatchedTracksEta[matchType::TPC]); getObjectsManager()->startPublishing(mFakeFractionTracksPt[matchType::TPC]); getObjectsManager()->startPublishing(mFakeFractionTracksEta[matchType::TPC]); + getObjectsManager()->startPublishing(mExpTimesPiMC[matchType::TPC]); + getObjectsManager()->startPublishing(mExpTimesKaMC[matchType::TPC]); + getObjectsManager()->startPublishing(mExpTimesPrMC[matchType::TPC]); } getObjectsManager()->startPublishing(mEffPt[matchType::TPC]); getObjectsManager()->startPublishing(mEffEta[matchType::TPC]); @@ -219,6 +241,9 @@ void TOFMatchedTracks::initialize(o2::framework::InitContext& /*ctx*/) getObjectsManager()->startPublishing(mFakeMatchedTracksEta[matchType::TPCTRD]); getObjectsManager()->startPublishing(mFakeFractionTracksPt[matchType::TPCTRD]); getObjectsManager()->startPublishing(mFakeFractionTracksEta[matchType::TPCTRD]); + getObjectsManager()->startPublishing(mExpTimesPiMC[matchType::TPCTRD]); + getObjectsManager()->startPublishing(mExpTimesKaMC[matchType::TPCTRD]); + getObjectsManager()->startPublishing(mExpTimesPrMC[matchType::TPCTRD]); } getObjectsManager()->startPublishing(mEffPt[matchType::TPCTRD]); getObjectsManager()->startPublishing(mEffEta[matchType::TPCTRD]); @@ -245,6 +270,9 @@ void TOFMatchedTracks::initialize(o2::framework::InitContext& /*ctx*/) getObjectsManager()->startPublishing(mFakeMatchedTracksEta[matchType::ITSTPC_ITSTPCTRD]); getObjectsManager()->startPublishing(mFakeFractionTracksPt[matchType::ITSTPC_ITSTPCTRD]); getObjectsManager()->startPublishing(mFakeFractionTracksEta[matchType::ITSTPC_ITSTPCTRD]); + getObjectsManager()->startPublishing(mExpTimesPiMC[matchType::ITSTPC_ITSTPCTRD]); + getObjectsManager()->startPublishing(mExpTimesKaMC[matchType::ITSTPC_ITSTPCTRD]); + getObjectsManager()->startPublishing(mExpTimesPrMC[matchType::ITSTPC_ITSTPCTRD]); } getObjectsManager()->startPublishing(mEffPt[matchType::ITSTPC_ITSTPCTRD]); getObjectsManager()->startPublishing(mEffEta[matchType::ITSTPC_ITSTPCTRD]); @@ -356,6 +384,11 @@ void TOFMatchedTracks::monitorData(o2::framework::ProcessingContext& ctx) if (lbl.isFake()) { mFakeMatchedTracksPt[matchType::TPC]->Fill(trk.getPt()); mFakeMatchedTracksEta[matchType::TPC]->Fill(trk.getEta()); + } else { + mDeltaTwMC->Fill(matchTOF.getSignal() - matchTOF.getT0true() - matchTOF.getTgeant() * 1E3); + mExpTimesPiMC[matchType::TPC]->Fill(trk.getPt(), matchTOF.getTgeant() * 1E3 - matchTOF.getLTIntegralOut().getTOF(2)); + mExpTimesKaMC[matchType::TPC]->Fill(trk.getPt(), matchTOF.getTgeant() * 1E3 - matchTOF.getLTIntegralOut().getTOF(3)); + mExpTimesPrMC[matchType::TPC]->Fill(trk.getPt(), matchTOF.getTgeant() * 1E3 - matchTOF.getLTIntegralOut().getTOF(4)); } } } @@ -418,6 +451,11 @@ void TOFMatchedTracks::monitorData(o2::framework::ProcessingContext& ctx) if (lbl.isFake()) { mFakeMatchedTracksPt[matchType::ITSTPC_ITSTPCTRD]->Fill(trkTPC.getPt()); mFakeMatchedTracksEta[matchType::ITSTPC_ITSTPCTRD]->Fill(trkTPC.getEta()); + } else { + mDeltaTwMC->Fill(matchTOF.getSignal() - matchTOF.getT0true() - matchTOF.getTgeant() * 1E3); + mExpTimesPiMC[matchType::ITSTPC_ITSTPCTRD]->Fill(trkTPC.getPt(), matchTOF.getTgeant() * 1E3 - matchTOF.getLTIntegralOut().getTOF(2)); + mExpTimesKaMC[matchType::ITSTPC_ITSTPCTRD]->Fill(trkTPC.getPt(), matchTOF.getTgeant() * 1E3 - matchTOF.getLTIntegralOut().getTOF(3)); + mExpTimesPrMC[matchType::ITSTPC_ITSTPCTRD]->Fill(trkTPC.getPt(), matchTOF.getTgeant() * 1E3 - matchTOF.getLTIntegralOut().getTOF(4)); } } } @@ -458,6 +496,11 @@ void TOFMatchedTracks::monitorData(o2::framework::ProcessingContext& ctx) if (lbl.isFake()) { mFakeMatchedTracksPt[matchType::TPCTRD]->Fill(trk.getPt()); mFakeMatchedTracksEta[matchType::TPCTRD]->Fill(trk.getEta()); + } else { + mDeltaTwMC->Fill(matchTOF.getSignal() - matchTOF.getT0true() - matchTOF.getTgeant() * 1E3); + mExpTimesPiMC[matchType::TPCTRD]->Fill(trk.getPt(), matchTOF.getTgeant() * 1E3 - matchTOF.getLTIntegralOut().getTOF(2)); + mExpTimesKaMC[matchType::TPCTRD]->Fill(trk.getPt(), matchTOF.getTgeant() * 1E3 - matchTOF.getLTIntegralOut().getTOF(3)); + mExpTimesPrMC[matchType::TPCTRD]->Fill(trk.getPt(), matchTOF.getTgeant() * 1E3 - matchTOF.getLTIntegralOut().getTOF(4)); } } } @@ -522,6 +565,11 @@ void TOFMatchedTracks::monitorData(o2::framework::ProcessingContext& ctx) if (lbl.isFake()) { mFakeMatchedTracksPt[matchType::ITSTPC_ITSTPCTRD]->Fill(trkTPC.getPt()); mFakeMatchedTracksEta[matchType::ITSTPC_ITSTPCTRD]->Fill(trkTPC.getEta()); + } else { + mDeltaTwMC->Fill(matchTOF.getSignal() - matchTOF.getT0true() - matchTOF.getTgeant() * 1E3); + mExpTimesPiMC[matchType::ITSTPC_ITSTPCTRD]->Fill(trkTPC.getPt(), matchTOF.getTgeant() * 1E3 - matchTOF.getLTIntegralOut().getTOF(2)); + mExpTimesKaMC[matchType::ITSTPC_ITSTPCTRD]->Fill(trkTPC.getPt(), matchTOF.getTgeant() * 1E3 - matchTOF.getLTIntegralOut().getTOF(3)); + mExpTimesPrMC[matchType::ITSTPC_ITSTPCTRD]->Fill(trkTPC.getPt(), matchTOF.getTgeant() * 1E3 - matchTOF.getLTIntegralOut().getTOF(4)); } } } @@ -839,6 +887,10 @@ void TOFMatchedTracks::reset() { // clean all the monitor objects here + if (mUseMC) { + mDeltaTwMC->Reset(); + } + ILOG(Debug, Devel) << "Resetting the histograms" << ENDM; for (int i = 0; i < matchType::SIZE; ++i) { mMatchedTracksPt[i]->Reset(); @@ -847,6 +899,9 @@ void TOFMatchedTracks::reset() if (mUseMC) { mFakeMatchedTracksPt[i]->Reset(); mFakeMatchedTracksEta[i]->Reset(); + mExpTimesPiMC[i]->Reset(); + mExpTimesKaMC[i]->Reset(); + mExpTimesPrMC[i]->Reset(); } mInTracksPt[i]->Reset(); mInTracksEta[i]->Reset();