13 base_class(t, n, p) {}
26 return StatusCode::SUCCESS;
30 const std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*>& vecRobs,
xAOD::NRPCRDOContainer& nrpcContainer)
const {
35 if (frag->rod_ndata() != 0) {
38 ATH_MSG_DEBUG(
" ROB " << MSG::hex << frag->source_id() <<
" is delivered with an empty payload" );
42 return StatusCode::SUCCESS;
47 return convert(Gaudi::Hive::currentContext());
51 const EventContext& ctx)
const
57 return StatusCode::FAILURE;
59 return convert(readCdo->getAllROBId(), ctx);
63 return convert(HashVec, Gaudi::Hive::currentContext());
70 return StatusCode::FAILURE;
72 return convert(readCdo->getROBId(HashVec, msgStream()), ctx);
76 return convert(robIds, Gaudi::Hive::currentContext());
80 std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*> vecOfRobf;
86 const std::vector<IdentifierHash>&)
const {
87 return convert(vecRobs, Gaudi::Hive::currentContext());
91 const std::vector<IdentifierHash>& ,
const EventContext& ctx)
const {
96 return convert(vecRobs, Gaudi::Hive::currentContext());
100 const EventContext& ctx)
const {
104 ATH_CHECK(rdoContainer.
record(std::make_unique<xAOD::NRPCRDOContainer>(), std::make_unique<xAOD::NRPCRDOAuxContainer>()));
107 return StatusCode::SUCCESS;
112#define WARNING_WITH_LINE(msg) ATH_MSG_WARNING(__FILE__ << ":" << __LINE__<< " " << msg)
115 }
catch (eformat::Issue& ex) {
117 return StatusCode::SUCCESS;
121 uint32_t version = robFrag.rod_version();
122 uint32_t sourceId = robFrag.source_id();
123 uint32_t rod_sourceId = robFrag.rod_source_id();
126 uint16_t subDetector = sourceId >> 16;
127 uint16_t boardSector = (sourceId & 0x00ffff);
129 ATH_MSG_VERBOSE(
"ROD version: " << MSG::hex << version << MSG::dec <<
" ROB source ID: " << MSG::hex << sourceId << MSG::dec
130 <<
" ROD source ID: " << MSG::hex << rod_sourceId << MSG::dec <<
" Subdetector: " << MSG::hex
131 << subDetector << MSG::dec <<
" boardSector: " << std::hex
132 << boardSector << std::dec );
138 robFrag.rod_data(
data);
140 const unsigned int data_size = robFrag.rod_ndata();
144 unsigned int idata=0;
145 while (idata<data_size) {
146 if (
data[idata]==6 &&
data[idata+4]==0xa0 &&
data[idata+5]==0) {
147 ATH_MSG_DEBUG(
"NRPC: Empty board " << std::hex <<
data[idata+4] << std::dec <<
" for " << std::hex <<
data[idata+1] << std::dec );
148 }
else if (
data[idata]<6) {
149 WARNING_WITH_LINE(
"NRPC: Corrupted: Number of words from board " << std::hex <<
data[idata+4] << std::dec <<
" is <6 :" <<
data[idata] );
151 }
else if ( idata+
data[idata] > data_size) {
152 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 );
154 }
else if ( (
data[idata+
data[idata]-2] & 0x000000ff) != 0xa0) {
160 uint32_t bcid12 = (
data[idata+2] & 0xff000000) >> 24;
161 uint32_t bcid34 = (
data[idata+2] & 0x00ff0000) >> 8;
162 uint32_t bcid56 = (
data[idata+2] & 0x0000ff00) << 8;
163 uint32_t bcid78 = (
data[idata+2] & 0x000000ff) << 24;
164 uint32_t bcid_nom = (bcid12 | bcid34 | bcid56 | bcid78) >> 4;
167 for (
unsigned int i=0; i<
data[idata]-6; i++) {
168 uint16_t board = (
data[idata+4+i] & 0x000000ff) ;
169 uint16_t chan = (
data[idata+4+i] & 0x0000ff00) >> 8 ;
170 float tot = ((
data[idata+4+i] & 0x007f0000) >> 16)*0.4 ;
171 float time = ((
data[idata+4+i] & 0x0f000000) >> 24)*1.6 ;
172 uint32_t bcid_hit = (
data[idata+4+i] & 0xf0000000) >> 28 ;
175 uint32_t bcid_nom_4bits = (bcid_nom & 0x0000000f) ;
177 if (bcid_hit >= bcid_nom_4bits) {
178 bcid = ( (bcid_nom & 0xfffffff0) | bcid_hit );
180 bcid = ( (bcid_nom & 0xfffffff0) | bcid_hit ) + 0x00000010;
199 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
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.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
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.
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
eformat::ROBFragment< PointerType > ROBFragment
NRPCRDO_v1 NRPCRDO
Define the version of the NRPC RDO class.
NRPCRDOContainer_v1 NRPCRDOContainer
Define the version of the NRPC RDO container.