9#include <generators/modules/HepevtInputModule.h>
11#include <framework/logging/Logger.h>
12#include <framework/datastore/DataStore.h>
13#include <framework/datastore/StoreArray.h>
14#include <framework/dataobjects/EventMetaData.h>
15#include <framework/datastore/StoreObjPtr.h>
25 setDescription(
"HepEvt file input. This module loads an event record from HEPEVT format and store the content into the MCParticle collection. HEPEVT format is a standard event record format to contain an event record in a Monte Carlo-independent format.");
31 "Boolean to indicate whether the event numbers from input file should be used.",
false);
35 addParam(
"useWeights",
m_useWeights,
"Set to 'true' to if generator weights should be propagated.",
false);
36 addParam(
"nVirtualParticles",
m_nVirtual,
"Number of particles at the beginning of the events that should be made virtual.", 0);
37 addParam(
"wrongSignPz",
m_wrongSignPz,
"Boolean to signal that directions of HER and LER were switched",
false);
44 B2FATAL(
"The exp. and run numbers are not properly initialized: please set the 'expNum' and 'runNum' parameters of the HepevtInput module.");
47 B2INFO(
"HepevtInput acts as input module for this process. This means the exp., run and event numbers will be set by this module.");
53 B2FATAL(
"Invalid list of input files, no entries found.");
62 }
catch (runtime_error& e) {
95 }
catch (HepevtReader::HepEvtEmptyEventError&) {
96 B2DEBUG(100,
"Reached end of HepEvt file.");
104 }
catch (runtime_error& e) {
109 B2DEBUG(100,
"Reached end of all HepEvt files.");
111 }
catch (runtime_error& e) {
@ c_ErrorIfAlreadyRegistered
If the object/array was already registered, produce an error (aborting initialisation).
bool skipEvents(int n)
Skips a given number of events.
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.
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.
@ c_checkCyclic
Check for cyclic dependencies.
@ c_setDecayInfo
Set decay time and vertex.
void generateList(const std::string &name="", int options=c_setNothing)
Generates the MCParticle list and stores it in the StoreArray with the given name.
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_Input
This module is an input module (reads data).
bool registerInDataStore(DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut)
Register the object/array in the DataStore.
Accessor to arrays stored in the data store.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
void clear()
Reset particles and decay information to make the class reusable.
Abstract base class for different kinds of events.