70{
71#ifdef BCM_DEBUG
73#endif
74
76
77 BCM_RDO_Collection* coll = nullptr;
78
79
81 robFrag->rod_data(vint);
82
83
84 int ROD_source_ID = robFrag->rod_source_id();
85
86
87 int ROD_LVL1_ID = robFrag->rod_lvl1_id();
88
89
90
91
92
93 uint32_t dataword_it_end = robFrag->rod_ndata();
94
96 unsigned int Pulse1Position = 0;
97 unsigned int Pulse1Width = 0;
98 unsigned int Pulse2Position = 0;
99 unsigned int Pulse2Width = 0;
100 unsigned int LVL1A = 0;
101 unsigned int BCID = 0;
102 unsigned int Error = 0;
104
106
107
108 for (uint32_t dataword_it = 0; dataword_it < dataword_it_end; ++dataword_it) {
109 uint32_t rawDataWord = vint[dataword_it];
110 unsigned int dataword_position = dataword_it%6;
111 switch(dataword_position) {
112 case 0:
113 if (dataword_it + 5 <=dataword_it_end) {
114 uint32_t lastDataWord = vint[dataword_it+5];
115 Error = (lastDataWord & 0x0000000f);
116 } else {
118 }
119 BCID = (rawDataWord & 0xfff00000) >> 20;
120 LVL1A = dataword_it / 6;
124 Pulse1Position = (rawDataWord & 0x000fc000) >> 14;
125 Pulse1Width = (rawDataWord & 0x00003e00) >> 9;
126 Pulse2Position = (rawDataWord & 0x000001f8) >> 3;
127 rawDataWord_buffer = (rawDataWord & 0x00000007);
128 break;
129 case 1:
130 Pulse2Width = ((rawDataWord & 0xc0000000) >> 30) | (rawDataWord_buffer << 2);
131#ifdef BCM_DEBUG
132 if (Pulse1Width != 0 || Pulse2Width != 0) {
133 ATH_MSG_ERROR(
"BCM-ISSUE L1ID: " << ROD_LVL1_ID <<
" Ch: " << Channel <<
" L1A: " << LVL1A <<
" BCID: " << BCID <<
" Hit: " << Pulse1Position <<
" " << Pulse1Width <<
" " << Pulse2Position <<
" " << Pulse2Width );
134 }
135 ATH_MSG_DEBUG(
"Decoded ROD 0x"<< std::hex<<ROD_source_ID<<std::dec <<
" channel: "<< Channel <<
" - BCID: "<< BCID <<
" : "<< Pulse1Position <<
"-"<< Pulse1Width <<
" "<< Pulse2Position <<
"-"<< Pulse2Width );
136#endif
137 coll->
push_back(
new RDO(Channel,Pulse1Position,Pulse1Width,Pulse2Position,Pulse2Width,LVL1A,BCID,ROD_LVL1_ID,Error));
141 Pulse1Position = (rawDataWord & 0x3f000000) >> 24;
142 Pulse1Width = (rawDataWord & 0x00f80000) >> 19;
143 Pulse2Position = (rawDataWord & 0x0007e000) >> 13;
144 Pulse2Width = (rawDataWord & 0x00001f00) >> 8;
145#ifdef BCM_DEBUG
146 if (Pulse1Width != 0 || Pulse2Width != 0) {
147 ATH_MSG_ERROR(
"BCM-ISSUE L1ID: " << ROD_LVL1_ID <<
" Ch: " << Channel <<
" L1A: " << LVL1A <<
" BCID: " << BCID <<
" Hit: " << Pulse1Position <<
" " << Pulse1Width <<
" " << Pulse2Position <<
" " << Pulse2Width );
148 }
149 ATH_MSG_DEBUG(
"Decoded ROD 0x"<< std::hex<<ROD_source_ID<<std::dec <<
" channel: "<< Channel <<
" - BCID: "<< BCID <<
" : "<< Pulse1Position <<
"-"<< Pulse1Width <<
" "<< Pulse2Position <<
"-"<< Pulse2Width );
150#endif
151 coll->
push_back(
new RDO(Channel,Pulse1Position,Pulse1Width,Pulse2Position,Pulse2Width,LVL1A,BCID,ROD_LVL1_ID,Error));
155 Pulse1Position = (rawDataWord & 0x000000fc) >> 2;
156 rawDataWord_buffer = (rawDataWord & 0x00000003);
157 break;
158 case 2:
159 Pulse1Width = ((rawDataWord & 0xe0000000) >> 29) | (rawDataWord_buffer << 3);
160 Pulse2Position = (rawDataWord & 0x1f800000) >> 23;
161 Pulse2Width = (rawDataWord & 0x007c0000) >> 18;
162#ifdef BCM_DEBUG
163 if (Pulse1Width != 0 || Pulse2Width != 0) {
164 ATH_MSG_ERROR(
"BCM-ISSUE L1ID: " << ROD_LVL1_ID <<
" Ch: " << Channel <<
" L1A: " << LVL1A <<
" BCID: " << BCID <<
" Hit: " << Pulse1Position <<
" " << Pulse1Width <<
" " << Pulse2Position <<
" " << Pulse2Width );
165 }
166 ATH_MSG_DEBUG(
"Decoded ROD 0x"<< std::hex<<ROD_source_ID<<std::dec <<
" channel: "<< Channel <<
" - BCID: "<< BCID <<
" : "<< Pulse1Position <<
"-"<< Pulse1Width <<
" "<< Pulse2Position <<
"-"<< Pulse2Width );
167#endif
168 coll->
push_back(
new RDO(Channel,Pulse1Position,Pulse1Width,Pulse2Position,Pulse2Width,LVL1A,BCID,ROD_LVL1_ID,Error));
172 Pulse1Position = (rawDataWord & 0x0003f000) >> 12;
173 Pulse1Width = (rawDataWord & 0x00000f80) >> 7;
174 Pulse2Position = (rawDataWord & 0x0000007e) >> 1;
175 rawDataWord_buffer = (rawDataWord & 0x00000001);
176 break;
177 case 3:
178 Pulse2Width = ((rawDataWord & 0xf0000000) >> 28) | (rawDataWord_buffer << 4);
179#ifdef BCM_DEBUG
180 if (Pulse1Width != 0 || Pulse2Width != 0) {
181 ATH_MSG_ERROR(
"BCM-ISSUE L1ID: " << ROD_LVL1_ID <<
" Ch: " << Channel <<
" L1A: " << LVL1A <<
" BCID: " << BCID <<
" Hit: " << Pulse1Position <<
" " << Pulse1Width <<
" " << Pulse2Position <<
" " << Pulse2Width );
182 }
183 ATH_MSG_DEBUG(
"Decoded ROD 0x"<< std::hex<<ROD_source_ID<<std::dec <<
" channel: "<< Channel <<
" - BCID: "<< BCID <<
" : "<< Pulse1Position <<
"-"<< Pulse1Width <<
" "<< Pulse2Position <<
"-"<< Pulse2Width );
184#endif
185 coll->
push_back(
new RDO(Channel,Pulse1Position,Pulse1Width,Pulse2Position,Pulse2Width,LVL1A,BCID,ROD_LVL1_ID,Error));
189 Pulse1Position = (rawDataWord & 0x0fc00000) >> 22;
190 Pulse1Width = (rawDataWord & 0x003e0000) >> 17;
191 Pulse2Position = (rawDataWord & 0x0001f800) >> 11;
192 Pulse2Width = (rawDataWord & 0x000007c0) >> 6;
193#ifdef BCM_DEBUG
194 if (Pulse1Width != 0 || Pulse2Width != 0) {
195 ATH_MSG_ERROR(
"BCM-ISSUE L1ID: " << ROD_LVL1_ID <<
" Ch: " << Channel <<
" L1A: " << LVL1A <<
" BCID: " << BCID <<
" Hit: " << Pulse1Position <<
" " << Pulse1Width <<
" " << Pulse2Position <<
" " << Pulse2Width );
196 }
197 ATH_MSG_DEBUG(
"Decoded ROD 0x"<< std::hex<<ROD_source_ID<<std::dec <<
" channel: "<< Channel <<
" - BCID: "<< BCID <<
" : "<< Pulse1Position <<
"-"<< Pulse1Width <<
" "<< Pulse2Position <<
"-"<< Pulse2Width);
198#endif
199 coll->
push_back(
new RDO(Channel,Pulse1Position,Pulse1Width,Pulse2Position,Pulse2Width,LVL1A,BCID,ROD_LVL1_ID,Error));
203 Pulse1Position = (rawDataWord & 0x0000003f);
204 break;
205 case 4:
206 Pulse1Width = (rawDataWord & 0xf8000000) >> 27;
207 Pulse2Position = (rawDataWord & 0x07e00000) >> 21;
208 Pulse2Width = (rawDataWord & 0x001f0000) >> 16;
209#ifdef BCM_DEBUG
210 if (Pulse1Width != 0 || Pulse2Width != 0) {
211 ATH_MSG_ERROR(
"BCM-ISSUE L1ID: " << ROD_LVL1_ID <<
" Ch: " << Channel <<
" L1A: " << LVL1A <<
" BCID: " << BCID <<
" Hit: " << Pulse1Position <<
" " << Pulse1Width <<
" " << Pulse2Position <<
" " << Pulse2Width);
212 }
213 ATH_MSG_DEBUG(
"Decoded ROD 0x"<< std::hex<<ROD_source_ID<<std::dec <<
" channel: "<< Channel <<
" - BCID: "<< BCID <<
" : "<< Pulse1Position <<
"-"<< Pulse1Width <<
" "<< Pulse2Position <<
"-"<< Pulse2Width );
214#endif
215 coll->
push_back(
new RDO(Channel,Pulse1Position,Pulse1Width,Pulse2Position,Pulse2Width,LVL1A,BCID,ROD_LVL1_ID,Error));
219 Pulse1Position = (rawDataWord & 0x0000fc00) >> 10;
220 Pulse1Width = (rawDataWord & 0x000003e0) >> 5;
221 rawDataWord_buffer = (rawDataWord & 0x0000001f);
222 break;
223 case 5:
224 Pulse2Position = ((rawDataWord & 0x80000000) >> 31) | (rawDataWord_buffer << 1);
225 Pulse2Width = (rawDataWord & 0x7c000000) >> 26;
226#ifdef BCM_DEBUG
227 if (Pulse1Width != 0 || Pulse2Width != 0) {
228 ATH_MSG_ERROR(
"BCM-ISSUE L1ID: " << ROD_LVL1_ID <<
" Ch: " << Channel <<
" L1A: " << LVL1A <<
" BCID: " << BCID <<
" Hit: " << Pulse1Position <<
" " << Pulse1Width <<
" " << Pulse2Position <<
" " << Pulse2Width );
229 }
230 ATH_MSG_DEBUG(
"Decoded ROD 0x"<< std::hex<<ROD_source_ID<<std::dec <<
" channel: "<< Channel <<
" - BCID: "<< BCID <<
" : "<< Pulse1Position <<
"-"<< Pulse1Width <<
" "<< Pulse2Position <<
"-"<< Pulse2Width );
231#endif
232 coll->
push_back(
new RDO(Channel,Pulse1Position,Pulse1Width,Pulse2Position,Pulse2Width,LVL1A,BCID,ROD_LVL1_ID,Error));
236 Pulse1Position = (rawDataWord & 0x03f00000) >> 20;
237 Pulse1Width = (rawDataWord & 0x000f8000) >> 15;
238 Pulse2Position = (rawDataWord & 0x00007e00) >> 9;
239 Pulse2Width = (rawDataWord & 0x000001f0) >> 4;
240#ifdef BCM_DEBUG
241 if (Pulse1Width != 0 || Pulse2Width != 0) {
242 ATH_MSG_ERROR(
"BCM-ISSUE L1ID: " << ROD_LVL1_ID <<
" Ch: " << Channel <<
" L1A: " << LVL1A <<
" BCID: " << BCID <<
" Hit: " << Pulse1Position <<
" " << Pulse1Width <<
" " << Pulse2Position <<
" " << Pulse2Width );
243 }
244 ATH_MSG_DEBUG(
"Decoded ROD 0x"<< std::hex<<ROD_source_ID<<std::dec <<
" channel: "<< Channel <<
" - BCID: "<< BCID <<
" : "<< Pulse1Position <<
"-"<< Pulse1Width <<
" "<< Pulse2Position <<
"-"<< Pulse2Width );
245#endif
246 coll->
push_back(
new RDO(Channel,Pulse1Position,Pulse1Width,Pulse2Position,Pulse2Width,LVL1A,BCID,ROD_LVL1_ID,Error));
248 break;
249 }
250 }
251
253}
unsigned int getChannelID(int ROD_source_ID, unsigned int dataword_position) const
std::atomic< unsigned int > m_LVL1A_number
BCM_RDO_Collection * getCollection(unsigned int chan, BCM_RDO_Container *cont) const
std::atomic< unsigned int > m_hit_number
std::atomic< unsigned int > m_fragment_number
value_type push_back(value_type pElem)
Add an element to the end of the collection.
::StatusCode StatusCode
StatusCode definition for legacy code.
Error
The different types of error that can be flagged in the L1TopoRDO.
Identifier32::value_type Channel
const DataType * PointerType