6 <contact>G. Casarosa giulia.casarosa@desy.de</contact>
8 This module is used for the SVD validation.
9 It gets information about SpacePoints, saving
10 in a ttree in a ROOT file.
21 from ROOT
import Belle2
22 from ROOT
import gROOT, AddressOf
23 from ROOT
import PyConfig
24 from ROOT
import TVector3
27 gROOT.ProcessLine(
'struct EventDataSpacePoint {\
37 from ROOT
import EventDataSpacePoint
41 '''class to create spacepoint ttree'''
44 """Initialize the module"""
46 super(SVDValidationTTreeSpacePoint, self).
__init__()
47 self.
file = ROOT.TFile(
'../SVDValidationTTreeSpacePoint.root',
'recreate')
48 '''Output ROOT file'''
49 self.
tree = ROOT.TTree(
'tree',
'Event data of SVD validation events')
50 '''TTrees for output data'''
51 self.
data = EventDataSpacePoint()
52 '''Instance of the EventDataSpacePoint class'''
55 for key
in EventDataSpacePoint.__dict__:
58 if isinstance(self.
data.__getattribute__(key), int):
60 self.
tree.Branch(key, AddressOf(self.
data, key), key + formstring)
63 """Find digit with a cluster and save needed information"""
69 for sp
in spacepoints:
72 sensorID = sp.getVxdID()
73 self.
data.sensor_id = int(sensorID)
74 sensorNum = sensorID.getSensorNumber()
75 self.
data.sensor = sensorNum
76 layerNum = sensorID.getLayerNumber()
79 sp_type = sp.getType()
83 self.
data.layer = layerNum
91 self.
data.sensor_type = sensorType
92 ladderNum = sensorID.getLadderNumber()
93 self.
data.ladder = ladderNum
98 self.
data.time_u = timeU
99 self.
data.time_v = timeV
106 """Close the output file. """