ATLAS Offline Software
GenAodValidationTool.h
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // GenAodValidationTool.h
8 // Header file for class GenAodValidationTool
9 // Author: S.Binet<binet@cern.ch>
11 #ifndef MCPARTICLETOOLS_GENAODVALIDATIONTOOL_H
12 #define MCPARTICLETOOLS_GENAODVALIDATIONTOOL_H
13 
14 // STL includes
15 #include <string>
16 #include <fstream>
17 
18 // FrameWork includes
19 #include "GaudiKernel/ToolHandle.h"
20 
21 // McParticleTools includes
23 #include "TruthIO/IIOHepMcTool.h"
24 
25 // Forward declaration
26 class McEventCollection;
30 
32 {
33 
35  // Public methods:
37  public:
38 
39  // Copy constructor:
40 
42  GenAodValidationTool( const std::string& type,
43  const std::string& name,
44  const IInterface* parent );
45 
47  virtual ~GenAodValidationTool();
48 
50  // Const methods:
52 
54  // Non-const methods:
56 
58  // Protected methods:
60  protected:
61 
65 
66  // to be implemented (if needed) by derived classes
67  virtual StatusCode initializeTool();
68  virtual StatusCode finalizeTool();
69 
73  virtual StatusCode executeTool();
74 
79  virtual StatusCode executeTool( const McEventCollection* refMcEvents,
80  const McEventCollection* checkMcEvents );
81 
86  virtual StatusCode executeTool( const HepMC::GenEvent* refMcEvents,
87  const HepMC::GenEvent* checkMcEvents );
88 
93  bool compareVtx( const HepMC::ConstGenVertexPtr& vtx1,
94  const HepMC::ConstGenVertexPtr& vtx2 ) const;
95 
104  const HepMC::ConstGenParticlePtr& p2 ) const;
105 
110 
112  // Protected data:
114  protected:
115 
118  StringProperty m_refMcEventsName;
119 
122  StringProperty m_checkMcEventsName;
123 
127  StringProperty m_hardVtxOutFileName;
128 
131  std::ofstream * m_outFile;
132 
135  typedef ToolHandle<IIOHepMcTool> HepMcTool_t;
136 
140 
144 
145 };
146 
147 #endif //> MCPARTICLETOOLS_GENAODVALIDATIONTOOL_H
GenAodValidationTool::compareVtx
bool compareVtx(const HepMC::ConstGenVertexPtr &vtx1, const HepMC::ConstGenVertexPtr &vtx2) const
Check that 2 given vertices are the same:
Definition: GenAodValidationTool.cxx:310
GenAodValidationTool::m_refMcEventWriter
HepMcTool_t m_refMcEventWriter
Tool to write the reference HepMC::GenEvent into a dedicated file.
Definition: GenAodValidationTool.h:139
GenAodValidationTool::GenAodValidationTool
GenAodValidationTool()
Default constructor:
GenAodValidationTool::~GenAodValidationTool
virtual ~GenAodValidationTool()
Destructor:
Definition: GenAodValidationTool.cxx:79
GenAodValidationTool
Definition: GenAodValidationTool.h:32
TruthParticleValidationBaseTool
Definition: TruthParticleValidationBaseTool.h:29
GenAodValidationTool::m_checkMcEventsName
StringProperty m_checkMcEventsName
Location of the 'to-be-validated' McEventCollection.
Definition: GenAodValidationTool.h:122
TRTCalib_cfilter.p1
p1
Definition: TRTCalib_cfilter.py:130
GenParticle_fwd.h
GenAodValidationTool::executeTool
virtual StatusCode executeTool()
Main method to perform the validation.
Definition: GenAodValidationTool.cxx:132
GenAodValidationTool::m_outFile
std::ofstream * m_outFile
Pointer to the output text file containing hard-scattering vertices.
Definition: GenAodValidationTool.h:131
TRTCalib_cfilter.p2
p2
Definition: TRTCalib_cfilter.py:131
GenAodValidationTool::m_hardVtxOutFileName
StringProperty m_hardVtxOutFileName
Name of the output text file which will contain the hard-scattering vertices.
Definition: GenAodValidationTool.h:127
GenAodValidationTool::HepMcTool_t
ToolHandle< IIOHepMcTool > HepMcTool_t
shorthand for lazy people (good coders are lazy people, aren't they ?)
Definition: GenAodValidationTool.h:135
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
GenVertex_fwd.h
TruthParticleValidationBaseTool.h
GenEvent_fwd.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
McEventCollection
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
Definition: McEventCollection.h:33
IIOHepMcTool.h
GenAodValidationTool::setupHepMcWriterTools
StatusCode setupHepMcWriterTools()
Request pointers to the HepMcWriterTools to be able to write out HepMC::GenEvent for further comparis...
Definition: GenAodValidationTool.cxx:452
HepMC::ConstGenParticlePtr
const GenParticle * ConstGenParticlePtr
Definition: GenParticle.h:38
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
GenAodValidationTool::initializeTool
virtual StatusCode initializeTool()
Non-const methods:
Definition: GenAodValidationTool.cxx:96
GenAodValidationTool::compareParts
bool compareParts(const HepMC::ConstGenParticlePtr &p1, const HepMC::ConstGenParticlePtr &p2) const
Check that 2 given particles are the same:
Definition: GenAodValidationTool.cxx:406
GenAodValidationTool::m_checkMcEventWriter
HepMcTool_t m_checkMcEventWriter
Tool to write the 'to-be-checked' HepMC::GenEvent into a dedicated file.
Definition: GenAodValidationTool.h:143
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
GenAodValidationTool::finalizeTool
virtual StatusCode finalizeTool()
Definition: GenAodValidationTool.cxx:125
HepMC::ConstGenVertexPtr
const HepMC::GenVertex * ConstGenVertexPtr
Definition: GenVertex.h:60
GenAodValidationTool::m_refMcEventsName
StringProperty m_refMcEventsName
Location of the reference McEventCollection.
Definition: GenAodValidationTool.h:118