Belle II Software development
SetMetaTimeModule Class Reference
Inheritance diagram for SetMetaTimeModule:

Public Member Functions

def initialize (self)
 
def calc_time (self, it)
 
def event (self)
 

Public Attributes

 meta
 Store object of EventMetaData.
 
 raws
 list of raw dataobjects
 

Static Public Attributes

str detectorlist = "SVD CDC ECL TOP"
 List of detector names to check in that order (for fallback)
 
None meta = None
 pointer to event meta data
 
list raws = []
 array of pointers to the detector raw data arrays
 

Detailed Description

module which sets time in EventMetaData from detector raw data

Author: bjoern.spruck@belle2.org

Definition at line 16 of file SetMetaTimeModule.py.

Member Function Documentation

◆ calc_time()

def calc_time (   self,
  it 
)
Calculate the time in ns since epoch from UnixTime and Accelerator Clock count

Definition at line 43 of file SetMetaTimeModule.py.

43 def calc_time(self, it):
44 """Calculate the time in ns since epoch from UnixTime and Accelerator Clock count"""
45 # t = it.GetTTTimeNs(0)
46 return it.GetTTUtime(0) * 1000000000 + int(round(it.GetTTCtime(0) / 0.127216))
47

◆ event()

def event (   self)
event

Definition at line 48 of file SetMetaTimeModule.py.

48 def event(self):
49 """event"""
50 if not self.meta.isValid():
51 B2FATAL("no valid EventMetaData object in this event")
52 return
53
54 t = self.meta.getTime() # Check if it already set, t=0 means not set
55 if t != 0:
56 return # No need to update
57
58 for det in self.raws:
59 if det:
60 for it in det:
61 t = self.calc_time(it)
62 self.meta.setTime(t)
63 return
64
65 B2DEBUG(1, "No time for EventMetaData extracted as no raw data entries were available from selected detectors")

◆ initialize()

def initialize (   self)
initialize

Definition at line 33 of file SetMetaTimeModule.py.

33 def initialize(self):
34 """initialize"""
35
36 self.meta = Belle2.PyStoreObj('EventMetaData')
37 if not self.meta:
38 B2FATAL("no EventMetaData object")
39 return
40
41 self.raws = [Belle2.PyStoreArray(f"Raw{e}s") for e in self.detectorlist.split()]
42
A (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:72
a (simplified) python wrapper for StoreObjPtr.
Definition: PyStoreObj.h:67

Member Data Documentation

◆ detectorlist

str detectorlist = "SVD CDC ECL TOP"
static

List of detector names to check in that order (for fallback)

Definition at line 25 of file SetMetaTimeModule.py.

◆ meta [1/2]

None meta = None
static

pointer to event meta data

Definition at line 28 of file SetMetaTimeModule.py.

◆ meta [2/2]

meta

Store object of EventMetaData.

Definition at line 36 of file SetMetaTimeModule.py.

◆ raws [1/2]

list raws = []
static

array of pointers to the detector raw data arrays

Definition at line 31 of file SetMetaTimeModule.py.

◆ raws [2/2]

raws

list of raw dataobjects

Definition at line 41 of file SetMetaTimeModule.py.


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