23 const unsigned int dummy_digit=0;
24 const unsigned int trt_number_of_collections=14912;
25 const unsigned int trt_number_of_channels=350848;
26 const unsigned int trt_channel_id_increment=0x20
u;
28 std::vector<unsigned int> trt_collection_id;
29 std::vector<unsigned int> trt_collection_size;
33 trt_number_of_collections);
35 unsigned int trt_collection_index=0;
36 unsigned int trt_channel_index=0;
37 unsigned int trt_channel_id;
38 unsigned int tcoll_id;
39 unsigned int tchan_id;
40 unsigned int tchan_word;
43 TRANS::const_iterator it_transColl = transCont->
begin();
44 TRANS::const_iterator it_transCollEnd = transCont->
end();
47 persCont->
m_rawdata.resize(trt_number_of_channels);
50 for (; it_transColl != it_transCollEnd; ++it_transColl) {
56 while ( trt_collection_id[trt_collection_index] != tcoll_id ) {
58 trt_channel_id = trt_collection_id[trt_collection_index];
63 pcollection.
m_end = 0;
65 for (
unsigned int i=0;
i<trt_collection_size[trt_collection_index]; ++
i) {
66 persCont->
m_rawdata[trt_channel_index] = dummy_digit;
67 trt_channel_id += trt_channel_id_increment;
70 trt_collection_index++;
75 trt_channel_id = trt_collection_id[trt_collection_index];
80 pcollection.
m_end = 0;
82 const unsigned int collection_end = trt_channel_index+trt_collection_size[trt_collection_index];
85 for (
unsigned int i = 0;
i < collection.
size(); ++
i) {
91 if (not tchan0)
throw std::runtime_error(
"TRT_LoLumRawDataContainerCnv_p3::transToPers: could not cast ptr to TRT_LoLumRawData");
92 tchan_id = tchan0->identify().get_identifier32().get_compact();
93 tchan_word = tchan0->getWord();
95 while ( trt_channel_id != tchan_id) {
96 persCont->
m_rawdata[trt_channel_index] = dummy_digit;
97 trt_channel_id += trt_channel_id_increment;
102 persCont->
m_rawdata[trt_channel_index]=tchan_word;
103 trt_channel_id += trt_channel_id_increment;
109 while (trt_channel_index != collection_end) {
110 persCont->
m_rawdata[trt_channel_index] = dummy_digit;
111 trt_channel_id += trt_channel_id_increment;
116 trt_collection_index++;
121 while ( trt_collection_index < trt_number_of_collections ) {
123 trt_channel_id = trt_collection_id[trt_collection_index];
125 pcollection.
m_id = 0;
128 pcollection.
m_end = 0;
131 for (
unsigned int i=0;
i<trt_collection_size[trt_collection_index]; ++
i) {
132 persCont->
m_rawdata[trt_channel_index] = dummy_digit;
133 trt_channel_id += trt_channel_id_increment;
136 trt_collection_index++;
140 MSG_DEBUG(
log,
" *** Writing TRT_RDO_Container (TRT_LoLumRawData concrete type)");
142 trt_collection_id.clear();
143 trt_collection_size.clear();
158 const unsigned int dummy_digit=0;
159 const unsigned int trt_number_of_collections=14912;
160 const unsigned int trt_channel_id_increment=0x20
u;
161 std::vector<unsigned int> trt_collection_id;
162 std::vector<unsigned int> trt_collection_size;
166 trt_number_of_collections);
168 unsigned int trt_channel_id;
169 unsigned int trt_channel_index=0;
170 unsigned int trt_channel_index_old;
174 if (persCont->
m_collections.size() != trt_number_of_collections){
176 <<
"TRT_LoLumRawDataContainerCnv_p3::persToTrans expected 14912 "
177 "collections but got "
179 <<
". We should be reading the whole detector!" <<
endmsg;
189 for (
unsigned int trt_collection_index=0; trt_collection_index<trt_number_of_collections; ++trt_collection_index) {
191 unsigned int nchans = trt_collection_size[trt_collection_index];
192 trt_channel_index_old = trt_channel_index;
193 unsigned int mchans = 0;
195 const unsigned int pword = persCont->
m_rawdata[trt_channel_index];
196 if ( pword != dummy_digit ) mchans++;
212 trt_channel_id = trt_collection_id[trt_collection_index];
213 trt_channel_index = trt_channel_index_old;
215 unsigned int jchan=0;
217 const unsigned int pword = persCont->
m_rawdata[trt_channel_index];
218 if ( pword == dummy_digit ) {
220 trt_channel_id += trt_channel_id_increment;
228 (*tcoll)[jchan] = tchan;
231 trt_channel_id += trt_channel_id_increment;
237 if (
sc.isFailure()) {
238 throw std::runtime_error(
"Failed to add collection to ID Container");
242 "AthenaPoolTPCnvIDCont::persToTrans, collection, hash_id / coll_id = "
243 << trt_collection_index <<
" / "
244 << trt_collection_id[trt_collection_index]
245 <<
", added to Identifiable container.");
248 trt_collection_id.clear();
249 trt_collection_size.clear();
251 MSG_DEBUG(
log,
" *** Reading TRT_RDO_Container (TRT_LoLumRawData concrete type)");
259 return(trans.release());