Belle II Software  release-06-02-00
PerEventStatisticsGetterModule Class Reference
Inheritance diagram for PerEventStatisticsGetterModule:
Collaboration diagram for PerEventStatisticsGetterModule:

Public Member Functions

def __init__ (self, output_file_name)
 
def initialize (self)
 
def event (self)
 
def terminate (self)
 

Public Attributes

 output_file_name
 Name of the output file.
 
 tfile
 Will host the pointer to the opened TFile later.
 
 statistics
 Will host the TTree later.
 
 event_number
 The columns to store the event number.
 
 ttree_inputs
 The columns for the statistics TTree (they will be filled in the event function).
 
 last_time_sum
 Last recored sum of event calls for all modules.
 
 branches_added
 A flag to indicate that we have already added the Branches to the TTree (which we will do in the first event)
 
 event_meta_data
 The event meta data.
 

Detailed Description

A basf2 python module to export *all* module time statistics (of every event, not just averaged)
 into a ROOT TTree written to a file.

Definition at line 17 of file per_event_statistics.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  output_file_name 
)
Create a new PerEventStatisticsGetterModule. You have to give the name of the
file, where the TTree with the full event statistics will be saved.

Reimplemented in SVDExtraEventStatisticsModule.

Definition at line 23 of file per_event_statistics.py.

23  def __init__(self, output_file_name):
24  """
25  Create a new PerEventStatisticsGetterModule. You have to give the name of the
26  file, where the TTree with the full event statistics will be saved.
27  """
28  super().__init__()
29 
30 
31  self.output_file_name = output_file_name
32 
33  self.tfile = None
34 
35  self.statistics = None
36 
37 
38  self.event_number = np.zeros(3, dtype=float)
39 
40  self.ttree_inputs = None
41 
42  self.last_time_sum = None
43 
44 
45  self.branches_added = False
46 
47 
48  self.event_meta_data = Belle2.PyStoreObj("EventMetaData")
49 
a (simplified) python wrapper for StoreObjPtr.
Definition: PyStoreObj.h:67

Member Function Documentation

◆ event()

def event (   self)
The event loop: Store the statistics as a new row in the TTree.

Reimplemented in SVDExtraEventStatisticsModule.

Definition at line 74 of file per_event_statistics.py.

◆ initialize()

def initialize (   self)
Create the needed store object pointer in the DataStore and the TFile with the TTree.

Reimplemented in SVDExtraEventStatisticsModule.

Definition at line 50 of file per_event_statistics.py.

◆ terminate()

def terminate (   self)
Write out the merged statistics to the ROOT file.
This should only be called once, as we would end up with different versions otherwise.

Definition at line 125 of file per_event_statistics.py.


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