LDMX Software
Public Member Functions | Private Attributes | Friends | List of all members
simcore::lhe::LHEParticle Class Reference

Single particle record in an LHE event. More...

#include <LHEParticle.h>

Public Member Functions

 LHEParticle (std::string &data)
 Class constructor.
 
int getIDUP () const
 Get the PDG code (IDUP).
 
int getISTUP () const
 Get the status code (ISTUP).
 
int getMOTHUP (int) const
 Get a mother particle index (MOTHUP) by index.
 
int getICOLUP (int) const
 Get the particle color (ICOLUP) by index.
 
double getPUP (int) const
 Get a momentum component (PUP) by index.
 
double getVTIMUP () const
 Get the proper lifetime (VTIMUP).
 
double getSPINUP () const
 Get the particle's spin (SPINUP).
 
void setMother (int i, LHEParticle *particle)
 Set a mother particle by index.
 
LHEParticlegetMother (int) const
 Get a mother particle by index.
 
void print (std::ostream &stream) const
 Print particle information to an output stream.
 

Private Attributes

LHEParticlemothers_ [2]
 The mother particles.
 
int idup_
 The PDG code.
 
int istup_
 The status code.
 
int mothup_ [2]
 The mother particle indices.
 
int icolup_ [2]
 The particle color.
 
double pup_ [5]
 The momentum components.
 
double vtimup_
 The proper time.
 
int spinup_
 The particle's spin.
 

Friends

std::ostream & operator<< (std::ostream &stream, const LHEParticle &particle)
 Overloaded stream operator.
 

Detailed Description

Single particle record in an LHE event.

Definition at line 20 of file LHEParticle.h.

Constructor & Destructor Documentation

◆ LHEParticle()

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

Class constructor.

Parameters
dataThe particle record as a space-delimited string.

Definition at line 17 of file LHEParticle.cxx.

17 {
18 std::istringstream iss(line);
19 std::vector<std::string> tokens;
20 do {
21 std::string elem;
22 iss >> elem;
23 if (elem.size() != 0) {
24 tokens.push_back(elem);
25 }
26 } while (iss);
27
28 if (tokens.size() != 13) {
29 EXCEPTION_RAISE("TokenNum",
30 "Wrong number of tokens in LHE particle record.");
31 }
32
33 idup_ = atof(tokens[0].c_str());
34 istup_ = atoi(tokens[1].c_str());
35 mothup_[0] = atoi(tokens[2].c_str());
36 mothup_[1] = atoi(tokens[3].c_str());
37 icolup_[0] = atoi(tokens[4].c_str());
38 icolup_[1] = atoi(tokens[5].c_str());
39 pup_[0] = atof(tokens[6].c_str());
40 pup_[1] = atof(tokens[7].c_str());
41 pup_[2] = atof(tokens[8].c_str());
42 pup_[3] = atof(tokens[9].c_str());
43 pup_[4] = atof(tokens[10].c_str());
44 vtimup_ = atof(tokens[11].c_str());
45 spinup_ = atof(tokens[12].c_str());
46
47 mothers_[0] = nullptr;
48 mothers_[1] = nullptr;
49}
int idup_
The PDG code.
LHEParticle * mothers_[2]
The mother particles.
int istup_
The status code.
int spinup_
The particle's spin.
int icolup_[2]
The particle color.
int mothup_[2]
The mother particle indices.
double pup_[5]
The momentum components.
double vtimup_
The proper time.

References icolup_, idup_, istup_, mothers_, mothup_, pup_, spinup_, and vtimup_.

Member Function Documentation

◆ getICOLUP()

int simcore::lhe::LHEParticle::getICOLUP ( int  i) const

Get the particle color (ICOLUP) by index.

Returns
The particle color by index.

Definition at line 57 of file LHEParticle.cxx.

57{ return icolup_[i]; }

References icolup_.

Referenced by print().

◆ getIDUP()

int simcore::lhe::LHEParticle::getIDUP ( ) const

Get the PDG code (IDUP).

Returns
The PDG code.

Definition at line 51 of file LHEParticle.cxx.

51{ return idup_; }

References idup_.

Referenced by simcore::generators::LHEPrimaryGenerator::GeneratePrimaryVertex(), and print().

◆ getISTUP()

int simcore::lhe::LHEParticle::getISTUP ( ) const

Get the status code (ISTUP).

Returns
The status code.

Definition at line 53 of file LHEParticle.cxx.

53{ return istup_; }

References istup_.

Referenced by simcore::generators::LHEPrimaryGenerator::GeneratePrimaryVertex(), and print().

◆ getMother()

LHEParticle * simcore::lhe::LHEParticle::getMother ( int  i) const

Get a mother particle by index.

Returns
The mother particle at the index.

Definition at line 69 of file LHEParticle.cxx.

69{ return mothers_[i]; }

References mothers_.

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

◆ getMOTHUP()

int simcore::lhe::LHEParticle::getMOTHUP ( int  i) const

Get a mother particle index (MOTHUP) by index.

Returns
The mother particle by index.

Definition at line 55 of file LHEParticle.cxx.

55{ return mothup_[i]; }

References mothup_.

Referenced by print(), and simcore::lhe::LHEReader::readNextEvent().

◆ getPUP()

double simcore::lhe::LHEParticle::getPUP ( int  i) const

Get a momentum component (PUP) by index.

Defined in order: E/C, Px, Py, Pz, mass

Returns
The momentum component by index.

Definition at line 59 of file LHEParticle.cxx.

59{ return pup_[i]; }

References pup_.

Referenced by simcore::generators::LHEPrimaryGenerator::GeneratePrimaryVertex(), and print().

◆ getSPINUP()

double simcore::lhe::LHEParticle::getSPINUP ( ) const

Get the particle's spin (SPINUP).

Returns
The particle's spin.

Definition at line 63 of file LHEParticle.cxx.

63{ return spinup_; }

References spinup_.

Referenced by print().

◆ getVTIMUP()

double simcore::lhe::LHEParticle::getVTIMUP ( ) const

Get the proper lifetime (VTIMUP).

Returns
The particle's proper lifetime.

Definition at line 61 of file LHEParticle.cxx.

61{ return vtimup_; }

References vtimup_.

Referenced by simcore::generators::LHEPrimaryGenerator::GeneratePrimaryVertex(), and print().

◆ print()

void simcore::lhe::LHEParticle::print ( std::ostream &  stream) const

Print particle information to an output stream.

Parameters
streamThe output stream.

Definition at line 71 of file LHEParticle.cxx.

71 {
72 stream << "LHEParticle { "
73 << "IDUP: " << getIDUP() << ", ISTUP: " << getISTUP()
74 << ", MOTHUP[0]: " << getMOTHUP(0) << ", MOTHUP[1]: " << getMOTHUP(1)
75 << ", ICOLUP[0]: " << getICOLUP(0) << ", ICOLUP[1]: " << getICOLUP(1)
76 << ", PUP[0]: " << getPUP(0) << ", PUP[1]: " << getPUP(1)
77 << ", PUP[2]: " << getPUP(2) << ", PUP[3]: " << getPUP(3)
78 << ", PUP[4]: " << getPUP(4) << ", VTIMUP: " << getVTIMUP()
79 << ", SPINUP: " << getSPINUP() << " }" << std::endl;
80}
int getMOTHUP(int) const
Get a mother particle index (MOTHUP) by index.
double getPUP(int) const
Get a momentum component (PUP) by index.
double getSPINUP() const
Get the particle's spin (SPINUP).
double getVTIMUP() const
Get the proper lifetime (VTIMUP).
int getISTUP() const
Get the status code (ISTUP).
int getIDUP() const
Get the PDG code (IDUP).
int getICOLUP(int) const
Get the particle color (ICOLUP) by index.

References getICOLUP(), getIDUP(), getISTUP(), getMOTHUP(), getPUP(), getSPINUP(), and getVTIMUP().

◆ setMother()

void simcore::lhe::LHEParticle::setMother ( int  i,
LHEParticle particle 
)

Set a mother particle by index.

Parameters
iThe mother index.
particleThe mother particle.

Definition at line 65 of file LHEParticle.cxx.

65 {
66 mothers_[i] = mother;
67}

References mothers_.

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

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  stream,
const LHEParticle particle 
)
friend

Overloaded stream operator.

Parameters
streamThe output stream.
particleThe particle to print.

Definition at line 82 of file LHEParticle.cxx.

82 {
83 particle.print(stream);
84 return stream;
85}

Member Data Documentation

◆ icolup_

int simcore::lhe::LHEParticle::icolup_[2]
private

The particle color.

Definition at line 122 of file LHEParticle.h.

Referenced by getICOLUP(), and LHEParticle().

◆ idup_

int simcore::lhe::LHEParticle::idup_
private

The PDG code.

Definition at line 107 of file LHEParticle.h.

Referenced by getIDUP(), and LHEParticle().

◆ istup_

int simcore::lhe::LHEParticle::istup_
private

The status code.

Definition at line 112 of file LHEParticle.h.

Referenced by getISTUP(), and LHEParticle().

◆ mothers_

LHEParticle* simcore::lhe::LHEParticle::mothers_[2]
private

The mother particles.

Definition at line 102 of file LHEParticle.h.

Referenced by getMother(), LHEParticle(), and setMother().

◆ mothup_

int simcore::lhe::LHEParticle::mothup_[2]
private

The mother particle indices.

Definition at line 117 of file LHEParticle.h.

Referenced by getMOTHUP(), and LHEParticle().

◆ pup_

double simcore::lhe::LHEParticle::pup_[5]
private

The momentum components.

Definition at line 127 of file LHEParticle.h.

Referenced by getPUP(), and LHEParticle().

◆ spinup_

int simcore::lhe::LHEParticle::spinup_
private

The particle's spin.

Definition at line 137 of file LHEParticle.h.

Referenced by getSPINUP(), and LHEParticle().

◆ vtimup_

double simcore::lhe::LHEParticle::vtimup_
private

The proper time.

Definition at line 132 of file LHEParticle.h.

Referenced by getVTIMUP(), and LHEParticle().


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