ATLAS Offline Software
Loading...
Searching...
No Matches
RpcOverlay.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5// Andrei Gaponenko <agaponenko@lbl.gov>, 2006, 2007
6// Ketevi A. Assamagan <ketevi@bnl.gov>, March 2008
7// Piyali Banerjee <Piyali.Banerjee@cern.ch>, March 2011
8
10
13
15
16
17//================================================================
18RpcOverlay::RpcOverlay(const std::string &name, ISvcLocator *pSvcLocator) :
19 IDC_MuonOverlayBase(name, pSvcLocator)
20{
21}
22
23//================================================================
25{
26 ATH_MSG_DEBUG("Initializing...");
27
28 ATH_CHECK(m_bkgInputKey.initialize(!m_bkgInputKey.empty()));
29 ATH_MSG_VERBOSE("Initialized ReadHandleKey: " << m_bkgInputKey );
30 ATH_CHECK(m_signalInputKey.initialize());
31 ATH_MSG_VERBOSE("Initialized ReadHandleKey: " << m_signalInputKey );
32 ATH_CHECK(m_outputKey.initialize());
33 ATH_MSG_VERBOSE("Initialized WriteHandleKey: " << m_outputKey );
34
35 return StatusCode::SUCCESS;
36}
37
38//================================================================
39StatusCode RpcOverlay::execute(const EventContext& ctx) const
40{
41 ATH_MSG_DEBUG("RpcOverlay::execute() begin");
42
43 const RpcDigitContainer *bkgContainerPtr = nullptr;
44 if (!m_bkgInputKey.empty()) {
46 if (!bkgContainer.isValid()) {
47 ATH_MSG_ERROR("Could not get background RPC container " << bkgContainer.name() << " from store " << bkgContainer.store());
48 return StatusCode::FAILURE;
49 }
50 bkgContainerPtr = bkgContainer.cptr();
51
52 ATH_MSG_DEBUG("Found background RpcDigitContainer called " << bkgContainer.name() << " in store " << bkgContainer.store());
53 ATH_MSG_DEBUG("RPC Background = " << Overlay::debugPrint(bkgContainer.cptr()));
54 ATH_MSG_VERBOSE("RPC background has digit_size " << bkgContainer->digit_size());
55 }
56
58 if (!signalContainer.isValid() ) {
59 ATH_MSG_ERROR("Could not get signal RPC container " << signalContainer.name() << " from store " << signalContainer.store());
60 return StatusCode::FAILURE;
61 }
62 ATH_MSG_DEBUG("Found signal RpcDigitContainer called " << signalContainer.name() << " in store " << signalContainer.store());
63 ATH_MSG_DEBUG("RPC Signal = " << Overlay::debugPrint(signalContainer.cptr()));
64 ATH_MSG_VERBOSE("RPC signal has digit_size " << signalContainer->digit_size());
65
67 ATH_CHECK(outputContainer.record(std::make_unique<RpcDigitContainer>(signalContainer->size())));
68 if (!outputContainer.isValid()) {
69 ATH_MSG_ERROR("Could not record output RpcDigitContainer called " << outputContainer.name() << " to store " << outputContainer.store());
70 return StatusCode::FAILURE;
71 }
72 ATH_MSG_DEBUG("Recorded output RpcDigitContainer called " << outputContainer.name() << " in store " << outputContainer.store());
73
74 // Do the actual overlay
75 ATH_CHECK(overlayMultiHitContainer(bkgContainerPtr, signalContainer.cptr(), outputContainer.ptr()));
76 ATH_MSG_DEBUG("RPC Result = " << Overlay::debugPrint(outputContainer.cptr()));
77
78
79 ATH_MSG_DEBUG("RpcOverlay::execute() end");
80
81 return StatusCode::SUCCESS;
82}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
Handle class for reading from StoreGate.
Handle class for recording to StoreGate.
StatusCode overlayMultiHitContainer(const IDC_Container *bkgContainer, const IDC_Container *signalContainer, IDC_Container *outputContainer) const
IDC_MuonOverlayBase(const std::string &name, ISvcLocator *pSvcLocator)
Use IdentifiableContainer with RpcDigitCollection.
virtual StatusCode initialize() override final
SG::ReadHandleKey< RpcDigitContainer > m_bkgInputKey
Definition RpcOverlay.h:32
RpcOverlay(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode execute(const EventContext &ctx) const override final
SG::WriteHandleKey< RpcDigitContainer > m_outputKey
Definition RpcOverlay.h:34
SG::ReadHandleKey< RpcDigitContainer > m_signalInputKey
Definition RpcOverlay.h:33
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.
std::string debugPrint(const IDC_Container *container, unsigned numprint=25)
Diagnostic output of Identifiable Containers.