6 #include "CTPfragment/CTPfragment.h"
7 #include "CTPfragment/CTPdataformat.h"
8 #include "CTPfragment/CTPdataformatVersion.h"
17 static const InterfaceID IID_ICTPByteStreamTool(
"CTPByteStreamTool", 1, 0 );
24 return IID_ICTPByteStreamTool;
35 declareInterface< CTPByteStreamTool >(
this );
49 unsigned int ctpVersionNumber =
result->getCTPVersionNumber();
50 CTPdataformatVersion ctpVersion(ctpVersionNumber);
59 minorVersion &= ctpVersion.getL1APositionMask();
60 minorVersion <<= ctpVersion.getL1APositionShift();
76 const std::vector< uint32_t >& vDataWords =
result->getDataWords();
77 std::vector< uint32_t >::const_iterator
it = vDataWords.begin();
78 std::vector< uint32_t >::const_iterator
end = vDataWords.end();
80 theROD->push_back( *
it );
88 return StatusCode::SUCCESS;
102 const uint32_t rodId = rob->rod_source_id();
104 ATH_MSG_DEBUG(
" expected ROD sub-detector ID: " << std::hex << ctpRodId
105 <<
" ID found: " << std::hex << rodId << std::dec);
107 if ( rodId == ctpRodId ) {
114 rob->rod_data( it_data );
115 const uint32_t ndata = rob->rod_ndata();
118 std::vector<uint32_t> vDataWords;
119 for (
uint32_t i = 0;
i < ndata; ++
i, ++it_data ) {
120 vDataWords.push_back(
static_cast<uint32_t>( *it_data ) );
128 result =
new CTP_RDO(ctpVersionNumber, std::move(vDataWords) , nExtraWords);
131 result->setL1AcceptBunchPosition(l1apos);
133 uint32_t tc = CTPfragment::turnCounter(rob);
134 result->setTurnCounter(tc);
136 return StatusCode::SUCCESS;
139 ATH_MSG_ERROR(
"Wrong ROD ID found in the CTP ROB fragment!");
140 return StatusCode::FAILURE;