Belle II Software  release-08-01-10
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 13 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 19 of file per_event_statistics.py.

19  def __init__(self, output_file_name):
20  """
21  Create a new PerEventStatisticsGetterModule. You have to give the name of the
22  file, where the TTree with the full event statistics will be saved.
23  """
24  super().__init__()
25 
26 
27  self.output_file_name = output_file_name
28 
29  self.tfile = None
30 
31  self.statistics = None
32 
33 
34  self.event_number = np.zeros(3, dtype=float)
35 
36  self.ttree_inputs = None
37 
38  self.last_time_sum = None
39 
40 
41  self.branches_added = False
42 
43  # Always avoid the top-level 'import ROOT'.
44  import ROOT # noqa
45 
46 
47  self.event_meta_data = ROOT.Belle2.PyStoreObj("EventMetaData") # noqa
48 

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 76 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 49 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 130 of file per_event_statistics.py.


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