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
55 if (!readCdo.isValid()) {
57 return StatusCode::FAILURE;
59 return convert(readCdo->getAllROBId(), ctx);
63 return convert(HashVec, Gaudi::Hive::currentContext());
68 if (!readCdo.isValid()) {
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)
117 return StatusCode::SUCCESS;
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 tdcSector = (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 <<
" tdcSector: " << std::hex
132 << tdcSector << 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 tdc " << 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 tdc " << std::hex <<
data[idata+4] << std::dec <<
" is <6 :" <<
data[idata] );
151 }
else if ( (
data[idata+
data[idata]-2] & 0x000000ff) != 0xa0) {
161 uint32_t bcid_nom = (bcid12 | bcid34 | bcid56 | bcid78) >> 4;
164 for (
unsigned int i=0;
i<
data[idata]-6;
i++) {
167 float tot = ((
data[idata+4] & 0x00ff0000) >> 16)*0.4 ;
168 float time = ((
data[idata+4] & 0x0f000000) >> 24)*1.6 ;
169 uint32_t bcid_hit = (
data[idata+4] & 0xf0000000) >> 28 ;
172 uint32_t bcid_nom_4bits = (bcid_nom & 0x0000000f) ;
174 if (bcid_hit >= bcid_nom_4bits) {
175 bcid = ( (bcid_nom & 0xfffffff0) | bcid_hit );
177 bcid = ( (bcid_nom & 0xfffffff0) | bcid_hit ) + 0x00000010;
196 return StatusCode::SUCCESS;