34 ATH_MSG_INFO(
"--- - CHECK BARREL FILE NAME" << barrelFileName);
36 ATH_MSG_INFO(
"--- - CHECK ECF FILE NAME" << ecfFileName);
38 ATH_MSG_INFO(
"--- - CHECK SIDE0 LUT FILE NAME" << side0LUTFileName);
40 ATH_MSG_INFO(
"--- - INFO SIDE1 LUT FILE NAME" << side1LUTFileName);
48 return StatusCode::SUCCESS;
115 std::vector<uint32_t> robID = {
m_robId };
121 ATH_MSG_ERROR(
"Wrong number of MUCTPI fragment in event: vrobf.size()="<<vrobf.size());
122 return StatusCode::FAILURE;
128 return StatusCode::SUCCESS;
137 ATH_MSG_DEBUG(
"executing convert() from ROBFragment to RDO");
139 const uint32_t rodId = rob->rod_source_id();
141 const uint32_t
bcId = rob->rod_bc_id();
143 ATH_MSG_DEBUG(
" expected ROD sub-detector ID: " << std::hex <<
m_robId <<
" ID found: " << std::hex << rodId << std::dec);
146 ATH_MSG_ERROR(
"Wrong ROD ID found in the MuCTPI ROB fragment!");
147 return StatusCode::FAILURE;
152 const uint32_t* it_data;
153 rob->rod_data( it_data );
154 const uint32_t ndata = rob->rod_ndata();
155 ATH_MSG_DEBUG(
"MUCTPI DQ DEBUG: number of ROB data words: " << std::dec << ndata);
158 std::vector< LVL1::MuCTPIBits::Slice > slices;
160 bool firstSlice=
true;
161 std::vector<size_t> errorBits;
162 uint64_t sliceMultiplicity=0;
164 for( uint32_t iWord = 0; iWord < ndata; ++iWord, ++it_data ) {
167 uint32_t word =
static_cast< uint32_t
>( *it_data );
168 ATH_MSG_DEBUG(
"MUCTPI raw word " << iWord <<
": 0x" << std::hex << word << std::dec);
174 ATH_MSG_DEBUG(
" MUCTPI DQ DEBUG: Timeslice found: "<< std::hex << word);
179 ATH_MSG_DEBUG(
" MUCTPI DQ DEBUG: new timeslice found (pushing)");
180 slices.push_back(slice);
190 <<
", NTOB=" <<
header.tobCount <<
", NCAND=" <<
header.candCount);
192 slice.nCand =
header.candCount;
193 slice.nTOB =
header.tobCount;
216 slice.mlt.bits = sliceMultiplicity;
230 slice.mlt.cnt.push_back( sliceMultiplicity & thismask);
277 slice.cand.push_back(thiscand);
281 ATH_MSG_DEBUG(
"This is a Topo TOB word "<< std::hex << word);
290 catch (
const std::out_of_range& e)
294 <<
" (" << e.what() <<
" exception)"
295 <<
" Word info: det = " << thistob.
det
297 <<
", side = " << thistob.
side
298 <<
", sector = " << thistob.
sec
312 slice.tob.push_back(thistob);
318 if (!errorBits.empty()) {
319 ATH_MSG_DEBUG(
"MUCTPI ROD data flagged with errors. The data status word is 0x" << std::hex << word << std::dec);
320 for (
size_t bit : errorBits) {
327 ATH_MSG_ERROR(
"The MUCTPI word 0x" << std::hex << word << std::dec <<
" does not match any known word type");
328 return StatusCode::FAILURE;
334 ATH_MSG_DEBUG(
" MUCTPI DQ DEBUG: out of words (pushing last slice)");
335 slices.push_back( std::move(slice) );
342 ATH_MSG_ERROR(
"TopoTOB word exception count exceeded limit!");
343 return StatusCode::FAILURE;
348 std::make_unique<MuCTPI_Phase1_RDO>(std::move(slices), std::move(errorBits))
350 return StatusCode::SUCCESS;
356 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define CHECK(...)
Evaluate an expression and check for errors.
static std::atomic< unsigned int > barrelROIFailCounter
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
uint16_t bcId(uint32_t data)
An algorithm that can be simultaneously executed in multiple threads.
OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment ROBF
std::vector< const ROBF * > VROBFRAG
virtual StatusCode initialize() override
const std::string m_ecfRoIFile
std::vector< uint32_t > m_muctpi_Nbits
StatusCode convert(const IROBDataProviderSvc::ROBF *rob, SG::WriteHandle< MuCTPI_Phase1_RDO > &outputHandle) const
Convert ROBFragment to MuCTPI_RDO.
ServiceHandle< IROBDataProviderSvc > m_robDataProviderSvc
ROBDataProvider service handle.
SG::WriteHandleKey< MuCTPI_Phase1_RDO > m_MuCTPI_Phase1_RDOKey
const std::string m_side0LUTFile
virtual StatusCode execute(const EventContext &eventContext) const override
LVL1MUCTPIPHASE1::L1TopoLUT m_l1topoLUT
Helper members.
Gaudi::Property< uint32_t > m_robId
Object storing the various IDs of the MuCTPI fragment.
MuCTPIPhase1ByteStreamAlgo(const std::string &name, ISvcLocator *svcLoc)
Default constructor.
virtual StatusCode finalize() override
const std::string m_barrelRoIFile
const std::string m_side1LUTFile
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
constexpr uint32_t maskedWord(uint32_t word, uint32_t shift, uint32_t mask)
Extract sub-word from 32-bit word by applying a shift and a mask.
static constexpr uint32_t RUN3_MULTIPLICITY_ENC_PART1_SHIFT
constexpr uint32_t multiplicityWordNumber(uint32_t word)
Decode the index of the multitpicity word, which is 1, 2, or 3.
static constexpr uint32_t RUN3_MULTIPLICITY_PART1_MASK
static constexpr uint32_t RUN3_NSW_MONITORING_TRIGGER_SHIFT
static constexpr std::array< std::string_view, 16 > DataStatusWordErrors
constexpr auto timesliceHeader(uint32_t word)
Decode timeslice word.
static constexpr uint32_t RUN3_MULTIPLICITY_ENC_PART2_SHIFT
static constexpr uint32_t RUN3_NSW_MONITORING_TRIGGER_MASK
static constexpr uint32_t RUN3_MULTIPLICITY_PART1_SHIFT
constexpr WordType getWordType(uint32_t word)
Determine the type of a MUCTPI ROD word.
static constexpr uint32_t RUN3_MULTIPLICITY_ENC_PART3_SHIFT
static constexpr uint32_t RUN3_MULTIPLICITY_OVERFLOW_MASK
static constexpr uint32_t RUN3_MULTIPLICITY_PART2_MASK
std::vector< size_t > getDataStatusWordErrors(uint32_t word)
Decode the data status word (returns a vector of bit indices for the errors set - empty if no errors)
static constexpr uint32_t RUN3_MULTIPLICITY_PART3_SHIFT
const uint32_t RPCtoTGC_pt_map[7]
static constexpr uint32_t RUN3_MULTIPLICITY_PART3_MASK
static constexpr uint32_t RUN3_MULTIPLICITY_PART2_SHIFT
static constexpr uint32_t RUN3_MULTIPLICITY_OVERFLOW_SHIFT
uint32_t barrel_eta_lookup
uint32_t barrel_phi_lookup