34 throw std::runtime_error(
"mergeChannelData<sTgcDigit>() called by a wrong parent algorithm? Must be STGC_Overlay.");
37 float sig_time = signalDigit.
time();
38 float bkg_time = bkgDigit.
time();
41 if ( abs(sig_time - bkg_time) > parent->timeIntegrationWindow() && sig_time < bkg_time ) {
45 else if ( abs(sig_time - bkg_time) > parent->timeIntegrationWindow() && sig_time > bkg_time ) {
47 signalDigit = bkgDigit;
51 else if ( abs(sig_time - bkg_time) < parent->timeIntegrationWindow() ) {
53 float time = std::min( signalDigit.
time(), bkgDigit.
time() );
81 return StatusCode::SUCCESS;
93 ATH_MSG_ERROR(
"Could not get background sTGC container " << bkgContainer.
name() <<
" from store " << bkgContainer.
store());
94 return StatusCode::FAILURE;
96 bkgContainerPtr = bkgContainer.
cptr();
98 ATH_MSG_DEBUG(
"Found background sTGCDigitContainer called " << bkgContainer.
name() <<
" in store " << bkgContainer.
store());
100 ATH_MSG_VERBOSE(
"sTGC background has digit_size " << bkgContainer->digit_size());
104 if(!signalContainer.
isValid() ) {
105 ATH_MSG_ERROR(
"Could not get signal sTgc container " << signalContainer.
name() <<
" from store " << signalContainer.
store());
106 return StatusCode::FAILURE;
108 ATH_MSG_DEBUG(
"Found signal sTgcDigitContainer called " << signalContainer.
name() <<
" in store " << signalContainer.
store());
110 ATH_MSG_VERBOSE(
"sTGC signal has digit_size " << signalContainer->digit_size());
113 ATH_CHECK(outputContainer.
record(std::make_unique<sTgcDigitContainer>(signalContainer->size())));
114 if (!outputContainer.
isValid()) {
115 ATH_MSG_ERROR(
"Could not record output sTgcDigitContainer called " << outputContainer.
name() <<
" to store " << outputContainer.
store());
116 return StatusCode::FAILURE;
118 ATH_MSG_DEBUG(
"Recorded output sTgcDigitContainer called " << outputContainer.
name() <<
" in store " << outputContainer.
store());
126 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)
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.
SG::ReadHandleKey< sTgcDigitContainer > m_signalInputKey
STGC_Overlay(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode initialize() override final
SG::WriteHandleKey< sTgcDigitContainer > m_outputKey
SG::ReadHandleKey< sTgcDigitContainer > m_bkgInputKey
virtual StatusCode execute(const EventContext &ctx) const override final
Use IdentifiableContainer with sTgcDigitCollection.
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.