78{
80 return StatusCode::FAILURE;
81
82 const int TRT_MaxBufferSize = 120*16;
83 int tmp_data[TRT_MaxBufferSize] = {0};
84
85 std::deque<bool> bitstowrite;
86
87 VRDO::iterator rdo_it =
m_RDOs.begin();
88 const VRDO::iterator rdo_it_end =
m_RDOs.end();
89
92 Identifier StrawID;
94
95 while ( rdo_it != rdo_it_end )
96 {
97 rawdata = *rdo_it;
98
99 StrawWord = rawdata->getWord();
100 StrawID = rawdata->identify();
101
102 BufferOffset =
m_CablingSvc->getBufferOffset( StrawID );
103
104
105
106
107
108 tmp_data[BufferOffset] = StrawWord;
109
110 ++rdo_it;
111 }
112
113 for (
int i=0;
i<TRT_MaxBufferSize;
i++ )
114 {
115 if ( tmp_data[i] )
116 {
117
118
119
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 );
125
126
127
128
129
130
131 for ( int j=0; j<27; j++ )
132 bitstowrite.push_back( (tmp_data[i] >> j) & 1 );
133 }
134 else
135 bitstowrite.push_back( 1 );
136 }
137
138
139
140 int bit_in_word = 0;
141 int out_word = 0;
142 while ( ! bitstowrite.empty() )
143 {
144 out_word = out_word | ( (bitstowrite.front()?1:0) << bit_in_word );
145 bitstowrite.pop_front();
146 bit_in_word++;
147
148 if ( bit_in_word > 31 )
149 {
150 v32rod.push_back( out_word );
151 out_word = 0;
152 bit_in_word = 0;
153 }
154 }
155
156 if ( 0 != bit_in_word )
157 v32rod.push_back( out_word );
158
159 return StatusCode::SUCCESS;
160}