 |
Belle II Software
release-05-02-19
|
11 #ifndef HEPEVTREADER_H
12 #define HEPEVTREADER_H
14 #include <framework/core/FrameworkExceptions.h>
15 #include <mdst/dataobjects/MCParticleGraph.h>
16 #include <boost/tokenizer.hpp>
21 #include <TLorentzRotation.h>
47 "Line %1%: Invalid daughter indices d1=%2%, d2=%3%, N=%4% (0<=d1<=d2<=N required)");
53 BELLE2_DEFINE_EXCEPTION(HepEvtParticleFormatError,
"Line %1%: Particle format not understood, got %2% fields !");
56 "Line %1%: Number of particles in event is %2% ! (This could mean EOF is reached.) ");
71 void open(
const std::string& filename);
100 typedef boost::tokenizer<boost::char_separator<char> >
tokenizer;
102 static const boost::char_separator<char>
sep;
134 #endif //HEPEVTREADER_H
void readParticle(MCParticleGraph::GraphParticle &particle)
Reads the information for a single particle from the Hepevt file.
std::ifstream m_input
The input stream of the ascii file.
int readEventHeader(int &eventID, double &eventWeight)
Reads the event header from the hepevt file.
void open(const std::string &filename)
Opens an ascii file and prepares it for reading.
Class to build, validate and sort a particle decay chain.
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 m_nVirtual
The number of particles in each event with a set Virtual flag.
HepevtReader()
Constructor.
Abstract base class for different kinds of events.
bool skipEvents(int n)
Skips a given number of events.
BELLE2_DEFINE_EXCEPTION(HepEvtCouldNotOpenFileError, "Could not open file %1% !")
Exception is thrown if the HepEvt file could not be opened.
TLorentzRotation m_labboost
Boost&rotation vector for boost from CM to LAB.
std::string getLine()
Returns the current line from the Hepevt ascii file.
~HepevtReader()
Destructor.
boost::tokenizer< boost::char_separator< char > > tokenizer
Just a typedef for simple use of the boost::tokenizer to split the lines.
int m_lineNr
The current line number within the ascii file.
static const boost::char_separator< char > sep
The characters at which to split, defaults to ",; \t".
void closeCurrentInputFile()
Closes the current input file to allow opening the next one.
Class to represent Particle data in graph.