diff --git a/HWInterface/RD53FWInterface.cc b/HWInterface/RD53FWInterface.cc index 617ba341bddf1cb2adbc3a971c84ade96f820867..fd77e0836da53c3c20b5823d6f5ba105a3710088 100644 --- a/HWInterface/RD53FWInterface.cc +++ b/HWInterface/RD53FWInterface.cc @@ -227,6 +227,11 @@ void RD53FWInterface::ConfigureBoard(const BeBoard* pBoard) LOG(INFO) << GREEN << std::fixed << std::setprecision(3) << "GTX receiver clock frequency (~160 MHz (~320 MHz) for electrical (optical) readout): " << BOLDYELLOW << gtxClk / 1000. << " MHz" << std::setprecision(-1) << RESET; if(!((fabs(gtxClk / 1000. - 160) < 1) || (fabs(gtxClk / 1000. - 320) < 1))) LOG(ERROR) << BOLDRED << "GTX receiver clock frequency not nominal" << RESET; + + // ################## + // # Reset Metadata # + // ################## + RD53FWInterface::resetNCorruptedNEvents(); } void RD53FWInterface::PrintFWstatus() @@ -343,7 +348,7 @@ void RD53FWInterface::ComposeAndPackChipCommands(const std::vector<uint16_t>& da // ############ for(auto i = 1u; i < data.size(); i += 2) commandList.emplace_back(bits::pack<16, 16>(data[i - 1], data[i])); - // If data.size() is not even, add a sync command + // If data.size() is not even, add a SYNC command if(data.size() % 2 != 0) commandList.emplace_back(bits::pack<16, 16>(data.back(), RD53ACmd::RD53ACmdEncoder::SYNC)); } @@ -534,7 +539,6 @@ void RD53FWInterface::Start(const BeBoard* pBoard) RD53FWInterface::ResetReadBkFIFO(); // @TMP@ : Temporary fix to avoid FIFO empty at readback RD53FWInterface::ResetReadoutBlk(); RD53FWInterface::SendBoardCommandWithStrobe("user.ctrl_regs.fast_cmd_reg_1.start_trigger"); - NCorruptedNEvents = 0; } void RD53FWInterface::Stop() { RD53FWInterface::SendBoardCommandWithStrobe("user.ctrl_regs.fast_cmd_reg_1.stop_trigger"); } @@ -1112,7 +1116,7 @@ void RD53FWInterface::InitializeClockGenerator(const std::string& refClockRate, 0x030E02E6, // VCO selection: 0xyyyyyyEy select VCO1 if CDCE reference is 40 MHz, 0xyyyyyyFy select VCO2 if CDCE reference is > 40 MHz // VCO1, PS = 4, FD = 12, FB = 1, ChargePump 50 uA, Internal Filter, R6.20 = 0, AuxOut = enable, AuxOut = OUT2 0xBD800DF7, // RC network parameters: C2 = 473.5 pF, R2 = 98.6 kOhm, C1 = 0 pF, C3 = 0 pF, R3 = 5 kOhm etc, SEL_DEL1 = 1, SEL_DEL2 = 1 - 0x80001808 // Sync command configuration + 0x80001808 // SYNC command configuration }; // 0xyy8403yy --> 240 MHz, LVDS, phase shift 0 deg diff --git a/HWInterface/RD53FWInterface.h b/HWInterface/RD53FWInterface.h index f74d77cb013d0cb480f54a8555e40d8e47ea4085..014195d5048b6e99fafaa8cf9eb85d1b1d895408 100644 --- a/HWInterface/RD53FWInterface.h +++ b/HWInterface/RD53FWInterface.h @@ -98,6 +98,7 @@ class RD53FWInterface : public BeBoardFWInterface RD53FWconstants::ReadoutSpeed ReadoutSpeed(); bool getChipCommunicationStatus() { return isChipCommunicationOK; } size_t getNCorruptedNEvents() { return NCorruptedNEvents; } + void resetNCorruptedNEvents() { NCorruptedNEvents = 0; } // ############################################# // # hybridId < 0 --> broadcast to all hybrids # diff --git a/settings/logger.conf b/settings/logger.conf index 5241fef9c601da16fa21e953c790311c2c87ba3b..0aeb496d0ccf6757c83564f43fa71336cdcf6818 100755 --- a/settings/logger.conf +++ b/settings/logger.conf @@ -8,22 +8,37 @@ PERFORMANCE_TRACKING = false MAX_LOG_FILE_SIZE = 16777216 ## Throw log files away after 16MB LOG_FLUSH_THRESHOLD = 10 + * DEBUG: FILENAME = "logs/Ph2_ACF_debug.log" - TO_STANDARD_OUTPUT = false ENABLED = false + TO_FILE = false + TO_STANDARD_OUTPUT = false LOG_FLUSH_THRESHOLD = 10 MAX_LOG_FILE_SIZE = 16777216 ## Throw log files away after 16MB + * WARNING: - ENABLED = true FILENAME = "logs/Ph2_ACF_warn.log" + ENABLED = true + TO_FILE = false TO_STANDARD_OUTPUT = true + MILLISECONDS_WIDTH = 3 + LOG_FLUSH_THRESHOLD = 10 + * VERBOSE: + * ERROR: - ENABLED = true FILENAME = "logs/Ph2_ACF_err.log" + ENABLED = true + TO_FILE = false TO_STANDARD_OUTPUT = true + MILLISECONDS_WIDTH = 3 + LOG_FLUSH_THRESHOLD = 10 + * FATAL: - ENABLED = false FILENAME = "logs/Ph2_ACF_fatal.log" + ENABLED = true + TO_FILE = false TO_STANDARD_OUTPUT = true + MILLISECONDS_WIDTH = 3 + LOG_FLUSH_THRESHOLD = 10 diff --git a/tools/RD53CalibBase.cc b/tools/RD53CalibBase.cc index 9d3d3945c780b22082a871e5f6899525b890fa3e..cf07b3c98b18450066509b83404a7247fb57be03 100644 --- a/tools/RD53CalibBase.cc +++ b/tools/RD53CalibBase.cc @@ -195,4 +195,8 @@ void CalibBase::prepareChipQueryForEnDis(const std::string& queryName) fDetectorContainer->setEnabledAll(true); } -void CalibBase::localConfigure(const std::string& histoFileName, int currentRun) { theCurrentRun = currentRun; } +void CalibBase::localConfigure(const std::string& histoFileName, int currentRun) +{ + theCurrentRun = currentRun; + for(const auto cBoard: *fDetectorContainer) static_cast<RD53FWInterface*>(this->fBeBoardFWMap[cBoard->getId()])->resetNCorruptedNEvents(); +} diff --git a/tools/Tool.cc b/tools/Tool.cc index 0fc8db62b1f8d9288ea77062d742887657eb7cbd..0b22a09e061466e1729ea844d131233badd46fc3 100644 --- a/tools/Tool.cc +++ b/tools/Tool.cc @@ -2150,11 +2150,7 @@ void Tool::measureBeBoardData(uint16_t boardId, uint32_t numberOfEvents, int32_t if(!fUseReadNEvents) numberOfEvents = fNReadbackEvents; if(fNormalize) - { - auto cTmp = - fDetectorDataContainer->getObject(boardId)->normalizeAndAverageContainers(fDetectorContainer->getObject(boardId), getChannelGroupHandlerContainer()->getObject(boardId), numberOfEvents); - LOG(DEBUG) << BOLDYELLOW << __PRETTY_FUNCTION__ << cTmp << RESET; - } + fDetectorDataContainer->getObject(boardId)->normalizeAndAverageContainers(fDetectorContainer->getObject(boardId), getChannelGroupHandlerContainer()->getObject(boardId), numberOfEvents); fUseReadNEvents = cUseReadNEvents; // LOG(INFO) << BOLDRED << __PRETTY_FUNCTION__ << " end " << RESET; } diff --git a/tools/Tool.h b/tools/Tool.h index ed7ddc3e192ffa879033f836d56fcb464624131c..ae5ab2daac606af5c295956b55198cf316280953 100644 --- a/tools/Tool.h +++ b/tools/Tool.h @@ -411,7 +411,7 @@ class Tool : public Ph2_System::SystemController std::ofstream* fOfStream; - MetadataHandler* fMetadataHandler; + MetadataHandler* fMetadataHandler{nullptr}; }; #endif