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

Public Member Functions

def __init__ (self)
 
def initialize (self)
 
def beginRun (self)
 
def event (self)
 
def terminate (self)
 

Detailed Description

Prints global coordinates of PXD hits to demonstrate the Pythonized
VXD::GeoCache.
Only SensorInfoBase is Pythonized (not PXD:SensorInfo and SVD::SensorInfo),
so that there is currently no access to specific PXD/SVD sensor features
(like PXD bulk doping or SVD APV25 time constants - such support can be
easily added, if desired, by placing the classes in the corresponding
linkdef.h file.
Complete geometry and sensor matrix information is, however, available
for all sensor types.

Definition at line 18 of file GeoCacheDemo.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self)
Initialize the module

Definition at line 31 of file GeoCacheDemo.py.

31 def __init__(self):
32 """Initialize the module"""
33
34 super().__init__()
35

Member Function Documentation

◆ beginRun()

def beginRun (   self)
 Does nothing 

Definition at line 39 of file GeoCacheDemo.py.

39 def beginRun(self):
40 """ Does nothing """
41

◆ event()

def event (   self)
Prints out PXD hits in global coordinates.

Definition at line 42 of file GeoCacheDemo.py.

42 def event(self):
43 """Prints out PXD hits in global coordinates."""
44
46 # PXD clusters
47 pxd_clusters = Belle2.PyStoreArray("PXDClusters")
48 if pxd_clusters.getEntries() > 0:
49 id = pxd_clusters[0].getSensorID()
50 info = geoCache.get(id)
51 else:
52 b2.B2INFO("No PXD hits in this event.")
53
54 for cluster in pxd_clusters:
55 if id != cluster.getSensorID(): # next sensor
56 id = cluster.getSensorID()
57 info = geoCache.get(id)
58 b2.B2INFO(f"Layer: {id.getLayerNumber()}, Ladder: {id.getLadderNumber()}, Sensor: {id.getSensorNumber()}")
59
60 r_local = ROOT.TVector3(cluster.getU(), cluster.getV(), 0)
61 r_global = info.pointToGlobal(r_local)
62 b2.B2INFO(f'PXD hit: {r_global.X():10.5f} {r_global.Y():10.5f} {r_global.Z():10.5f}')
63
A (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:72
static GeoCache & getInstance()
Return a reference to the singleton instance.
Definition: GeoCache.cc:214

◆ initialize()

def initialize (   self)
 Does nothing 

Definition at line 36 of file GeoCacheDemo.py.

36 def initialize(self):
37 """ Does nothing """
38

◆ terminate()

def terminate (   self)
 Do nothing 

Definition at line 64 of file GeoCacheDemo.py.

64 def terminate(self):
65 """ Do nothing """
66
67
68# Particle gun module

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