34 throw std::runtime_error(
"mergeChannelData<MmDigit>() called by a wrong parent algorithm? Must be MM_Overlay.");
44 if ( std::abs(sig_time - bkg_time) > parent->timeIntegrationWindow() && sig_time < bkg_time ) {
48 else if ( std::abs(sig_time - bkg_time) > parent->timeIntegrationWindow() && sig_time > bkg_time ) {
50 signalDigit = bkgDigit;
54 else if ( std::abs(sig_time - bkg_time) < parent->timeIntegrationWindow() ) {
57 float time = std::min( sig_time, bkg_time );
84 return StatusCode::SUCCESS;
96 ATH_MSG_ERROR(
"Could not get background MM container " << bkgContainer.
name() <<
" from store " << bkgContainer.
store());
97 return StatusCode::FAILURE;
99 bkgContainerPtr = bkgContainer.
cptr();
101 ATH_MSG_DEBUG(
"Found background MMDigitContainer called " << bkgContainer.
name() <<
" in store " << bkgContainer.
store());
103 ATH_MSG_VERBOSE(
"MM background has digit_size " << bkgContainer->digit_size());
107 if(!signalContainer.
isValid() ) {
108 ATH_MSG_ERROR(
"Could not get signal MM container " << signalContainer.
name() <<
" from store " << signalContainer.
store());
109 return StatusCode::FAILURE;
111 ATH_MSG_DEBUG(
"Found signal MmDigitContainer called " << signalContainer.
name() <<
" in store " << signalContainer.
store());
113 ATH_MSG_VERBOSE(
"MM signal has digit_size " << signalContainer->digit_size());
116 ATH_CHECK(outputContainer.
record(std::make_unique<MmDigitContainer>(signalContainer->size())));
117 if (!outputContainer.
isValid()) {
118 ATH_MSG_ERROR(
"Could not record output MmDigitContainer called " << outputContainer.
name() <<
" to store " << outputContainer.
store());
119 return StatusCode::FAILURE;
121 ATH_MSG_DEBUG(
"Recorded output MmDigitContainer called " << outputContainer.
name() <<
" in store " << outputContainer.
store());
129 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
double charge(const T &p)
Handle class for reading from StoreGate.
Handle class for recording to StoreGate.
StatusCode overlayContainer(const IDC_Container *bkgContainer, const IDC_Container *signalContainer, IDC_Container *outputContainer) const
IDC_MuonOverlayBase(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode execute(const EventContext &ctx) const override final
MM_Overlay(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadHandleKey< MmDigitContainer > m_signalInputKey
SG::WriteHandleKey< MmDigitContainer > m_outputKey
virtual StatusCode initialize() override final
SG::ReadHandleKey< MmDigitContainer > m_bkgInputKey
Use IdentifiableContainer with MmDigitCollection.
float stripResponseCharge() const
Return the charge.
float stripResponseTime() const
strip response info
Identifier identify() 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.
const_pointer_type cptr() const
Dereference the pointer.
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?
pointer_type ptr()
Dereference the pointer.
Helpers for overlaying Identifiable Containers.
void mergeChannelData(HGTD_RDO &, const HGTD_RDO &, const IDC_OverlayBase *algorithm)
std::string debugPrint(const IDC_Container *container, unsigned numprint=25)
Diagnostic output of Identifiable Containers.