30{
31
32 try {
33 fragment.check();
34 } catch (eformat::Issue &ex) {
36 return StatusCode::SUCCESS;
37 }
38
39
40 const Muon::nsw::NSWTriggerCommonDecoder
decoder{fragment,
"MML1A"};
41
43 ATH_MSG_DEBUG(
"NSW MMTP Common Decoder found exceptions while reading this MML1A fragment from " + std::to_string(fragment.rob_source_id()) +
". Skipping. Error id: "+std::to_string(
decoder.error_id()));
44 return StatusCode::SUCCESS;
45 }
46
47 if (
decoder.get_elinks().size()!=3 &&
decoder.get_elinks().size()!=5) {
48
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;
51 }
52
53
54
55 bool consistent = true;
56 const auto l0 =
static_cast<const Muon::nsw::NSWTriggerMML1AElink*
>(
decoder.get_elinks()[0].
get());
57 for(
const auto& baseLink:
decoder.get_elinks()) {
58 const auto l =
static_cast<const Muon::nsw::NSWTriggerMML1AElink*
>(baseLink.get());
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;}
63 }
64 if (!consistent) {
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;
67 }
68
69
70
73
74
75 uint32_t sid = fragment.rob_source_id ();
76 eformat::helper::SourceIdentifier source_id (sid);
77
79
80
81 rdo->set_sourceID(sid);
82 rdo->set_moduleID(m);
83 rdo->set_ROD_L1ID(fragment.rod_lvl1_id ());
84 rdo->set_ROD_BCID(fragment.rod_bc_id ());
85
86
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());
91
92
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());
101
102
103 rdo->set_l1a_timeout(
l0->l1a_timeout());
104 rdo->set_l1a_engines(
l0->l1a_engine_snapshot());
105
106 for(
const auto& baseLink:
decoder.get_elinks()){
107 const auto l =
dynamic_cast<const Muon::nsw::NSWTriggerMML1AElink*
>(baseLink.get());
108
109 if (
l->l1a_timeout()==0) {
ATH_MSG_DEBUG(
"NSW MMTP Common Decoder reporting timeout condition: unclear if current event can be trusted");}
110
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);
116 }
117 }
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());
125 }
126
127 }
128
129
130 return StatusCode::SUCCESS;
131}
#define ATH_MSG_WARNING(x)
value_type push_back(value_type pElem)
Add an element to the end of the collection.
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
l
Printing final latex table to .tex output file.
NSWMMTPRDO_v1 NSWMMTPRDO
Define the version of the NSW MM RDO class.