Belle II Software  release-05-02-19
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 10 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 16 of file per_event_statistics.py.

16  def __init__(self, output_file_name):
17  """
18  Create a new PerEventStatisticsGetterModule. You have to give the name of the
19  file, where the TTree with the full event statistics will be saved.
20  """
21  super().__init__()
22 
23 
24  self.output_file_name = output_file_name
25 
26  self.tfile = None
27 
28  self.statistics = None
29 
30 
31  self.event_number = np.zeros(3, dtype=float)
32 
33  self.ttree_inputs = None
34 
35  self.last_time_sum = None
36 
37 
38  self.branches_added = False
39 
40 
41  self.event_meta_data = Belle2.PyStoreObj("EventMetaData")
42 

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 67 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 43 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 118 of file per_event_statistics.py.


The documentation for this class was generated from the following file:
Belle2::PyStoreObj
a (simplified) python wrapper for StoreObjPtr.
Definition: PyStoreObj.h:69