Belle II Software  release-06-01-15
RandomBarrierModule.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #include <framework/modules/core/RandomBarrierModule.h>
10 #include <framework/core/RandomNumbers.h>
11 
12 
13 using namespace Belle2;
14 
15 //-----------------------------------------------------------------
16 // Register the Module
17 //-----------------------------------------------------------------
18 REG_MODULE(RandomBarrier)
19 
20 //-----------------------------------------------------------------
21 // Implementation
22 //-----------------------------------------------------------------
23 
25 {
26  setDescription("Sets gRandom to an independent generator for the following modules. E.g. a module chain of the sort [ParticleGun -> RandomBarrier -> FullSim] would use one RNG instance for the ParticleGun, and another for FullSim and all following modules. You may find this useful if you want to change the simulation, but don't want differences to affect the particle generation. The output is equivalent to saving the output of ParticleGun in a file, and reading it again to do the simulation. Correct separation is not provided for terminate(), don't use random numbers there.");
27  setPropertyFlags(c_ParallelProcessingCertified);
28 }
29 
30 RandomBarrierModule::~RandomBarrierModule() = default;
31 
33 {
35 }
37 {
38  //terminate() is called in reverse order. If you use random numbers there, we can't help you.
39 }
40 
42 {
44 }
46 {
48 }
50 {
52 }
Base class for Modules.
Definition: Module.h:72
Sets gRandom to an independent generator for the following modules.
virtual void initialize() override
Initialize the Module.
virtual void event() override
This method is the core of the module.
virtual void endRun() override
This method is called if the current run ends.
virtual void terminate() override
This method is called at the end of the event processing.
virtual void beginRun() override
Called when entering a new run.
static void barrier()
Increase random barrier.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:650
Abstract base class for different kinds of events.