19 static const InterfaceID IID_IBCM_RodDecoder(
"BCM_RodDecoder", 1, 0);
22 return IID_IBCM_RodDecoder;
47 return StatusCode::SUCCESS;
63 return StatusCode::SUCCESS;
81 robFrag->rod_data(vint);
84 int ROD_source_ID = robFrag->rod_source_id();
87 int ROD_LVL1_ID = robFrag->rod_lvl1_id();
93 uint32_t dataword_it_end = robFrag->rod_ndata();
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;
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) {
113 if (dataword_it + 5 <=dataword_it_end) {
114 uint32_t lastDataWord = vint[dataword_it+5];
115 Error = (lastDataWord & 0x0000000f);
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);
130 Pulse2Width = ((rawDataWord & 0xc0000000) >> 30) | (rawDataWord_buffer << 2);
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 );
135 ATH_MSG_DEBUG(
"Decoded ROD 0x"<< std::hex<<ROD_source_ID<<std::dec <<
" channel: "<<
Channel <<
" - BCID: "<<
BCID <<
" : "<< Pulse1Position <<
"-"<< Pulse1Width <<
" "<< Pulse2Position <<
"-"<< Pulse2Width );
141 Pulse1Position = (rawDataWord & 0x3f000000) >> 24;
142 Pulse1Width = (rawDataWord & 0x00f80000) >> 19;
143 Pulse2Position = (rawDataWord & 0x0007e000) >> 13;
144 Pulse2Width = (rawDataWord & 0x00001f00) >> 8;
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 );
149 ATH_MSG_DEBUG(
"Decoded ROD 0x"<< std::hex<<ROD_source_ID<<std::dec <<
" channel: "<<
Channel <<
" - BCID: "<<
BCID <<
" : "<< Pulse1Position <<
"-"<< Pulse1Width <<
" "<< Pulse2Position <<
"-"<< Pulse2Width );
155 Pulse1Position = (rawDataWord & 0x000000fc) >> 2;
156 rawDataWord_buffer = (rawDataWord & 0x00000003);
159 Pulse1Width = ((rawDataWord & 0xe0000000) >> 29) | (rawDataWord_buffer << 3);
160 Pulse2Position = (rawDataWord & 0x1f800000) >> 23;
161 Pulse2Width = (rawDataWord & 0x007c0000) >> 18;
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 );
166 ATH_MSG_DEBUG(
"Decoded ROD 0x"<< std::hex<<ROD_source_ID<<std::dec <<
" channel: "<<
Channel <<
" - BCID: "<<
BCID <<
" : "<< Pulse1Position <<
"-"<< Pulse1Width <<
" "<< Pulse2Position <<
"-"<< Pulse2Width );
172 Pulse1Position = (rawDataWord & 0x0003f000) >> 12;
173 Pulse1Width = (rawDataWord & 0x00000f80) >> 7;
174 Pulse2Position = (rawDataWord & 0x0000007e) >> 1;
175 rawDataWord_buffer = (rawDataWord & 0x00000001);
178 Pulse2Width = ((rawDataWord & 0xf0000000) >> 28) | (rawDataWord_buffer << 4);
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 );
183 ATH_MSG_DEBUG(
"Decoded ROD 0x"<< std::hex<<ROD_source_ID<<std::dec <<
" channel: "<<
Channel <<
" - BCID: "<<
BCID <<
" : "<< Pulse1Position <<
"-"<< Pulse1Width <<
" "<< Pulse2Position <<
"-"<< Pulse2Width );
189 Pulse1Position = (rawDataWord & 0x0fc00000) >> 22;
190 Pulse1Width = (rawDataWord & 0x003e0000) >> 17;
191 Pulse2Position = (rawDataWord & 0x0001f800) >> 11;
192 Pulse2Width = (rawDataWord & 0x000007c0) >> 6;
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 );
197 ATH_MSG_DEBUG(
"Decoded ROD 0x"<< std::hex<<ROD_source_ID<<std::dec <<
" channel: "<<
Channel <<
" - BCID: "<<
BCID <<
" : "<< Pulse1Position <<
"-"<< Pulse1Width <<
" "<< Pulse2Position <<
"-"<< Pulse2Width);
203 Pulse1Position = (rawDataWord & 0x0000003f);
206 Pulse1Width = (rawDataWord & 0xf8000000) >> 27;
207 Pulse2Position = (rawDataWord & 0x07e00000) >> 21;
208 Pulse2Width = (rawDataWord & 0x001f0000) >> 16;
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);
213 ATH_MSG_DEBUG(
"Decoded ROD 0x"<< std::hex<<ROD_source_ID<<std::dec <<
" channel: "<<
Channel <<
" - BCID: "<<
BCID <<
" : "<< Pulse1Position <<
"-"<< Pulse1Width <<
" "<< Pulse2Position <<
"-"<< Pulse2Width );
219 Pulse1Position = (rawDataWord & 0x0000fc00) >> 10;
220 Pulse1Width = (rawDataWord & 0x000003e0) >> 5;
221 rawDataWord_buffer = (rawDataWord & 0x0000001f);
224 Pulse2Position = ((rawDataWord & 0x80000000) >> 31) | (rawDataWord_buffer << 1);
225 Pulse2Width = (rawDataWord & 0x7c000000) >> 26;
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 );
230 ATH_MSG_DEBUG(
"Decoded ROD 0x"<< std::hex<<ROD_source_ID<<std::dec <<
" channel: "<<
Channel <<
" - BCID: "<<
BCID <<
" : "<< Pulse1Position <<
"-"<< Pulse1Width <<
" "<< Pulse2Position <<
"-"<< Pulse2Width );
236 Pulse1Position = (rawDataWord & 0x03f00000) >> 20;
237 Pulse1Width = (rawDataWord & 0x000f8000) >> 15;
238 Pulse2Position = (rawDataWord & 0x00007e00) >> 9;
239 Pulse2Width = (rawDataWord & 0x000001f0) >> 4;
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 );
244 ATH_MSG_DEBUG(
"Decoded ROD 0x"<< std::hex<<ROD_source_ID<<std::dec <<
" channel: "<<
Channel <<
" - BCID: "<<
BCID <<
" : "<< Pulse1Position <<
"-"<< Pulse1Width <<
" "<< Pulse2Position <<
"-"<< Pulse2Width );
260 switch(ROD_source_ID) {
263 switch(dataword_position) {
285 switch(dataword_position) {
307 switch(dataword_position) {
329 switch(dataword_position) {
362 bool collExists =
false;
366 if ((*it)->getChannel() ==
chan) {