ATLAS Offline Software
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 
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 
48 {}
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 
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
McAodTupleWriter::McAodTupleWriter
McAodTupleWriter()
Default constructor:
McAodTupleWriter::finalize
virtual StatusCode finalize()
Definition: McAodTupleWriter.cxx:59
McAodTupleWriter::execute
virtual StatusCode execute()
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::m_mcAodWriter
IIOMcAodTool_t m_mcAodWriter
Tool to write the reference TruthParticleContainer into a dedicated tuple.
Definition: McAodTupleWriter.h:70
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
McAodTupleWriter::initialize
virtual StatusCode initialize()
Athena Algorithm's Hooks.
Definition: McAodTupleWriter.cxx:52
AthAlgorithm
Definition: AthAlgorithm.h:47
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
McAodTupleWriter.h
IIOMcAodTool.h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
McAodTupleWriter::~McAodTupleWriter
virtual ~McAodTupleWriter()
Destructor:
Definition: McAodTupleWriter.cxx:47
McAodTupleWriter::IIOMcAodTool_t
ToolHandle< IIOMcAodTool > IIOMcAodTool_t
Definition: McAodTupleWriter.h:66