14 <contact>G. Casarosa giulia.casarosa@desy.de</contact>
16 This module is used for the SVD validation.
17 It gets information about SpacePoints, saving
18 in a ttree in a ROOT file.
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 digit with a cluster and save needed information"""
73 for sp
in spacepoints:
76 sensorID = sp.getVxdID()
77 self.
datadata.sensor_id = int(sensorID)
78 sensorNum = sensorID.getSensorNumber()
79 self.
datadata.sensor = sensorNum
80 layerNum = sensorID.getLayerNumber()
83 sp_type = sp.getType()
87 self.
datadata.layer = layerNum
95 self.
datadata.sensor_type = sensorType
96 ladderNum = sensorID.getLadderNumber()
97 self.
datadata.ladder = ladderNum
102 self.
datadata.time_u = timeU
103 self.
datadata.time_v = timeV
110 """Close the output file. """
112 self.
filefile.Write()
113 self.
filefile.Close()
a (simplified) python wrapper for StoreArray.
data
instance of EventDataSpacePoint class