65 {
66#define WARNING_WITH_LINE(msg) ATH_MSG_WARNING(__FILE__ << ":" << __LINE__<< " " << msg)
67 try {
68 robFrag.check();
69 } catch (eformat::Issue& ex) {
71 return StatusCode::SUCCESS;
72 }
73
74
76 uint32_t sourceId = robFrag.source_id();
77 uint32_t rod_sourceId = robFrag.rod_source_id();
78
79
80 uint16_t subDetector = sourceId >> 16;
81 uint16_t boardSector = (sourceId & 0x00ffff);
82
83 ATH_MSG_VERBOSE(
"ROD version: " << MSG::hex << version << MSG::dec <<
" ROB source ID: " << MSG::hex << sourceId << MSG::dec
84 << " ROD source ID: " << MSG::hex << rod_sourceId << MSG::dec << " Subdetector: " << MSG::hex
85 << subDetector << MSG::dec << " boardSector: " << std::hex
86 << boardSector << std::dec );
87
88
89
90
92 robFrag.rod_data(
data);
93
94 const unsigned int data_size = robFrag.rod_ndata();
95
96
97
98 unsigned int idata=0;
99 while (idata<data_size) {
100 if (
data[idata]==6 &&
data[idata+4]==0xa0 &&
data[idata+5]==0) {
101 ATH_MSG_DEBUG(
"NRPC: Empty board " << std::hex <<
data[idata+4] << std::dec <<
" for " << std::hex <<
data[idata+1] << std::dec );
102 }
else if (
data[idata]<6) {
103 WARNING_WITH_LINE(
"NRPC: Corrupted: Number of words from board " << std::hex <<
data[idata+4] << std::dec <<
" is <6 :" <<
data[idata] );
104 break;
105 }
else if ( idata+
data[idata] > data_size) {
106 WARNING_WITH_LINE(
"NRPC: Corrupted number of words from board " << std::hex <<
data[idata+4] << std::dec <<
" is too large :" << std::hex <<
data[idata] << std::dec );
107 break;
108 }
else if ( (
data[idata+
data[idata]-2] & 0x000000ff) != 0xa0) {
110 break;
111 } else {
112
113
118 uint32_t bcid_nom = (bcid12 | bcid34 | bcid56 | bcid78) >> 4;
119
120
121 for (
unsigned int i=0;
i<
data[idata]-6;
i++) {
124 float tot = ((
data[idata+4+
i] & 0x007f0000) >> 16)*0.4 ;
125 float time = ((
data[idata+4+
i] & 0x0f000000) >> 24)*1.6 ;
127
128
129 uint32_t bcid_nom_4bits = (bcid_nom & 0x0000000f) ;
131 if (bcid_hit >= bcid_nom_4bits) {
132 bcid = ( (bcid_nom & 0xfffffff0) | bcid_hit );
133 } else {
134 bcid = ( (bcid_nom & 0xfffffff0) | bcid_hit ) + 0x00000010;
135 }
136
137
146 }
147 }
148
150 }
151
152
153 return StatusCode::SUCCESS;
154
155}
char data[hepevt_bytes_allocation_ATLAS]
#define WARNING_WITH_LINE(msg)
value_type push_back(value_type pElem)
Add an element to the end of the collection.
void setBoardsector(uint16_t Boardsector)
Set the sector of the board within the subdetector.
void setBoard(uint16_t Board)
Set the number of the TDC channel.
void setTimeoverthr(float Timeoverthr)
Set the time over threshold.
void setSubdetector(uint16_t SubDet)
Set the sub detector.
void setChannel(uint16_t Channel)
Set the fire channel number.
void setTime(float Time)
Set the trigger time [ns].
void setBcid(uint32_t Bcid)
Set the bunch crossing identifier.
time(flags, cells_name, *args, **kw)
NRPCRDO_v1 NRPCRDO
Define the version of the NRPC RDO class.
setEventNumber setTimeStamp bcid