ATLAS Offline Software
Loading...
Searching...
No Matches
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
18
19// McParticleAlgs includes
20#include "McAodTupleWriter.h"
21
25
28McAodTupleWriter::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
49
53{
54 ATH_MSG_INFO ("Initializing " << name() << "...");
56 return StatusCode::SUCCESS;
57}
58
60{
61 ATH_MSG_INFO ("Finalizing " << name() << "...");
62 return StatusCode::SUCCESS;
63}
64
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
80{
81 if ( !m_mcAodWriter.retrieve().isSuccess() ) {
83 ("Could not retrieve algTool IIOMcAodTool [" << m_mcAodWriter.type()
84 << "] !!");
85 throw std::runtime_error("Could not setup McWriter property !");
86 } else {
88 ("Retrieved and configured algTool [" << m_mcAodWriter.type() << "]");
89 }
90
91 return;
92}
93
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
virtual StatusCode finalize()
IIOMcAodTool_t m_mcAodWriter
Tool to write the reference TruthParticleContainer into a dedicated tuple.
virtual ~McAodTupleWriter()
Destructor:
void setupMcAodWriterTool()
Method to configure the back-end to write out the HepMC::GenEvent.
virtual StatusCode execute()
McAodTupleWriter()
Default constructor:
virtual StatusCode initialize()
Athena Algorithm's Hooks.
ToolHandle< IIOMcAodTool > IIOMcAodTool_t