 |
Belle II Software
release-05-02-19
|
12 #include <framework/core/FrameworkExceptions.h>
13 #include <mdst/dataobjects/MCParticleGraph.h>
18 #include <TLorentzRotation.h>
20 #include "HepMC/GenEvent.h"
45 "Event %1%: Invalid daughter indices d1=%2%, d2=%3%, N=%4% (0<=d1<=d2<=N required)");
51 BELLE2_DEFINE_EXCEPTION(HepMCParticleFormatError,
"Event %1%: Particle format not understood, got %2% fields !");
56 "Event %1%: Number of particles in event is %2% ! (This could mean EOF is reached.) ");
72 void open(
const std::string& filename);
90 int getEvent(MCParticleGraph& graph,
double& weight);
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.
std::ifstream m_input
The input stream of the ascii file.
~HepMCReader()
Destructor.
const int m_maxEvent
max events to process
int m_nVirtual
The number of particles in each event with a set Virtual flag.
Abstract base class for different kinds of events.
void closeCurrentInputFile()
Closes the current input file to allow opening the next one.
int nextValidEvent(HepMC::GenEvent &evt)
Got to next event in bounds.
TLorentzRotation m_labboost
Boost&rotation vector for boost from CM to LAB.
const int m_minEvent
min event nr to process
void readNextEvent(HepMC::GenEvent &evt)
read the next event from the IO stream and write into evt
void open(const std::string &filename)
Opens an ascii file and prepares it for reading.
int countEvents(const std::string &filename)
Count events in file.
BELLE2_DEFINE_EXCEPTION(HepMCCouldNotOpenFileError, "Could not open file %1% !")
Exception is thrown if the HepMC file could not be opened.
HepMCReader(const int minEvent=0, const int maxEvent=INT_MAX)
Constructor.