14 This module is used
for the SVD validation.
15 It gets information about truehits, saving
in a ttree
in a ROOT file.
17 <noexecute>SVD validation helper
class</noexecute>
24from ROOT import Belle2
25from ROOT
import gROOT, addressof
28gROOT.ProcessLine(
'struct EventDataTrueHit {\
38from ROOT
import EventDataTrueHit
42 '''class to create the true hit ttree'''
45 """Initialize the module"""
49 self.
file = ROOT.TFile(
'../SVDValidationTTreeTrueHit.root',
'recreate')
51 self.
tree = ROOT.TTree(
'tree',
'Event data of SVD validation events')
53 self.
data = EventDataTrueHit()
56 for key
in EventDataTrueHit.__dict__:
59 if isinstance(self.
data.__getattribute__(key), int):
61 self.
tree.Branch(key, addressof(self.
data, key), key + formstring)
64 """ Start with truehits and use the relation to get the corresponding clusters """
66 for truehit
in svdtruehits:
67 clusters = truehit.getRelationsFrom(
'SVDClusters')
69 if len(clusters) == 0:
70 self.
data.reconstructed = 0
72 sensorID = truehit.getSensorID()
73 self.
data.sensor_id = int(sensorID)
74 sensorNum = sensorID.getSensorNumber()
75 self.
data.sensor = sensorNum
76 layerNum = sensorID.getLayerNumber()
77 self.
data.layer = layerNum
85 self.
data.sensor_type = sensorType
86 ladderNum = sensorID.getLadderNumber()
87 self.
data.ladder = ladderNum
88 self.
data.strip_dir = -1
93 for cluster
in clusters:
94 self.
data.reconstructed = 1
96 sensorID = truehit.getSensorID()
97 self.
data.sensor_id = int(sensorID)
98 sensorNum = sensorID.getSensorNumber()
99 self.
data.sensor = sensorNum
100 layerNum = sensorID.getLayerNumber()
101 self.
data.layer = layerNum
109 self.
data.sensor_type = sensorType
110 ladderNum = sensorID.getLadderNumber()
111 self.
data.ladder = ladderNum
112 if cluster.isUCluster():
113 self.
data.strip_dir = 0
115 self.
data.strip_dir = 1
121 """Close the output file. """
A (simplified) python wrapper for StoreArray.
data
instance of EventDataTrueHit class