Commit 192adea3 authored by Mauro Dinardo's avatar Mauro Dinardo
Browse files

Added command packing by hybrid

parent 69551862
......@@ -437,6 +437,13 @@ 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)
{
RD53Cmd::WrReg(pChip->getId(), pChip->getRegItem(pRegNode).fAddress, data).appendTo(commandList);
}
void RD53Interface::SendCommandsPack(const std::vector<uint16_t>& commandList, int hybridId) { static_cast<RD53FWInterface*>(fBoardFW)->WriteChipCommand(commandList, hybridId); }
// ###########################
// # Dedicated to minitoring #
// ###########################
......
......@@ -39,6 +39,9 @@ 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);
private:
std::vector<std::pair<uint16_t, uint16_t>> ReadRD53Reg(Ph2_HwDescription::ReadoutChip* pChip, const std::string& pRegNode);
void WriteRD53Mask(Ph2_HwDescription::RD53* pRD53, bool doSparse, bool doDefault, bool pVerifLoop = false);
......
......@@ -194,6 +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;
uint16_t init;
uint16_t numberOfBits = floor(log2(stopValue - startValue + 1) + 1);
......@@ -231,24 +233,31 @@ void GainOptimization::bitWiseScanGlobal(const std::string& regName, uint32_t nE
for(const auto cBoard: *fDetectorContainer)
for(const auto cOpticalGroup: *cBoard)
for(const auto cHybrid: *cOpticalGroup)
for(const auto cChip: *cHybrid)
{
midDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>() =
(minDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>() +
maxDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>()) /
2;
this->fReadoutChipInterface->WriteChipReg(
static_cast<RD53*>(cChip),
regName,
midDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>(),
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
<< midDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>() << BOLDMAGENTA
<< " <<<" << RESET;
}
{
commandList.clear();
int hybridId = cHybrid->getId();
for(const auto cChip: *cHybrid)
{
midDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>() =
(minDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>() +
maxDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>()) /
2;
static_cast<RD53Interface*>(this->fReadoutChipInterface)
->PackChipCommands(static_cast<RD53*>(cChip),
regName,
midDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>(),
commandList);
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
<< midDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>() << BOLDMAGENTA
<< " <<<" << RESET;
}
static_cast<RD53Interface*>(this->fReadoutChipInterface)->SendCommandsPack(commandList, hybridId);
}
// ################
// # Run analysis #
......@@ -316,14 +325,18 @@ void GainOptimization::bitWiseScanGlobal(const std::string& regName, uint32_t nE
for(const auto cBoard: *fDetectorContainer)
for(const auto cOpticalGroup: *cBoard)
for(const auto cHybrid: *cOpticalGroup)
{
commandList.clear();
int hybridId = cHybrid->getId();
for(const auto cChip: *cHybrid)
if(bestDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>() != 0)
{
this->fReadoutChipInterface->WriteChipReg(
static_cast<RD53*>(cChip),
regName,
bestDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>(),
true);
static_cast<RD53Interface*>(this->fReadoutChipInterface)
->PackChipCommands(static_cast<RD53*>(cChip),
regName,
bestDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>(),
commandList);
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,6 +347,9 @@ 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);
}
// ################
// # Run analysis #
// ################
......
......@@ -193,6 +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;
uint16_t init;
uint16_t numberOfBits = floor(log2(stopValue - startValue + 1) + 1);
......@@ -233,6 +235,10 @@ void ThrAdjustment::bitWiseScanGlobal(const std::string& regName, uint32_t nEven
for(const auto cBoard: *fDetectorContainer)
for(const auto cOpticalGroup: *cBoard)
for(const auto cHybrid: *cOpticalGroup)
{
commandList.clear();
int hybridId = cHybrid->getId();
for(const auto cChip: *cHybrid)
{
midDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>() =
......@@ -240,11 +246,11 @@ void ThrAdjustment::bitWiseScanGlobal(const std::string& regName, uint32_t nEven
maxDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>()) /
2;
this->fReadoutChipInterface->WriteChipReg(
static_cast<RD53*>(cChip),
regName,
midDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>(),
true);
static_cast<RD53Interface*>(this->fReadoutChipInterface)
->PackChipCommands(static_cast<RD53*>(cChip),
regName,
midDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>(),
commandList);
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
......@@ -252,6 +258,9 @@ void ThrAdjustment::bitWiseScanGlobal(const std::string& regName, uint32_t nEven
<< " <<<" << RESET;
}
static_cast<RD53Interface*>(this->fReadoutChipInterface)->SendCommandsPack(commandList, hybridId);
}
// ################
// # Run analysis #
// ################
......@@ -306,20 +315,24 @@ void ThrAdjustment::bitWiseScanGlobal(const std::string& regName, uint32_t nEven
for(const auto cBoard: *fDetectorContainer)
for(const auto cOpticalGroup: *cBoard)
for(const auto cHybrid: *cOpticalGroup)
{
commandList.clear();
int hybridId = cHybrid->getId();
for(const auto cChip: *cHybrid)
if(bestDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>() != 0)
{
this->fReadoutChipInterface->WriteChipReg(
static_cast<RD53*>(cChip),
regName,
bestDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>(),
true);
this->fReadoutChipInterface->WriteChipReg(
static_cast<RD53*>(cChip),
"VCAL_HIGH",
bestDACDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>(),
true);
static_cast<RD53Interface*>(this->fReadoutChipInterface)
->PackChipCommands(static_cast<RD53*>(cChip),
regName,
bestDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>(),
commandList);
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);
LOG(INFO) << BOLDMAGENTA << ">>> Best " << BOLDYELLOW << regName << BOLDMAGENTA << " value for [board/opticalGroup/hybrid/chip = " << BOLDYELLOW << cBoard->getId() << "/"
<< cOpticalGroup->getId() << "/" << cHybrid->getId() << "/" << +cChip->getId() << BOLDMAGENTA << "] = " << BOLDYELLOW
......@@ -329,6 +342,8 @@ 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);
}
// ################
// # Run analysis #
......@@ -339,6 +354,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;
uint16_t init;
uint16_t numberOfBits = floor(log2(stopValue - startValue + 1) + 1);
......@@ -377,6 +394,10 @@ std::shared_ptr<DetectorDataContainer> ThrAdjustment::bitWiseScanGlobal_MeasureT
for(const auto cBoard: *fDetectorContainer)
for(const auto cOpticalGroup: *cBoard)
for(const auto cHybrid: *cOpticalGroup)
{
commandList.clear();
int hybridId = cHybrid->getId();
for(const auto cChip: *cHybrid)
{
midDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>() =
......@@ -384,11 +405,11 @@ std::shared_ptr<DetectorDataContainer> ThrAdjustment::bitWiseScanGlobal_MeasureT
maxDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>()) /
2;
this->fReadoutChipInterface->WriteChipReg(
static_cast<RD53*>(cChip),
regName,
midDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>(),
true);
static_cast<RD53Interface*>(this->fReadoutChipInterface)
->PackChipCommands(static_cast<RD53*>(cChip),
regName,
midDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>(),
commandList);
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
......@@ -396,6 +417,9 @@ std::shared_ptr<DetectorDataContainer> ThrAdjustment::bitWiseScanGlobal_MeasureT
<< " <<<" << RESET;
}
static_cast<RD53Interface*>(this->fReadoutChipInterface)->SendCommandsPack(commandList, hybridId);
}
// ################
// # Run analysis #
// ################
......
......@@ -272,6 +272,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;
uint16_t init;
uint16_t numberOfBits = floor(log2(stopValue - startValue + 1) + 1);
......@@ -329,6 +331,10 @@ void ThrEqualization::bitWiseScanGlobal(const std::string& regName, uint32_t nEv
for(const auto cBoard: *fDetectorContainer)
for(const auto cOpticalGroup: *cBoard)
for(const auto cHybrid: *cOpticalGroup)
{
commandList.clear();
int hybridId = cHybrid->getId();
for(const auto cChip: *cHybrid)
{
midDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>() =
......@@ -336,11 +342,11 @@ void ThrEqualization::bitWiseScanGlobal(const std::string& regName, uint32_t nEv
maxDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>()) /
2;
this->fReadoutChipInterface->WriteChipReg(
static_cast<RD53*>(cChip),
regName,
midDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>(),
true);
static_cast<RD53Interface*>(this->fReadoutChipInterface)
->PackChipCommands(static_cast<RD53*>(cChip),
regName,
midDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>(),
commandList);
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
......@@ -348,6 +354,9 @@ void ThrEqualization::bitWiseScanGlobal(const std::string& regName, uint32_t nEv
<< " <<<" << RESET;
}
static_cast<RD53Interface*>(this->fReadoutChipInterface)->SendCommandsPack(commandList, hybridId);
}
// ################
// # Run analysis #
// ################
......@@ -404,15 +413,18 @@ void ThrEqualization::bitWiseScanGlobal(const std::string& regName, uint32_t nEv
for(const auto cBoard: *fDetectorContainer)
for(const auto cOpticalGroup: *cBoard)
for(const auto cHybrid: *cOpticalGroup)
{
commandList.clear();
int hybridId = cHybrid->getId();
for(const auto cChip: *cHybrid)
if(bestDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>() != 0)
{
this->fReadoutChipInterface->WriteChipReg(
static_cast<RD53*>(cChip),
regName,
bestDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>(),
true);
static_cast<RD53Interface*>(this->fReadoutChipInterface)
->PackChipCommands(static_cast<RD53*>(cChip),
regName,
bestDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>(),
commandList);
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
......@@ -422,6 +434,9 @@ 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);
}
// ################
// # Run analysis #
// ################
......
......@@ -191,6 +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;
uint16_t init;
uint16_t numberOfBits = floor(log2(stopValue - startValue + 1) + 1);
......@@ -228,6 +230,10 @@ void ThrMinimization::bitWiseScanGlobal(const std::string& regName, uint32_t nEv
for(const auto cBoard: *fDetectorContainer)
for(const auto cOpticalGroup: *cBoard)
for(const auto cHybrid: *cOpticalGroup)
{
commandList.clear();
int hybridId = cHybrid->getId();
for(const auto cChip: *cHybrid)
{
midDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>() =
......@@ -235,11 +241,11 @@ void ThrMinimization::bitWiseScanGlobal(const std::string& regName, uint32_t nEv
maxDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>()) /
2;
this->fReadoutChipInterface->WriteChipReg(
static_cast<RD53*>(cChip),
regName,
midDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>(),
true);
static_cast<RD53Interface*>(this->fReadoutChipInterface)
->PackChipCommands(static_cast<RD53*>(cChip),
regName,
midDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>(),
commandList);
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
......@@ -247,6 +253,9 @@ void ThrMinimization::bitWiseScanGlobal(const std::string& regName, uint32_t nEv
<< " <<<" << RESET;
}
static_cast<RD53Interface*>(this->fReadoutChipInterface)->SendCommandsPack(commandList, hybridId);
}
// ################
// # Run analysis #
// ################
......@@ -303,14 +312,18 @@ void ThrMinimization::bitWiseScanGlobal(const std::string& regName, uint32_t nEv
for(const auto cBoard: *fDetectorContainer)
for(const auto cOpticalGroup: *cBoard)
for(const auto cHybrid: *cOpticalGroup)
{
commandList.clear();
int hybridId = cHybrid->getId();
for(const auto cChip: *cHybrid)
if(bestDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>() != 0)
{
this->fReadoutChipInterface->WriteChipReg(
static_cast<RD53*>(cChip),
regName,
bestDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>(),
true);
static_cast<RD53Interface*>(this->fReadoutChipInterface)
->PackChipCommands(static_cast<RD53*>(cChip),
regName,
bestDACcontainer.at(cBoard->getIndex())->at(cOpticalGroup->getIndex())->at(cHybrid->getIndex())->at(cChip->getIndex())->getSummary<uint16_t>(),
commandList);
LOG(INFO) << BOLDMAGENTA << ">>> Best " << BOLDYELLOW << regName << BOLDMAGENTA << " value for [board/opticalGroup/hybrid/chip = " << BOLDYELLOW << cBoard->getId() << "/"
<< cOpticalGroup->getId() << "/" << cHybrid->getId() << "/" << +cChip->getId() << BOLDMAGENTA << "] = " << BOLDYELLOW
......@@ -321,6 +334,9 @@ 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);
}
// ################
// # 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