11#include <framework/logging/LogConfig.h>
12#include <framework/gearbox/Const.h>
397 std::vector<std::string>
ERunType
Enum for identifying run type (beam or cosmic)
This class stores all environment information required to run the framework, such as module or data f...
Environment()
Set up environment from standard BELLE2_ environment variables.
const std::vector< std::string > & getStreamingObjects() const
Get list of streaming objects.
bool m_zmqDAQEnvironment
True in DAQ environment.
int m_zmqDAQFirstEventRun
Exp no.
unsigned int getZMQWorkerTimeout() const
How long should a worker maximally need to process all of his events in the queue....
std::string m_steering
The content of the steering file.
Environment & operator=(const Environment &)=delete
Disable/Hide the copy assignment operator.
bool getWriteSimSteps() const
Get the flag for writing the simulation steps into an output csv file.
std::vector< std::string > m_entrySequencesOverride
A number sequence (e.g.
int m_numberProcesses
The number of worker processes that should be used for the parallel processing.
void setOutputFileOverride(const std::string &name)
Override output file name for modules.
std::string consumeOutputFileOverride(const std::string &moduleName)
Return overriden output file name, or "" if none was set.
std::string m_profileModuleName
Name of the module which should be profiled, empty if no profiling requested.
void setZMQDAQFirstEventExp(int exp)
set the exp number for DAQ first event
bool isZMQDAQFirstEvent(int exp, int run)
checks the exp/run is DAQ first event
unsigned int getZMQEventBufferSize() const
Number of events to keep in flight for every worker.
void setZMQRestartFailedWorkers(bool zmqRestartFailedWorkers)
If a worker dies, restart it.
bool m_noStats
Disable collection of statistics during event processing.
bool getDryRun() const
Read steering file, but do not start any actually start any event processing.
void setNumberProcesses(int number)
Sets the number of processes which should be used for the parallel processing.
const std::list< std::string > & getModuleSearchPaths() const
Returns a list of file paths searched for module libraries.
void setZMQFailOnFailedWorkers(bool zmqFailOnFailedWorkers)
If a worker dies, fail also.
unsigned int getNumberOfEvents() const
Return the number of events, from either input or EventInfoSetter, or -n command line override (if le...
Const::ERunType getRunType() const
Get the run type (beam or cosmic)
void setProfileModuleName(const std::string &name)
Set the name of a module to be profiled.
const std::string & getZMQSocketAddress() const
Socket address to use in ZMQ.
void setSteering(const std::string &steering)
Sets the steering file content.
const std::string & getSteering() const
Returns the steering file content.
bool getZMQFailOnFailedWorkers() const
If a worker dies, fail also.
bool isMC() const
Do we have generated, not real data?
~Environment()
The Environment destructor.
bool isCosmicRun() const
Is the run for cosmics data?
std::string m_externalsPath
The path in which the externals are located.
std::string m_jobInfoOutput
Output for printJobInformation(), generated by setJobInformation().
void setNumberEventsOverride(unsigned int nevents)
Override the number of events in run 1 for EventInfoSetter module.
void setRealm(LogConfig::ELogRealm realm)
Set the basf2 execution realm.
bool m_zmqRestartFailedWorkers
If a worker dies, restart it.
bool m_useZMQ
Set to true to use ZMQ instead of RingBuffer.
void setJobInformation(const std::shared_ptr< Path > &path)
Set info from path executed by the framework.
unsigned int m_zmqMaximalWaitingTime
Maximal waiting time of any ZMQ module for any communication in ms.
Const::ERunType m_runType
Flag which tells if the run is beam (default: c_Beam) or cosmic (c_Cosmic).
void setZMQMaximalWaitingTime(unsigned int zmqMaximalWaitingTime)
Maximal waiting time of any ZMQ module for any communication in ms.
unsigned int getSkipEventsOverride() const
Get skipNEvents override, or 0 if unset.
void setRunType(Const::ERunType runType)
Set the run type (beam or cosmic).
std::string m_outputFileOverride
Override name of output file for output module.
int getNumberProcesses() const
Returns the number of worker processes which should be used for the parallel processing.
bool getZMQDAQEnvironment() const
obtain current environment (DAQ or not)
unsigned int m_mcEvents
counter for number of generated events.
void setZMQEventBufferSize(unsigned int zmqEventBufferSize)
Number of events to keep in flight for every worker.
void setRunExperimentOverride(int run, int experiment)
Override run and experiment for EventInfoSetter.
std::vector< std::string > m_inputFilesOverride
Override input file names for input modules.
bool m_writeSimSteps
bool for writing out the simulation steps into a csv file.
int getExperimentOverride() const
Get experiment override, or -1 if unset.
std::vector< std::string > getEntrySequencesOverride() const
Returns the number sequences (e.g.
unsigned int getZMQMaximalWaitingTime() const
Maximal waiting time of any ZMQ module for any communication in ms.
void setExternalsPath(const std::string &externalsPath)
Sets the path which points to the externals directory of the framework.
bool getNoStats() const
Disable collection of statistics during event processing.
std::vector< std::string > m_streamingObjects
objects to be streamed in Tx module (all if empty)
void setZMQUseEventBackup(bool zmqUseEventBackup)
If a worker dies, store its events in a backup.
void setStreamingObjects(const std::vector< std::string > &strobjs)
Set list of streaming objects.
int m_zmqDAQFirstEventExp
Exp no.
bool getVisualizeDataFlow() const
Wether to generate DOT files with data store inputs/outputs of each module.
void setWriteSimSteps(const bool writeSimSteps)
Set the flag for writing the simulation steps into an output csv file.
const std::vector< std::string > & getInputFilesOverride() const
Return overriden input file names, or empty vector if none were set.
Environment(const Environment &)=delete
Disable/Hide the copy constructor.
void setNumberProcessesOverride(int nproc)
Override number of processes to run in parallel.
void setZMQSocketAddress(const std::string &zmqSocketAddress)
Socket address to use in ZMQ.
unsigned int getNumberOfMCEvents() const
Number of generated events (from EventInfoSetter).
unsigned int m_numberEventsOverride
Override number of events in the first run.
bool isBeamRun() const
Is the run for beam data?
std::string m_outputFileOverrideModule
Name of the module which consumed the output file Override if any was given.
const std::string & getOutputFileOverrideModule() const
Return the name of the module which consumed the OutputFileOverride, "" if no output file override wa...
bool m_visualizeDataFlow
Wether to generate DOT files with data store inputs/outputs of each module.
int m_experiment
override experiment for EventInfoSetter.
const std::string & getOutputFileOverride() const
Return overriden output file name, or "" if none was set.
unsigned int m_zmqWorkerTimeout
How long should a worker maximally need to process all of his events in the queue.
const std::string & getExternalsPath() const
Returns the path which points to the externals directory of the framework.
int getRunOverride() const
Get run override, or -1 if unset.
int m_logLevelOverride
Override global log level if != LogConfig::c_Default.
void setLogLevelOverride(int level)
Override global log level if != LogConfig::c_Default.
int m_numberProcessesOverride
Override m_numberProcesses if >= 0.
int getZMQDAQFirstEventExp() const
get the exp number for DAQ first event
void printJobInformation() const
Print information on input/output files in current steering file, used by –dry-run.
void setEntrySequencesOverride(const std::vector< std::string > &sequences)
Override the number sequences (e.g.
void setZMQDAQEnvironment(bool zmqDAQ)
Set DAQ environment.
bool getUseZMQ() const
Flag if ZMQ should be used instead of the RingBuffer multiprocesing implementation.
LogConfig::ELogRealm m_realm
The realm in which basf2 is executed.
void setZMQWorkerTimeout(unsigned int zmqWorkerTimeout)
How long should a worker maximally need to process all of his events in the queue....
bool getZMQUseEventBackup() const
If a worker dies, store its events in a backup.
static Environment & Instance()
Static method to get a reference to the Environment instance.
int getZMQDAQFirstEventRun() const
get run number for DAQ first event
std::string m_picklePath
Path to the file where the pickled path is stored.
void setSecondaryInputFilesOverride(const std::vector< std::string > &names)
Override secondary input file names for modules.
std::string m_zmqSocketAddress
Socket address to use in ZMQ.
void setUseZMQ(bool useZMQ)
Set the flag if ZMQ should be used instead of the RingBuffer multiprocessing implementation.
std::vector< std::string > m_secondaryInputFilesOverride
Override secondary input file names for input modules.
bool m_zmqUseEventBackup
If a worker dies, store its events in a backup.
void setPicklePath(const std::string &path)
Sets the path to the file where the pickled path is stored.
bool getZMQRestartFailedWorkers() const
If a worker dies, restart it.
void setZMQDAQFirstEventRun(int run)
set run number for DAQ first event
int getLogLevelOverride() const
Get log level override.
bool m_dryRun
Read steering file, but do not start any actually start any event processing.
unsigned int getNumberEventsOverride() const
Returns number of events in run 1 for EventInfoSetter module, or 0 for no override.
unsigned int m_skipNEvents
override skipNEvents for EventInfoSetter/RootInput.
bool m_zmqFailOnFailedWorkers
If a worker dies, fail also.
std::string getProfileModuleName() const
Return the name of the module to be profiled, empty if no profiling was requested.
void setSkipEventsOverride(unsigned int skipEvents)
Set skipNEvents override.
void setVisualizeDataFlow(bool on)
Wether to generate DOT files with data store inputs/outputs of each module.
void setInputFilesOverride(const std::vector< std::string > &names)
Override input file names for modules.
const std::vector< std::string > & getSecondaryInputFilesOverride() const
Return overriden secondary input file names, or empty vector if none were set.
void setNoStats(bool noStats)
Disable collection of statistics during event processing.
void setDryRun(bool dryRun)
Read steering file, but do not start any actually start any event processing.
std::string getPicklePath() const
Returns the path to the file where the pickled path is stored.
void setNumberOfMCEvents(unsigned int n)
Set number of generated events (for EventInfoSetter).
LogConfig::ELogRealm getRealm() const
Get the basf2 execution realm.
int m_run
override run for EventInfoSetter.
unsigned int m_zmqEventBufferSize
Number of events to keep in flight for every worker.
ELogRealm
Definition of the supported execution realms.
@ c_None
No specific realm.
Abstract base class for different kinds of events.