From 4a2d2971aec383a9b3d26db38798d9f5d8a4b620 Mon Sep 17 00:00:00 2001 From: noferini Date: Thu, 28 Jan 2021 14:07:13 +0100 Subject: [PATCH] fix for tof pattern in CTF (8bits words) --- .../TOF/include/DataFormatsTOF/CTF.h | 4 +- Detectors/CTF/test/test_ctf_io_tof.cxx | 4 +- Detectors/TOF/base/CMakeLists.txt | 3 +- .../TOF/base/include/TOFBase/WindowFiller.h | 4 +- Detectors/TOF/base/src/WindowFiller.cxx | 54 +++++++++++++++---- .../TOF/calibration/src/TOFFEElightConfig.cxx | 6 +-- .../include/TOFReconstruction/CTFCoder.h | 12 ++--- Detectors/TOF/reconstruction/src/CTFCoder.cxx | 13 +++-- .../TOFWorkflowUtils/CompressedDecodingTask.h | 1 + .../TOFWorkflowUtils/DigitReaderSpec.h | 2 +- .../TOFDigitWriterSplitterSpec.h | 2 +- .../workflow/src/CompressedDecodingTask.cxx | 28 ++++++++-- .../TOF/workflow/src/EntropyEncoderSpec.cxx | 2 +- .../TOF/workflow/src/TOFDigitWriterSpec.cxx | 2 +- 14 files changed, 94 insertions(+), 43 deletions(-) diff --git a/DataFormats/Detectors/TOF/include/DataFormatsTOF/CTF.h b/DataFormats/Detectors/TOF/include/DataFormatsTOF/CTF.h index 75341a074681b..824df93660c7f 100644 --- a/DataFormats/Detectors/TOF/include/DataFormatsTOF/CTF.h +++ b/DataFormats/Detectors/TOF/include/DataFormatsTOF/CTF.h @@ -67,13 +67,13 @@ struct CompressedInfos { std::vector stripID; /// increment of stripID wrt that of prev. strip std::vector chanInStrip; /// channel in strip 0-95 (ordered in time) std::vector tot; /// Time-Over-Threshold in TOF channel (about 48.8 ps) - std::vector pattMap; /// explict patterns container + std::vector pattMap; /// explict patterns container CompressedInfos() = default; void clear(); - ClassDefNV(CompressedInfos, 2); + ClassDefNV(CompressedInfos, 3); }; /// wrapper for the Entropy-encoded clusters of the TF diff --git a/Detectors/CTF/test/test_ctf_io_tof.cxx b/Detectors/CTF/test/test_ctf_io_tof.cxx index 27810fc5b9292..cdccecc2b7cf4 100644 --- a/Detectors/CTF/test/test_ctf_io_tof.cxx +++ b/Detectors/CTF/test/test_ctf_io_tof.cxx @@ -30,7 +30,7 @@ BOOST_AUTO_TEST_CASE(CompressedClustersTest) std::vector digits; std::vector rows; - std::vector pattVec; + std::vector pattVec; TStopwatch sw; sw.Start(); @@ -117,7 +117,7 @@ BOOST_AUTO_TEST_CASE(CompressedClustersTest) std::vector digitsD; std::vector rowsD; - std::vector pattVecD; + std::vector pattVecD; sw.Start(); const auto ctfImage = CTF::getImage(vec.data()); { diff --git a/Detectors/TOF/base/CMakeLists.txt b/Detectors/TOF/base/CMakeLists.txt index 2e063f4851424..e8bfc3b75b6d1 100644 --- a/Detectors/TOF/base/CMakeLists.txt +++ b/Detectors/TOF/base/CMakeLists.txt @@ -16,7 +16,8 @@ o2_add_library(TOFBase src/Strip.cxx src/WindowFiller.cxx PUBLIC_LINK_LIBRARIES Boost::serialization FairRoot::Base ms_gsl::ms_gsl - O2::DetectorsBase O2::CommonDataFormat O2::DetectorsRaw) + O2::DetectorsBase O2::CommonDataFormat O2::DetectorsRaw + O2::DataFormatsTOF) o2_target_root_dictionary(TOFBase HEADERS include/TOFBase/Geo.h include/TOFBase/Digit.h diff --git a/Detectors/TOF/base/include/TOFBase/WindowFiller.h b/Detectors/TOF/base/include/TOFBase/WindowFiller.h index 4c2f43764cd9c..9bc3d8f163295 100644 --- a/Detectors/TOF/base/include/TOFBase/WindowFiller.h +++ b/Detectors/TOF/base/include/TOFBase/WindowFiller.h @@ -75,7 +75,7 @@ class WindowFiller memset(mChannelCounts, 0, o2::tof::Geo::NCHANNELS * sizeof(mChannelCounts[0])); } - std::vector& getPatterns() { return mPatterns; } + std::vector& getPatterns() { return mPatterns; } void addPattern(const uint32_t val, int icrate, int orbit, int bc) { mCratePatterns.emplace_back(val, icrate, orbit * 3 + (bc + 100) / Geo::BC_IN_WINDOW); } void addCrateHeaderData(unsigned long orbit, int crate, int32_t bc, uint32_t eventCounter); @@ -111,7 +111,7 @@ class WindowFiller // arrays with digit and MCLabels out of the current readout windows (stored to fill future readout window) std::vector mFutureDigits; - std::vector mPatterns; + std::vector mPatterns; std::vector mErrors; std::vector mCratePatterns; diff --git a/Detectors/TOF/base/src/WindowFiller.cxx b/Detectors/TOF/base/src/WindowFiller.cxx index 492bf51a59914..a4dda48f99712 100644 --- a/Detectors/TOF/base/src/WindowFiller.cxx +++ b/Detectors/TOF/base/src/WindowFiller.cxx @@ -21,6 +21,7 @@ #include #include #include "FairLogger.h" +#include "DataFormatsTOF/CompressedDataFormat.h" using namespace o2::tof; @@ -190,18 +191,51 @@ void WindowFiller::fillOutputContainer(std::vector& digits) int npatterns = 0; // check if patterns are in the current row + unsigned int initrow = mFirstIR.orbit * Geo::NWINDOW_IN_ORBIT; for (std::vector::reverse_iterator it = mCratePatterns.rbegin(); it != mCratePatterns.rend(); ++it) { - if (it->row > mReadoutWindowCurrent) { + //printf("pattern row=%ld current=%ld\n",it->row - initrow,mReadoutWindowCurrent); + + if (it->row - initrow > mReadoutWindowCurrent) { break; } - if (it->row < mReadoutWindowCurrent) { // this should not happen + if (it->row - initrow < mReadoutWindowCurrent) { // this should not happen LOG(ERROR) << "One pattern skipped because appears to occur early of the current row " << it->row << " < " << mReadoutWindowCurrent << " ?!"; } else { - mPatterns.push_back(it->pattern); - info.addedDiagnostic(it->icrate); + uint32_t cpatt = it->pattern; + auto dpatt = reinterpret_cast(&cpatt); + uint8_t slot = dpatt->slotID; + uint32_t cbit = 1; + mPatterns.push_back(slot + 28); // add slot + info.addedDiagnostic(it->icrate); npatterns++; + + for (int ibit = 0; ibit < 28; ibit++) { + if (dpatt->faultBits & cbit) { + mPatterns.push_back(ibit); // add bit error + info.addedDiagnostic(it->icrate); + npatterns++; + } + cbit <<= 1; + } + // uint8_t w1 = cpatt & 0xff; + // uint8_t w2 = (cpatt >> 8) & 0xff; + // uint8_t w3 = (cpatt >> 16) & 0xff; + // uint8_t w4 = (cpatt >> 24) & 0xff; + //// cpatt = w1 + (w2 + (w3 + uint(w4)*256)*256)*256; + // mPatterns.push_back(w1); + // info.addedDiagnostic(it->icrate); + // npatterns++; + // mPatterns.push_back(w2); + // info.addedDiagnostic(it->icrate); + // npatterns++; + // mPatterns.push_back(w3); + // info.addedDiagnostic(it->icrate); + // npatterns++; + // mPatterns.push_back(w4); + // info.addedDiagnostic(it->icrate); + // npatterns++; } mCratePatterns.pop_back(); } @@ -265,12 +299,14 @@ void WindowFiller::flushOutputContainer(std::vector& digits) checkIfReuseFutureDigitsRO(); } + int nwindowperTF = o2::raw::HBFUtils::Instance().getNOrbitsPerTF() * Geo::NWINDOW_IN_ORBIT; + for (Int_t i = 0; i < MAXWINDOWS; i++) { - fillOutputContainer(digits); // fill last readout windows + if (mReadoutWindowData.size() < nwindowperTF) { + fillOutputContainer(digits); // fill last readout windows + } } - int nwindowperTF = o2::raw::HBFUtils::Instance().getNOrbitsPerTF() * Geo::NWINDOW_IN_ORBIT; - // check that all orbits are complete in terms of number of readout windows while ((mReadoutWindowData.size() % nwindowperTF)) { fillOutputContainer(digits); // fill windows without digits to complete all orbits in the last TF @@ -306,7 +342,7 @@ void WindowFiller::checkIfReuseFutureDigits() int isnext = Int_t(timestamp * Geo::READOUTWINDOW_INV) - (mReadoutWindowCurrent + 1); // to be replaced with uncalibrated time if (isnext < 0) { // we jump too ahead in future, digit will be not stored - LOG(INFO) << "Digit lost because we jump too ahead in future. Current RO window=" << isnext << "\n"; + LOG(DEBUG) << "Digit lost because we jump too ahead in future. Current RO window=" << isnext << "\n"; // remove digit from array in the future int labelremoved = digit->getLabel(); @@ -375,7 +411,7 @@ void WindowFiller::checkIfReuseFutureDigitsRO() // the same but using readout in int isnext = row - mReadoutWindowCurrent; if (isnext < 0) { // we jump too ahead in future, digit will be not stored - LOG(INFO) << "Digit lost because we jump too ahead in future. Current RO window=" << isnext << "\n"; + LOG(DEBUG) << "Digit lost because we jump too ahead in future. Current RO window=" << isnext << "\n"; // remove digit from array in the future int labelremoved = digit->getLabel(); diff --git a/Detectors/TOF/calibration/src/TOFFEElightConfig.cxx b/Detectors/TOF/calibration/src/TOFFEElightConfig.cxx index 6e1b5b5bfa8ba..0141b404e56d2 100644 --- a/Detectors/TOF/calibration/src/TOFFEElightConfig.cxx +++ b/Detectors/TOF/calibration/src/TOFFEElightConfig.cxx @@ -17,9 +17,5 @@ TOFFEEchannelConfig* TOFFEElightConfig::getChannelConfig(int icrate, int itrm, i // return the channel config for the given crate, trm, chain, tdc, tdcchannel - return icrate >= Geo::kNCrate ? nullptr : itrm >= Geo::kNTRM ? nullptr - : ichain >= Geo::kNChain ? nullptr - : itdc >= Geo::kNTdc ? nullptr - : ichtdc >= Geo::kNCh ? nullptr - : &mChannelConfig[icrate][itrm][ichain][itdc][ichtdc]; + return icrate >= Geo::kNCrate ? nullptr : itrm >= Geo::kNTRM ? nullptr : ichain >= Geo::kNChain ? nullptr : itdc >= Geo::kNTdc ? nullptr : ichtdc >= Geo::kNCh ? nullptr : &mChannelConfig[icrate][itrm][ichain][itdc][ichtdc]; } diff --git a/Detectors/TOF/reconstruction/include/TOFReconstruction/CTFCoder.h b/Detectors/TOF/reconstruction/include/TOFReconstruction/CTFCoder.h index edea8157d760e..0b7a9992732b5 100644 --- a/Detectors/TOF/reconstruction/include/TOFReconstruction/CTFCoder.h +++ b/Detectors/TOF/reconstruction/include/TOFReconstruction/CTFCoder.h @@ -39,7 +39,7 @@ class CTFCoder : public o2::ctf::CTFCoderBase /// entropy-encode clusters to buffer with CTF template - void encode(VEC& buff, const gsl::span& rofRecVec, const gsl::span& cdigVec, const gsl::span& pattVec); + void encode(VEC& buff, const gsl::span& rofRecVec, const gsl::span& cdigVec, const gsl::span& pattVec); /// entropy decode clusters from buffer with CTF template @@ -49,14 +49,14 @@ class CTFCoder : public o2::ctf::CTFCoderBase private: /// compres compact clusters to CompressedInfos - void compress(CompressedInfos& cc, const gsl::span& rofRecVec, const gsl::span& cdigVec, const gsl::span& pattVec); + void compress(CompressedInfos& cc, const gsl::span& rofRecVec, const gsl::span& cdigVec, const gsl::span& pattVec); size_t estimateCompressedSize(const CompressedInfos& cc); /// decompress CompressedInfos to compact clusters template void decompress(const CompressedInfos& cc, VROF& rofRecVec, VDIG& cdigVec, VPAT& pattVec); void appendToTree(TTree& tree, CTF& ec); - void readFromTree(TTree& tree, int entry, std::vector& rofRecVec, std::vector& cdigVec, std::vector& pattVec); + void readFromTree(TTree& tree, int entry, std::vector& rofRecVec, std::vector& cdigVec, std::vector& pattVec); protected: ClassDefNV(CTFCoder, 1); @@ -65,7 +65,7 @@ class CTFCoder : public o2::ctf::CTFCoderBase ///___________________________________________________________________________________ /// entropy-encode digits to buffer with CTF template -void CTFCoder::encode(VEC& buff, const gsl::span& rofRecVec, const gsl::span& cdigVec, const gsl::span& pattVec) +void CTFCoder::encode(VEC& buff, const gsl::span& rofRecVec, const gsl::span& cdigVec, const gsl::span& pattVec) { using MD = o2::ctf::Metadata::OptStore; // what to do which each field: see o2::ctd::Metadata explanation @@ -180,7 +180,7 @@ void CTFCoder::decompress(const CompressedInfos& cc, VROF& rofRecVec, VDIG& cdig int firstDig = digCount; - int BCrow = prevIR.orbit * Geo::BC_IN_ORBIT + prevIR.bc; + int64_t BCrow = prevIR.toLong(); digCopy.resize(cc.ndigROF[irof]); for (uint32_t idig = 0; idig < cc.ndigROF[irof]; idig++) { @@ -192,7 +192,7 @@ void CTFCoder::decompress(const CompressedInfos& cc, VROF& rofRecVec, VDIG& cdig } else { ctdc += cc.timeTDCInc[digCount]; } - LOGF(DEBUG, "BC=%d, TDC=%d, TOT=%d, CH=%d", uint32_t(ctimeframe) * 64 + ctdc / 1024 + BCrow, ctdc % 1024, cc.tot[digCount], uint32_t(cc.stripID[digCount]) * 96 + cc.chanInStrip[digCount]); + LOGF(DEBUG, "BC=%ld, TDC=%d, TOT=%d, CH=%d", uint32_t(ctimeframe) * 64 + ctdc / 1024 + BCrow, ctdc % 1024, cc.tot[digCount], uint32_t(cc.stripID[digCount]) * 96 + cc.chanInStrip[digCount]); digit.setBC(uint32_t(ctimeframe) * 64 + ctdc / 1024 + BCrow); digit.setTDC(ctdc % 1024); diff --git a/Detectors/TOF/reconstruction/src/CTFCoder.cxx b/Detectors/TOF/reconstruction/src/CTFCoder.cxx index 877314411888d..6f3f03736e999 100644 --- a/Detectors/TOF/reconstruction/src/CTFCoder.cxx +++ b/Detectors/TOF/reconstruction/src/CTFCoder.cxx @@ -27,7 +27,7 @@ void CTFCoder::appendToTree(TTree& tree, CTF& ec) ///___________________________________________________________________________________ // extract and decode data from the tree -void CTFCoder::readFromTree(TTree& tree, int entry, std::vector& rofRecVec, std::vector& cdigVec, std::vector& pattVec) +void CTFCoder::readFromTree(TTree& tree, int entry, std::vector& rofRecVec, std::vector& cdigVec, std::vector& pattVec) { assert(entry >= 0 && entry < tree.GetEntries()); CTF ec; @@ -39,7 +39,7 @@ void CTFCoder::readFromTree(TTree& tree, int entry, std::vector& rofRecVec, const gsl::span& cdigVec, - const gsl::span& pattVec) + const gsl::span& pattVec) { // store in the header the orbit of 1st ROF cc.clear(); @@ -49,7 +49,7 @@ void CTFCoder::compress(CompressedInfos& cc, const auto& rofRec0 = rofRecVec[0]; int nrof = rofRecVec.size(); - LOGF(INFO, "TOF compress %d ReadoutWindow with %ld digits", nrof, cdigVec.size()); + LOGF(DEBUG, "TOF compress %d ReadoutWindow with %ld digits", nrof, cdigVec.size()); cc.header.nROFs = nrof; cc.header.firstOrbit = rofRec0.getBCData().orbit; @@ -68,7 +68,7 @@ void CTFCoder::compress(CompressedInfos& cc, cc.stripID.resize(cc.header.nDigits); cc.chanInStrip.resize(cc.header.nDigits); cc.tot.resize(cc.header.nDigits); - cc.pattMap.resize(cc.header.nPatternBytes); + cc.pattMap.resize(pattVec.size()); uint16_t prevBC = cc.header.firstBC; uint32_t prevOrbit = cc.header.firstOrbit; @@ -79,7 +79,7 @@ void CTFCoder::compress(CompressedInfos& cc, const auto& rofRec = rofRecVec[irof]; const auto& intRec = rofRec.getBCData(); - int rofInBC = intRec.toLong(); + int64_t rofInBC = intRec.toLong(); // define interaction record if (intRec.orbit == prevOrbit) { cc.orbitIncROF[irof] = 0; @@ -150,7 +150,6 @@ void CTFCoder::compress(CompressedInfos& cc, LOGF(DEBUG, "%d) TF=%d, TDC=%d, STRIP=%d, CH=%d, TOT=%d", idig, cc.timeFrameInc[idig], cc.timeTDCInc[idig], cc.stripID[idig], cc.chanInStrip[idig], cc.tot[idig]); } } - // store explicit patters as they are memcpy(cc.pattMap.data(), pattVec.data(), cc.header.nPatternBytes); // RSTODO: do we need this? } @@ -219,6 +218,6 @@ size_t CTFCoder::estimateCompressedSize(const CompressedInfos& cc) sz += ESTSIZE(cc.pattMap, CTF::BLCpattMap); // clang-format on sz *= 2. / 3; // if needed, will be autoexpanded - LOG(INFO) << "Estimated output size is " << sz << " bytes"; + LOG(DEBUG) << "Estimated output size is " << sz << " bytes"; return sz; } diff --git a/Detectors/TOF/workflow/include/TOFWorkflowUtils/CompressedDecodingTask.h b/Detectors/TOF/workflow/include/TOFWorkflowUtils/CompressedDecodingTask.h index 35b67d5224b78..ce267846481ea 100644 --- a/Detectors/TOF/workflow/include/TOFWorkflowUtils/CompressedDecodingTask.h +++ b/Detectors/TOF/workflow/include/TOFWorkflowUtils/CompressedDecodingTask.h @@ -66,6 +66,7 @@ class CompressedDecodingTask : public DecoderBase, public Task bool mHasToBePosted = false; bool mConetMode = false; uint32_t mInitOrbit = 0; + uint32_t mCurrentOrbit = 0; bool mRowFilter = false; bool mMaskNoise = false; int mNoiseRate = 1000; diff --git a/Detectors/TOF/workflow/include/TOFWorkflowUtils/DigitReaderSpec.h b/Detectors/TOF/workflow/include/TOFWorkflowUtils/DigitReaderSpec.h index e4e3acca37947..f61ad3c60eead 100644 --- a/Detectors/TOF/workflow/include/TOFWorkflowUtils/DigitReaderSpec.h +++ b/Detectors/TOF/workflow/include/TOFWorkflowUtils/DigitReaderSpec.h @@ -44,7 +44,7 @@ class DigitReader : public Task std::vector mDigits, *mPdigits = &mDigits; std::vector mRow, *mProw = &mRow; std::vector> mLabels, *mPlabels = &mLabels; - std::vector mPatterns, *mPpatterns = &mPatterns; + std::vector mPatterns, *mPpatterns = &mPatterns; }; /// create a processor spec diff --git a/Detectors/TOF/workflow/include/TOFWorkflowUtils/TOFDigitWriterSplitterSpec.h b/Detectors/TOF/workflow/include/TOFWorkflowUtils/TOFDigitWriterSplitterSpec.h index 8311733203f0f..e2ad14c1a49a1 100644 --- a/Detectors/TOF/workflow/include/TOFWorkflowUtils/TOFDigitWriterSplitterSpec.h +++ b/Detectors/TOF/workflow/include/TOFWorkflowUtils/TOFDigitWriterSplitterSpec.h @@ -33,7 +33,7 @@ class TOFDigitWriterSplitter : public Task { using OutputType = std::vector; using ReadoutWinType = std::vector; - using PatternType = std::vector; + using PatternType = std::vector; using ErrorType = std::vector; using HeaderType = o2::tof::DigitHeader; diff --git a/Detectors/TOF/workflow/src/CompressedDecodingTask.cxx b/Detectors/TOF/workflow/src/CompressedDecodingTask.cxx index c60badeb3fa88..f3c8e17188853 100644 --- a/Detectors/TOF/workflow/src/CompressedDecodingTask.cxx +++ b/Detectors/TOF/workflow/src/CompressedDecodingTask.cxx @@ -99,7 +99,8 @@ void CompressedDecodingTask::postData(ProcessingContext& pc) pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "DIGITS", 0, Lifetime::Timeframe}, *alldigits); pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "READOUTWINDOW", 0, Lifetime::Timeframe}, *row); - std::vector& patterns = mDecoder.getPatterns(); + std::vector& patterns = mDecoder.getPatterns(); + pc.outputs().snapshot(Output{o2::header::gDataOriginTOF, "PATTERNS", 0, Lifetime::Timeframe}, patterns); std::vector& errors = mDecoder.getErrors(); @@ -179,6 +180,10 @@ void CompressedDecodingTask::headerHandler(const CrateHeader_t* crateHeader, con LOG(DEBUG) << "Crate found" << crateHeader->drmID; mInitOrbit = crateOrbit->orbitID; + if (mCurrentOrbit > 0) { + mInitOrbit = mCurrentOrbit; + } + if (mNCrateOpenTF == 0) { mDecoder.setFirstIR({0, mInitOrbit}); } @@ -195,14 +200,22 @@ void CompressedDecodingTask::trailerHandler(const CrateHeader_t* crateHeader, co mNCrateCloseTF++; } - mDecoder.addCrateHeaderData(crateOrbit->orbitID, crateHeader->drmID, crateHeader->bunchID, crateTrailer->eventCounter); + if (mCurrentOrbit > 0) { + mDecoder.addCrateHeaderData(mCurrentOrbit, crateHeader->drmID, crateHeader->bunchID, crateTrailer->eventCounter); + } else { + mDecoder.addCrateHeaderData(crateOrbit->orbitID, crateHeader->drmID, crateHeader->bunchID, crateTrailer->eventCounter); + } // Diagnostics used to fill digit patterns auto numberOfDiagnostics = crateTrailer->numberOfDiagnostics; auto numberOfErrors = crateTrailer->numberOfErrors; for (int i = 0; i < numberOfDiagnostics; i++) { const uint32_t* val = reinterpret_cast(&(diagnostics[i])); - mDecoder.addPattern(*val, crateHeader->drmID, crateOrbit->orbitID, crateHeader->bunchID); + if (mCurrentOrbit > 0) { + mDecoder.addPattern(*val, crateHeader->drmID, mCurrentOrbit, crateHeader->bunchID); // take orbit from crateHeader instead of crateOrbit (it can be wrong, check also for digits!) + } else { + mDecoder.addPattern(*val, crateHeader->drmID, crateOrbit->orbitID, crateHeader->bunchID); + } /* int islot = (*val & 15); @@ -336,8 +349,9 @@ void CompressedDecodingTask::rdhHandler(const o2::header::RAWDataHeader* rdh) { const auto& rdhr = *rdh; // set first orbtìt here (to be check in future), please not remove this!!! + mCurrentOrbit = RDHUtils::getHeartBeatOrbit(rdhr); if (mNCrateOpenTF == 0) { - mInitOrbit = RDHUtils::getHeartBeatOrbit(rdhr); + mInitOrbit = mCurrentOrbit; mDecoder.setFirstIR({0, mInitOrbit}); } @@ -360,7 +374,11 @@ void CompressedDecodingTask::frameHandler(const CrateHeader_t* crateHeader, cons { for (int i = 0; i < frameHeader->numberOfHits; ++i) { auto packedHit = packedHits + i; - mDecoder.InsertDigit(crateHeader->drmID, frameHeader->trmID, packedHit->tdcID, packedHit->chain, packedHit->channel, crateOrbit->orbitID, crateHeader->bunchID, frameHeader->frameID << 13, packedHit->time, packedHit->tot); + if (mCurrentOrbit > 0) { + mDecoder.InsertDigit(crateHeader->drmID, frameHeader->trmID, packedHit->tdcID, packedHit->chain, packedHit->channel, mCurrentOrbit, crateHeader->bunchID, frameHeader->frameID << 13, packedHit->time, packedHit->tot); + } else { + mDecoder.InsertDigit(crateHeader->drmID, frameHeader->trmID, packedHit->tdcID, packedHit->chain, packedHit->channel, crateOrbit->orbitID, crateHeader->bunchID, frameHeader->frameID << 13, packedHit->time, packedHit->tot); + } } }; diff --git a/Detectors/TOF/workflow/src/EntropyEncoderSpec.cxx b/Detectors/TOF/workflow/src/EntropyEncoderSpec.cxx index 7af45cc28c8b2..23a13304c4220 100644 --- a/Detectors/TOF/workflow/src/EntropyEncoderSpec.cxx +++ b/Detectors/TOF/workflow/src/EntropyEncoderSpec.cxx @@ -43,7 +43,7 @@ void EntropyEncoderSpec::run(ProcessingContext& pc) auto cput = mTimer.CpuTime(); mTimer.Start(false); auto compDigits = pc.inputs().get>("compDigits"); - auto pspan = pc.inputs().get>("patterns"); + auto pspan = pc.inputs().get>("patterns"); auto rofs = pc.inputs().get>("ROframes"); auto& buffer = pc.outputs().make>(Output{o2::header::gDataOriginTOF, "CTFDATA", 0, Lifetime::Timeframe}); diff --git a/Detectors/TOF/workflow/src/TOFDigitWriterSpec.cxx b/Detectors/TOF/workflow/src/TOFDigitWriterSpec.cxx index 24a81ffaa1793..580df2e8a879a 100644 --- a/Detectors/TOF/workflow/src/TOFDigitWriterSpec.cxx +++ b/Detectors/TOF/workflow/src/TOFDigitWriterSpec.cxx @@ -26,7 +26,7 @@ template using BranchDefinition = MakeRootTreeWriterSpec::BranchDefinition; using OutputType = std::vector; using ReadoutWinType = std::vector; -using PatternType = std::vector; +using PatternType = std::vector; using ErrorType = std::vector; using LabelsType = std::vector>; using HeaderType = o2::tof::DigitHeader;