7 #include "Identifier/Identifier.h"
8 #include "eformat/Issue.h"
9 #include "eformat/SourceIdentifier.h"
20 declareInterface<INSWMMTP_ROD_Decoder>(
this );
26 return StatusCode::SUCCESS;
36 return StatusCode::SUCCESS;
44 return StatusCode::SUCCESS;
47 if (
decoder.get_elinks().size()!=3 &&
decoder.get_elinks().size()!=5) {
49 ATH_MSG_DEBUG(
"NSW MMTP Common Decoder didn't give 3 or 5 elinks in output: something off with this fragment. Skipping.");
50 return StatusCode::SUCCESS;
55 bool consistent =
true;
57 for(
const auto& baseLink:
decoder.get_elinks()) {
59 if (
l0->head_sectID() !=
l->head_sectID()) {consistent =
false;
break;}
60 if (
l0->L1ID() !=
l->L1ID()) {consistent =
false;
break;}
61 if (
l0->l1a_versionID() !=
l->l1a_versionID()) {consistent =
false;
break;}
62 if (
l0->l1a_req_BCID() !=
l->l1a_req_BCID()) {consistent =
false;
break;}
65 ATH_MSG_DEBUG(
"NSW MMTP Common Decoder found inconsistent header parameters in the elinks: something off with this fragment. Skipping.");
66 return StatusCode::SUCCESS;
75 uint32_t sid = fragment.rob_source_id ();
76 eformat::helper::SourceIdentifier source_id (sid);
81 rdo->set_sourceID(sid);
83 rdo->set_ROD_L1ID(fragment.rod_lvl1_id ());
84 rdo->set_ROD_BCID(fragment.rod_bc_id ());
87 rdo->set_EC(
l0->head_EC());
88 rdo->set_sectID(
l0->head_sectID());
89 rdo->set_L1ID(
l0->L1ID());
90 rdo->set_BCID(
l0->head_BCID());
93 rdo->set_l1a_request_BCID(
l0->l1a_local_req_BCID());
94 rdo->set_l1a_release_BCID(
l0->l1a_local_rel_BCID());
95 rdo->set_l1a_window_open(
l0->l1a_open_BCID());
96 rdo->set_l1a_window_center(
l0->l1a_req_BCID());
97 rdo->set_l1a_window_close(
l0->l1a_close_BCID());
98 rdo->set_l1a_window_open_offset(
l0->l1a_open_BCID_offset());
99 rdo->set_l1a_window_center_offset(
l0->l1a_req_BCID_offset());
100 rdo->set_l1a_window_close_offset(
l0->l1a_close_BCID_offset());
103 rdo->set_l1a_timeout(
l0->l1a_timeout());
104 rdo->set_l1a_engines(
l0->l1a_engine_snapshot());
106 for(
const auto& baseLink:
decoder.get_elinks()){
109 if (
l->l1a_timeout()==0) {
ATH_MSG_DEBUG(
"NSW MMTP Common Decoder reporting timeout condition: unclear if current event can be trusted");}
111 for (
const auto&
a:
l->art_packets()) {
112 for (
const auto&
c:
a->channels()) {
113 rdo->art_BCID().push_back(
a->art_BCID());
114 rdo->art_layer().push_back(
c.first);
115 rdo->art_channel().push_back(
c.second);
118 for (
const auto&
t:
l->trig_packets()) {
119 rdo->trig_globalX().push_back(
t->trig_globalX());
120 rdo->trig_globalU().push_back(
t->trig_globalU());
121 rdo->trig_BCID().push_back(
t->trig_BCID());
122 rdo->trig_dTheta().push_back(
t->trig_dTheta());
123 rdo->trig_ROI_rID().push_back(
t->trig_rBin());
124 rdo->trig_ROI_phiID().push_back(
t->trig_phiBin());
130 return StatusCode::SUCCESS;