3#include "Framework/Exception/Exception.h"
12namespace simcore::lhe {
15 std::istringstream iss(line);
16 std::vector<std::string> tokens;
20 if (elem.size() != 0) {
21 tokens.push_back(elem);
25 if (tokens.size() != 6) {
26 EXCEPTION_RAISE(
"TokenNum",
27 "Wrong number of tokens in LHE event information record.");
30 nup_ = atoi(tokens[0].c_str());
31 idprup_ = atoi(tokens[1].c_str());
32 xwgtup_ = atof(tokens[2].c_str());
33 scalup_ = atof(tokens[3].c_str());
34 aqedup_ = atof(tokens[4].c_str());
35 aqcdup_ = atof(tokens[5].c_str());
43 for (std::vector<LHEParticle*>::iterator it =
particles_.begin();
83 std::istringstream iss(line);
84 std::vector<std::string> tokens;
88 if (elem.size() != 0) {
89 tokens.push_back(elem);
93 if (tokens.size() != 4 && tokens.size() != 5) {
94 EXCEPTION_RAISE(
"TokenNum",
95 "Wrong number of tokens or format in LHE event vertex "
96 "information record.");
98 vtx_[0] = atof(tokens[1].c_str());
99 vtx_[1] = atof(tokens[2].c_str());
100 vtx_[2] = atof(tokens[3].c_str());
101 if (tokens.size() > 4) {
102 vtxt_ = atof(tokens[4].c_str());
Class defining an LHE event with a list of particles and information from the header block.
LHEEvent(std::string &data)
Class constructor.
double vtx_[3]
Vertex location.
double getXWGTUP() const
Get the event weight (XWGTUP).
void addParticle(LHEParticle *particle)
Add a particle to the event.
int nup_
Number of particles.
double getAQCDUP() const
Get the value of the QED coupling (AQCDUP).
int idprup_
The physics process ID.
double aqedup_
QCD coupling value.
double aqcdup_
QCD coupling value.
double getVertexTime() const
Get the vertex time.
double scalup_
Scale Q of parton distributions.
int getIDPRUP() const
Get the ID of the physics process (IDRUP).
const std::vector< LHEParticle * > & getParticles()
Get the list of particles in the event.
double getSCALUP() const
Get the scale Q of parton distributions (SCALUP).
double xwgtup_
The event weight.
int getNUP() const
Get the number of particles (NUP) in the event.
double getAQEDUP() const
Get the value of the QED coupling (AQEDUP).
const double * getVertex() const
Get the vertex location (careful to match units as expected!)
std::vector< LHEParticle * > particles_
The list of particles.
void setVertex(double x, double y, double z)
Set the vertex location (careful to match units as expected!)
virtual ~LHEEvent()
Class destructor.
Single particle record in an LHE event.