ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Generators
TruthConverters
TruthConverters
xAODtoHepMCTool.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
/*
6
* dual-use tool for converting xAOD truth events back to HepMC
7
* Principal Authors (responsible for the core conversion algorithm): Josh McFayden and James Catmore
8
* Tool Author: Jim Lacey (Carleton University)
9
* ... updated tool interface to be dual-use
10
* ... added missing PDF information and requirements to allow running on full sim (remove Geant4 secondaries)
11
* <james.lacey@cern.ch,jlacey@physics.carleton.ca>
12
* <dag.gillberg@cern.ch>
13
*/
14
15
#ifndef TRUTHCONVERTERS_XAODTOHEPMCTOOL_H
16
#define TRUTHCONVERTERS_XAODTOHEPMCTOOL_H 1
17
18
#include "
AsgTools/AsgTool.h
"
19
#include "
GenInterfaces/IxAODtoHepMCTool.h
"
20
21
22
class
xAODtoHepMCTool
:
public
asg::AsgTool
,
public
virtual
IxAODtoHepMCTool
{
23
public
:
24
ASG_TOOL_CLASS
(
xAODtoHepMCTool
,
IxAODtoHepMCTool
)
25
xAODtoHepMCTool
(
const
std::string& name );
26
virtual
~xAODtoHepMCTool
() { };
27
28
virtual
StatusCode
initialize
()
override
;
29
StatusCode
finalize
()
override
;
30
31
public
:
32
std::vector<HepMC::GenEvent>
getHepMCEvents
(
const
xAOD::TruthEventContainer
* xTruthEventContainer,
const
xAOD::EventInfo
* eventInfo)
const override
;
33
34
private
:
35
HepMC::GenEvent
createHepMCEvent
(
const
xAOD::TruthEvent
* xEvt,
const
xAOD::EventInfo
* eventInfo)
const
;
36
HepMC::GenVertexPtr
vertexHelper
(
const
xAOD::TruthVertex
*,std::map<const xAOD::TruthVertex*,HepMC::GenVertexPtr>&,
bool
&)
const
;
37
HepMC::GenParticlePtr
createHepMCParticle
(
const
xAOD::TruthParticle
*)
const
;
38
HepMC::GenVertexPtr
createHepMCVertex
(
const
xAOD::TruthVertex
*)
const
;
39
void
printxAODEvent
(
const
xAOD::TruthEvent
* event,
const
xAOD::EventInfo
* eventInfo)
const
;
40
41
private
:
43
Gaudi::Property<float>
m_momFac
{
44
this
,
"MomentFactor"
, 0.001,
45
"Scale factor to be applied to truth energy and momenta to convert from MeV, e.g. 0.001 to go to GeV"
};
46
Gaudi::Property<float>
m_lenFac
{
47
this
,
"LengthFactor"
, 1.0,
48
"Scale factor to be applied to truth lengths to convert from mm, e.g. 0.01 to go to cm"
};
49
Gaudi::Property<bool>
m_signalOnly
{
50
this
,
"SignalOnly"
,
true
,
51
"Convert only the signal event (true), or all events found"
};
52
Gaudi::Property<int>
m_maxCount
{
53
this
,
"PrintNevents"
, 0,
54
"Maximum number of events to print out"
};
55
56
//not sure if these need to be atomic but just in case this will run in MT
57
mutable
std::atomic<int>
m_evtCount
{};
58
mutable
std::atomic<int>
m_badSuggest
{};
59
int
m_noProdVtx
{};
60
int
m_badBeams
{};
61
62
};
63
64
#endif
//> !XAODTOHEPMC_XAODTOHEPMCTOOL_H
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition
AsgToolMacros.h:68
AsgTool.h
IxAODtoHepMCTool.h
IxAODtoHepMCTool
Definition
IxAODtoHepMCTool.h:34
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition
AsgTool.h:47
xAODtoHepMCTool::m_evtCount
std::atomic< int > m_evtCount
Counters.
Definition
xAODtoHepMCTool.h:57
xAODtoHepMCTool::finalize
StatusCode finalize() override
Definition
xAODtoHepMCTool.cxx:23
xAODtoHepMCTool::m_badBeams
int m_badBeams
Definition
xAODtoHepMCTool.h:60
xAODtoHepMCTool::createHepMCEvent
HepMC::GenEvent createHepMCEvent(const xAOD::TruthEvent *xEvt, const xAOD::EventInfo *eventInfo) const
Definition
xAODtoHepMCTool.cxx:86
xAODtoHepMCTool::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition
xAODtoHepMCTool.cxx:16
xAODtoHepMCTool::m_noProdVtx
int m_noProdVtx
Definition
xAODtoHepMCTool.h:59
xAODtoHepMCTool::m_badSuggest
std::atomic< int > m_badSuggest
Definition
xAODtoHepMCTool.h:58
xAODtoHepMCTool::xAODtoHepMCTool
xAODtoHepMCTool(const std::string &name)
Definition
xAODtoHepMCTool.cxx:11
xAODtoHepMCTool::vertexHelper
HepMC::GenVertexPtr vertexHelper(const xAOD::TruthVertex *, std::map< const xAOD::TruthVertex *, HepMC::GenVertexPtr > &, bool &) const
Definition
xAODtoHepMCTool.cxx:191
xAODtoHepMCTool::createHepMCVertex
HepMC::GenVertexPtr createHepMCVertex(const xAOD::TruthVertex *) const
Definition
xAODtoHepMCTool.cxx:225
xAODtoHepMCTool::~xAODtoHepMCTool
virtual ~xAODtoHepMCTool()
Definition
xAODtoHepMCTool.h:26
xAODtoHepMCTool::m_signalOnly
Gaudi::Property< bool > m_signalOnly
Definition
xAODtoHepMCTool.h:49
xAODtoHepMCTool::m_momFac
Gaudi::Property< float > m_momFac
Input container key (job property).
Definition
xAODtoHepMCTool.h:43
xAODtoHepMCTool::createHepMCParticle
HepMC::GenParticlePtr createHepMCParticle(const xAOD::TruthParticle *) const
Definition
xAODtoHepMCTool.cxx:215
xAODtoHepMCTool::printxAODEvent
void printxAODEvent(const xAOD::TruthEvent *event, const xAOD::EventInfo *eventInfo) const
Definition
xAODtoHepMCTool.cxx:235
xAODtoHepMCTool::m_lenFac
Gaudi::Property< float > m_lenFac
Definition
xAODtoHepMCTool.h:46
xAODtoHepMCTool::m_maxCount
Gaudi::Property< int > m_maxCount
Definition
xAODtoHepMCTool.h:52
xAODtoHepMCTool::getHepMCEvents
std::vector< HepMC::GenEvent > getHepMCEvents(const xAOD::TruthEventContainer *xTruthEventContainer, const xAOD::EventInfo *eventInfo) const override
Definition
xAODtoHepMCTool.cxx:52
HepMC::GenParticlePtr
HepMC3::GenParticlePtr GenParticlePtr
Definition
GenParticle.h:19
HepMC::GenVertexPtr
HepMC3::GenVertexPtr GenVertexPtr
Definition
GenVertex.h:23
HepMC::GenEvent
HepMC3::GenEvent GenEvent
Definition
GenEvent.h:39
xAOD::TruthEventContainer
TruthEventContainer_v1 TruthEventContainer
Declare the latest version of the truth event container.
Definition
TruthEventContainer.h:18
xAOD::EventInfo
EventInfo_v1 EventInfo
Definition of the latest event info version.
Definition
IEventInfoCnvTool.h:16
xAOD::TruthVertex
TruthVertex_v1 TruthVertex
Typedef to implementation.
Definition
TruthVertex.h:15
xAOD::TruthEvent
TruthEvent_v1 TruthEvent
Typedef to implementation.
Definition
TruthEvent.h:17
xAOD::TruthParticle
TruthParticle_v1 TruthParticle
Typedef to implementation.
Definition
Event/xAOD/xAODTruth/xAODTruth/TruthParticle.h:15
Generated on
for ATLAS Offline Software by
1.17.0