33 throw std::runtime_error(
"mergeChannelData<MdtDigit>() called by a wrong parent algorithm? Must be MdtOverlay.");
36 int sig_tdc = signalDigit.
tdc();
37 int bkg_tdc = bkgDigit.
tdc();
41 if (std::abs(sig_tdc - bkg_tdc) > parent->adcIntegrationWindow() && sig_tdc < bkg_tdc ) {
46 else if (std::abs(sig_tdc - bkg_tdc) > parent->adcIntegrationWindow() && sig_tdc > bkg_tdc ) {
48 signalDigit = bkgDigit;
54 else if (std::abs(sig_tdc - bkg_tdc) < parent->adcIntegrationWindow() ) {
55 int tdc = std::min( signalDigit.
tdc(), bkgDigit.
tdc() );
56 int adc = signalDigit.
adc() + bkgDigit.
adc();
82 return StatusCode::SUCCESS;
94 ATH_MSG_ERROR(
"Could not get background MDT container " << bkgContainer.
name() <<
" from store " << bkgContainer.
store());
95 return StatusCode::FAILURE;
97 bkgContainerPtr = bkgContainer.
cptr();
99 ATH_MSG_DEBUG(
"Found background MdtDigitContainer called " << bkgContainer.
name() <<
" in store " << bkgContainer.
store());
101 ATH_MSG_VERBOSE(
"MDT background has digit_size " << bkgContainer->digit_size());
105 if(!signalContainer.
isValid() ) {
106 ATH_MSG_ERROR(
"Could not get signal MDT container " << signalContainer.
name() <<
" from store " << signalContainer.
store());
107 return StatusCode::FAILURE;
109 ATH_MSG_DEBUG(
"Found signal MdtDigitContainer called " << signalContainer.
name() <<
" in store " << signalContainer.
store());
111 ATH_MSG_VERBOSE(
"MDT signal has digit_size " << signalContainer->digit_size());
114 ATH_CHECK(outputContainer.
record(std::make_unique<MdtDigitContainer>(signalContainer->size())));
115 if (!outputContainer.
isValid()) {
116 ATH_MSG_ERROR(
"Could not record output MdtDigitContainer called " << outputContainer.
name() <<
" to store " << outputContainer.
store());
117 return StatusCode::FAILURE;
119 ATH_MSG_DEBUG(
"Recorded output MdtDigitContainer called " << outputContainer.
name() <<
" in store " << outputContainer.
store());
128 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.
StatusCode overlayContainer(const IDC_Container *bkgContainer, const IDC_Container *signalContainer, IDC_Container *outputContainer) const
IDC_MuonOverlayBase(const std::string &name, ISvcLocator *pSvcLocator)
Use IdentifiableContainer with MdtDigitCollection.
virtual StatusCode execute(const EventContext &ctx) const override final
SG::ReadHandleKey< MdtDigitContainer > m_bkgInputKey
virtual StatusCode initialize() override final
SG::ReadHandleKey< MdtDigitContainer > m_signalInputKey
MdtOverlay(const std::string &name, ISvcLocator *pSvcLocator)
SG::WriteHandleKey< MdtDigitContainer > m_outputKey
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.