11#include <framework/core/FrameworkExceptions.h>
12#include <mdst/dataobjects/MCParticleGraph.h>
13#include <boost/tokenizer.hpp>
40 "Line %1%: Invalid daughter indices d1=%2%, d2=%3%, N=%4% (0<=d1<=d2<=N required)");
48 BELLE2_DEFINE_EXCEPTION(LHEEmptyEventError,
"Line %1%: Number of particles in event is %2% ! (This could mean EOF is reached.) ");
68 void open(
const std::string& filename);
110 typedef boost::tokenizer<boost::char_separator<char> >
tokenizer;
112 static const boost::char_separator<char>
sep;
Class to read LHE files and store the content in a MCParticle graph.
int readParticle(MCParticleGraph::GraphParticle &particle)
Reads the information for a single particle from the LHE file.
bool skipEvents(int n)
Skips a given number of events.
std::string getLine()
Returns the current line from the LHE ascii file.
void setVirtualIndex(int index)
Set the maximum index of particles in each event that must be set as c_IsVirtual (1-based).
double m_Rmin
Minimum of vertex distance to IP.
BELLE2_DEFINE_EXCEPTION(LHEInvalidDaughterIndicesError, "Line %1%: Invalid daughter indices d1=%2%, d2=%3%, N=%4% (0<=d1<=d2<=N required)")
Exception is thrown if the given indices of the daughters are not valid.
int m_pdgDisplaced
PDG code of the displaced particle being studied.
static const boost::char_separator< char > sep
The characters at which to split, defaults to ",; \t".
void setInitialIndex(int index)
Set the maximum index of particles in each event that must be set as c_Initial (1-based).
int m_lineNr
The current line number within the ascii file.
int m_indexVirtual
Maximum index of particles in each event that must be set as c_IsVirtual (1-based).
double m_Rmax
Maximum of vertex distance to IP.
void open(const std::string &filename)
Opens an ascii file and prepares it for reading.
void closeCurrentInputFile()
Closes the current input file to allow opening the next one.
std::ifstream m_input
The input stream of the ascii file.
boost::tokenizer< boost::char_separator< char > > tokenizer
Just a typedef for simple use of the boost::tokenizer to split the lines.
BELLE2_DEFINE_EXCEPTION(LHEConvertFieldError, "Line %1%: Could not convert field %2%: %3%")
Exception is thrown if a field in the LHE file could not be converted to a number.
int m_indexInitial
Maximum index of particles in each event that must be set as c_Initial (1-based).
int getEvent(MCParticleGraph &graph, double &weight)
Reads the next event and stores the result in the given MCParticle graph.
bool m_wrongSignPz
Bool to indicate that HER and LER were swapped.
int readEventHeader(double &eventWeight)
Reads the event header from the hepevt file.
double m_meanDecayLength
Mean lifetime*c of displaced particle.
BELLE2_DEFINE_EXCEPTION(LHEEmptyEventError, "Line %1%: Number of particles in event is %2% ! (This could mean EOF is reached.) ")
Exception is thrown if the number of particles for this event is 0 or less.
BELLE2_DEFINE_EXCEPTION(LHECouldNotOpenFileError, "Could not open file %1% !")
Exception is thrown if the LHE file could not be opened.
BELLE2_DEFINE_EXCEPTION(LHEParticleFormatError, "Line %1%: Particle format not understood, got %2% fields !")
Exception is thrown if the format of a line of the LHE file could not be parsed.
BELLE2_DEFINE_EXCEPTION(LHEHeaderNotValidError, "Line %1%: Event header not understood: %2%")
Exception is thrown if the header specifying the event header could not be parsed.
Class to represent Particle data in graph.
Class to build, validate and sort a particle decay chain.
Abstract base class for different kinds of events.