Decoding the muCTPi RoIB and DAQ ROB and return in and out of time RoIs.
48 char log_fill_char_save = (
msg().stream()).
fill();
66 std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*> muCTPiRobFragmentVec;
70 if (muCTPiRobFragmentVec.size()==0) {
76 ATH_MSG_DEBUG(
" decodeMuCTPi: ROB id = 0x" << std::setw(6) << MSG::hex << muCTPiRobFragmentVec[0]->source_id() << MSG::dec);
79 ATH_MSG_DEBUG(
" decodeMuCTPi: received ROB id = 0x" << std::setw(6) << MSG::hex << muCTPiRobFragmentVec[0]->source_id() << MSG::dec
80 <<
" does not match requested ROB id = 0x"
86 uint32_t formatVersion = muCTPiRobFragmentVec[0]->rod_version();
87 uint32_t evtNum = muCTPiRobFragmentVec[0]->rod_lvl1_id();
88 uint32_t robFragSize = muCTPiRobFragmentVec[0]->fragment_size_word();
89 uint32_t rodFragSize = muCTPiRobFragmentVec[0]->rod_fragment_size_word();
90 uint32_t robId = muCTPiRobFragmentVec[0]->source_id();
91 uint32_t rodId = muCTPiRobFragmentVec[0]->rod_source_id();
92 const uint32_t bcId = muCTPiRobFragmentVec[0]->rod_bc_id();
95 muCTPiRobFragmentVec[0]->rod_status(
status );
102 ATH_MSG_DEBUG(
"ROB ID 0x" << MSG::hex << robId <<
" ROD ID 0x"
103 << rodId << MSG::dec <<
" ROB fragment size "
104 << robFragSize <<
" ROD fragment size " << rodFragSize);
107 <<
" ROD Header BCID " <<
bcId
108 <<
" ROD Header Format version " << formatVersion);
111 muCTPiRobFragmentVec[0]->rod_data( it_data );
112 const uint32_t ndata = muCTPiRobFragmentVec[0]->rod_ndata();
116 std::vector< uint32_t > candidateMultiplicity;
118 std::vector< uint32_t > dataWord;
120 if( *it_data >> LVL1::MuCTPIBits::MULT_WORD_FLAG_SHIFT ) {
121 candidateMultiplicity.push_back(
static_cast< uint32_t >( *it_data ) );
122 ATH_MSG_DEBUG(
" 0x" << MSG::hex << std::setw( 8 ) << std::setfill(
'0' )
123 << ( *it_data ) <<
" (candidate multiplicity)" << std::setfill( log_fill_char_save ));
125 dataWord.push_back(
static_cast< uint32_t >( *it_data ) );
126 ATH_MSG_DEBUG(
" 0x" << MSG::hex << std::setw( 8 ) << std::setfill(
'0' )
127 << ( *it_data ) <<
" (candidate word)"
128 <<
" (--> RoI word = 0x" << MSG::hex << std::setw( 8 ) << std::setfill(
'0' )
130 << std::setfill( log_fill_char_save ));
135 daqmuCTPIResult =
new MuCTPI_RDO( std::move(candidateMultiplicity), std::move(dataWord) );
142 if(rdoHandle.isValid()){
143 daqmuCTPIResult = rdoHandle.cptr();
154 for(std::vector< uint32_t >::const_iterator
it = daqmuCTPIResult->
dataWord().begin();
167 auto inTime_muCTPIRoIs= std::vector<ROIB::MuCTPIRoI>();
168 auto outOfTime_muCTPIRoIs= std::vector< std::pair<ROIB::MuCTPIRoI,int> >();
170 inTime_muCTPIRoIs.reserve( roiEventNCan );
171 outOfTime_muCTPIRoIs.reserve( roiEventNCan );
173 for(std::vector< uint32_t >::const_iterator
it = daqmuCTPIResult->
dataWord().begin();
182 if (roiEventBCID == daqRoI.getBCID()) {
183 inTime_muCTPIRoIs.push_back(roI);
185 outOfTime_muCTPIRoIs.push_back( std::pair<ROIB::MuCTPIRoI,int>(roI,(
int(daqRoI.getBCID())-
int(roiEventBCID))) );
191 ATH_MSG_DEBUG(
" RoIs in time with event BCID: Number of RoIs = " << inTime_muCTPIRoIs.size());
196 ATH_MSG_DEBUG(
" RoIs out of time with event BCID: Number of RoIs = " << outOfTime_muCTPIRoIs.size());
197 for (std::vector< std::pair<ROIB::MuCTPIRoI,int> >::
iterator it = outOfTime_muCTPIRoIs.begin();
it != outOfTime_muCTPIRoIs.end(); ++
it) {
198 ATH_MSG_DEBUG(
" Difference(RoI(BCID) - Event(BCID)) = " << (*it).second);
203 std::unique_ptr<TrigMuonRoITool::MuonRois>
rois(
new TrigMuonRoITool::MuonRois(std::move(inTime_muCTPIRoIs), std::move(outOfTime_muCTPIRoIs)));
207 delete daqmuCTPIResult;