Belle II Software  release-05-02-19
EventProcessor.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010-2015 Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Andreas Moll, Christian Pulvermacher, Martin Ritter *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 //first because of python include
12 #include <framework/core/Module.h>
13 
14 #include <framework/core/EventProcessor.h>
15 
16 #include <framework/core/PathIterator.h>
17 #include <framework/datastore/DataStore.h>
18 #include <framework/database/DBStore.h>
19 #include <framework/database/Database.h>
20 #include <framework/logging/Logger.h>
21 #include <framework/core/Environment.h>
22 #include <framework/core/DataFlowVisualization.h>
23 #include <framework/core/RandomNumbers.h>
24 #include <framework/core/MetadataService.h>
25 #include <framework/gearbox/Unit.h>
26 #include <framework/utilities/Utils.h>
27 
28 #ifdef HAS_CALLGRIND
29 #include <valgrind/callgrind.h>
36 #define CALL_MODULE(module,x) \
37  if(m_profileModule && m_profileModule==module && RUNNING_ON_VALGRIND){\
38  CALLGRIND_START_INSTRUMENTATION;\
39  module->x();\
40  CALLGRIND_STOP_INSTRUMENTATION;\
41  }else{\
42  module->x();\
43  }
44 #else
45 #define CALL_MODULE(module, x) module->x()
46 #endif
47 
48 #include <TROOT.h>
49 
50 #include <csignal>
51 #include <unistd.h>
52 #include <cstring>
53 
54 using namespace std;
55 using namespace Belle2;
56 
57 namespace {
58  static int gSignalReceived = 0;
59  static void signalHandler(int signal)
60  {
61  gSignalReceived = signal;
62 
63  if (signal == SIGINT) {
64  EventProcessor::writeToStdErr("Received Ctrl+C, basf2 will exit safely. (Press Ctrl+\\ (SIGQUIT) to abort immediately - this will break output files.)\n");
65  }
66  }
67 }
68 EventProcessor::StoppedBySignalException::StoppedBySignalException(int signal_):
69  runtime_error("Execution stopped by signal " + to_string(signal_) + "!"),
70  signal(signal_)
71 {
72 }
73 
74 void EventProcessor::writeToStdErr(const char msg[])
75 {
76  //signal handlers are called asynchronously, making many standard functions (including output) dangerous
77  //write() is, however, safe, so we'll use that to write to stderr.
78 
79  //strlen() not explicitly in safe list, but doesn't have any error handling routines that might alter global state
80  const int len = strlen(msg);
81 
82  int rc = write(STDERR_FILENO, msg, len);
83  (void) rc; //ignore return value (there's nothing we can do about a failed write)
84 
85 }
86 
89 {
90 
91 }
92 
94 
95 namespace {
98  struct NumberEventsOverrideGuard {
100  explicit NumberEventsOverrideGuard(unsigned int newValue)
101  {
104  }
106  ~NumberEventsOverrideGuard()
107  {
109  }
111  unsigned int m_maxEvent;
112  };
113 }
114 
115 long EventProcessor::getMaximumEventNumber(long maxEvent) const
116 {
117  //Check whether the number of events was set via command line argument
118  unsigned int numEventsArgument = Environment::Instance().getNumberEventsOverride();
119  if ((numEventsArgument > 0) && ((maxEvent == 0) || (maxEvent > numEventsArgument))) {
120  return numEventsArgument;
121  }
122  return maxEvent;
123 }
124 
125 void EventProcessor::process(const PathPtr& startPath, long maxEvent)
126 {
127  maxEvent = getMaximumEventNumber(maxEvent);
128  // Make sure the NumberEventsOverride reflects the actual number if
129  // process(path, N) was used instead of -n and that it's reset to what it was
130  // after we're done with processing()
131  NumberEventsOverrideGuard numberOfEventsOverrideGuard(maxEvent);
132 
133  //Get list of modules which could be executed during the data processing.
134  ModulePtrList moduleList = startPath->buildModulePathList();
135 
136  //Find the adress of the module we want to profile
137  if (!m_profileModuleName.empty()) {
138  for (const auto& module : moduleList) {
139  if (module->getName() == m_profileModuleName) {
140  m_profileModule = module.get();
141  break;
142  }
143  }
144  if (!m_profileModule)
145  B2FATAL("Module profiling was requested via --profile, but no module '" << m_profileModuleName << "' was found!");
146  }
147 
148  //Initialize modules
149  processInitialize(moduleList);
150 
151  //do we want to visualize DataStore input/ouput?
152  if (Environment::Instance().getVisualizeDataFlow()) {
153  DataFlowVisualization v(&DataStore::Instance().getDependencyMap());
154  v.visualizePath("dataflow.dot", *startPath);
155  }
156 
157  //Don't start processing in case of no master module
158  if (!m_master) {
159  B2ERROR("There is no module that provides event and run numbers (EventMetaData). You must add either the EventInfoSetter or an input module (e.g. RootInput) to the beginning of your path.");
160  }
161 
162  //Check if errors appeared. If yes, don't start the event processing.
164  if ((numLogError == 0) && m_master) {
166  try {
167  processCore(startPath, moduleList, maxEvent); //Do the event processing
168  } catch (StoppedBySignalException& e) {
169  if (e.signal != SIGINT) {
170  // close all open ROOT files, ROOT's exit handler will crash otherwise
171  gROOT->GetListOfFiles()->Delete();
172 
173  B2FATAL(e.what());
174  }
175  //in case of SIGINT, we move on to processTerminate() to shut down safely
176  } catch (...) {
177  if (m_eventMetaDataPtr)
178  B2ERROR("Exception occured in exp/run/evt: "
179  << m_eventMetaDataPtr->getExperiment() << " / "
180  << m_eventMetaDataPtr->getRun() << " / "
181  << m_eventMetaDataPtr->getEvent());
182  throw;
183  }
184 
185  } else {
186  B2FATAL(numLogError << " ERROR(S) occurred! The processing of events will not be started.");
187  }
188 
189  //Terminate modules
190  processTerminate(moduleList);
191 
193 
194  if (gSignalReceived == SIGINT) {
195  const auto msg = R"(Processing aborted via SIGINT, terminating.
196  Output files have been closed safely and should be readable. However
197  processing was NOT COMPLETE. The output files do contain only events
198  processed until this point.)";
199  if (m_eventMetaDataPtr)
200  B2ERROR(msg
201  << LogVar("last_experiment", m_eventMetaDataPtr->getExperiment())
202  << LogVar("last_run", m_eventMetaDataPtr->getRun())
203  << LogVar("last_event", m_eventMetaDataPtr->getEvent()));
204  else
205  B2ERROR(msg);
206  installSignalHandler(SIGINT, SIG_DFL);
207  raise(SIGINT);
208  }
209 }
210 
211 
212 //============================================================================
213 // Protected methods
214 //============================================================================
215 
217 {
218  LogSystem& logSystem = LogSystem::Instance();
219  const bool collectStats = !Environment::Instance().getNoStats();
220  // set up logging
221  logSystem.updateModule(&(module->getLogConfig()), module->getName());
222  // set up statistics is requested
223  if (collectStats) m_processStatisticsPtr->startModule();
224  // call module
225  CALL_MODULE(module, event);
226  // stop timing
227  if (collectStats) m_processStatisticsPtr->stopModule(module, ModuleStatistics::c_Event);
228  // reset logging
229  logSystem.updateModule(nullptr);
230 };
231 
232 void EventProcessor::processInitialize(const ModulePtrList& modulePathList, bool setEventInfo)
233 {
234  LogSystem& logSystem = LogSystem::Instance();
235  auto dbsession = Database::Instance().createScopedUpdateSession();
236 
237  m_processStatisticsPtr.registerInDataStore();
238  //TODO I might want to overwrite it in initialize (e.g. if read from file)
239  // For parallel processing or subevents, I don't want that, though.
240  // Maybe make this a function argument?
242  m_processStatisticsPtr.create();
243  m_processStatisticsPtr->startGlobal();
244 
245  MetadataService::Instance().addBasf2Status("initializing");
246 
247  for (const ModulePtr& modPtr : modulePathList) {
248  Module* module = modPtr.get();
249 
250  if (module->hasUnsetForcedParams()) {
251  //error message was printed by module
252  continue;
253  }
254 
255  //Set the module dependent log level
256  logSystem.updateModule(&(module->getLogConfig()), module->getName());
258 
259  //Do initialization
260  m_processStatisticsPtr->initModule(module);
261  m_processStatisticsPtr->startModule();
262  CALL_MODULE(module, initialize);
264 
265  //Set the global log level
266  logSystem.updateModule(nullptr);
267 
268  //Check whether this is the master module
269  if (!m_master && DataStore::Instance().getEntry(m_eventMetaDataPtr) != nullptr) {
270  B2DEBUG(100, "Found module providing EventMetaData: " << module->getName());
271  m_master = module;
272  if (setEventInfo) {
273  callEvent(module);
274  // update Database payloads: we now have valid event meta data unless
275  // we don't process any events
277  }
278  }
279 
280  if (gSignalReceived != 0) {
281  throw StoppedBySignalException(gSignalReceived);
282  }
283  }
285 }
286 
287 void EventProcessor::installSignalHandler(int sig, void (*fn)(int))
288 {
289  struct sigaction s;
290  memset(&s, '\0', sizeof(s));
291 
292  s.sa_handler = fn;
293  sigemptyset(&s.sa_mask);
294  if (sig == SIGCHLD)
295  s.sa_flags |= SA_NOCLDSTOP; //don't produce signal when children are stopped
296 
297  if (sigaction(sig, &s, nullptr) != 0) {
298  B2FATAL("Cannot setup signal handler for signal " << sig);
299  }
300 }
301 
303 {
304  if (!fn)
305  fn = signalHandler;
306  installSignalHandler(SIGINT, fn);
307  installSignalHandler(SIGTERM, fn);
308  installSignalHandler(SIGQUIT, fn);
309 }
310 
311 bool EventProcessor::processEvent(PathIterator moduleIter, bool skipMasterModule)
312 {
313  double time = Utils::getClock() / Unit::s;
315  MetadataService::Instance().addBasf2Status("running event loop");
316  m_lastMetadataUpdate = time;
317  }
318 
319  const bool collectStats = !Environment::Instance().getNoStats();
320 
321  while (!moduleIter.isDone()) {
322  Module* module = moduleIter.get();
323 
324  // run the module ... unless we don't want to
325  if (!(skipMasterModule && module == m_master)) {
326  callEvent(module);
327  }
328 
329  //Check for end of data
330  if ((m_eventMetaDataPtr && (m_eventMetaDataPtr->isEndOfData())) ||
331  ((module == m_master) && !m_eventMetaDataPtr)) {
332  if (module != m_master) {
333  B2WARNING("Event processing stopped by module '" << module->getName() <<
334  "', which is not in control of event processing (does not provide EventMetaData)");
335  }
336  return true;
337  }
338 
339  //Handle EventMetaData changes by master module
340  if (module == m_master) {
341 
342  //initialize random number state for the event
344 
345  //Check for a change of the run
346  if ((m_eventMetaDataPtr->getExperiment() != m_previousEventMetaData.getExperiment()) ||
348 
349  if (collectStats)
350  m_processStatisticsPtr->suspendGlobal();
351 
352  processEndRun();
353  processBeginRun(skipMasterModule);
354 
355  if (collectStats)
356  m_processStatisticsPtr->resumeGlobal();
357  }
358 
360 
361  //make sure we use the event dependent generator again
363 
365 
366  } else {
367  //Check for a second master module. Cannot do this if we skipped the
368  //master module as the EventMetaData is probably set before we call this
369  //function
370  if (!skipMasterModule && m_eventMetaDataPtr &&
372  B2FATAL("Two modules setting EventMetaData were discovered: " << m_master->getName() << " and " << module->getName());
373  }
374  }
375 
376  if (gSignalReceived != 0) {
377  throw StoppedBySignalException(gSignalReceived);
378  }
379 
380  //Check for the module conditions, evaluate them and if one is true switch to the new path
381  if (module->evalCondition()) {
382  PathPtr condPath = module->getConditionPath();
383  //continue with parent Path after condition path is executed?
384  if (module->getAfterConditionPath() == Module::EAfterConditionPath::c_Continue) {
385  moduleIter = PathIterator(condPath, moduleIter);
386  } else {
387  moduleIter = PathIterator(condPath);
388  }
389  } else {
390  moduleIter.next();
391  }
392  } //end module loop
393  return false;
394 }
395 
396 void EventProcessor::processCore(const PathPtr& startPath, const ModulePtrList& modulePathList, long maxEvent, bool isInputProcess)
397 {
399  m_moduleList = modulePathList;
400  //Remember the previous event meta data, and identify end of data meta data
401  m_previousEventMetaData.setEndOfData(); //invalid start state
402 
403  const bool collectStats = !Environment::Instance().getNoStats();
404 
405  //Loop over the events
406  long currEvent = 0;
407  bool endProcess = false;
408  while (!endProcess) {
409  if (collectStats)
410  m_processStatisticsPtr->startGlobal();
411 
412  PathIterator moduleIter(startPath);
413  endProcess = processEvent(moduleIter, isInputProcess && currEvent == 0);
414 
415  //Delete event related data in DataStore
417 
418  currEvent++;
419  if ((maxEvent > 0) && (currEvent >= maxEvent)) endProcess = true;
420  if (collectStats)
422  } //end event loop
423 
424  //End last run
425  m_eventMetaDataPtr.create();
426  processEndRun();
427 }
428 
429 
431 {
432  MetadataService::Instance().addBasf2Status("terminating");
433 
434  LogSystem& logSystem = LogSystem::Instance();
435  ModulePtrList::const_reverse_iterator listIter;
436  m_processStatisticsPtr->startGlobal();
437 
438  for (listIter = modulePathList.rbegin(); listIter != modulePathList.rend(); ++listIter) {
439  Module* module = listIter->get();
440 
441  //Set the module dependent log level
442  logSystem.updateModule(&(module->getLogConfig()), module->getName());
443 
444  //Do termination
445  m_processStatisticsPtr->startModule();
446  CALL_MODULE(module, terminate);
448 
449  //Set the global log level
450  logSystem.updateModule(nullptr);
451  }
452 
454 }
455 
456 
458 {
459  MetadataService::Instance().addBasf2Status("beginning run");
460 
461  m_inRun = true;
462  auto dbsession = Database::Instance().createScopedUpdateSession();
463 
464  LogSystem& logSystem = LogSystem::Instance();
465  m_processStatisticsPtr->startGlobal();
466 
467  if (!skipDB) DBStore::Instance().update();
468 
469  //initialize random generator for end run
471 
472  for (const ModulePtr& modPtr : m_moduleList) {
473  Module* module = modPtr.get();
474 
475  //Set the module dependent log level
476  logSystem.updateModule(&(module->getLogConfig()), module->getName());
477 
478  //Do beginRun() call
479  m_processStatisticsPtr->startModule();
480  CALL_MODULE(module, beginRun);
482 
483  //Set the global log level
484  logSystem.updateModule(nullptr);
485  }
486 
488 }
489 
490 
492 {
494 
495  if (!m_inRun)
496  return;
497  m_inRun = false;
498 
499  LogSystem& logSystem = LogSystem::Instance();
500  m_processStatisticsPtr->startGlobal();
501 
502  const EventMetaData newEventMetaData = *m_eventMetaDataPtr;
504 
505  //initialize random generator for end run
507 
508  for (const ModulePtr& modPtr : m_moduleList) {
509  Module* module = modPtr.get();
510 
511  //Set the module dependent log level
512  logSystem.updateModule(&(module->getLogConfig()), module->getName());
513 
514  //Do endRun() call
515  m_processStatisticsPtr->startModule();
516  CALL_MODULE(module, endRun);
518 
519  //Set the global log level
520  logSystem.updateModule(nullptr);
521  }
522  *m_eventMetaDataPtr = newEventMetaData;
523 
525 }
Belle2::EventProcessor::callEvent
void callEvent(Module *module)
Calls event() on one single module, setting up logging and statistics as needed.
Definition: EventProcessor.cc:216
Belle2::Unit::s
static const double s
[second]
Definition: Unit.h:105
Belle2::EventProcessor::process
void process(const PathPtr &startPath, long maxEvent=0)
Processes the full module chain, starting with the first module in the given path.
Definition: EventProcessor.cc:125
Belle2::Environment::setNumberEventsOverride
void setNumberEventsOverride(unsigned int nevents)
Override the number of events in run 1 for EventInfoSetter module.
Definition: Environment.h:71
Belle2::PathIterator::next
void next()
increment.
Definition: PathIterator.h:59
Belle2::EventProcessor::processTerminate
void processTerminate(const ModulePtrList &modulePathList)
Terminates the modules.
Definition: EventProcessor.cc:430
Belle2::DataStore::getDependencyMap
DependencyMap & getDependencyMap()
Return map of depedencies between modules.
Definition: DataStore.h:512
Belle2::ModuleStatistics::c_Event
@ c_Event
Counting time/calls in event()
Definition: ModuleStatistics.h:45
Belle2::DataStore::Instance
static DataStore & Instance()
Instance of singleton Store.
Definition: DataStore.cc:54
Belle2::ModuleStatistics::c_EndRun
@ c_EndRun
Counting time/calls in endRun()
Definition: ModuleStatistics.h:47
Belle2::Database::createScopedUpdateSession
ScopeGuard createScopedUpdateSession()
Make sure we have efficient http pipelinging during initialize/beginRun but don't keep session alive ...
Definition: Database.cc:74
Belle2::DataStore::setInitializeActive
void setInitializeActive(bool active)
Setter for m_initializeActive.
Definition: DataStore.cc:94
Belle2::RandomNumbers::useEventDependent
static void useEventDependent()
Set Event dependent Random Generator as current one.
Definition: RandomNumbers.cc:130
Belle2::MetadataService::addBasf2Status
void addBasf2Status(const std::string &message="")
Add metadata of basf2 status.
Definition: MetadataService.cc:77
Belle2::ModuleStatistics::c_Term
@ c_Term
Counting time/calls in terminate()
Definition: ModuleStatistics.h:49
Belle2::EventProcessor::m_eventMetaDataPtr
StoreObjPtr< EventMetaData > m_eventMetaDataPtr
EventMetaData is used by processEvent()/processCore().
Definition: EventProcessor.h:173
Belle2::EventProcessor::EventProcessor
EventProcessor()
Constructor.
Definition: EventProcessor.cc:87
Belle2::EventProcessor::m_lastMetadataUpdate
double m_lastMetadataUpdate
Time in seconds of last call for metadata update in event loop.
Definition: EventProcessor.h:185
Belle2::EventProcessor::processEvent
bool processEvent(PathIterator moduleIter, bool skipMasterModule)
Calls event() functions on all modules for the current event.
Definition: EventProcessor.cc:311
Belle2::EventProcessor::StoppedBySignalException
Exception thrown when execution is stopped by a signal.
Definition: EventProcessor.h:85
Belle2::EventProcessor::writeToStdErr
static void writeToStdErr(const char msg[])
async-safe method to write something to STDERR.
Definition: EventProcessor.cc:74
Belle2::EventProcessor::m_profileModule
Module * m_profileModule
Adress of the module which we want to profile, nullptr if no profiling is requested.
Definition: EventProcessor.h:170
Belle2::DependencyMap::setModule
void setModule(const Module &mod)
Set the current module (for getCurrentModuleInfo())
Definition: DependencyMap.h:53
Belle2::EventMetaData::setEndOfData
void setEndOfData()
Marks the end of the data processing.
Definition: EventMetaData.cc:29
Belle2::Module
Base class for Modules.
Definition: Module.h:74
Belle2::EventProcessor::processBeginRun
void processBeginRun(bool skipDB=false)
Calls the begin run methods of all modules.
Definition: EventProcessor.cc:457
Belle2::EventProcessor::m_inRun
bool m_inRun
Are we currently in a run? If yes, processEndRun() needs to do something.
Definition: EventProcessor.h:182
Belle2::RandomNumbers::initializeEndRun
static void initializeEndRun()
Initialize run independent random generator for end run.
Definition: RandomNumbers.cc:99
Belle2::ModuleCondition::EAfterConditionPath::c_Continue
@ c_Continue
After the conditional path, resume execution after this module.
Belle2::EventProcessor::~EventProcessor
virtual ~EventProcessor()
Destructor.
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::LogSystem
Class for logging debug, info and error messages.
Definition: LogSystem.h:56
Belle2::ModulePtrList
std::list< ModulePtr > ModulePtrList
Defines a std::list of shared module pointers.
Definition: Module.h:586
Belle2::EventProcessor::m_profileModuleName
std::string m_profileModuleName
Name of the module which should be profiled, empty if no profiling is requested.
Definition: EventProcessor.h:167
Belle2::PathPtr
std::shared_ptr< Path > PathPtr
Defines a pointer to a path object as a boost shared pointer.
Definition: Path.h:30
LogVar
Class to store variables with their name which were sent to the logging service.
Definition: LogVariableStream.h:24
Belle2::EventProcessor::getMaximumEventNumber
long getMaximumEventNumber(long maxEvent) const
Calculate the maximum event number out of the argument from command line and the environment.
Definition: EventProcessor.cc:115
Belle2::ModulePtr
std::shared_ptr< Module > ModulePtr
Defines a pointer to a module object as a boost shared pointer.
Definition: Module.h:42
Belle2::LogConfig::c_Error
@ c_Error
Error: for things that went wrong and have to be fixed.
Definition: LogConfig.h:40
Belle2::DBStore::Instance
static DBStore & Instance()
Instance of a singleton DBStore.
Definition: DBStore.cc:36
Belle2::EventProcessor::m_moduleList
ModulePtrList m_moduleList
List of all modules in order initialized.
Definition: EventProcessor.h:164
Belle2::RandomNumbers::initializeEvent
static void initializeEvent(bool force=false)
Initialize event information.
Definition: RandomNumbers.cc:110
Belle2::EventProcessor::m_metadataUpdateInterval
double m_metadataUpdateInterval
Minimal time difference in seconds for metadata updates in event loop.
Definition: EventProcessor.h:188
Belle2::PathIterator::get
Module * get() const
dereference.
Definition: PathIterator.h:85
Belle2::LogSystem::updateModule
void updateModule(const LogConfig *moduleLogConfig=nullptr, const std::string &moduleName="")
Sets the log configuration to the given module log configuration and sets the module name This method...
Definition: LogSystem.h:201
Belle2::Environment::getNoStats
bool getNoStats() const
Disable collection of statistics during event processing.
Definition: Environment.h:189
Belle2::EventMetaData::getExperiment
int getExperiment() const
Experiment Getter.
Definition: EventMetaData.h:174
Belle2::EventProcessor::processEndRun
void processEndRun()
Calls the end run methods of all modules.
Definition: EventProcessor.cc:491
Belle2::EventProcessor::processInitialize
void processInitialize(const ModulePtrList &modulePathList, bool setEventInfo=true)
Initializes the modules.
Definition: EventProcessor.cc:232
Belle2::ModuleStatistics::c_BeginRun
@ c_BeginRun
Counting time/calls in beginRun()
Definition: ModuleStatistics.h:43
Belle2::DBStore::updateEvent
void updateEvent()
Updates all intra-run dependent objects.
Definition: DBStore.cc:150
Belle2::EventProcessor::m_processStatisticsPtr
StoreObjPtr< ProcessStatistics > m_processStatisticsPtr
Also used in a number of places.
Definition: EventProcessor.h:179
Belle2::LogSystem::Instance
static LogSystem & Instance()
Static method to get a reference to the LogSystem instance.
Definition: LogSystem.cc:33
Belle2::Utils::getClock
double getClock()
Return current value of the real-time clock.
Definition: Utils.cc:58
Belle2::EventMetaData::getRun
int getRun() const
Run Getter.
Definition: EventMetaData.h:161
Belle2::Database::Instance
static Database & Instance()
Instance of a singleton Database.
Definition: Database.cc:54
Belle2::EventMetaData
Store event, run, and experiment numbers.
Definition: EventMetaData.h:43
Belle2::Environment::getNumberEventsOverride
unsigned int getNumberEventsOverride() const
Returns number of events in run 1 for EventInfoSetter module, or 0 for no override.
Definition: Environment.h:74
Belle2::EventProcessor::processCore
void processCore(const PathPtr &startPath, const ModulePtrList &modulePathList, long maxEvent=0, bool isInputProcess=true)
Processes the full module chain consisting of an arbitrary number of connected paths,...
Definition: EventProcessor.cc:396
Belle2::DataFlowVisualization
class to visualize data flow between modules.
Definition: DataFlowVisualization.h:34
Belle2::Environment::Instance
static Environment & Instance()
Static method to get a reference to the Environment instance.
Definition: Environment.cc:31
Belle2::RandomNumbers::initializeBeginRun
static void initializeBeginRun()
Initialize run independent random generator for begin run.
Definition: RandomNumbers.cc:87
Belle2::MetadataService::Instance
static MetadataService & Instance()
Static method to get a reference to the MetadataService instance.
Definition: MetadataService.cc:28
Belle2::PathIterator
Iterator over a Path (returning Module pointers).
Definition: PathIterator.h:36
Belle2::EventProcessor::m_master
const Module * m_master
The master module that determines the experiment/run/event number.
Definition: EventProcessor.h:163
Belle2::DataStore::c_Event
@ c_Event
Different object in each event, all objects/arrays are invalidated after event() function has been ca...
Definition: DataStore.h:61
Belle2::EventProcessor::m_previousEventMetaData
EventMetaData m_previousEventMetaData
Stores state of EventMetaData before it was last changed.
Definition: EventProcessor.h:176
Belle2::LogSystem::printErrorSummary
void printErrorSummary()
Print error/warning summary at end of execution.
Definition: LogSystem.cc:210
Belle2::Module::getName
const std::string & getName() const
Returns the name of the module.
Definition: Module.h:189
Belle2::PathIterator::isDone
bool isDone() const
Are we finished iterating?
Definition: PathIterator.h:82
Belle2::DataStore::invalidateData
void invalidateData(EDurability durability)
Clears all registered StoreEntry objects of a specified durability, invalidating all objects.
Definition: DataStore.cc:689
Belle2::DataStore
In the store you can park objects that have to be accessed by various modules.
Definition: DataStore.h:53
Belle2::EventProcessor::installSignalHandler
static void installSignalHandler(int sig, void(*fn)(int))
Install a signal handler 'fn' for given signal.
Definition: EventProcessor.cc:287
Belle2::LogSystem::getMessageCounter
int getMessageCounter(LogConfig::ELogLevel logLevel) const
Returns the number of logging calls per log level.
Definition: LogSystem.cc:165
Belle2::DBStore::update
void update()
Updates all objects that are outside their interval of validity.
Definition: DBStore.cc:87
Belle2::EventProcessor::installMainSignalHandlers
static void installMainSignalHandlers(void(*fn)(int)=nullptr)
Install signal handler for INT, TERM and QUIT signals.
Definition: EventProcessor.cc:302
Belle2::ModuleStatistics::c_Init
@ c_Init
Counting time/calls in initialize()
Definition: ModuleStatistics.h:41