ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonOverlay
RpcOverlay
src
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
9
#include <
RpcOverlay/RpcOverlay.h
>
10
11
#include <
StoreGate/ReadHandle.h
>
12
#include <
StoreGate/WriteHandle.h
>
13
14
#include <
IDC_OverlayBase/IDC_OverlayHelpers.h
>
15
16
17
//================================================================
18
RpcOverlay::RpcOverlay
(
const
std::string &name, ISvcLocator *pSvcLocator) :
19
IDC_MuonOverlayBase
(name, pSvcLocator)
20
{
21
}
22
23
//================================================================
24
StatusCode
RpcOverlay::initialize
()
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
//================================================================
39
StatusCode
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()) {
45
SG::ReadHandle<RpcDigitContainer>
bkgContainer (
m_bkgInputKey
, ctx);
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
57
SG::ReadHandle<RpcDigitContainer>
signalContainer(
m_signalInputKey
, ctx);
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
66
SG::WriteHandle<RpcDigitContainer>
outputContainer(
m_outputKey
, ctx);
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
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
IDC_OverlayHelpers.h
RpcOverlay.h
ReadHandle.h
Handle class for reading from StoreGate.
WriteHandle.h
Handle class for recording to StoreGate.
IDC_MuonOverlayBase::overlayMultiHitContainer
StatusCode overlayMultiHitContainer(const IDC_Container *bkgContainer, const IDC_Container *signalContainer, IDC_Container *outputContainer) const
Definition
IDC_MuonOverlayBase.h:42
IDC_MuonOverlayBase::IDC_MuonOverlayBase
IDC_MuonOverlayBase(const std::string &name, ISvcLocator *pSvcLocator)
Definition
IDC_MuonOverlayBase.h:29
RpcDigitContainer
Use IdentifiableContainer with RpcDigitCollection.
Definition
RpcDigitContainer.h:53
RpcOverlay::initialize
virtual StatusCode initialize() override final
Definition
RpcOverlay.cxx:24
RpcOverlay::m_bkgInputKey
SG::ReadHandleKey< RpcDigitContainer > m_bkgInputKey
Definition
RpcOverlay.h:32
RpcOverlay::RpcOverlay
RpcOverlay(const std::string &name, ISvcLocator *pSvcLocator)
Definition
RpcOverlay.cxx:18
RpcOverlay::execute
virtual StatusCode execute(const EventContext &ctx) const override final
Definition
RpcOverlay.cxx:39
RpcOverlay::m_outputKey
SG::WriteHandleKey< RpcDigitContainer > m_outputKey
Definition
RpcOverlay.h:34
RpcOverlay::m_signalInputKey
SG::ReadHandleKey< RpcDigitContainer > m_signalInputKey
Definition
RpcOverlay.h:33
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
SG::VarHandleBase::store
std::string store() const
Return the name of the store holding the object we are proxying.
Definition
StoreGate/src/VarHandleBase.cxx:382
SG::VarHandleBase::name
const std::string & name() const
Return the StoreGate ID for the referenced object.
Definition
AthToolSupport/AsgDataHandles/Root/VarHandleBase.cxx:75
SG::WriteHandle
Definition
StoreGate/StoreGate/WriteHandle.h:73
SG::WriteHandle::cptr
const_pointer_type cptr() const
Dereference the pointer.
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
SG::WriteHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::WriteHandle::ptr
pointer_type ptr()
Dereference the pointer.
Overlay::debugPrint
std::string debugPrint(const IDC_Container *container, unsigned numprint=25)
Diagnostic output of Identifiable Containers.
Generated on
for ATLAS Offline Software by
1.17.0