57 ATH_MSG_INFO(
"=======================================" );
58 ATH_MSG_INFO(
"Constructor for Phase1 MUCTPI_AthTool." );
59 ATH_MSG_INFO(
"=======================================" );
65 ATH_MSG_INFO(
"=======================================" );
66 ATH_MSG_INFO(
"Initialisation for Phase1 MUCTPI_AthTool" );
67 ATH_MSG_INFO(
"=======================================" );
92 return StatusCode::FAILURE;
103 ATH_MSG_INFO(
"Initializing L1Topo decoding with the following inputs");
108 std::vector<std::string> topo_errors =
m_theMuctpi.configureTopo(barrelFileName,
112 if (topo_errors.size())
114 std::stringstream err;
115 err <<
"Couldn't initialize L1Topo eta/phi encoding/decoding:\n";
116 for (
unsigned i=0;i<topo_errors.size();i++) err << topo_errors[i] <<
"\n";
118 return StatusCode::FAILURE;
135 ATH_MSG_DEBUG(
"Full path to XML LUT file: " << fullFileName );
139 msp.configureOverlapRemoval(fullFileName);
145 <<
"Wrong overlap strategy name specified: \""
147 return StatusCode::FAILURE;
164 return StatusCode::SUCCESS;
169 ATH_MSG_INFO(
"=======================================" );
171 ATH_MSG_INFO(
"=======================================" );
173 ATH_MSG_INFO(
"initialize(): use L1 trigger menu from detector store" );
181 if (!msp.configurePtEncoding())
184 <<
"Couldn't configure pt encoding in MuonSectorProcessor " << msp.getSide();
185 return StatusCode::FAILURE;
189 return StatusCode::SUCCESS;
219 bool gotRPCInput(
false );
223 ATH_MSG_WARNING(
"Cannot retrieve RPC L1Muctpi object from StoreGate!" );
226 ATH_MSG_DEBUG(
"Retrieved RPC Lvl1MuCTPIInput object from StoreGate" );
233 bool gotTGCInput(
false );
237 ATH_MSG_WARNING(
"Cannot retrieve TGC L1Muctpi object from StoreGate!" );
240 ATH_MSG_DEBUG(
"Retrieved TGC Lvl1MuCTPIInput object from StoreGate" );
247 if( ! ( gotRPCInput && gotTGCInput ) ) {
248 ATH_MSG_WARNING(
"No input received from the RPC or TGC sector logic simulation" );
249 return StatusCode::SUCCESS;
252 mergedInput.
merge( *dHandleRPC );
253 mergedInput.
merge( *dHandleTGC );
262 std::string ret =
m_theMuctpi.processData(&mergedInput, resultsBC0, 0);
265 REPORT_ERROR( StatusCode::FAILURE ) <<
"Error while processing MUCTPI data: " << ret;
266 return StatusCode::FAILURE;
281 m_theMuctpi.processData(&mergedInput, results, bcidOffset);
296 return StatusCode::SUCCESS;
338 return StatusCode::SUCCESS;
371 return StatusCode::SUCCESS;
381 std::advance(xAODRoIsKeyIt, bcidOffset+2);
383 ATH_CHECK(xAODRoIs.record(std::make_unique<xAOD::MuonRoIContainer>(),
384 std::make_unique<xAOD::MuonRoIAuxContainer>()));
385 ATH_MSG_DEBUG(
"Recorded MuonRoIContainer with key " << xAODRoIs.key());
389 std::advance(l1topoKeyIt, bcidOffset+2);
393 if (!results.has_value()) {
395 ATH_MSG_DEBUG(
"L1Topo output recorded to StoreGate with key " << l1topo.
key());
396 ATH_MSG_DEBUG(
"No results for BCID offset " << bcidOffset <<
" - recorded empty outputs");
397 return StatusCode::SUCCESS;
403 const std::vector<unsigned int>& ctpData = results->get().ctp_words;
404 if (ctpData.empty()) {
405 ATH_MSG_ERROR(
"TriggerProcessor didn't provide correct CTP data");
406 return StatusCode::FAILURE;
410 ATH_CHECK(muctpi_ctp.
record(std::make_unique<LVL1::MuCTPICTP>(ctpData)));
411 ATH_MSG_DEBUG(
"CTP word recorded to StoreGate with key " << muctpi_ctp.
key());
415 for (
const DAQData&
data : results->get().daq_data) {
416 xAODRoIs->push_back(std::make_unique<xAOD::MuonRoI>());
430 ATH_MSG_ERROR(
"Failed to determine Sector ID from RoI word 0x" << std::hex <<
data.dataWord << std::dec);
431 return StatusCode::FAILURE;
436 xAODRoIs->back()->initialize(
data.dataWord, roiData.
eta(), roiData.
phi(), maxThrInfo.first, maxThrInfo.second, 0);
440 ATH_CHECK(l1topo.
record(std::make_unique<LVL1::MuCTPIL1Topo>(results->get().l1topoData.getCandidates())));
441 if (bcidOffset!=0) {l1topo->setBcidOffset(bcidOffset);}
442 ATH_MSG_DEBUG(
"L1Topo output recorded to StoreGate with key " << l1topo.
key());
444 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
#define REPORT_ERROR(SC)
Report an error.
#define CHECK(...)
Evaluate an expression and check for errors.
char data[hepevt_bytes_allocation_ATLAS]
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
const_pointer_type ptr()
Dereference the pointer.
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
constexpr SubsysID getSubsysID(uint32_t word)
Decode the subsys ID from RoI candidate word.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())