ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
ForwardDetectors
ZDC
ZdcRec
src
ZdcRecV3.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
/*
6
* ZdcRecV3.cxx
7
*
8
* Created on: Sept 11, 2016 (never forget)
9
* Author: Peter.Steinberg@bnl.gov
10
*/
11
12
13
#include <memory>
14
15
#include "GaudiKernel/ISvcLocator.h"
16
#include "GaudiKernel/MsgStream.h"
17
#include "GaudiKernel/StatusCode.h"
18
#include "
StoreGate/StoreGateSvc.h
"
19
#include "
StoreGate/WriteHandle.h
"
20
#include "
StoreGate/ReadHandle.h
"
21
//#include "Identifier/Identifier.h"
22
23
#include "
xAODForward/ZdcModuleContainer.h
"
24
#include "
ZdcRec/ZdcRecV3.h
"
25
#include "
ZdcAnalysis/ZdcAnalysisTool.h
"
26
27
//==================================================================================================
28
ZdcRecV3::ZdcRecV3
(
const
std::string& name, ISvcLocator* pSvcLocator) :
29
30
AthAlgorithm
(name, pSvcLocator),
31
m_ownPolicy
(static_cast<int> (
SG
::OWN_ELEMENTS))
32
{
33
declareProperty
(
"OwnPolicy"
,
m_ownPolicy
) ;
34
}
35
//==================================================================================================
36
37
//==================================================================================================
38
ZdcRecV3::~ZdcRecV3
() {}
39
//==================================================================================================
40
41
//==================================================================================================
42
StatusCode
ZdcRecV3::initialize
()
43
{
44
MsgStream mLog(msgSvc(), name());
45
46
// Reconstruction Tool
47
ATH_CHECK
(
m_zdcTool
.retrieve() );
48
49
ATH_CHECK
(
m_zdcModuleContainerName
.initialize() );
50
ATH_CHECK
(
m_zdcSumContainerName
.initialize() );
51
52
if
(
m_ownPolicy
==
SG::OWN_ELEMENTS
)
53
mLog << MSG::DEBUG <<
"...will OWN its cells."
<<
endmsg
;
54
else
55
mLog << MSG::DEBUG <<
"...will VIEW its cells."
<<
endmsg
;
56
57
58
mLog << MSG::DEBUG <<
"--> ZDC: ZdcRecV3 initialization complete"
<<
endmsg
;
59
60
return
StatusCode::SUCCESS;
61
}
62
//==================================================================================================
63
64
//==================================================================================================
65
StatusCode
ZdcRecV3::execute
(
const
EventContext& ctx)
66
{
67
68
ATH_MSG_DEBUG
(
"--> ZDC: ZdcRecV3 execute starting on "
69
<< ctx.evt()
70
<<
"th event"
);
71
72
73
SG::ReadHandle<xAOD::ZdcModuleContainer>
moduleContainer (
m_zdcModuleContainerName
, ctx);
74
SG::ReadHandle<xAOD::ZdcModuleContainer>
moduleSumContainer (
m_zdcSumContainerName
, ctx);
75
76
ATH_CHECK
(
m_zdcTool
->recoZdcModules(*moduleContainer.
get
(), *moduleSumContainer.
get
() ) );
// passes by reference
77
78
return
StatusCode::SUCCESS;
79
80
}
81
//==================================================================================================
82
83
//==================================================================================================
84
StatusCode
ZdcRecV3::finalize
()
85
{
86
87
ATH_MSG_DEBUG
(
"--> ZDC: ZdcRecV3 finalize complete"
);
88
89
return
StatusCode::SUCCESS;
90
91
}
92
//==================================================================================================
93
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
StoreGateSvc.h
ReadHandle.h
Handle class for reading from StoreGate.
WriteHandle.h
Handle class for recording to StoreGate.
ZdcAnalysisTool.h
ZdcModuleContainer.h
ZdcRecV3.h
AthAlgorithm::AthAlgorithm
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
AthAlgorithm.cxx:10
AthCommonAlgorithm< Gaudi::Algorithm >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::ReadHandle::get
const_pointer_type get() const
Dereference the pointer, but don't cache anything.
ZdcRecV3::~ZdcRecV3
~ZdcRecV3()
Definition
ZdcRecV3.cxx:38
ZdcRecV3::m_zdcTool
ToolHandle< ZDC::IZdcAnalysisTool > m_zdcTool
Definition
ZdcRecV3.h:91
ZdcRecV3::ZdcRecV3
ZdcRecV3(const std::string &name, ISvcLocator *pSvcLocator)
Definition
ZdcRecV3.cxx:28
ZdcRecV3::m_ownPolicy
int m_ownPolicy
class member version of retrieving StoreGate
Definition
ZdcRecV3.h:66
ZdcRecV3::finalize
StatusCode finalize() override
Definition
ZdcRecV3.cxx:84
ZdcRecV3::initialize
StatusCode initialize() override
Definition
ZdcRecV3.cxx:42
ZdcRecV3::execute
StatusCode execute(const EventContext &ctx) override
Execute method.
Definition
ZdcRecV3.cxx:65
ZdcRecV3::m_zdcModuleContainerName
SG::ReadHandleKey< xAOD::ZdcModuleContainer > m_zdcModuleContainerName
Digits data container name.
Definition
ZdcRecV3.h:82
ZdcRecV3::m_zdcSumContainerName
SG::ReadHandleKey< xAOD::ZdcModuleContainer > m_zdcSumContainerName
Definition
ZdcRecV3.h:85
SG
Forward declaration.
Definition
CaloCellPacker_400_500.h:32
SG::OWN_ELEMENTS
@ OWN_ELEMENTS
this data object owns its elements
Definition
OwnershipPolicy.h:17
Generated on
for ATLAS Offline Software by
1.17.0