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 "Framework/Exception/Exception.h"
12
#include "
SimCore/HepMC/HepMCParticle.h
"
13
14
// HepMC3
15
#include "HepMC3/GenEvent.h"
16
#include "HepMC3/GenVertex.h"
17
18
// Geant4
19
#include "globals.hh"
20
21
// STL
22
#include <iostream>
23
#include <memory>
24
#include <vector>
25
26
namespace
simcore::hepmc {
27
37
class
HepMCEvent
{
38
public
:
43
HepMCEvent
(std::shared_ptr<HepMC3::GenEvent> event);
44
48
virtual
~HepMCEvent
() =
default
;
49
54
int
getNumParticles
()
const
;
55
60
double
getEventWeight
()
const
;
61
66
const
double
*
getVertex
()
const
;
67
72
double
getVertexTime
()
const
;
73
79
const
std::vector<std::unique_ptr<HepMCParticle>>&
getParticles
()
const
;
80
85
std::shared_ptr<HepMC3::GenEvent>
getGenEvent
()
const
;
86
87
private
:
91
std::shared_ptr<HepMC3::GenEvent>
event_
;
92
96
mutable
double
vtx_
[3];
97
101
mutable
double
vtxt_
{0.};
102
106
mutable
std::vector<std::unique_ptr<HepMCParticle>>
particles_
;
107
111
mutable
bool
particles_extracted_
{
false
};
112
116
void
extractParticles
()
const
;
117
};
118
119
}
// namespace simcore::hepmc
120
121
#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:37
simcore::hepmc::HepMCEvent::vtxt_
double vtxt_
Vertex time (in ns)
Definition
HepMCEvent.h:101
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:58
simcore::hepmc::HepMCEvent::particles_extracted_
bool particles_extracted_
Flag to indicate if particles have been extracted.
Definition
HepMCEvent.h:111
simcore::hepmc::HepMCEvent::getVertex
const double * getVertex() const
Get the vertex location (in mm, as expected by Geant4).
Definition
HepMCEvent.cxx:54
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:6
simcore::hepmc::HepMCEvent::extractParticles
void extractParticles() const
Extract final state particles from the HepMC event.
Definition
HepMCEvent.cxx:70
simcore::hepmc::HepMCEvent::getEventWeight
double getEventWeight() const
Get the event weight.
Definition
HepMCEvent.cxx:48
simcore::hepmc::HepMCEvent::vtx_
double vtx_[3]
Vertex location (in mm)
Definition
HepMCEvent.h:96
simcore::hepmc::HepMCEvent::getVertexTime
double getVertexTime() const
Get the vertex time (in ns, as expected by Geant4).
Definition
HepMCEvent.cxx:56
simcore::hepmc::HepMCEvent::particles_
std::vector< std::unique_ptr< HepMCParticle > > particles_
The list of final state particles to be tracked.
Definition
HepMCEvent.h:106
simcore::hepmc::HepMCEvent::getGenEvent
std::shared_ptr< HepMC3::GenEvent > getGenEvent() const
Get the underlying HepMC3 GenEvent.
Definition
HepMCEvent.cxx:66
simcore::hepmc::HepMCEvent::getNumParticles
int getNumParticles() const
Get the number of particles in the event.
Definition
HepMCEvent.cxx:41
simcore::hepmc::HepMCEvent::event_
std::shared_ptr< HepMC3::GenEvent > event_
The underlying HepMC3 GenEvent.
Definition
HepMCEvent.h:91
Generated by
1.12.0