Belle II Software light-2406-ragdoll
TestDoWhile Class Reference
Inheritance diagram for TestDoWhile:
Collaboration diagram for TestDoWhile:

Public Member Functions

def __init__ (self)
 
def event (self)
 

Public Attributes

 eventInfo
 use the event meta info to store the iterations
 

Detailed Description

Small test module to print something in Path.doWhile

Definition at line 16 of file dowhile.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self)
Remember how many iterations we want

Definition at line 19 of file dowhile.py.

19 def __init__(self):
20 """Remember how many iterations we want"""
21 super().__init__()
22
23 self.eventInfo = Belle2.PyStoreObj("EventMetaData")
24
a (simplified) python wrapper for StoreObjPtr.
Definition: PyStoreObj.h:67

Member Function Documentation

◆ event()

def event (   self)
Print the current iteration for this event as well as the first five random numbers

Definition at line 25 of file dowhile.py.

25 def event(self):
26 """Print the current iteration for this event as well as the first five random numbers"""
27 weight = self.eventInfo.getGeneratedWeight()
28 B2INFO(f"Current Iteration: {weight}")
29 rndm = [f"{gRandom.Rndm():.4f}" for i in range(5)]
30 B2INFO(f"First 5 random numbers: {rndm}")
31 weight += 1
32 self.eventInfo.setGeneratedWeight(weight)
33 self.return_value(weight > self.eventInfo.getRun())
34
35

Member Data Documentation

◆ eventInfo

eventInfo

use the event meta info to store the iterations

Definition at line 23 of file dowhile.py.


The documentation for this class was generated from the following file: