Skip to content
Snippets Groups Projects
Commit 0527bd94 authored by Rafal Bielski's avatar Rafal Bielski :wave:
Browse files

Add CheckDataConsistency option to MTCalibPebHypoTool

parent 8246251f
No related branches found
No related tags found
No related merge requests found
...@@ -91,6 +91,7 @@ class MTCalibPebHypoOptions: ...@@ -91,6 +91,7 @@ class MTCalibPebHypoOptions:
self.NumBurnCycles = 0 self.NumBurnCycles = 0
self.BurnTimeRandomly = True self.BurnTimeRandomly = True
self.Crunch = False self.Crunch = False
self.CheckDataConsistency = False
self.ROBAccessDict = rob_access_dict self.ROBAccessDict = rob_access_dict
self.TimeBetweenROBReqMillisec = 0 self.TimeBetweenROBReqMillisec = 0
self.PEBROBList = [] self.PEBROBList = []
...@@ -168,6 +169,7 @@ def make_hypo_tool(name, options=default_options): ...@@ -168,6 +169,7 @@ def make_hypo_tool(name, options=default_options):
hypo_tool.NumBurnCycles = options.NumBurnCycles hypo_tool.NumBurnCycles = options.NumBurnCycles
hypo_tool.BurnTimeRandomly = options.BurnTimeRandomly hypo_tool.BurnTimeRandomly = options.BurnTimeRandomly
hypo_tool.Crunch = options.Crunch hypo_tool.Crunch = options.Crunch
hypo_tool.CheckDataConsistency = options.CheckDataConsistency
hypo_tool.ROBAccessDict = options.ROBAccessDict hypo_tool.ROBAccessDict = options.ROBAccessDict
hypo_tool.TimeBetweenROBReqMillisec = options.TimeBetweenROBReqMillisec hypo_tool.TimeBetweenROBReqMillisec = options.TimeBetweenROBReqMillisec
hypo_tool.PEBROBList = options.PEBROBList hypo_tool.PEBROBList = options.PEBROBList
......
...@@ -21,6 +21,7 @@ MTCalibPebConfig.default_options.BurnTimePerCycleMillisec = get_opt('BurnTimePer ...@@ -21,6 +21,7 @@ MTCalibPebConfig.default_options.BurnTimePerCycleMillisec = get_opt('BurnTimePer
MTCalibPebConfig.default_options.NumBurnCycles = get_opt('NumBurnCycles', 10) MTCalibPebConfig.default_options.NumBurnCycles = get_opt('NumBurnCycles', 10)
MTCalibPebConfig.default_options.BurnTimeRandomly = get_opt('BurnTimeRandomly', True) MTCalibPebConfig.default_options.BurnTimeRandomly = get_opt('BurnTimeRandomly', True)
MTCalibPebConfig.default_options.Crunch = get_opt('Crunch', False) MTCalibPebConfig.default_options.Crunch = get_opt('Crunch', False)
MTCalibPebConfig.default_options.CheckDataConsistency = get_opt('CheckDataConsistency', False)
MTCalibPebConfig.default_options.ROBAccessDict = get_opt('ROBAccessDict', MTCalibPebConfig.rob_access_dict) MTCalibPebConfig.default_options.ROBAccessDict = get_opt('ROBAccessDict', MTCalibPebConfig.rob_access_dict)
MTCalibPebConfig.default_options.TimeBetweenROBReqMillisec = get_opt('TimeBetweenROBReqMillisec', 0) MTCalibPebConfig.default_options.TimeBetweenROBReqMillisec = get_opt('TimeBetweenROBReqMillisec', 0)
MTCalibPebConfig.default_options.PEBROBList = get_opt('PEBROBList', []) MTCalibPebConfig.default_options.PEBROBList = get_opt('PEBROBList', [])
......
...@@ -229,8 +229,22 @@ StatusCode MTCalibPebHypoTool::decide(const MTCalibPebHypoTool::Input& input) co ...@@ -229,8 +229,22 @@ StatusCode MTCalibPebHypoTool::decide(const MTCalibPebHypoTool::Input& input) co
IROBDataProviderSvc::VROBFRAG robFragments; IROBDataProviderSvc::VROBFRAG robFragments;
m_robDataProviderSvc->getROBData(input.eventContext, robs, robFragments, name()+"-GET"); m_robDataProviderSvc->getROBData(input.eventContext, robs, robFragments, name()+"-GET");
ATH_MSG_DEBUG("Number of ROBs retrieved: " << robFragments.size()); ATH_MSG_DEBUG("Number of ROBs retrieved: " << robFragments.size());
if (!robFragments.empty()) if (!robFragments.empty()) {
ATH_MSG_DEBUG("List of ROBs found: " << std::endl << format(robFragments)); ATH_MSG_DEBUG("List of ROBs found: " << std::endl << format(robFragments));
}
if (m_checkDataConsistency.value()) {
for (const IROBDataProviderSvc::ROBF* rob : robFragments) {
try {
if (!rob->check_rob() || !rob->check_rod()) {
ATH_MSG_ERROR("Data consistency check failed");
}
}
catch (const std::exception& ex) {
ATH_MSG_ERROR("Data consistency check failed: " << ex.what());
}
ATH_MSG_DEBUG("Data consistency check passed for ROB 0x" << std::hex << rob->rob_source_id() << std::dec);
}
}
} }
if (instr.type == ReqType::COL) { if (instr.type == ReqType::COL) {
// Event building // Event building
......
...@@ -84,6 +84,10 @@ private: ...@@ -84,6 +84,10 @@ private:
this, "Crunch", false, this, "Crunch", false,
"Crunch CPU instead of sleeping" "Crunch CPU instead of sleeping"
}; };
Gaudi::Property<bool> m_checkDataConsistency {
this, "CheckDataConsistency", false,
"Perform consistency checks for all retrieved ROB data"
};
Gaudi::Property<std::map<std::string,std::vector<uint32_t> > > m_robAccessDictProp { Gaudi::Property<std::map<std::string,std::vector<uint32_t> > > m_robAccessDictProp {
this, "ROBAccessDict", {}, this, "ROBAccessDict", {},
"Dictionary of prefetch/retrieve operations with given ROB IDs. The value is a vector of ROB IDs. " "Dictionary of prefetch/retrieve operations with given ROB IDs. The value is a vector of ROB IDs. "
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment