ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
TruthParticleID
McParticleAlgs
src
McAodTupleWriter.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// McAodTupleWriter.cxx
7
// Implementation file for class McAodTupleWriter
8
// Author: S.Binet<binet@cern.ch>
10
11
// STL includes
12
#include <stdexcept>
13
14
// FrameWork includes
15
16
// McParticleKernel includes
17
#include "
McParticleKernel/IIOMcAodTool.h
"
18
19
// McParticleAlgs includes
20
#include "
McAodTupleWriter.h
"
21
25
28
McAodTupleWriter::McAodTupleWriter
(
const
std::string& name,
29
ISvcLocator* pSvcLocator ) :
30
AthAlgorithm
( name, pSvcLocator ),
31
m_mcAodWriter
(
"McAodTupleWriterTool"
, this )
32
{
33
//
34
// Property declaration
35
//
36
//declareProperty( "Property", m_nProperty );
37
38
declareProperty
(
"McWriter"
,
39
m_mcAodWriter
=
IIOMcAodTool_t
(
"McAodTupleWriterTool"
,
40
this
),
41
"Tool to write the reference TruthParticleContainer into "
42
"a dedicated file"
);
43
}
44
47
McAodTupleWriter::~McAodTupleWriter
()
48
{}
49
52
StatusCode
McAodTupleWriter::initialize
()
53
{
54
ATH_MSG_INFO
(
"Initializing "
<< name() <<
"..."
);
55
setupMcAodWriterTool
();
56
return
StatusCode::SUCCESS;
57
}
58
59
StatusCode
McAodTupleWriter::finalize
()
60
{
61
ATH_MSG_INFO
(
"Finalizing "
<< name() <<
"..."
);
62
return
StatusCode::SUCCESS;
63
}
64
65
StatusCode
McAodTupleWriter::execute
(
const
EventContext&
/*ctx*/
)
66
{
67
ATH_MSG_DEBUG
(
"Executing "
<< name() <<
"..."
);
68
69
if
( !
m_mcAodWriter
->execute().isSuccess() ) {
70
ATH_MSG_WARNING
(
"Problem executing IIOMcAodTool !!"
);
71
}
72
73
return
StatusCode::SUCCESS;
74
}
75
79
void
McAodTupleWriter::setupMcAodWriterTool
()
80
{
81
if
( !
m_mcAodWriter
.retrieve().isSuccess() ) {
82
ATH_MSG_ERROR
83
(
"Could not retrieve algTool IIOMcAodTool ["
<<
m_mcAodWriter
.type()
84
<<
"] !!"
);
85
throw
std::runtime_error(
"Could not setup McWriter property !"
);
86
}
else
{
87
ATH_MSG_DEBUG
88
(
"Retrieved and configured algTool ["
<<
m_mcAodWriter
.type() <<
"]"
);
89
}
90
91
return
;
92
}
93
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
IIOMcAodTool.h
McAodTupleWriter.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
McAodTupleWriter::finalize
virtual StatusCode finalize()
Definition
McAodTupleWriter.cxx:59
McAodTupleWriter::m_mcAodWriter
IIOMcAodTool_t m_mcAodWriter
Tool to write the reference TruthParticleContainer into a dedicated tuple.
Definition
McAodTupleWriter.h:70
McAodTupleWriter::~McAodTupleWriter
virtual ~McAodTupleWriter()
Destructor:
Definition
McAodTupleWriter.cxx:47
McAodTupleWriter::execute
virtual StatusCode execute(const EventContext &ctx)
Execute method.
Definition
McAodTupleWriter.cxx:65
McAodTupleWriter::setupMcAodWriterTool
void setupMcAodWriterTool()
Method to configure the back-end to write out the HepMC::GenEvent.
Definition
McAodTupleWriter.cxx:79
McAodTupleWriter::McAodTupleWriter
McAodTupleWriter()
Default constructor:
McAodTupleWriter::initialize
virtual StatusCode initialize()
Athena Algorithm's Hooks.
Definition
McAodTupleWriter.cxx:52
McAodTupleWriter::IIOMcAodTool_t
ToolHandle< IIOMcAodTool > IIOMcAodTool_t
Definition
McAodTupleWriter.h:66
Generated on
for ATLAS Offline Software by
1.17.0