Belle II Software  release-05-02-19
RandomBarrierModule.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2013 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Christian Pulvermacher *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include <framework/modules/core/RandomBarrierModule.h>
12 #include <framework/core/RandomNumbers.h>
13 
14 
15 using namespace Belle2;
16 
17 //-----------------------------------------------------------------
18 // Register the Module
19 //-----------------------------------------------------------------
20 REG_MODULE(RandomBarrier)
21 
22 //-----------------------------------------------------------------
23 // Implementation
24 //-----------------------------------------------------------------
25 
27 {
28  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.");
29  setPropertyFlags(c_ParallelProcessingCertified);
30 }
31 
32 RandomBarrierModule::~RandomBarrierModule() = default;
33 
35 {
37 }
39 {
40  //terminate() is called in reverse order. If you use random numbers there, we can't help you.
41 }
42 
44 {
46 }
48 {
50 }
52 {
54 }
REG_MODULE
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:652
Belle2::RandomBarrierModule::terminate
virtual void terminate() override
This method is called at the end of the event processing.
Definition: RandomBarrierModule.cc:38
Belle2::RandomNumbers::barrier
static void barrier()
Increase random barrier.
Definition: RandomNumbers.cc:71
Belle2::RandomBarrierModule::event
virtual void event() override
This method is the core of the module.
Definition: RandomBarrierModule.cc:51
Belle2::RandomBarrierModule::initialize
virtual void initialize() override
Initialize the Module.
Definition: RandomBarrierModule.cc:34
Belle2::Module
Base class for Modules.
Definition: Module.h:74
Belle2::RandomBarrierModule::endRun
virtual void endRun() override
This method is called if the current run ends.
Definition: RandomBarrierModule.cc:47
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::RandomBarrierModule
Sets gRandom to an independent generator for the following modules.
Definition: RandomBarrierModule.h:41
Belle2::RandomBarrierModule::beginRun
virtual void beginRun() override
Called when entering a new run.
Definition: RandomBarrierModule.cc:43