Belle II Software  release-08-01-10
AccessingDataStoreModule Class Reference
Inheritance diagram for AccessingDataStoreModule:
Collaboration diagram for AccessingDataStoreModule:

Public Member Functions

def initialize (self)
 
def event (self)
 

Public Attributes

 eventinfo
 an example object from the datastore (the metadata collection for the event)
 
 particles
 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 087_module.py.

Member Function Documentation

◆ event()

def event (   self)
Print the number of charged particles and the total charge

Definition at line 19 of file 087_module.py.

19  def event(self):
20  """Print the number of charged particles and the total charge"""
21  n_charged = 0
22  total_charge = 0
23  for particle in self.particles:
24  charge = particle.getCharge()
25  if charge:
26  n_charged += 1
27  total_charge += charge
28 
29  b2.B2INFO(
30  f"Number of charged particles = {n_charged}, "
31  f"total charge of event = {total_charge}"
32  )
33 
34 
35 # create a path

◆ initialize()

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

Definition at line 10 of file 087_module.py.


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