LDMX Software
simcore::lhe::LHEEvent Class Reference

LHE event with a list of particles and information from the header block. More...

#include <LHEEvent.h>

Public Member Functions

 LHEEvent (std::string &data)
 Class constructor.
 
virtual ~LHEEvent ()=default
 Class destructor.
 
int getNumParticles () const
 Get the number of particles (NUP) in the event.
 
int getProcessID () const
 Get the ID of the physics process (IDRUP).
 
double getEventWeight () const
 Get the event weight (XWGTUP).
 
double getScaleQ () const
 Get the scale Q of parton distributions (SCALUP).
 
double getCouplingQed () const
 Get the value of the QED coupling (AQEDUP).
 
double getCouplingQcd () const
 Get the value of the QCD coupling (AQCDUP).
 
void setVertex (double x_, double y_, double z_)
 Set the vertex location (careful to match units as expected!)
 
void setVertex (const std::string &line)
 Parse the vertex from a line of the form "#vertex [x_] [y_] [z_]".
 
const double * getVertex () const
 Get the vertex location (careful to match units as expected!)
 
double getVertexTime () const
 Get the vertex time.
 
void addParticle (std::unique_ptr< LHEParticle > particle)
 Add a particle to the event.
 
const std::vector< std::unique_ptr< LHEParticle > > & getParticles () const
 Get the list of particles in the event.
 

Private Attributes

int num_particles_
 Number of particles.
 
int process_id_
 The physics process ID.
 
double event_weight_
 The event weight.
 
double scale_q_
 Scale Q of parton distributions.
 
double coupling_qed_
 QED coupling value.
 
double coupling_qcd_
 QCD coupling value.
 
double vtx_ [3]
 Vertex location.
 
double vtxt_ {0.}
 Vertex time.
 
std::vector< std::unique_ptr< LHEParticle > > particles_
 The list of particles.
 

Detailed Description

LHE event with a list of particles and information from the header block.

Note
Detailed information on the Les Houches Event (LHE) format is provided here: A standard format for Les Houches Event Files.

Definition at line 37 of file LHEEvent.h.

Constructor & Destructor Documentation

◆ LHEEvent()

simcore::lhe::LHEEvent::LHEEvent ( std::string & data)

Class constructor.

Parameters
dataThe string data of the event header.

Definition at line 6 of file LHEEvent.cxx.

6 {
7 std::istringstream iss(line);
8 std::vector<std::string> tokens;
9 do {
10 std::string elem;
11 iss >> elem;
12 if (elem.size() != 0) {
13 tokens.push_back(elem);
14 }
15 } while (iss);
16
17 if (tokens.size() != 6) {
18 EXCEPTION_RAISE("TokenNum",
19 "Wrong number of tokens in LHE event information record.");
20 }
21
22 num_particles_ = atoi(tokens[0].c_str());
23 // The physics process ID
24 process_id_ = atoi(tokens[1].c_str());
25 // The event weight
26 event_weight_ = atof(tokens[2].c_str());
27 // Scale Q of parton distributions
28 scale_q_ = atof(tokens[3].c_str());
29 // QED coupling value
30 coupling_qed_ = atof(tokens[4].c_str());
31 // QCD coupling value
32 coupling_qcd_ = atof(tokens[5].c_str());
33
34 vtx_[0] = 0;
35 vtx_[1] = 0;
36 vtx_[2] = 0;
37}
double vtx_[3]
Vertex location.
Definition LHEEvent.h:154
int num_particles_
Number of particles.
Definition LHEEvent.h:124
double event_weight_
The event weight.
Definition LHEEvent.h:134
double coupling_qcd_
QCD coupling value.
Definition LHEEvent.h:149
double scale_q_
Scale Q of parton distributions.
Definition LHEEvent.h:139
int process_id_
The physics process ID.
Definition LHEEvent.h:129
double coupling_qed_
QED coupling value.
Definition LHEEvent.h:144

References coupling_qcd_, coupling_qed_, event_weight_, num_particles_, process_id_, scale_q_, and vtx_.

Member Function Documentation

◆ addParticle()

void simcore::lhe::LHEEvent::addParticle ( std::unique_ptr< LHEParticle > particle)

Add a particle to the event.

@particle The particle to add.

Definition at line 55 of file LHEEvent.cxx.

55 {
56 particles_.push_back(std::move(particle));
57}
std::vector< std::unique_ptr< LHEParticle > > particles_
The list of particles.
Definition LHEEvent.h:164

References particles_.

◆ getCouplingQcd()

double simcore::lhe::LHEEvent::getCouplingQcd ( ) const

Get the value of the QCD coupling (AQCDUP).

Returns
The value of the QCD coupling.

Definition at line 49 of file LHEEvent.cxx.

49{ return coupling_qcd_; }

References coupling_qcd_.

◆ getCouplingQed()

double simcore::lhe::LHEEvent::getCouplingQed ( ) const

Get the value of the QED coupling (AQEDUP).

Returns
The value of the QED coupling.

Definition at line 47 of file LHEEvent.cxx.

47{ return coupling_qed_; }

References coupling_qed_.

◆ getEventWeight()

double simcore::lhe::LHEEvent::getEventWeight ( ) const

Get the event weight (XWGTUP).

Returns
The event weight.

Definition at line 43 of file LHEEvent.cxx.

43{ return event_weight_; }

References event_weight_.

◆ getNumParticles()

int simcore::lhe::LHEEvent::getNumParticles ( ) const

Get the number of particles (NUP) in the event.

Returns
The number of particles in event.

Definition at line 39 of file LHEEvent.cxx.

39{ return num_particles_; }

References num_particles_.

◆ getParticles()

const std::vector< std::unique_ptr< LHEParticle > > & simcore::lhe::LHEEvent::getParticles ( ) const

Get the list of particles in the event.

Returns
The list of particles in the event.

Definition at line 59 of file LHEEvent.cxx.

60 {
61 return particles_;
62}

References particles_.

◆ getProcessID()

int simcore::lhe::LHEEvent::getProcessID ( ) const

Get the ID of the physics process (IDRUP).

Returns
The ID of the physics process.

Definition at line 41 of file LHEEvent.cxx.

41{ return process_id_; }

References process_id_.

◆ getScaleQ()

double simcore::lhe::LHEEvent::getScaleQ ( ) const

Get the scale Q of parton distributions (SCALUP).

Returns
The scale Q of parton distributions.

Definition at line 45 of file LHEEvent.cxx.

45{ return scale_q_; }

References scale_q_.

◆ getVertex()

const double * simcore::lhe::LHEEvent::getVertex ( ) const

Get the vertex location (careful to match units as expected!)

Returns
Array double[3] with x_,y_,z_ ordering

Definition at line 51 of file LHEEvent.cxx.

51{ return vtx_; }

References vtx_.

◆ getVertexTime()

double simcore::lhe::LHEEvent::getVertexTime ( ) const

Get the vertex time.

Returns
time of primary particle creation.

Definition at line 53 of file LHEEvent.cxx.

53{ return vtxt_; }
double vtxt_
Vertex time.
Definition LHEEvent.h:159

References vtxt_.

◆ setVertex() [1/2]

void simcore::lhe::LHEEvent::setVertex ( const std::string & line)

Parse the vertex from a line of the form "#vertex [x_] [y_] [z_]".

Parse the vertex from a line of the form "#vertex [x_] [y_] [z_] [t]" Where [t] is assumed zero if not specified.

Definition at line 74 of file LHEEvent.cxx.

74 {
75 std::istringstream iss(line);
76 std::vector<std::string> tokens;
77 do {
78 std::string elem;
79 iss >> elem;
80 if (elem.size() != 0) {
81 tokens.push_back(elem);
82 }
83 } while (iss);
84
85 if (tokens.size() != 4 && tokens.size() != 5) {
86 EXCEPTION_RAISE("TokenNum",
87 "Wrong number of tokens or format in LHE event vertex "
88 "information record.");
89 }
90 vtx_[0] = atof(tokens[1].c_str());
91 vtx_[1] = atof(tokens[2].c_str());
92 vtx_[2] = atof(tokens[3].c_str());
93 if (tokens.size() > 4) {
94 vtxt_ = atof(tokens[4].c_str());
95 }
96}

References vtx_, and vtxt_.

◆ setVertex() [2/2]

void simcore::lhe::LHEEvent::setVertex ( double x_,
double y_,
double z_ )

Set the vertex location (careful to match units as expected!)

Definition at line 64 of file LHEEvent.cxx.

64 {
65 vtx_[0] = x_;
66 vtx_[1] = y_;
67 vtx_[2] = z_;
68}

References vtx_.

Member Data Documentation

◆ coupling_qcd_

double simcore::lhe::LHEEvent::coupling_qcd_
private

QCD coupling value.

Definition at line 149 of file LHEEvent.h.

Referenced by getCouplingQcd(), and LHEEvent().

◆ coupling_qed_

double simcore::lhe::LHEEvent::coupling_qed_
private

QED coupling value.

Definition at line 144 of file LHEEvent.h.

Referenced by getCouplingQed(), and LHEEvent().

◆ event_weight_

double simcore::lhe::LHEEvent::event_weight_
private

The event weight.

Definition at line 134 of file LHEEvent.h.

Referenced by getEventWeight(), and LHEEvent().

◆ num_particles_

int simcore::lhe::LHEEvent::num_particles_
private

Number of particles.

Definition at line 124 of file LHEEvent.h.

Referenced by getNumParticles(), and LHEEvent().

◆ particles_

std::vector<std::unique_ptr<LHEParticle> > simcore::lhe::LHEEvent::particles_
private

The list of particles.

Definition at line 164 of file LHEEvent.h.

Referenced by addParticle(), and getParticles().

◆ process_id_

int simcore::lhe::LHEEvent::process_id_
private

The physics process ID.

Definition at line 129 of file LHEEvent.h.

Referenced by getProcessID(), and LHEEvent().

◆ scale_q_

double simcore::lhe::LHEEvent::scale_q_
private

Scale Q of parton distributions.

Definition at line 139 of file LHEEvent.h.

Referenced by getScaleQ(), and LHEEvent().

◆ vtx_

double simcore::lhe::LHEEvent::vtx_[3]
private

Vertex location.

Definition at line 154 of file LHEEvent.h.

Referenced by getVertex(), LHEEvent(), setVertex(), and setVertex().

◆ vtxt_

double simcore::lhe::LHEEvent::vtxt_ {0.}
private

Vertex time.

Definition at line 159 of file LHEEvent.h.

159{0.};

Referenced by getVertexTime(), and setVertex().


The documentation for this class was generated from the following files: