Belle II Software
release-05-02-19
Main Page
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Variables
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Typedefs
a
b
c
d
e
h
i
l
m
n
p
r
s
t
v
w
Enumerations
Enumerator
c
d
f
p
t
u
v
w
Classes
Class List
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Enumerations
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
Enumerator
a
b
c
d
e
f
g
h
k
l
m
n
o
p
r
s
t
u
v
w
z
Related Functions
b
c
d
g
i
o
r
s
t
Files
File List
File Members
All
Functions
PrescaleModule.cc
1
/**************************************************************************
2
* BASF2 (Belle Analysis Framework 2) *
3
* Copyright(C) 2010 - Belle II Collaboration *
4
* *
5
* Author: The Belle II Collaboration *
6
* Contributors: David Dossett *
7
* *
8
* This software is provided "as is" without any warranty. *
9
**************************************************************************/
10
11
#include <framework/modules/core/PrescaleModule.h>
12
#include <TRandom.h>
13
14
using namespace
Belle2
;
15
16
//-----------------------------------------------------------------
17
// Register the Module
18
//-----------------------------------------------------------------
19
REG_MODULE
(Prescale)
20
21
//-----------------------------------------------------------------
22
// Implementation
23
//-----------------------------------------------------------------
24
25
PrescaleModule
::
PrescaleModule
() :
Module
()
26
{
27
//Set module properties
28
setDescription(
"Returns True or False randomly for each event. "
29
"Fraction of the time that True is returned is set by the 'prescale' parameter. "
30
"You can use conditional basf2 paths to allow only the events that return True (or False) to continue."
);
31
32
setPropertyFlags(c_ParallelProcessingCertified);
33
34
addParam(
"prescale"
, m_prescale,
"Fraction of events that will return True from this module. Range(0.0 -> 1.0)"
,
double
(1.0));
35
}
36
37
void
PrescaleModule::event
()
38
{
39
setReturnValue
(gRandom->Uniform() <
m_prescale
);
40
}
REG_MODULE
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition:
Module.h:652
Belle2::PrescaleModule::event
virtual void event() override
Sets the return value by running a RNG vs.
Definition:
PrescaleModule.cc:37
Belle2::Module
Base class for Modules.
Definition:
Module.h:74
Belle2
Abstract base class for different kinds of events.
Definition:
MillepedeAlgorithm.h:19
Belle2::Module::setReturnValue
void setReturnValue(int value)
Sets the return value for this module as integer.
Definition:
Module.cc:222
Belle2::PrescaleModule
The Prescale module.
Definition:
PrescaleModule.h:36
Belle2::PrescaleModule::m_prescale
double m_prescale
Prescale module parameter, this fraction of events will return True.
Definition:
PrescaleModule.h:52
framework
modules
core
src
PrescaleModule.cc
Generated on Tue Jan 4 2022 02:56:52 for Belle II Software by
1.8.17