Belle II Software  release-08-01-10
crossTalkSkim_util.py
1 # !/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 #
13 # util to skim out cross talk event in the origami sensors
14 #
15 # requires svdCrossTalkFinderModule to have flagged events in
16 # SVDEventInfo
17 #
18 # in order to use this function:
19 # import it:
20 # from svd.crossTalkSkim_utils import skimCrossTalkEventsModule
21 # and then use it:
22 # emptypath = create_path()
23 # skimCrossTalk.if_true(emptypath)
24 #
25 
26 import basf2
27 from ROOT import Belle2
28 
29 
30 class skimCrossTalkEventsModule(basf2.Module):
31  """
32  a basf2 pythin module to skim SVD xTalk events
33  """
34 
35  def event(self):
36  """
37  check if the xTalk flag is set and return 1 in this case
38  """
39 
40  svdEventInfo = Belle2.PyStoreObj('SVDEventInfo')
41 
42  if svdEventInfo.isCrossTalkEvent():
43 
44  self.return_value(1)
45 
46  else:
47 
48  self.return_value(0)
a (simplified) python wrapper for StoreObjPtr.
Definition: PyStoreObj.h:67