|
ATLAS Offline Software
|
Go to the documentation of this file.
23 return StatusCode::FAILURE;
28 return StatusCode::FAILURE;
39 return StatusCode::SUCCESS;
53 ATH_MSG_ERROR(
"Could not get background CscSimDataCollection container " << bkgContainer.
name() <<
" from store " << bkgContainer.
store());
54 return StatusCode::FAILURE;
56 bkgContainerPtr = bkgContainer.
cptr();
58 ATH_MSG_DEBUG(
"Found background CscSimDataCollection container " << bkgContainer.
name() <<
" in store " << bkgContainer.
store());
62 if (!signalContainer.
isValid()) {
63 ATH_MSG_ERROR(
"Could not get signal CscSimDataCollection container " << signalContainer.
name() <<
" from store " << signalContainer.
store());
64 return StatusCode::FAILURE;
66 ATH_MSG_DEBUG(
"Found signal CscSimDataCollection container " << signalContainer.
name() <<
" in store " << signalContainer.
store());
70 ATH_CHECK(outputContainer.
record(std::make_unique<CscSimDataCollection>()));
71 if (!outputContainer.
isValid()) {
72 ATH_MSG_ERROR(
"Could not record output CscSimDataCollection container " << outputContainer.
name() <<
" to store " << outputContainer.
store());
73 return StatusCode::FAILURE;
75 ATH_MSG_DEBUG(
"Recorded output CscSimDataCollection 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()) {
91 const std::vector<CscSimData::Deposit> &depositsBkg =
entry.second.getdeposits();
92 std::vector<CscSimData::Deposit> depositsVector(outSimData.
getdeposits());
93 depositsVector.insert(depositsVector.end(), depositsBkg.begin(), depositsBkg.end());
95 if (!depositsVector.empty() && !depositsBkg.empty()) {
96 depositsVector[0].second.setCharge(depositsVector[0].
second.charge() + depositsBkg[0].second.charge());
97 depositsVector[outSimData.
getdeposits().size()].second.setCharge(0);
102 outputContainer->insert(
entry);
110 return StatusCode::SUCCESS;
const_pointer_type cptr()
Dereference the pointer.
virtual StatusCode execute(const EventContext &ctx) const override
CscSimDataOverlay(const std::string &name, ISvcLocator *pSvcLocator)
const std::string & name() const
Return the StoreGate ID for the referenced object.
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
SG::ReadHandleKey< CscSimDataCollection > m_bkgInputKey
An algorithm that can be simultaneously executed in multiple threads.
Handle class for recording to StoreGate.
SG::WriteHandleKey< CscSimDataCollection > m_outputKey
::StatusCode StatusCode
StatusCode definition for legacy code.
std::string store() const
Return the name of the store holding the object we are proxying.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
virtual bool isValid() override final
Can the handle be successfully dereferenced?
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
virtual StatusCode initialize() override
SG::ReadHandleKey< CscSimDataCollection > m_signalInputKey
const std::vector< Deposit > & getdeposits() const
Handle class for reading from StoreGate.