G4DarkBreM  v2.1.0
Geant4 Dark Bremmstrahlung from MadGraph
g4db::parse Namespace Reference

namespace holding implementation of library parsing More...

Functions

void lhe (boost::iostreams::filtering_istream &reader, int aprime_lhe_id, std::map< int, std::map< double, std::vector< OutgoingKinematics >>> &lib)
 Parse an LHE file from the input stream. More...
 
void csv (boost::iostreams::filtering_istream &reader, std::map< int, std::map< double, std::vector< OutgoingKinematics >>> &lib)
 parse the input stream as a CSV file, filling the input library More...
 

Detailed Description

namespace holding implementation of library parsing

Function Documentation

◆ csv()

void g4db::parse::csv ( boost::iostreams::filtering_istream &  reader,
std::map< int, std::map< double, std::vector< OutgoingKinematics >>> &  lib 
)

parse the input stream as a CSV file, filling the input library

The CSV file is expected to have a single header line which names the columns. These column names have no requirements (besides the existence of this line).

The CSV is required to have 10 columns on all non-empty lines of the file. The 10 columns of the CSV all are in MeV and in order are

  1. The target Z
  2. The incident lepton energy
  3. The total energy of the recoil
  4. The x-component of the recoil momentum
  5. The y-component of the recoil momentum
  6. The z-component of the recoil momentum
  7. The total energy of the CoM
  8. The x-component of the CoM
  9. The y-component of the CoM
  10. The z-component of the CoM
Note
If developing this function, make sure to update dumpLibrary so that they can be used in conjuction.
Parameters
[in]readerinput stream reading the file
[in,out]libdark brem event library to fill

◆ lhe()

void g4db::parse::lhe ( boost::iostreams::filtering_istream &  reader,
int  aprime_lhe_id,
std::map< int, std::map< double, std::vector< OutgoingKinematics >>> &  lib 
)

Parse an LHE file from the input stream.

We go line-by-line through the input text stream, looking for dark brem events. A "dark brem event" in this context is defined below.

lepton_id -1 <skip> <skip> <skip> <skip> px py pz E m
<skip-line>
<skip-line>
lepton_id 1 <skip> <skip> <skip> <skip> px py pz E m
<skip-line>
<skip-line>
aprime_id 1 <skip> <skip> <skip> <skip> px py pz E m

We also check each line if it contains a 'Znuc' string. Looking for the target Z value from this line matching the following format.

<num> <Z> # Znuc <other comments>

This is supposed to match a line of the param_card dumped into the header of the LHE. In other words, this parser should function properly if your MG/ME model has a configurable parameter in param_card.dat for the target Z and that parameter is called 'Znuc'.

This matches a subcomponent of the LHE scheme written by MadGraph/MadEvent (hence the reason this is the "lhe" parser); however, a lot of information is skipped and additional assumptions are made in order to increase the parsing speed.

The lepton_id is allowed to be either 11 or 13 everywhere. No consistency checking is done.

The E from the first line is used as the incident lepton energy. The four-momentum from the middle line is the recoil lepton's four momentum, and the four-momentum from the last line (A') is used in conjuction with the recoil four-momentum to calculate the center of momentum vector.

Parameters
[in]readerinput stream reading the file
[in]aprime_lhe_idID number of the dark photon within the LHE file
[in,out]libdark brem event library to fill