ATLAS Offline Software
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 
24 #include "ZdcRec/ZdcRecV3.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 //==================================================================================================
39 //==================================================================================================
40 
41 //==================================================================================================
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 
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 //==================================================================================================
66 {
67 
68  const EventContext& ctx = Gaudi::Hive::currentContext();
69  ATH_MSG_DEBUG ("--> ZDC: ZdcRecV3 execute starting on "
70  << ctx.evt()
71  << "th event");
72 
73 
76 
77  ATH_CHECK( m_zdcTool->recoZdcModules(*moduleContainer.get(), *moduleSumContainer.get() ) ); // passes by reference
78 
79  return StatusCode::SUCCESS;
80 
81 }
82 //==================================================================================================
83 
84 //==================================================================================================
86 {
87 
88  ATH_MSG_DEBUG( "--> ZDC: ZdcRecV3 finalize complete" );
89 
90  return StatusCode::SUCCESS;
91 
92 }
93 //==================================================================================================
94 
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
ZdcRecV3::ZdcRecV3
ZdcRecV3(const std::string &name, ISvcLocator *pSvcLocator)
Definition: ZdcRecV3.cxx:28
ZdcRecV3::finalize
StatusCode finalize() override
Definition: ZdcRecV3.cxx:85
ZdcRecV3.h
ZdcAnalysisTool.h
WriteHandle.h
Handle class for recording to StoreGate.
ZdcRecV3::m_zdcModuleContainerName
SG::ReadHandleKey< xAOD::ZdcModuleContainer > m_zdcModuleContainerName
Digits data container name.
Definition: ZdcRecV3.h:82
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
ZdcRecV3::~ZdcRecV3
~ZdcRecV3()
Definition: ZdcRecV3.cxx:38
SG::OWN_ELEMENTS
@ OWN_ELEMENTS
this data object owns its elements
Definition: OwnershipPolicy.h:17
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SG::ReadHandle::get
const_pointer_type get() const
Dereference the pointer, but don't cache anything.
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ZdcRecV3::execute
StatusCode execute() override
Definition: ZdcRecV3.cxx:65
AthAlgorithm
Definition: AthAlgorithm.h:47
ZdcRecV3::initialize
StatusCode initialize() override
Definition: ZdcRecV3.cxx:42
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
ZdcRecV3::m_zdcTool
ToolHandle< ZDC::IZdcAnalysisTool > m_zdcTool
Definition: ZdcRecV3.h:91
DEBUG
#define DEBUG
Definition: page_access.h:11
ZdcRecV3::m_zdcSumContainerName
SG::ReadHandleKey< xAOD::ZdcModuleContainer > m_zdcSumContainerName
Definition: ZdcRecV3.h:85
ReadHandle.h
Handle class for reading from StoreGate.
ZdcRecV3::m_ownPolicy
int m_ownPolicy
class member version of retrieving StoreGate
Definition: ZdcRecV3.h:66
StoreGateSvc.h
ZdcModuleContainer.h