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

Public Member Functions

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

Public Attributes

 file
 Input file object.
 

Detailed Description

A module to gather data on charge sharing in the SVD.

Definition at line 18 of file SVDChargeSharing.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self)
Initialize the module

Definition at line 22 of file SVDChargeSharing.py.

22 def __init__(self):
23 """Initialize the module"""
24
25 super().__init__()
26
27 self.file = open('SVDChargeSharingData.txt', 'w')
28

Member Function Documentation

◆ beginRun()

def beginRun (   self)
 Write legend for file columns 

Definition at line 29 of file SVDChargeSharing.py.

29 def beginRun(self):
30 """ Write legend for file columns """
31
32 self.file.write('sensor_type layer ladder sensor truehit_index cluster_index ')
33 self.file.write('truehit_u truehit_eta_u truehit_v truehit_eta_v charge_keV ')
34 self.file.write('theta_u theta_v cluster_isU cluster_pos cluster_eta ')
35 self.file.write('cluster_charge_ADU seed_charge_ADU cluster_size\n')
36

◆ event()

def event (   self)
Find clusters with a truehit and print some stats.

Definition at line 37 of file SVDChargeSharing.py.

37 def event(self):
38 """Find clusters with a truehit and print some stats."""
39
40 # truehits = Belle2.PyStoreArray('SVDTrueHits')
41 # nTruehits = truehits.getEntries()
42 clusters = Belle2.PyStoreArray('SVDClusters')
43 nClusters = clusters.getEntries()
44 print("nClusters = "+str(nClusters))
46 # Start with clusters and use the relation to get the corresponding
47 # digits and truehits.
48 for cluster_index in range(nClusters):
49 cluster = clusters[cluster_index]
50 # Get SensorInfo for the sensor
51 truehit = cluster.getRelated('SVDTrueHits')
52 # Here we ask only for clusters with exactly one TrueHit.
53 if (not truehit):
54 continue
55
56 # Now let's store some data
57 s = ''
58 # Sesnor identification
59 sensorID = Belle2.VxdID(truehit.getRawSensorID())
60 info = geoCache.get(sensorID)
61 layer = sensorID.getLayerNumber()
62 ladder = sensorID.getLadderNumber()
63 sensor = sensorID.getSensorNumber()
64 # No wedge sensor data
65 if sensor == 1 and layer != 3:
66 continue
67
68 sensorType = 'barrel' if layer > 3 else 'layer3'
69 s += f'{sensorType} {layer} {ladder} {sensor} {truehit.getArrayIndex():4d} {cluster_index:4d} '
70 # TrueHit information
71 truehit_u = truehit.getU()
72 truehit_v = truehit.getV()
73 pitch_u = info.getUPitch()
74 truehit_eta_u = (truehit_u / pitch_u) % 1
75 pitch_v = info.getVPitch()
76 truehit_eta_v = (truehit_v / pitch_v) % 1
77 thetaU = math.atan2(truehit.getExitU() - truehit.getEntryU(),
78 info.getThickness())
79 thetaV = math.atan2(truehit.getExitV() - truehit.getEntryV(),
80 info.getThickness())
81 s += f'{truehit_u:10.5f} {truehit_eta_u:10.5f} {truehit_v:10.5f} {truehit_eta_v:10.5f} ' + \
82 f'{1.0e6 * truehit.getEnergyDep():10.7f} {thetaU:6.3f} {thetaV:6.3f} '
83 # Cluster information
84 cluster_pitch = (pitch_u if cluster.isUCluster() else pitch_v)
85 cluster_eta = (cluster.getPosition() / cluster_pitch) % 1
86 s += f'{cluster.isUCluster()} {cluster.getPosition():10.5f} {cluster_eta:10.5f} {cluster.getCharge():10.1f} ' + \
87 f'{cluster.getSeedCharge():10.1f} {cluster.getSize():5d}'
88 s += '\n'
89 self.file.write(s)
90
A (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:72
static GeoCache & getInstance()
Return a reference to the singleton instance.
Definition: GeoCache.cc:214
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33

◆ terminate()

def terminate (   self)
 Close the output file.

Definition at line 91 of file SVDChargeSharing.py.

91 def terminate(self):
92 """ Close the output file."""
93
94 self.file.close()

Member Data Documentation

◆ file

file

Input file object.

Definition at line 27 of file SVDChargeSharing.py.


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