5 #include "Identifier/Identifier.h"
6 #include "eformat/Issue.h"
7 #include "eformat/SourceIdentifier.h"
16 using namespace nsw::STGTPSegments;
24 declareInterface<INSWTP_ROD_Decoder>(
this);
29 return StatusCode::SUCCESS;
39 return StatusCode::FAILURE;
44 for(
const auto& baseLink: nsw_trigger_decoder.
get_elinks()){
48 const auto link = std::dynamic_pointer_cast<Muon::nsw::NSWTriggerSTGL1AElink>(baseLink);
50 const std::shared_ptr<Muon::nsw::NSWResourceId>& elinkID = link->elinkId ();
57 rdo->set_moduleID(moduleID);
60 rdo->set_ROD_L1ID(fragment.rod_lvl1_id ());
61 rdo->set_sectID(link->head_sectID());
62 rdo->set_EC(link->head_EC());
63 rdo->set_BCID(link->head_BCID());
64 rdo->set_L1ID(link->L1ID());
65 rdo->set_window_open_bcid(link->l1a_open_BCID());
66 rdo->set_l1a_request_bcid(link->l1a_req_BCID());
67 rdo->set_window_close_bcid(link->l1a_close_BCID());
68 rdo->set_config_window_open_bcid_offset(link->l1a_open_BCID_offset());
69 rdo->set_config_l1a_request_bcid_offset(link->l1a_req_BCID_offset());
70 rdo->set_config_window_close_bcid_offset(link->l1a_close_BCID_offset());
80 const std::vector<STGTPPadPacket>& pad_packets = link->pad_packets();
81 for(
uint i_packetIndex = 0; i_packetIndex<pad_packets.size(); i_packetIndex++){
83 for(
uint i_candidateIndex=0; i_candidateIndex < 4; i_candidateIndex++){
84 if(pad_packet.
BandID(i_candidateIndex) == 255 && pad_packet.
PhiID(i_candidateIndex) == 63)
continue;
85 uint8_t candidateNumber = (i_packetIndex<<4) | i_candidateIndex;
86 rdo->pad_candidateNumber().push_back(candidateNumber);
87 rdo->pad_phiID().push_back(pad_packet.
PhiID(i_candidateIndex));
88 rdo->pad_bandID().push_back(pad_packet.
BandID(i_candidateIndex));
90 rdo->pad_BCID().push_back(pad_packet.
BCID());
91 rdo->pad_idleFlag().push_back(pad_packet.
PadIdleFlag());
97 const std::vector<STGTPSegmentPacket>& segment_packets = link->segment_packet();
98 for(
uint i_packetIndex = 0; i_packetIndex<segment_packets.size(); i_packetIndex++){
115 uint8_t candidateNumber = (i_packetIndex<<4) | i_candidateIndex;
118 rdo->merge_segments().push_back(word);
119 rdo->merge_candidateNumber().push_back(candidateNumber);
123 rdo->merge_BCID_sectorID().push_back(merge_BCID_sectorID);
129 return StatusCode::SUCCESS;