18 return StatusCode::FAILURE;
23 return StatusCode::FAILURE;
34 return StatusCode::SUCCESS;
48 ATH_MSG_ERROR(
"Could not get background InDetSimDataCollection container " << bkgContainer.
name() <<
" from store " << bkgContainer.
store());
49 return StatusCode::FAILURE;
51 bkgContainerPtr = bkgContainer.
cptr();
53 ATH_MSG_DEBUG(
"Found background InDetSimDataCollection container " << bkgContainer.
name() <<
" in store " << bkgContainer.
store());
57 if (!signalContainer.
isValid()) {
58 ATH_MSG_ERROR(
"Could not get signal InDetSimDataCollection container " << signalContainer.
name() <<
" from store " << signalContainer.
store());
59 return StatusCode::FAILURE;
61 ATH_MSG_DEBUG(
"Found signal InDetSimDataCollection container " << signalContainer.
name() <<
" in store " << signalContainer.
store());
65 ATH_CHECK(outputContainer.
record(std::make_unique<InDetSimDataCollection>()));
66 if (!outputContainer.
isValid()) {
67 ATH_MSG_ERROR(
"Could not record output InDetSimDataCollection container " << outputContainer.
name() <<
" to store " << outputContainer.
store());
68 return StatusCode::FAILURE;
70 ATH_MSG_DEBUG(
"Recorded output InDetSimDataCollection container " << outputContainer.
name() <<
" in store " << outputContainer.
store());
73 ATH_MSG_VERBOSE(
"Inserting signal SDO, size = " << signalContainer->size());
74 outputContainer->insert(signalContainer->begin(), signalContainer->end());
78 ATH_MSG_VERBOSE(
"Inserting background SDO, size = " << bkgContainerPtr->size());
80 for (
const auto &entry : *bkgContainerPtr) {
81 auto it = outputContainer->find(entry.first);
82 if (it != outputContainer->end()) {
85 std::vector<InDetSimData::Deposit> depositsVector(outSimData.
getdeposits());
86 depositsVector.insert(depositsVector.end(), entry.second.getdeposits().begin(), entry.second.getdeposits().end());
90 outputContainer->insert(entry);
98 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
An algorithm that can be simultaneously executed in multiple threads.
SG::ReadHandleKey< InDetSimDataCollection > m_signalInputKey
virtual StatusCode initialize() override
SG::WriteHandleKey< InDetSimDataCollection > m_outputKey
virtual StatusCode execute(const EventContext &ctx) const override
SG::ReadHandleKey< InDetSimDataCollection > m_bkgInputKey
InDetSDOOverlay(const std::string &name, ISvcLocator *pSvcLocator)
const std::vector< Deposit > & getdeposits() const
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?