Commit b31992cd authored by minime's avatar minime
Browse files

Added command packing by hybrid

parent c00fa28b
......@@ -184,13 +184,16 @@ void RD53FWInterface::ConfigureFromXML(const BeBoard* pBoard)
}
void RD53FWInterface::WriteChipCommand(const std::vector<uint16_t>& data, int hybridId)
// #############################################
// # hybridId < 0 --> broadcast to all hybrids #
// #############################################
{
size_t n32bitWords = (data.size() / 2) + (data.size() % 2);
bool retry;
int nAttempts = 0;
std::vector<uint32_t> commandList;
RD53FWInterface::ComposeAndPackChipCommands(data, hybridId, commandList);
RD53FWInterface::SendChipCommandsPack(commandList);
}
void RD53FWInterface::ComposeAndPackChipCommands(const std::vector<uint16_t>& data, int hybridId, std::vector<uint32_t>& commandList)
{
const size_t n32bitWords = (data.size() / 2) + (data.size() % 2);
// #####################
// # Check if all good #
......@@ -198,25 +201,29 @@ void RD53FWInterface::WriteChipCommand(const std::vector<uint16_t>& data, int hy
if(ReadReg("user.stat_regs.slow_cmd.error_flag") == true) LOG(ERROR) << BOLDRED << "Write-command FIFO error" << RESET;
if(ReadReg("user.stat_regs.slow_cmd.fifo_empty") == false) LOG(ERROR) << BOLDRED << "Write-command FIFO not empty" << RESET;
// #######################
// # Load command vector #
// #######################
std::vector<uint32_t> stackRegisters;
stackRegisters.reserve(n32bitWords + 1);
// Header
stackRegisters.emplace_back(bits::pack<6, 10, 4, 12>(HEADEAR_WRTCMD, (hybridId < 0 ? enabledHybrids : 1 << hybridId), 0, n32bitWords));
// ##########
// # Header #
// ##########
commandList.emplace_back(bits::pack<6, 10, 4, 12>(HEADEAR_WRTCMD, (hybridId < 0 ? enabledHybrids : 1 << hybridId), 0, n32bitWords));
// Commands
for(auto i = 1u; i < data.size(); i += 2) stackRegisters.emplace_back(bits::pack<16, 16>(data[i - 1], data[i]));
// ############
// # Commands #
// ############
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() % 2 != 0) stackRegisters.emplace_back(bits::pack<16, 16>(data.back(), RD53CmdEncoder::SYNC));
if(data.size() % 2 != 0) commandList.emplace_back(bits::pack<16, 16>(data.back(), RD53CmdEncoder::SYNC));
}
void RD53FWInterface::SendChipCommandsPack(const std::vector<uint32_t>& commandList)
{
int nAttempts = 0;
bool retry;
// ###############################
// # Send command(s) to the chip #
// ###############################
RegManager::WriteBlockReg("user.ctrl_regs.Slow_cmd_fifo_din", stackRegisters);
RegManager::WriteBlockReg("user.ctrl_regs.Slow_cmd_fifo_din", commandList);
RegManager::WriteStackReg({{"user.ctrl_regs.Slow_cmd.dispatch_packet", 1}, {"user.ctrl_regs.Slow_cmd.dispatch_packet", 0}});
// ####################################
......@@ -1191,7 +1198,7 @@ void RD53FWInterface::SetAndConfigureFastCommands(const BeBoard* pBoard, uint32_
// #######################################
// # Configuration for digital injection #
// #######################################
RD53::CalCmd calcmd_first(1, 2, 8, 0, 0);
RD53::CalCmd calcmd_first(1, 2, 10, 0, 0);
RD53FWInterface::localCfgFastCmd.fast_cmd_fsm.first_cal_data = calcmd_first.getCalCmd(chipId);
RD53::CalCmd calcmd_second(0, 0, 0, 0, 0);
RD53FWInterface::localCfgFastCmd.fast_cmd_fsm.second_cal_data = calcmd_second.getCalCmd(chipId);
......@@ -1214,7 +1221,7 @@ void RD53FWInterface::SetAndConfigureFastCommands(const BeBoard* pBoard, uint32_
// ######################################
RD53::CalCmd calcmd_first(1, 0, 0, 0, 0);
RD53FWInterface::localCfgFastCmd.fast_cmd_fsm.first_cal_data = calcmd_first.getCalCmd(chipId);
RD53::CalCmd calcmd_second(0, 0, 2, 0, 0);
RD53::CalCmd calcmd_second(0, 0, 1, 0, 0);
RD53FWInterface::localCfgFastCmd.fast_cmd_fsm.second_cal_data = calcmd_second.getCalCmd(chipId);
RD53FWInterface::localCfgFastCmd.fast_cmd_fsm.delay_after_first_prime = (nClkDelays == 0 ? (uint32_t)INJdelay::Loop : nClkDelays);
......
......@@ -103,7 +103,12 @@ class RD53FWInterface : public BeBoardFWInterface
void ChipReset() override;
void ChipReSync() override;
// #############################################
// # hybridId < 0 --> broadcast to all hybrids #
// #############################################
void WriteChipCommand(const std::vector<uint16_t>& data, int hybridId);
void ComposeAndPackChipCommands(const std::vector<uint16_t>& data, int hybridId, std::vector<uint32_t>& commandList);
void SendChipCommandsPack(const std::vector<uint32_t>& commandList);
std::vector<std::pair<uint16_t, uint16_t>> ReadChipRegisters(Ph2_HwDescription::ReadoutChip* pChip);
struct ChipFrame
......
......@@ -437,12 +437,20 @@ void RD53Interface::ReadChipAllLocalReg(ReadoutChip* pChip, const std::string& r
for(auto col = 0u; col < RD53::nCols; col++) pValue.getChannel<uint16_t>(row, col) = pRD53->getTDAC(row, col);
}
void RD53Interface::PackChipCommands(Chip* pChip, const std::string& pRegNode, uint16_t data, std::vector<uint16_t>& commandList)
void RD53Interface::PackChipCommands(Chip* pChip, const std::string& pRegNode, uint16_t data, std::vector<uint16_t>& chipCommandList, bool updateReg)
{
RD53Cmd::WrReg(pChip->getId(), pChip->getRegItem(pRegNode).fAddress, data).appendTo(commandList);
RD53Cmd::WrReg(pChip->getId(), pChip->getRegItem(pRegNode).fAddress, data).appendTo(chipCommandList);
if(updateReg == true) pChip->setReg(pRegNode, data);
}
void RD53Interface::SendCommandsPack(const std::vector<uint16_t>& commandList, int hybridId) { static_cast<RD53FWInterface*>(fBoardFW)->WriteChipCommand(commandList, hybridId); }
void RD53Interface::SendChipCommandsPack(const std::vector<uint16_t>& chipCommandList, int hybridId) { static_cast<RD53FWInterface*>(fBoardFW)->WriteChipCommand(chipCommandList, hybridId); }
void RD53Interface::PackHybridCommands(const std::vector<uint16_t>& chipCommandList, int hybridId, std::vector<uint32_t>& hybridCommandList)
{
static_cast<RD53FWInterface*>(fBoardFW)->ComposeAndPackChipCommands(chipCommandList, hybridId, hybridCommandList);
}
void RD53Interface::SendHybridCommandsPack(const std::vector<uint32_t>& hybridCommandList) { static_cast<RD53FWInterface*>(fBoardFW)->SendChipCommandsPack(hybridCommandList); }
// ###########################
// # Dedicated to minitoring #
......
......@@ -39,8 +39,11 @@ class RD53Interface : public ReadoutChipInterface
bool MaskAllChannels(Ph2_HwDescription::ReadoutChip* pChip, bool mask, bool pVerifLoop = true) override;
bool maskChannelsAndSetInjectionSchema(Ph2_HwDescription::ReadoutChip* pChip, const ChannelGroupBase* group, bool mask, bool inject, bool pVerifLoop = false) override;
void PackChipCommands(Ph2_HwDescription::Chip* pChip, const std::string& pRegNode, uint16_t data, std::vector<uint16_t>& commandList);
void SendCommandsPack(const std::vector<uint16_t>& commandList, int hybridId);
void PackChipCommands(Ph2_HwDescription::Chip* pChip, const std::string& pRegNode, uint16_t data, std::vector<uint16_t>& chipCommandList, bool updateReg = false);
void SendChipCommandsPack(const std::vector<uint16_t>& chipCommandList, int hybridId);
void PackHybridCommands(const std::vector<uint16_t>& chipCommandList, int hybridId, std::vector<uint32_t>& hybridCommandList);
void SendHybridCommandsPack(const std::vector<uint32_t>& hybridCommandList);
private:
std::vector<std::pair<uint16_t, uint16_t>> ReadRD53Reg(Ph2_HwDescription::ReadoutChip* pChip, const std::string& pRegNode);
......
......@@ -19,8 +19,8 @@
#include "Tool.h"
#ifdef __USE_ROOT__
#include "TApplication.h"
#include "../DQMUtils/RD53GainHistograms.h"
#include "TApplication.h"
#endif
// ###################
......
......@@ -194,7 +194,8 @@ void GainOptimization::fillHisto()
void GainOptimization::bitWiseScanGlobal(const std::string& regName, uint32_t nEvents, const float& target, uint16_t startValue, uint16_t stopValue)
{
std::vector<uint16_t> commandList;
std::vector<uint16_t> chipCommandList;
std::vector<uint32_t> hybridCommandList;
uint16_t init;
uint16_t numberOfBits = floor(log2(stopValue - startValue + 1) + 1);
......@@ -232,9 +233,12 @@ void GainOptimization::bitWiseScanGlobal(const std::string& regName, uint32_t nE
// ###########################
for(const auto cBoard: *fDetectorContainer)
for(const auto cOpticalGroup: *cBoard)
{
hybridCommandList.clear();
for(const auto cHybrid: *cOpticalGroup)
{
commandList.clear();
chipCommandList.clear();
int hybridId = cHybrid->getId();
for(const auto cChip: *cHybrid)
......@@ -248,7 +252,7 @@ void GainOptimization::bitWiseScanGlobal(const std::string& regName, uint32_t nE
->PackChipCommands(static_cast<RD53*>(cChip),
regName,
midDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>(),
commandList);
chipCommandList, true);
LOG(INFO) << BOLDMAGENTA << ">>> " << BOLDYELLOW << regName << BOLDMAGENTA << " value for [board/opticalGroup/hybrid/chip = " << BOLDYELLOW << cBoard->getId() << "/"
<< cOpticalGroup->getId() << "/" << cHybrid->getId() << "/" << +cChip->getId() << RESET << BOLDMAGENTA << "] = " << RESET << BOLDYELLOW
......@@ -256,9 +260,13 @@ void GainOptimization::bitWiseScanGlobal(const std::string& regName, uint32_t nE
<< " <<<" << RESET;
}
static_cast<RD53Interface*>(this->fReadoutChipInterface)->SendCommandsPack(commandList, hybridId);
// static_cast<RD53Interface*>(this->fReadoutChipInterface)->SendChipCommandsPack(chipCommandList, hybridId);
static_cast<RD53Interface*>(this->fReadoutChipInterface)->PackHybridCommands(chipCommandList, hybridId, hybridCommandList);
}
static_cast<RD53Interface*>(this->fReadoutChipInterface)->SendHybridCommandsPack(hybridCommandList);
}
// ################
// # Run analysis #
// ################
......@@ -324,9 +332,12 @@ void GainOptimization::bitWiseScanGlobal(const std::string& regName, uint32_t nE
// ###########################
for(const auto cBoard: *fDetectorContainer)
for(const auto cOpticalGroup: *cBoard)
{
hybridCommandList.clear();
for(const auto cHybrid: *cOpticalGroup)
{
commandList.clear();
chipCommandList.clear();
int hybridId = cHybrid->getId();
for(const auto cChip: *cHybrid)
......@@ -336,7 +347,7 @@ void GainOptimization::bitWiseScanGlobal(const std::string& regName, uint32_t nE
->PackChipCommands(static_cast<RD53*>(cChip),
regName,
bestDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>(),
commandList);
chipCommandList, true);
LOG(INFO) << BOLDMAGENTA << ">>> Best " << BOLDYELLOW << regName << BOLDMAGENTA << " value for [board/opticalGroup/hybrid/chip = " << BOLDYELLOW << cBoard->getId() << "/"
<< cOpticalGroup->getId() << "/" << cHybrid->getId() << "/" << +cChip->getId() << BOLDMAGENTA << "] = " << BOLDYELLOW
......@@ -347,9 +358,13 @@ void GainOptimization::bitWiseScanGlobal(const std::string& regName, uint32_t nE
LOG(WARNING) << BOLDRED << ">>> Best " << BOLDYELLOW << regName << BOLDRED << " value for [board/opticalGroup/hybrid/chip = " << BOLDYELLOW << cBoard->getId() << "/"
<< cOpticalGroup->getId() << "/" << cHybrid->getId() << "/" << +cChip->getId() << BOLDRED << "] was not found <<<" << RESET;
static_cast<RD53Interface*>(this->fReadoutChipInterface)->SendCommandsPack(commandList, hybridId);
// static_cast<RD53Interface*>(this->fReadoutChipInterface)->SendChipCommandsPack(chipCommandList, hybridId);
static_cast<RD53Interface*>(this->fReadoutChipInterface)->PackHybridCommands(chipCommandList, hybridId, hybridCommandList);
}
static_cast<RD53Interface*>(this->fReadoutChipInterface)->SendHybridCommandsPack(hybridCommandList);
}
// ################
// # Run analysis #
// ################
......
......@@ -19,8 +19,8 @@
#include "Tool.h"
#ifdef __USE_ROOT__
#include "TApplication.h"
#include "../DQMUtils/RD53PhysicsHistograms.h"
#include "TApplication.h"
#endif
// #######################
......
......@@ -18,8 +18,8 @@
#include "Tool.h"
#ifdef __USE_ROOT__
#include "TApplication.h"
#include "../DQMUtils/RD53PixelAliveHistograms.h"
#include "TApplication.h"
#endif
// #########################
......
......@@ -19,8 +19,8 @@
#include "Tool.h"
#ifdef __USE_ROOT__
#include "TApplication.h"
#include "../DQMUtils/RD53SCurveHistograms.h"
#include "TApplication.h"
#endif
// #####################
......
......@@ -193,7 +193,8 @@ void ThrAdjustment::fillHisto()
void ThrAdjustment::bitWiseScanGlobal(const std::string& regName, uint32_t nEvents, const float& target, uint16_t startValue, uint16_t stopValue)
{
std::vector<uint16_t> commandList;
std::vector<uint16_t> chipCommandList;
std::vector<uint32_t> hybridCommandList;
uint16_t init;
uint16_t numberOfBits = floor(log2(stopValue - startValue + 1) + 1);
......@@ -234,9 +235,12 @@ void ThrAdjustment::bitWiseScanGlobal(const std::string& regName, uint32_t nEven
// ###########################
for(const auto cBoard: *fDetectorContainer)
for(const auto cOpticalGroup: *cBoard)
{
hybridCommandList.clear();
for(const auto cHybrid: *cOpticalGroup)
{
commandList.clear();
chipCommandList.clear();
int hybridId = cHybrid->getId();
for(const auto cChip: *cHybrid)
......@@ -250,7 +254,7 @@ void ThrAdjustment::bitWiseScanGlobal(const std::string& regName, uint32_t nEven
->PackChipCommands(static_cast<RD53*>(cChip),
regName,
midDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>(),
commandList);
chipCommandList, true);
LOG(INFO) << BOLDMAGENTA << ">>> " << BOLDYELLOW << regName << BOLDMAGENTA << " value for [board/opticalGroup/hybrid/chip = " << BOLDYELLOW << cBoard->getId() << "/"
<< cOpticalGroup->getId() << "/" << cHybrid->getId() << "/" << +cChip->getId() << RESET << BOLDMAGENTA << "] = " << RESET << BOLDYELLOW
......@@ -258,9 +262,13 @@ void ThrAdjustment::bitWiseScanGlobal(const std::string& regName, uint32_t nEven
<< " <<<" << RESET;
}
static_cast<RD53Interface*>(this->fReadoutChipInterface)->SendCommandsPack(commandList, hybridId);
// static_cast<RD53Interface*>(this->fReadoutChipInterface)->SendChipCommandsPack(chipCommandList, hybridId);
static_cast<RD53Interface*>(this->fReadoutChipInterface)->PackHybridCommands(chipCommandList, hybridId, hybridCommandList);
}
static_cast<RD53Interface*>(this->fReadoutChipInterface)->SendHybridCommandsPack(hybridCommandList);
}
// ################
// # Run analysis #
// ################
......@@ -314,9 +322,12 @@ void ThrAdjustment::bitWiseScanGlobal(const std::string& regName, uint32_t nEven
// ###########################
for(const auto cBoard: *fDetectorContainer)
for(const auto cOpticalGroup: *cBoard)
{
hybridCommandList.clear();
for(const auto cHybrid: *cOpticalGroup)
{
commandList.clear();
chipCommandList.clear();
int hybridId = cHybrid->getId();
for(const auto cChip: *cHybrid)
......@@ -326,13 +337,13 @@ void ThrAdjustment::bitWiseScanGlobal(const std::string& regName, uint32_t nEven
->PackChipCommands(static_cast<RD53*>(cChip),
regName,
bestDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>(),
commandList);
chipCommandList, true);
static_cast<RD53Interface*>(this->fReadoutChipInterface)
->PackChipCommands(static_cast<RD53*>(cChip),
"VCAL_HIGH",
bestDACDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>(),
commandList);
chipCommandList, true);
LOG(INFO) << BOLDMAGENTA << ">>> Best " << BOLDYELLOW << regName << BOLDMAGENTA << " value for [board/opticalGroup/hybrid/chip = " << BOLDYELLOW << cBoard->getId() << "/"
<< cOpticalGroup->getId() << "/" << cHybrid->getId() << "/" << +cChip->getId() << BOLDMAGENTA << "] = " << BOLDYELLOW
......@@ -342,9 +353,14 @@ void ThrAdjustment::bitWiseScanGlobal(const std::string& regName, uint32_t nEven
else
LOG(WARNING) << BOLDRED << ">>> Best " << BOLDYELLOW << regName << BOLDRED << " value for [board/opticalGroup/hybrid/chip = " << BOLDYELLOW << cBoard->getId() << "/"
<< cOpticalGroup->getId() << "/" << cHybrid->getId() << "/" << +cChip->getId() << BOLDRED << "] was not found <<<" << RESET;
static_cast<RD53Interface*>(this->fReadoutChipInterface)->SendCommandsPack(commandList, hybridId);
// static_cast<RD53Interface*>(this->fReadoutChipInterface)->SendChipCommandsPack(chipCommandList, hybridId);
static_cast<RD53Interface*>(this->fReadoutChipInterface)->PackHybridCommands(chipCommandList, hybridId, hybridCommandList);
}
static_cast<RD53Interface*>(this->fReadoutChipInterface)->SendHybridCommandsPack(hybridCommandList);
}
// ################
// # Run analysis #
// ################
......@@ -354,7 +370,8 @@ void ThrAdjustment::bitWiseScanGlobal(const std::string& regName, uint32_t nEven
std::shared_ptr<DetectorDataContainer> ThrAdjustment::bitWiseScanGlobal_MeasureThr(const std::string& regName, uint32_t nEvents, const float& target, uint16_t startValue, uint16_t stopValue)
{
std::vector<uint16_t> commandList;
std::vector<uint16_t> chipCommandList;
std::vector<uint32_t> hybridCommandList;
uint16_t init;
uint16_t numberOfBits = floor(log2(stopValue - startValue + 1) + 1);
......@@ -393,9 +410,12 @@ std::shared_ptr<DetectorDataContainer> ThrAdjustment::bitWiseScanGlobal_MeasureT
// ###########################
for(const auto cBoard: *fDetectorContainer)
for(const auto cOpticalGroup: *cBoard)
{
hybridCommandList.clear();
for(const auto cHybrid: *cOpticalGroup)
{
commandList.clear();
chipCommandList.clear();
int hybridId = cHybrid->getId();
for(const auto cChip: *cHybrid)
......@@ -409,7 +429,7 @@ std::shared_ptr<DetectorDataContainer> ThrAdjustment::bitWiseScanGlobal_MeasureT
->PackChipCommands(static_cast<RD53*>(cChip),
regName,
midDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>(),
commandList);
chipCommandList, true);
LOG(INFO) << BOLDMAGENTA << ">>> " << BOLDYELLOW << regName << BOLDMAGENTA << " value for [board/opticalGroup/hybrid/chip = " << BOLDYELLOW << cBoard->getId() << "/"
<< cOpticalGroup->getId() << "/" << cHybrid->getId() << "/" << +cChip->getId() << RESET << BOLDMAGENTA << "] = " << RESET << BOLDYELLOW
......@@ -417,9 +437,13 @@ std::shared_ptr<DetectorDataContainer> ThrAdjustment::bitWiseScanGlobal_MeasureT
<< " <<<" << RESET;
}
static_cast<RD53Interface*>(this->fReadoutChipInterface)->SendCommandsPack(commandList, hybridId);
// static_cast<RD53Interface*>(this->fReadoutChipInterface)->SendChipCommandsPack(chipCommandList, hybridId);
static_cast<RD53Interface*>(this->fReadoutChipInterface)->PackHybridCommands(chipCommandList, hybridId, hybridCommandList);
}
static_cast<RD53Interface*>(this->fReadoutChipInterface)->SendHybridCommandsPack(hybridCommandList);
}
// ################
// # Run analysis #
// ################
......
......@@ -271,7 +271,8 @@ void ThrEqualization::fillHisto()
void ThrEqualization::bitWiseScanGlobal(const std::string& regName, uint32_t nEvents, const float& target, uint16_t startValue, uint16_t stopValue)
{
std::vector<uint16_t> commandList;
std::vector<uint16_t> chipCommandList;
std::vector<uint32_t> hybridCommandList;
uint16_t init;
uint16_t numberOfBits = floor(log2(stopValue - startValue + 1) + 1);
......@@ -313,9 +314,12 @@ void ThrEqualization::bitWiseScanGlobal(const std::string& regName, uint32_t nEv
// ###########################
for(const auto cBoard: *fDetectorContainer)
for(const auto cOpticalGroup: *cBoard)
{
hybridCommandList.clear();
for(const auto cHybrid: *cOpticalGroup)
{
commandList.clear();
chipCommandList.clear();
int hybridId = cHybrid->getId();
for(const auto cChip: *cHybrid)
......@@ -329,7 +333,7 @@ void ThrEqualization::bitWiseScanGlobal(const std::string& regName, uint32_t nEv
->PackChipCommands(static_cast<RD53*>(cChip),
regName,
midDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>(),
commandList);
chipCommandList, true);
LOG(INFO) << BOLDMAGENTA << ">>> " << BOLDYELLOW << regName << BOLDMAGENTA << " value for [board/opticalGroup/hybrid/chip = " << BOLDYELLOW << cBoard->getId() << "/"
<< cOpticalGroup->getId() << "/" << cHybrid->getId() << "/" << +cChip->getId() << RESET << BOLDMAGENTA << "] = " << RESET << BOLDYELLOW
......@@ -337,9 +341,13 @@ void ThrEqualization::bitWiseScanGlobal(const std::string& regName, uint32_t nEv
<< " <<<" << RESET;
}
static_cast<RD53Interface*>(this->fReadoutChipInterface)->SendCommandsPack(commandList, hybridId);
// static_cast<RD53Interface*>(this->fReadoutChipInterface)->SendChipCommandsPack(chipCommandList, hybridId);
static_cast<RD53Interface*>(this->fReadoutChipInterface)->PackHybridCommands(chipCommandList, hybridId, hybridCommandList);
}
static_cast<RD53Interface*>(this->fReadoutChipInterface)->SendHybridCommandsPack(hybridCommandList);
}
// ################
// # Run analysis #
// ################
......@@ -395,9 +403,12 @@ void ThrEqualization::bitWiseScanGlobal(const std::string& regName, uint32_t nEv
// ###########################
for(const auto cBoard: *fDetectorContainer)
for(const auto cOpticalGroup: *cBoard)
{
hybridCommandList.clear();
for(const auto cHybrid: *cOpticalGroup)
{
commandList.clear();
chipCommandList.clear();
int hybridId = cHybrid->getId();
for(const auto cChip: *cHybrid)
......@@ -407,7 +418,8 @@ void ThrEqualization::bitWiseScanGlobal(const std::string& regName, uint32_t nEv
->PackChipCommands(static_cast<RD53*>(cChip),
regName,
bestDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>(),
commandList);
chipCommandList, true);
LOG(INFO) << BOLDMAGENTA << ">>> Best " << BOLDYELLOW << regName << BOLDMAGENTA << " value for [board/opticalGroup/hybrid/chip = " << BOLDYELLOW << cBoard->getId() << "/"
<< cOpticalGroup->getId() << "/" << cHybrid->getId() << "/" << +cChip->getId() << BOLDMAGENTA << "] = " << BOLDYELLOW
<< bestDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>() << BOLDMAGENTA
......@@ -417,9 +429,13 @@ void ThrEqualization::bitWiseScanGlobal(const std::string& regName, uint32_t nEv
LOG(WARNING) << BOLDRED << ">>> Best " << BOLDYELLOW << regName << BOLDRED << " value for [board/opticalGroup/hybrid/chip = " << BOLDYELLOW << cBoard->getId() << "/"
<< cOpticalGroup->getId() << "/" << cHybrid->getId() << "/" << +cChip->getId() << BOLDRED << "] was not found <<<" << RESET;
static_cast<RD53Interface*>(this->fReadoutChipInterface)->SendCommandsPack(commandList, hybridId);
// static_cast<RD53Interface*>(this->fReadoutChipInterface)->SendChipCommandsPack(chipCommandList, hybridId);
static_cast<RD53Interface*>(this->fReadoutChipInterface)->PackHybridCommands(chipCommandList, hybridId, hybridCommandList);
}
static_cast<RD53Interface*>(this->fReadoutChipInterface)->SendHybridCommandsPack(hybridCommandList);
}
// ################
// # Run analysis #
// ################
......
......@@ -191,7 +191,8 @@ void ThrMinimization::fillHisto()
void ThrMinimization::bitWiseScanGlobal(const std::string& regName, uint32_t nEvents, const float& target, uint16_t startValue, uint16_t stopValue)
{
std::vector<uint16_t> commandList;
std::vector<uint16_t> chipCommandList;
std::vector<uint32_t> hybridCommandList;
uint16_t init;
uint16_t numberOfBits = floor(log2(stopValue - startValue + 1) + 1);
......@@ -229,9 +230,12 @@ void ThrMinimization::bitWiseScanGlobal(const std::string& regName, uint32_t nEv
// ###########################
for(const auto cBoard: *fDetectorContainer)
for(const auto cOpticalGroup: *cBoard)
{
hybridCommandList.clear();
for(const auto cHybrid: *cOpticalGroup)
{
commandList.clear();
chipCommandList.clear();
int hybridId = cHybrid->getId();
for(const auto cChip: *cHybrid)
......@@ -245,7 +249,7 @@ void ThrMinimization::bitWiseScanGlobal(const std::string& regName, uint32_t nEv
->PackChipCommands(static_cast<RD53*>(cChip),
regName,
midDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>(),
commandList);
chipCommandList, true);
LOG(INFO) << BOLDMAGENTA << ">>> " << BOLDYELLOW << regName << BOLDMAGENTA << " value for [board/opticalGroup/hybrid/chip = " << BOLDYELLOW << cBoard->getId() << "/"
<< cOpticalGroup->getId() << "/" << cHybrid->getId() << "/" << +cChip->getId() << RESET << BOLDMAGENTA << "] = " << RESET << BOLDYELLOW
......@@ -253,9 +257,13 @@ void ThrMinimization::bitWiseScanGlobal(const std::string& regName, uint32_t nEv
<< " <<<" << RESET;
}
static_cast<RD53Interface*>(this->fReadoutChipInterface)->SendCommandsPack(commandList, hybridId);
// static_cast<RD53Interface*>(this->fReadoutChipInterface)->SendChipCommandsPack(chipCommandList, hybridId);
static_cast<RD53Interface*>(this->fReadoutChipInterface)->PackHybridCommands(chipCommandList, hybridId, hybridCommandList);
}
static_cast<RD53Interface*>(this->fReadoutChipInterface)->SendHybridCommandsPack(hybridCommandList);
}
// ################
// # Run analysis #
// ################
......@@ -311,9 +319,12 @@ void ThrMinimization::bitWiseScanGlobal(const std::string& regName, uint32_t nEv
// ###########################
for(const auto cBoard: *fDetectorContainer)
for(const auto cOpticalGroup: *cBoard)
{
hybridCommandList.clear();
for(const auto cHybrid: *cOpticalGroup)
{
commandList.clear();
chipCommandList.clear();
int hybridId = cHybrid->getId();
for(const auto cChip: *cHybrid)
......@@ -323,7 +334,7 @@ void ThrMinimization::bitWiseScanGlobal(const std::string& regName, uint32_t nEv
->PackChipCommands(static_cast<RD53*>(cChip),
regName,
bestDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>(),
commandList);
chipCommandList, true);
LOG(INFO) << BOLDMAGENTA << ">>> Best " << BOLDYELLOW << regName << BOLDMAGENTA << " value for [board/opticalGroup/hybrid/chip = " << BOLDYELLOW << cBoard->getId() << "/"
<< cOpticalGroup->getId() << "/" << cHybrid->getId() << "/" << +cChip->getId() << BOLDMAGENTA << "] = " << BOLDYELLOW
......@@ -334,9 +345,13 @@ void ThrMinimization::bitWiseScanGlobal(const std::string& regName, uint32_t nEv
LOG(WARNING) << BOLDRED << ">>> Best " << BOLDYELLOW << regName << BOLDRED << " value for [board/opticalGroup/hybrid/chip = " << BOLDYELLOW << cBoard->getId() << "/"
<< cOpticalGroup->getId() << "/" << cHybrid->getId() << "/" << +cChip->getId() << BOLDRED << "] was not found <<<" << RESET;
static_cast<RD53Interface*>(this->fReadoutChipInterface)->SendCommandsPack(commandList, hybridId);
// static_cast<RD53Interface*>(this->fReadoutChipInterface)->SendChipCommandsPack(chipCommandList, hybridId);
static_cast<RD53Interface*>(this->fReadoutChipInterface)->PackHybridCommands(chipCommandList, hybridId, hybridCommandList);
}
static_cast<RD53Interface*>(this->fReadoutChipInterface)->SendHybridCommandsPack(hybridCommandList);
}
// ################
// # Run analysis #
// ################
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment