|
ATLAS Offline Software
|
Go to the documentation of this file.
31 ATH_MSG_INFO(
"--- - CHECK BARREL FILE NAME" << barrelFileName);
33 ATH_MSG_INFO(
"--- - CHECK ECF FILE NAME" << ecfFileName);
35 ATH_MSG_INFO(
"--- - CHECK SIDE0 LUT FILE NAME" << side0LUTFileName);
37 ATH_MSG_INFO(
"--- - INFO SIDE1 LUT FILE NAME" << side1LUTFileName);
45 return StatusCode::SUCCESS;
112 std::vector<uint32_t> robID = {
m_robId };
118 ATH_MSG_ERROR(
"Wrong number of MUCTPI fragment in event: vrobf.size()="<<vrobf.size());
119 return StatusCode::FAILURE;
125 return StatusCode::SUCCESS;
134 ATH_MSG_DEBUG(
"executing convert() from ROBFragment to RDO");
136 const uint32_t rodId = rob->rod_source_id();
140 ATH_MSG_DEBUG(
" expected ROD sub-detector ID: " << std::hex <<
m_robId <<
" ID found: " << std::hex << rodId << std::dec);
143 ATH_MSG_ERROR(
"Wrong ROD ID found in the MuCTPI ROB fragment!");
144 return StatusCode::FAILURE;
150 rob->rod_data( it_data );
151 const uint32_t ndata = rob->rod_ndata();
152 ATH_MSG_DEBUG(
"MUCTPI DQ DEBUG: number of ROB data words: " << std::dec << ndata);
155 std::vector< LVL1::MuCTPIBits::Slice >
slices;
157 bool firstSlice=
true;
158 std::vector<size_t> errorBits;
161 for(
uint32_t iWord = 0; iWord < ndata; ++iWord, ++it_data ) {
165 ATH_MSG_DEBUG(
"MUCTPI raw word " << iWord <<
": 0x" << std::hex << word << std::dec);
171 ATH_MSG_DEBUG(
" MUCTPI DQ DEBUG: Timeslice found: "<< std::hex << word);
176 ATH_MSG_DEBUG(
" MUCTPI DQ DEBUG: new timeslice found (pushing)");
188 <<
", NTOB=" <<
header.tobCount <<
", NCAND=" <<
header.candCount);
202 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;
204 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;
206 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;
213 slice.mlt.candOverflow =
LVL1::MuCTPIBits::maskedWord(word,LVL1::MuCTPIBits::RUN3_MULTIPLICITY_OVERFLOW_SHIFT, LVL1::MuCTPIBits::RUN3_MULTIPLICITY_OVERFLOW_MASK);
214 slice.mlt.bits = sliceMultiplicity;
228 slice.mlt.cnt.push_back( sliceMultiplicity & thismask);
275 slice.cand.push_back(thiscand);
279 ATH_MSG_DEBUG(
"This is a Topo TOB word "<< std::hex << word);
294 slice.tob.push_back(thistob);
300 if (!errorBits.empty()) {
301 ATH_MSG_DEBUG(
"MUCTPI ROD data flagged with errors. The data status word is 0x" << std::hex << word << std::dec);
302 for (
size_t bit : errorBits) {
303 ATH_MSG_DEBUG(
"Error bit " << bit <<
": " << LVL1::MuCTPIBits::DataStatusWordErrors.at(bit));
309 ATH_MSG_ERROR(
"The MUCTPI word 0x" << std::hex << word << std::dec <<
" does not match any known word type");
310 return StatusCode::FAILURE;
316 ATH_MSG_DEBUG(
" MUCTPI DQ DEBUG: out of words (pushing last slice)");
321 std::make_unique<MuCTPI_Phase1_RDO>(std::move(
slices), std::move(errorBits))
323 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.
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.
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