LDMX Software
Public Member Functions | Private Attributes | List of all members
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 ()
 Class destructor.
 
int getNUP () const
 Get the number of particles (NUP) in the event.
 
int getIDPRUP () const
 Get the ID of the physics process (IDRUP).
 
double getXWGTUP () const
 Get the event weight (XWGTUP).
 
double getSCALUP () const
 Get the scale Q of parton distributions (SCALUP).
 
double getAQEDUP () const
 Get the value of the QED coupling (AQEDUP).
 
double getAQCDUP () const
 Get the value of the QED 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 (LHEParticle *particle)
 Add a particle to the event.
 
const std::vector< LHEParticle * > & getParticles ()
 Get the list of particles in the event.
 

Private Attributes

int nup_
 Number of particles.
 
int idprup_
 The physics process ID.
 
double xwgtup_
 The event weight.
 
double scalup_
 Scale Q of parton distributions.
 
double aqedup_
 QCD coupling value.
 
double aqcdup_
 QCD coupling value.
 
double vtx_ [3]
 Vertex location.
 
double vtxt_ {0.}
 Vertex time.
 
std::vector< 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 29 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 14 of file LHEEvent.cxx.

14 {
15 std::istringstream iss(line);
16 std::vector<std::string> tokens;
17 do {
18 std::string elem;
19 iss >> elem;
20 if (elem.size() != 0) {
21 tokens.push_back(elem);
22 }
23 } while (iss);
24
25 if (tokens.size() != 6) {
26 EXCEPTION_RAISE("TokenNum",
27 "Wrong number of tokens in LHE event information record.");
28 }
29
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());
36
37 vtx_[0] = 0;
38 vtx_[1] = 0;
39 vtx_[2] = 0;
40}
double vtx_[3]
Vertex location.
Definition LHEEvent.h:146
int nup_
Number of particles.
Definition LHEEvent.h:116
int idprup_
The physics process ID.
Definition LHEEvent.h:121
double aqedup_
QCD coupling value.
Definition LHEEvent.h:136
double aqcdup_
QCD coupling value.
Definition LHEEvent.h:141
double scalup_
Scale Q of parton distributions.
Definition LHEEvent.h:131
double xwgtup_
The event weight.
Definition LHEEvent.h:126

References aqcdup_, aqedup_, idprup_, nup_, scalup_, vtx_, and xwgtup_.

◆ ~LHEEvent()

simcore::lhe::LHEEvent::~LHEEvent ( )
virtual

Class destructor.

Definition at line 42 of file LHEEvent.cxx.

42 {
43 for (std::vector<LHEParticle*>::iterator it = particles_.begin();
44 it != particles_.end(); it++) {
45 delete (*it);
46 }
47 particles_.clear();
48}
std::vector< LHEParticle * > particles_
The list of particles.
Definition LHEEvent.h:156

References particles_.

Member Function Documentation

◆ addParticle()

void simcore::lhe::LHEEvent::addParticle ( LHEParticle particle)

Add a particle to the event.

@particle The particle to add.

Definition at line 66 of file LHEEvent.cxx.

66 {
67 particles_.push_back(particle);
68}

References particles_.

Referenced by simcore::lhe::LHEReader::readNextEvent().

◆ getAQCDUP()

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

Get the value of the QED coupling (AQCDUP).

Returns
The value of the QED coupling.

Definition at line 60 of file LHEEvent.cxx.

60{ return aqcdup_; }

References aqcdup_.

◆ getAQEDUP()

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

Get the value of the QED coupling (AQEDUP).

Returns
The value of the QED coupling.

Definition at line 58 of file LHEEvent.cxx.

58{ return aqedup_; }

References aqedup_.

◆ getIDPRUP()

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

Get the ID of the physics process (IDRUP).

Returns
The ID of the physics process.

Definition at line 52 of file LHEEvent.cxx.

52{ return idprup_; }

References idprup_.

◆ getNUP()

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

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

Returns
The number of particles in event.

Definition at line 50 of file LHEEvent.cxx.

50{ return nup_; }

References nup_.

◆ getParticles()

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

Get the list of particles in the event.

Returns
The list of particles in the event.

Definition at line 70 of file LHEEvent.cxx.

70{ return particles_; }

References particles_.

Referenced by simcore::generators::LHEPrimaryGenerator::GeneratePrimaryVertex(), and simcore::lhe::LHEReader::readNextEvent().

◆ getSCALUP()

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

Get the scale Q of parton distributions (SCALUP).

Returns
The scale Q of parton distributions.

Definition at line 56 of file LHEEvent.cxx.

56{ return scalup_; }

References scalup_.

◆ 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 62 of file LHEEvent.cxx.

62{ return vtx_; }

References vtx_.

Referenced by simcore::generators::LHEPrimaryGenerator::GeneratePrimaryVertex().

◆ getVertexTime()

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

Get the vertex time.

Returns
time of primary particle creation.

Definition at line 64 of file LHEEvent.cxx.

64{ return vtxt_; }
double vtxt_
Vertex time.
Definition LHEEvent.h:151

References vtxt_.

◆ getXWGTUP()

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

Get the event weight (XWGTUP).

Returns
The event weight.

Definition at line 54 of file LHEEvent.cxx.

54{ return xwgtup_; }

References xwgtup_.

Referenced by simcore::generators::LHEPrimaryGenerator::GeneratePrimaryVertex().

◆ 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 82 of file LHEEvent.cxx.

82 {
83 std::istringstream iss(line);
84 std::vector<std::string> tokens;
85 do {
86 std::string elem;
87 iss >> elem;
88 if (elem.size() != 0) {
89 tokens.push_back(elem);
90 }
91 } while (iss);
92
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.");
97 }
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());
103 }
104}

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 72 of file LHEEvent.cxx.

72 {
73 vtx_[0] = x;
74 vtx_[1] = y;
75 vtx_[2] = z;
76}

References vtx_.

Referenced by simcore::lhe::LHEReader::readNextEvent().

Member Data Documentation

◆ aqcdup_

double simcore::lhe::LHEEvent::aqcdup_
private

QCD coupling value.

Definition at line 141 of file LHEEvent.h.

Referenced by getAQCDUP(), and LHEEvent().

◆ aqedup_

double simcore::lhe::LHEEvent::aqedup_
private

QCD coupling value.

Definition at line 136 of file LHEEvent.h.

Referenced by getAQEDUP(), and LHEEvent().

◆ idprup_

int simcore::lhe::LHEEvent::idprup_
private

The physics process ID.

Definition at line 121 of file LHEEvent.h.

Referenced by getIDPRUP(), and LHEEvent().

◆ nup_

int simcore::lhe::LHEEvent::nup_
private

Number of particles.

Definition at line 116 of file LHEEvent.h.

Referenced by getNUP(), and LHEEvent().

◆ particles_

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

The list of particles.

Definition at line 156 of file LHEEvent.h.

Referenced by addParticle(), getParticles(), and ~LHEEvent().

◆ scalup_

double simcore::lhe::LHEEvent::scalup_
private

Scale Q of parton distributions.

Definition at line 131 of file LHEEvent.h.

Referenced by getSCALUP(), and LHEEvent().

◆ vtx_

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

Vertex location.

Definition at line 146 of file LHEEvent.h.

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

◆ vtxt_

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

Vertex time.

Definition at line 151 of file LHEEvent.h.

151{0.};

Referenced by getVertexTime(), and setVertex().

◆ xwgtup_

double simcore::lhe::LHEEvent::xwgtup_
private

The event weight.

Definition at line 126 of file LHEEvent.h.

Referenced by getXWGTUP(), and LHEEvent().


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