23 return StatusCode::FAILURE;
28 return StatusCode::FAILURE;
39 return StatusCode::SUCCESS;
53 ATH_MSG_ERROR(
"Could not get background MuonSimDataCollection container " << bkgContainer.
name() <<
" from store " << bkgContainer.
store());
54 return StatusCode::FAILURE;
56 bkgContainerPtr = bkgContainer.
cptr();
58 ATH_MSG_DEBUG(
"Found background MuonSimDataCollection container " << bkgContainer.
name() <<
" in store " << bkgContainer.
store());
62 if (!signalContainer.
isValid()) {
63 ATH_MSG_ERROR(
"Could not get signal MuonSimDataCollection container " << signalContainer.
name() <<
" from store " << signalContainer.
store());
64 return StatusCode::FAILURE;
66 ATH_MSG_DEBUG(
"Found signal MuonSimDataCollection container " << signalContainer.
name() <<
" in store " << signalContainer.
store());
70 ATH_CHECK(outputContainer.
record(std::make_unique<MuonSimDataCollection>()));
71 if (!outputContainer.
isValid()) {
72 ATH_MSG_ERROR(
"Could not record output MuonSimDataCollection container " << outputContainer.
name() <<
" to store " << outputContainer.
store());
73 return StatusCode::FAILURE;
75 ATH_MSG_DEBUG(
"Recorded output MuonSimDataCollection container " << outputContainer.
name() <<
" in store " << outputContainer.
store());
79 ATH_MSG_VERBOSE(
"Inserting signal SDO, size = " << signalContainer->size());
80 outputContainer->insert(signalContainer->begin(), signalContainer->end());
84 ATH_MSG_VERBOSE(
"Inserting background SDO, size = " << bkgContainerPtr->size());
86 for (
const auto &entry : *bkgContainerPtr) {
87 auto it = outputContainer->find(entry.first);
88 if (it != outputContainer->end()) {
89 if (it->second.getTime() < entry.second.getTime()) {
94 ATH_MSG_VERBOSE(
"Replacing signal SDO, time = " << it->second.getTime() <<
", "
95 <<
"with background SDO, time = " << entry.second.getTime());
99 tempSDO.
setTime(entry.second.getTime());
101 it->second = std::move(tempSDO);
103 outputContainer->insert(entry);
111 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
Handle class for reading from StoreGate.
Handle class for recording to StoreGate.
An algorithm that can be simultaneously executed in multiple threads.
SG::WriteHandleKey< MuonSimDataCollection > m_outputKey
virtual StatusCode execute(const EventContext &ctx) const override
MuonSimDataOverlay(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadHandleKey< MuonSimDataCollection > m_signalInputKey
SG::ReadHandleKey< MuonSimDataCollection > m_bkgInputKey
virtual StatusCode initialize() override
void setTime(const float &time)
void setPosition(const Amg::Vector3D &pos)
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
std::string store() const
Return the name of the store holding the object we are proxying.
const std::string & name() const
Return the StoreGate ID for the referenced object.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
virtual bool isValid() override final
Can the handle be successfully dereferenced?