LDMX Software
SimCore
include
SimCore
HepMC
HepMCEvent.h
Go to the documentation of this file.
1
7
#ifndef SIMCORE_HEPMCEVENT_H_
8
#define SIMCORE_HEPMCEVENT_H_
9
10
// LDMX
11
#include "
SimCore/HepMC/HepMCParticle.h
"
12
13
// HepMC3
14
#include "HepMC3/GenEvent.h"
15
#include "HepMC3/GenVertex.h"
16
17
// Geant4
18
19
// STL
20
#include <memory>
21
#include <vector>
22
23
namespace
simcore::hepmc {
24
34
class
HepMCEvent
{
35
public
:
40
HepMCEvent
(std::shared_ptr<HepMC3::GenEvent> event);
41
45
virtual
~HepMCEvent
() =
default
;
46
51
int
getNumParticles
()
const
;
52
57
double
getEventWeight
()
const
;
58
63
const
double
*
getVertex
()
const
;
64
69
double
getVertexTime
()
const
;
70
76
const
std::vector<std::unique_ptr<HepMCParticle>>&
getParticles
()
const
;
77
82
std::shared_ptr<HepMC3::GenEvent>
getGenEvent
()
const
;
83
84
private
:
88
std::shared_ptr<HepMC3::GenEvent>
event_
;
89
93
mutable
double
vtx_
[3];
94
98
mutable
double
vtxt_
{0.};
99
103
mutable
std::vector<std::unique_ptr<HepMCParticle>>
particles_
;
104
108
mutable
bool
particles_extracted_
{
false
};
109
113
void
extractParticles
()
const
;
114
};
115
116
}
// namespace simcore::hepmc
117
118
#endif
HepMCParticle.h
Class defining a single particle record in a HepMC event.
simcore::hepmc::HepMCEvent
Wrapper for HepMC3::GenEvent with convenience methods.
Definition
HepMCEvent.h:34
simcore::hepmc::HepMCEvent::vtxt_
double vtxt_
Vertex time (in ns)
Definition
HepMCEvent.h:98
simcore::hepmc::HepMCEvent::getParticles
const std::vector< std::unique_ptr< HepMCParticle > > & getParticles() const
Get the list of final state particles in the event.
Definition
HepMCEvent.cxx:60
simcore::hepmc::HepMCEvent::particles_extracted_
bool particles_extracted_
Flag to indicate if particles have been extracted.
Definition
HepMCEvent.h:108
simcore::hepmc::HepMCEvent::getVertex
const double * getVertex() const
Get the vertex location (in mm, as expected by Geant4).
Definition
HepMCEvent.cxx:56
simcore::hepmc::HepMCEvent::~HepMCEvent
virtual ~HepMCEvent()=default
Class destructor.
simcore::hepmc::HepMCEvent::HepMCEvent
HepMCEvent(std::shared_ptr< HepMC3::GenEvent > event)
Class constructor.
Definition
HepMCEvent.cxx:8
simcore::hepmc::HepMCEvent::extractParticles
void extractParticles() const
Extract final state particles from the HepMC event.
Definition
HepMCEvent.cxx:72
simcore::hepmc::HepMCEvent::getEventWeight
double getEventWeight() const
Get the event weight.
Definition
HepMCEvent.cxx:50
simcore::hepmc::HepMCEvent::vtx_
double vtx_[3]
Vertex location (in mm)
Definition
HepMCEvent.h:93
simcore::hepmc::HepMCEvent::getVertexTime
double getVertexTime() const
Get the vertex time (in ns, as expected by Geant4).
Definition
HepMCEvent.cxx:58
simcore::hepmc::HepMCEvent::particles_
std::vector< std::unique_ptr< HepMCParticle > > particles_
The list of final state particles to be tracked.
Definition
HepMCEvent.h:103
simcore::hepmc::HepMCEvent::getGenEvent
std::shared_ptr< HepMC3::GenEvent > getGenEvent() const
Get the underlying HepMC3 GenEvent.
Definition
HepMCEvent.cxx:68
simcore::hepmc::HepMCEvent::getNumParticles
int getNumParticles() const
Get the number of particles in the event.
Definition
HepMCEvent.cxx:43
simcore::hepmc::HepMCEvent::event_
std::shared_ptr< HepMC3::GenEvent > event_
The underlying HepMC3 GenEvent.
Definition
HepMCEvent.h:88
Generated by
1.12.0