ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonOverlay
TgcOverlay
src
TgcOverlay.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 <
TgcOverlay/TgcOverlay.h
>
10
11
#include <
StoreGate/ReadHandle.h
>
12
#include <
StoreGate/WriteHandle.h
>
13
14
#include <
IDC_OverlayBase/IDC_OverlayHelpers.h
>
15
16
17
//================================================================
18
TgcOverlay::TgcOverlay
(
const
std::string &name, ISvcLocator *pSvcLocator) :
19
IDC_MuonOverlayBase
(name, pSvcLocator)
20
{
21
}
22
23
//================================================================
24
StatusCode
TgcOverlay::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
TgcOverlay::execute
(
const
EventContext& ctx)
const
{
40
ATH_MSG_DEBUG
(
"TgcOverlay::execute() begin"
);
41
42
const
TgcDigitContainer
*bkgContainerPtr =
nullptr
;
43
if
(!
m_bkgInputKey
.empty()) {
44
SG::ReadHandle<TgcDigitContainer>
bkgContainer (
m_bkgInputKey
, ctx);
45
if
(!bkgContainer.
isValid
()) {
46
ATH_MSG_ERROR
(
"Could not get background TgcDigitContainer called "
<< bkgContainer.
name
() <<
" from store "
<< bkgContainer.
store
());
47
return
StatusCode::FAILURE;
48
}
49
bkgContainerPtr = bkgContainer.
cptr
();
50
51
ATH_MSG_DEBUG
(
"Found background TgcDigitContainer called "
<< bkgContainer.
name
() <<
" in store "
<< bkgContainer.
store
());
52
ATH_MSG_DEBUG
(
"TGC Background = "
<<
Overlay::debugPrint
(bkgContainer.
cptr
()));
53
ATH_MSG_VERBOSE
(
"TGC background has digit_size "
<< bkgContainer->digit_size());
54
}
55
56
SG::ReadHandle<TgcDigitContainer>
signalContainer(
m_signalInputKey
, ctx);
57
if
(!signalContainer.
isValid
() ) {
58
ATH_MSG_ERROR
(
"Could not get signal TgcDigitContainer called "
<< signalContainer.
name
() <<
" from store "
<< signalContainer.
store
());
59
return
StatusCode::FAILURE;
60
}
61
ATH_MSG_DEBUG
(
"Found overlay TgcDigitContainer called "
<< signalContainer.
name
() <<
" in store "
<< signalContainer.
store
());
62
ATH_MSG_DEBUG
(
"TGC Signal = "
<<
Overlay::debugPrint
(signalContainer.
cptr
()));
63
ATH_MSG_VERBOSE
(
"TGC signal has digit_size "
<< signalContainer->digit_size());
64
65
SG::WriteHandle<TgcDigitContainer>
outputContainer(
m_outputKey
, ctx);
66
ATH_CHECK
(outputContainer.
record
(std::make_unique<TgcDigitContainer>(signalContainer->size())));
67
if
(!outputContainer.
isValid
()) {
68
ATH_MSG_ERROR
(
"Could not record output TgcDigitContainer called "
<< outputContainer.
name
() <<
" to store "
<< outputContainer.
store
());
69
return
StatusCode::FAILURE;
70
}
71
ATH_MSG_DEBUG
(
"Recorded output TgcDigitContainer called "
<< outputContainer.
name
() <<
" in store "
<< outputContainer.
store
());
72
73
// Do the actual overlay
74
ATH_CHECK
(
overlayMultiHitContainer
(bkgContainerPtr, signalContainer.
cptr
(), outputContainer.
ptr
()));
75
ATH_MSG_DEBUG
(
"TGC Result = "
<<
Overlay::debugPrint
(outputContainer.
cptr
()));
76
77
78
ATH_MSG_DEBUG
(
"TgcOverlay::execute() end"
);
79
80
return
StatusCode::SUCCESS;
81
}
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
ReadHandle.h
Handle class for reading from StoreGate.
WriteHandle.h
Handle class for recording to StoreGate.
TgcOverlay.h
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
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.
TgcDigitContainer
Use IdentifiableContainer with TgcDigitCollection.
Definition
TgcDigitContainer.h:53
TgcOverlay::execute
virtual StatusCode execute(const EventContext &ctx) const override final
Definition
TgcOverlay.cxx:39
TgcOverlay::initialize
virtual StatusCode initialize() override final
Definition
TgcOverlay.cxx:24
TgcOverlay::m_bkgInputKey
SG::ReadHandleKey< TgcDigitContainer > m_bkgInputKey
Definition
TgcOverlay.h:30
TgcOverlay::m_outputKey
SG::WriteHandleKey< TgcDigitContainer > m_outputKey
Definition
TgcOverlay.h:32
TgcOverlay::TgcOverlay
TgcOverlay(const std::string &name, ISvcLocator *pSvcLocator)
Definition
TgcOverlay.cxx:18
TgcOverlay::m_signalInputKey
SG::ReadHandleKey< TgcDigitContainer > m_signalInputKey
Definition
TgcOverlay.h:31
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