15 This module is used for the SVD validation.
16 It gets information about all SpacePoints, saving
17 in a ttree in a ROOT file.
19 <noexecute>SVD validation helper class</noexecute>
27 from ROOT
import Belle2
28 from ROOT
import gROOT, addressof
31 gROOT.ProcessLine(
'struct EventDataSpacePoint {\
41 from ROOT
import EventDataSpacePoint
45 '''class to create spacepoint ttree'''
48 """Initialize the module"""
50 super(SVDValidationTTreeSpacePoint, self).
__init__()
52 self.
filefile = ROOT.TFile(
'../SVDValidationTTreeSpacePoint.root',
'recreate')
54 self.
treetree = ROOT.TTree(
'tree',
'Event data of SVD validation events')
56 self.
datadata = EventDataSpacePoint()
59 for key
in EventDataSpacePoint.__dict__:
62 if isinstance(self.
datadata.__getattribute__(key), int):
64 self.
treetree.Branch(key, addressof(self.
datadata, key), key + formstring)
67 """Find SVD SpacePoints in the event"""
71 for sp
in spacepoints:
74 sensorID = sp.getVxdID()
75 self.
datadata.sensor_id = int(sensorID)
76 sensorNum = sensorID.getSensorNumber()
77 self.
datadata.sensor = sensorNum
78 layerNum = sensorID.getLayerNumber()
81 sp_type = sp.getType()
85 self.
datadata.layer = layerNum
93 self.
datadata.sensor_type = sensorType
94 self.
datadata.ladder = sensorID.getLadderNumber()
97 self.
datadata.time_u = sp.TimeU()
98 self.
datadata.time_v = sp.TimeV()
105 """Close the output file. """
107 self.
filefile.Write()
108 self.
filefile.Close()
A (simplified) python wrapper for StoreArray.
data
instance of EventDataSpacePoint class