16 #include "GaudiKernel/ISvcLocator.h"
17 #include "GaudiKernel/Bootstrap.h"
18 #include "GaudiKernel/MsgStream.h"
19 #include "GaudiKernel/IMessageSvc.h"
24 :m_trt_id ( nullptr ),
25 m_CablingSvc (
"TRT_CablingSvc",
"TRT_RodEncoder" ),
26 m_RodBlockVersion ( 0 )
39 return StatusCode::FAILURE;
41 int TRT_MaxBufferSize = 120*16;
43 v32rod.resize(TRT_MaxBufferSize,0 );
53 while ( rdo_it != rdo_it_end )
66 v32rod[BufferOffset] = StrawWord;
71 return StatusCode::SUCCESS;
80 return StatusCode::FAILURE;
82 const int TRT_MaxBufferSize = 120*16;
83 int tmp_data[TRT_MaxBufferSize] = {0};
85 std::deque<bool> bitstowrite;
95 while ( rdo_it != rdo_it_end )
102 BufferOffset =
m_CablingSvc->getBufferOffset( StrawID );
108 tmp_data[BufferOffset] = StrawWord;
113 for (
int i=0;
i<TRT_MaxBufferSize;
i++ )
120 bitstowrite.push_back( 0 );
121 bitstowrite.push_back( 0 );
122 bitstowrite.push_back( 0 );
123 bitstowrite.push_back( 0 );
124 bitstowrite.push_back( 0 );
131 for (
int j=0; j<27; j++ )
132 bitstowrite.push_back( (tmp_data[
i] >> j) & 1 );
135 bitstowrite.push_back( 1 );
142 while ( ! bitstowrite.empty() )
144 out_word = out_word | ( (bitstowrite.front()?1:0) << bit_in_word );
145 bitstowrite.pop_front();
148 if ( bit_in_word > 31 )
150 v32rod.push_back( out_word );
156 if ( 0 != bit_in_word )
157 v32rod.push_back( out_word );
159 return StatusCode::SUCCESS;