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

Public Member Functions

 initialize (self)
 
 event (self)
 

Public Attributes

 eventinfo = Belle2.PyStoreObj("EventMetaData")
 an example object from the datastore (the metadata collection for the event)
 
 particles = Belle2.PyStoreArray("MCParticles")
 an example array from the datastore (the list of MC particles)
 

Detailed Description

An example of a basf2 module in python which accesses things in the datastore.

Definition at line 7 of file 085_module.py.

Member Function Documentation

◆ event()

event ( self)
Print the event number and the PDG code of the MCParticle

Definition at line 19 of file 085_module.py.

19 def event(self):
20 """Print the event number and the PDG code of the MCParticle"""
21 for particle in self.particles:
22 b2.B2INFO(
23 f"We're in event {self.eventinfo.getEvent()} "
24 f"and have a particle with PDG code {particle.getPDG()}"
25 )
26
27
28# create a path

◆ initialize()

initialize ( self)
Create a member to access event info and the MCParticles
StoreArray

Definition at line 10 of file 085_module.py.

10 def initialize(self):
11 """Create a member to access event info and the MCParticles
12 StoreArray
13 """
14
15 self.eventinfo = Belle2.PyStoreObj("EventMetaData")
16
17 self.particles = Belle2.PyStoreArray("MCParticles")
18
A (simplified) python wrapper for StoreArray.
a (simplified) python wrapper for StoreObjPtr.
Definition PyStoreObj.h:67

Member Data Documentation

◆ eventinfo

eventinfo = Belle2.PyStoreObj("EventMetaData")

an example object from the datastore (the metadata collection for the event)

Definition at line 15 of file 085_module.py.

◆ particles

particles = Belle2.PyStoreArray("MCParticles")

an example array from the datastore (the list of MC particles)

Definition at line 17 of file 085_module.py.


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