14 declareInterface<Muon::IMuonRawDataProviderTool>(
this);
29 return StatusCode::SUCCESS;
33 const std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*>& vecRobs,
xAOD::NRPCRDOContainer& nrpcContainer)
const {
38 if (frag->rod_ndata() != 0) {
41 ATH_MSG_DEBUG(
" ROB " << MSG::hex << frag->source_id() <<
" is delivered with an empty payload" );
45 return StatusCode::SUCCESS;
50 return convert(Gaudi::Hive::currentContext());
54 const EventContext& ctx)
const
61 return StatusCode::FAILURE;
64 const std::vector<uint32_t>& robIds=readCdo->getAllROBId();
70 return convert(HashVec, Gaudi::Hive::currentContext());
78 return StatusCode::FAILURE;
80 return convert(readCdo->getROBId(HashVec, msgStream()), ctx);
84 return convert(robIds, Gaudi::Hive::currentContext());
88 std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*> vecOfRobf;
94 const std::vector<IdentifierHash>&)
const {
95 return convert(vecRobs, Gaudi::Hive::currentContext());
99 const std::vector<IdentifierHash>& ,
const EventContext& ctx)
const {
104 return convert(vecRobs, Gaudi::Hive::currentContext());
108 const EventContext& ctx)
const {
112 ATH_CHECK(rdoContainerHandle.
record(std::make_unique<xAOD::NRPCRDOContainer>(), std::make_unique<xAOD::NRPCRDOAuxContainer>()));
118 return StatusCode::SUCCESS;
123 #define WARNING_WITH_LINE(msg) ATH_MSG_WARNING(__FILE__ << ":" << __LINE__<< " " << msg)
128 return StatusCode::SUCCESS;
133 uint32_t sourceId = robFrag.source_id();
134 uint32_t rod_sourceId = robFrag.rod_source_id();
137 uint16_t subDetector = sourceId >> 16;
138 uint16_t tdcSector = (sourceId & 0x00ffff);
140 ATH_MSG_VERBOSE(
"ROD version: " << MSG::hex <<
version << MSG::dec <<
" ROB source ID: " << MSG::hex << sourceId << MSG::dec
141 <<
" ROD source ID: " << MSG::hex << rod_sourceId << MSG::dec <<
" Subdetector: " << MSG::hex
142 << subDetector << MSG::dec <<
" tdcSector: " << std::hex
143 << tdcSector << std::dec );
149 robFrag.rod_data(
data);
151 const unsigned int data_size = robFrag.rod_ndata();
155 unsigned int idata=0;
156 while (idata<data_size) {
157 if (
data[idata]==6 &&
data[idata+4]==0xa0 &&
data[idata+5]==0) {
158 ATH_MSG_DEBUG(
"NRPC: Empty tdc " << std::hex <<
data[idata+4] << std::dec <<
" for " << std::hex <<
data[idata+1] << std::dec );
159 }
else if (
data[idata]<6) {
160 WARNING_WITH_LINE(
"NRPC: Corrupted: Number of words from tdc " << std::hex <<
data[idata+4] << std::dec <<
" is <6 :" <<
data[idata] );
162 }
else if ( (
data[idata+
data[idata]-2] & 0x000000ff) != 0xa0) {
172 uint32_t bcid_nom = (bcid12 | bcid34 | bcid56 | bcid78) >> 4;
175 for (
unsigned int i=0;
i<
data[idata]-6;
i++) {
178 float tot = ((
data[idata+4] & 0x00ff0000) >> 16)*0.4 ;
179 float time = ((
data[idata+4] & 0x0f000000) >> 24)*1.6 ;
180 uint32_t bcid_hit = (
data[idata+4] & 0xf0000000) >> 28 ;
183 uint32_t bcid_nom_4bits = (bcid_nom & 0x0000000f) ;
185 if (bcid_hit >= bcid_nom_4bits) {
186 bcid = ( (bcid_nom & 0xfffffff0) | bcid_hit );
188 bcid = ( (bcid_nom & 0xfffffff0) | bcid_hit ) + 0x00000010;
209 return StatusCode::SUCCESS;