 |
ATLAS Offline Software
|
Go to the documentation of this file.
13 static std::atomic<unsigned int> barrelROIFailCounter{0};
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();
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;
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;
164 for(
uint32_t iWord = 0; iWord < ndata; ++iWord, ++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)");
191 <<
", NTOB=" <<
header.tobCount <<
", NCAND=" <<
header.candCount);
205 sliceMultiplicity |= ( (
uint64_t)
LVL1::MuCTPIBits::maskedWord(word,LVL1::MuCTPIBits::RUN3_MULTIPLICITY_PART1_SHIFT, LVL1::MuCTPIBits::RUN3_MULTIPLICITY_PART1_MASK) ) << LVL1::MuCTPIBits::RUN3_MULTIPLICITY_ENC_PART1_SHIFT;
207 sliceMultiplicity |= ( (
uint64_t)
LVL1::MuCTPIBits::maskedWord(word,LVL1::MuCTPIBits::RUN3_MULTIPLICITY_PART2_SHIFT, LVL1::MuCTPIBits::RUN3_MULTIPLICITY_PART2_MASK) ) << LVL1::MuCTPIBits::RUN3_MULTIPLICITY_ENC_PART2_SHIFT;
209 sliceMultiplicity |= ( (
uint64_t)
LVL1::MuCTPIBits::maskedWord(word,LVL1::MuCTPIBits::RUN3_MULTIPLICITY_PART3_SHIFT, LVL1::MuCTPIBits::RUN3_MULTIPLICITY_PART3_MASK) ) << LVL1::MuCTPIBits::RUN3_MULTIPLICITY_ENC_PART3_SHIFT;
216 slice.mlt.candOverflow =
LVL1::MuCTPIBits::maskedWord(word,LVL1::MuCTPIBits::RUN3_MULTIPLICITY_OVERFLOW_SHIFT, LVL1::MuCTPIBits::RUN3_MULTIPLICITY_OVERFLOW_MASK);
217 slice.mlt.bits = sliceMultiplicity;
231 slice.mlt.cnt.push_back( sliceMultiplicity & thismask);
278 slice.cand.push_back(thiscand);
282 ATH_MSG_DEBUG(
"This is a Topo TOB word "<< std::hex << word);
291 catch (
const std::out_of_range&
e)
293 ++barrelROIFailCounter;
295 <<
" (" <<
e.what() <<
" exception)"
296 <<
" Word info: det = " << thistob.
det
298 <<
", side = " << thistob.
side
299 <<
", sector = " << thistob.
sec
313 slice.tob.push_back(thistob);
319 if (!errorBits.empty()) {
320 ATH_MSG_DEBUG(
"MUCTPI ROD data flagged with errors. The data status word is 0x" << std::hex << word << std::dec);
321 for (
size_t bit : errorBits) {
322 ATH_MSG_DEBUG(
"Error bit " << bit <<
": " << LVL1::MuCTPIBits::DataStatusWordErrors.at(bit));
328 ATH_MSG_ERROR(
"The MUCTPI word 0x" << std::hex << word << std::dec <<
" does not match any known word type");
329 return StatusCode::FAILURE;
335 ATH_MSG_DEBUG(
" MUCTPI DQ DEBUG: out of words (pushing last slice)");
341 if (barrelROIFailCounter ==
slices.size() + 2 )
343 ATH_MSG_ERROR(
"TopoTOB word exception count exceeded limit!");
344 return StatusCode::FAILURE;
349 std::make_unique<MuCTPI_Phase1_RDO>(std::move(
slices), std::move(errorBits))
351 return StatusCode::SUCCESS;
356 if (barrelROIFailCounter != 0)
ATH_MSG_WARNING(barrelROIFailCounter <<
" TopoTOB words could not retrieve RoIs in the barrel");
357 return StatusCode::SUCCESS;
LVL1MUCTPIPHASE1::L1TopoLUT m_l1topoLUT
Helper members.
uint32_t barrel_phi_lookup
unsigned short getBarrelROI(unsigned short side, unsigned short sector, unsigned short ieta, unsigned short iphi) const
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)
constexpr WordType getWordType(uint32_t word)
Determine the type of a MUCTPI ROD word.
uint32_t barrel_eta_lookup
MuCTPIPhase1ByteStreamAlgo(const std::string &name, ISvcLocator *svcLoc)
Default constructor.
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.
Gaudi::Property< uint32_t > m_robId
Object storing the various IDs of the MuCTPI fragment.
const std::string m_ecfRoIFile
#define ATH_MSG_VERBOSE(x)
const std::string m_side1LUTFile
An algorithm that can be simultaneously executed in multiple threads.
constexpr uint32_t multiplicityWordNumber(uint32_t word)
Decode the index of the multitpicity word, which is 1, 2, or 3.
StatusCode convert(const IROBDataProviderSvc::ROBF *rob, SG::WriteHandle< MuCTPI_Phase1_RDO > &outputHandle) const
Convert ROBFragment to MuCTPI_RDO.
L1TopoCoordinates getCoordinates(const unsigned short &side, const unsigned short &subsystem, const unsigned short §orID, const unsigned short &roi) const
::StatusCode StatusCode
StatusCode definition for legacy code.
virtual StatusCode finalize() override
const std::string m_side0LUTFile
#define CHECK(...)
Evaluate an expression and check for errors.
std::vector< const ROBF * > VROBFRAG
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
constexpr auto timesliceHeader(uint32_t word)
Decode timeslice word.
uint16_t bcId(uint32_t data)
virtual StatusCode execute(const EventContext &eventContext) const override
const std::string m_barrelRoIFile
virtual StatusCode initialize() override
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
const uint32_t RPCtoTGC_pt_map[7]
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
ServiceHandle< IROBDataProviderSvc > m_robDataProviderSvc
ROBDataProvider service handle.
#define ATH_MSG_WARNING(x)
bool initializeLUT(const std::string &barrelFileName, const std::string &ecfFileName, const std::string &side0LUTFileName, const std::string &side1LUTFileName)
std::vector< uint32_t > m_muctpi_Nbits
SG::WriteHandleKey< MuCTPI_Phase1_RDO > m_MuCTPI_Phase1_RDOKey