19 size_t nb_mon_rdos = 0, nb_ref_rdos = 0;
27 if (nb_ref_rdos == 0) {
29 return StatusCode::FAILURE;
31 if (nb_mon_rdos == 0) {
33 return StatusCode::FAILURE;
36 ATH_MSG_DEBUG(
"nb modules: ref: " << reference_rdos.size() <<
", mon: "
37 << monitored_rdos.size());
38 ATH_MSG_DEBUG(
"nb RDOs: ref: " << nb_ref_rdos <<
", mon: " << nb_mon_rdos);
40 size_t err_module_missing_from_ref = 0;
41 size_t err_module_missing_from_mon = 0;
42 size_t err_rdo_missing_from_ref = 0;
43 size_t err_rdo_missing_from_mon = 0;
44 size_t err_rdo_contents = 0;
47 std::set<Identifier> ref_modules;
48 for (
auto const & [module_id, _]: reference_rdos) {
49 ref_modules.insert(module_id);
52 for (
auto const & [module_id, mon_module_rdos]: monitored_rdos) {
53 auto const ref_module_rdos_it = reference_rdos.find(module_id);
54 if (ref_module_rdos_it == reference_rdos.end()) {
56 err_module_missing_from_ref += 1;
61 ref_modules.erase(module_id);
63 auto const & ref_module_rdos = ref_module_rdos_it->second;
66 std::set<Identifier> ref_rdo_ids;
67 for (
auto const & [ref_rdo_id, _]: ref_module_rdos) {
68 ref_rdo_ids.insert(ref_rdo_id);
71 for (
auto const & [mon_rdo_id, mon_rdo_word]: mon_module_rdos) {
72 auto const ref_rdo_it = ref_module_rdos.find(mon_rdo_id);
73 if (ref_rdo_it == ref_module_rdos.end()) {
75 <<
": module ID: " << module_id
76 <<
", RDO ID: " << mon_rdo_id);
77 err_rdo_missing_from_ref += 1;
82 ref_rdo_ids.erase(mon_rdo_id);
84 auto const & ref_rdo = *ref_rdo_it;
85 if (mon_rdo_word != ref_rdo.second) {
87 <<
": module ID: " << module_id
88 <<
", RDO id: " << mon_rdo_id
89 <<
", ref: " << ref_rdo.second
90 <<
", mon: " << mon_rdo_word);
91 err_rdo_contents += 1;
96 for (
auto const & rdo_id: ref_rdo_ids) {
98 <<
": module ID: " << module_id
99 <<
", RDO ID:" << rdo_id);
100 err_rdo_missing_from_mon += 1;
105 for (
auto const & module_id: ref_modules) {
107 err_module_missing_from_mon += 1;
110 if (err_module_missing_from_mon || err_module_missing_from_ref
111 || err_rdo_missing_from_mon || err_rdo_missing_from_ref
115 <<
" (total collections: " << reference_rdos.size()
116 <<
", total RDOs: ref: " << nb_ref_rdos <<
", mon: " << nb_mon_rdos <<
")"
117 <<
": module missing from ref: " << err_module_missing_from_ref
118 <<
", module missing from mon: " << err_module_missing_from_mon
119 <<
", RDO missing from ref: " << err_rdo_missing_from_ref
120 <<
", RDO missing from mon: " << err_rdo_missing_from_mon
121 <<
", RDO contents: " << err_rdo_contents
123 return StatusCode::FAILURE;
128 return StatusCode::SUCCESS;
156 using PixelRawDataContainerProxy =
159 auto pixel_rdo_container_collection_proxy =
162 for (PixelRawDataContainerProxy module_rdo_container_proxy :
163 pixel_rdo_container_collection_proxy) {
164 if (module_rdo_container_proxy.empty()) {
167 const IdentifierHash module_hash = module_rdo_container_proxy.identifyHash();
170 std::map<Identifier, unsigned int> & module_rdos = sorted_rdos[module_id];
172 for (PixelRawDataProxy rdo: module_rdo_container_proxy) {
174 const int16_t row = rdo.coordinates()[0];
175 const int16_t col = rdo.coordinates()[1];
177 module_rdos[rdo_id] = rdo.dataWord();
181 return StatusCode::SUCCESS;