Belle II Software development
|
Class to read Touschek files and store their content in a MCParticle graph. More...
#include <TouschekReaderTURTLE.h>
Public Member Functions | |
BELLE2_DEFINE_EXCEPTION (TouschekCouldNotOpenFileError, "Could not open file %1% !") | |
Exception is thrown if the Touschek file could not be opened. | |
BELLE2_DEFINE_EXCEPTION (TouschekConvertFieldError, "Line %1%: Could not convert field %2%: %3%") | |
Exception is thrown if a field in the Touschek file could not be converted to a number. | |
TouschekReaderTURTLE (TGeoHMatrix *transMatrix, int pdg) | |
Constructor of the TouschekReader class. | |
~TouschekReaderTURTLE () | |
Destructor. | |
void | open (const std::string &filename) |
Opens an ascii file and prepares it for reading. | |
int | getParticles (int number, MCParticleGraph &graph) |
Reads the specified number of particles from the file and stores the result in the given MCParticle graph. | |
Protected Attributes | |
TGeoHMatrix * | m_transMatrix |
Transformation matrix from local Touschek to global geant4 space. | |
int | m_pdg |
The pdg value of the type of particle that is read (e.g. | |
std::ifstream | m_input |
The input stream of the ascii file. | |
int | m_lineNum |
The line number in the ascii file of the last particle which was read. | |
Class to read Touschek files and store their content in a MCParticle graph.
The reader supports retrieving the Touschek information from an ascii text file.
The file contains just a list of particles, defined at plane +-50cm from the IP. The reader reads either a specified number of particles from the file, or all particles.
Definition at line 34 of file TouschekReaderTURTLE.h.
TouschekReaderTURTLE | ( | TGeoHMatrix * | transMatrix, |
int | pdg | ||
) |
Constructor of the TouschekReader class.
transMatrix | Pointer to the matrix which transforms the particles from the local Touschek to the global geant4 coordinate system. |
pdg | The pdg value of the type of particle that is read (e.g. 11 for e-, -11 for e+). |
Definition at line 23 of file TouschekReaderTURTLE.cc.
~TouschekReaderTURTLE | ( | ) |
Destructor.
Definition at line 29 of file TouschekReaderTURTLE.cc.
int getParticles | ( | int | number, |
MCParticleGraph & | graph | ||
) |
Reads the specified number of particles from the file and stores the result in the given MCParticle graph.
The number of the last particle which was read is saved. So the next time this method is called the reading continues at the position where the last particle which was read.
number | The number of particles that should be read from the file. Set it to -1 to read all particles. |
graph | Reference to the graph which should be filled with the information from the Touschek file. |
Definition at line 43 of file TouschekReaderTURTLE.cc.
void open | ( | const std::string & | filename | ) |
Opens an ascii file and prepares it for reading.
filename | The filename of the Touschek ascii file which should be read. |
Definition at line 35 of file TouschekReaderTURTLE.cc.
|
protected |
The input stream of the ascii file.
Definition at line 78 of file TouschekReaderTURTLE.h.
|
protected |
The line number in the ascii file of the last particle which was read.
Definition at line 79 of file TouschekReaderTURTLE.h.
|
protected |
The pdg value of the type of particle that is read (e.g.
11 for e-, -11 for e+).
Definition at line 77 of file TouschekReaderTURTLE.h.
|
protected |
Transformation matrix from local Touschek to global geant4 space.
Definition at line 76 of file TouschekReaderTURTLE.h.