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

Public Member Functions

def event (self)
 

Static Public Attributes

int iEvent = 0
 event counter
 

Detailed Description

Test to read relations in the input files.

Definition at line 24 of file chain_input.py.

Member Function Documentation

◆ event()

def event (   self)
reimplementation of Module::event().

prints PXD true and simhit indices, using relations

Definition at line 30 of file chain_input.py.

30 def event(self):
31 """reimplementation of Module::event().
32
33 prints PXD true and simhit indices, using relations
34 """
35 filemetadata = Belle2.PyStoreObj('FileMetaData', 1)
36 nevents = filemetadata.obj().getNEvents()
37 if self.iEvent < 12 and not nevents == 12:
38 basf2.B2FATAL("FileMetaData from file 1 not loaded!")
39 elif self.iEvent >= 12 and not nevents == 15:
40 basf2.B2FATAL("FileMetaData from file 2 not loaded!")
41
42 simhits = Belle2.PyStoreArray('PXDSimHits')
43 for hit in simhits:
44 relations = hit.getRelationsFrom("PXDTrueHits")
45 for truehit in relations:
46 print(f'truehit {truehit.getArrayIndex()} => hit {hit.getArrayIndex()}')
47
48 self.iEvent += 1
49
50
A (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:72
a (simplified) python wrapper for StoreObjPtr.
Definition: PyStoreObj.h:67

Member Data Documentation

◆ iEvent

int iEvent = 0
static

event counter

Definition at line 28 of file chain_input.py.


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