12from ROOT
import Belle2, TFile, TTree, gROOT
20inputFile = sys.argv[1]
21outputFile = sys.argv[2]
23svd_Clusters =
"SVDClusters"
24svd_ClustersFromTracks =
"SVDClustersFromTracks"
25svd_EventInfo =
"SVDEventInfo"
26svd_EventMD =
"EventMetaData"
35 Class used to check the goodness of the CoG time calibration
40 Initialize object (histograms, lists, ...) used by the class
45 self.layer = np.zeros(1, dtype=int)
51 self.side = np.zeros(1, dtype=int)
53 self.TB = np.zeros(1, dtype=int)
65 self.clsSNR = np.zeros(1, dtype=float)
67 self.run = np.zeros(1, dtype=int)
69 self.exp = np.zeros(1, dtype=int)
96 self.
tree = TTree(
'cls',
'tree')
98 self.
tree.Branch(
'layer', self.
layer,
'layer/I')
100 self.
tree.Branch(
'ladder', self.
ladder,
'ladder/I')
102 self.
tree.Branch(
'sensor', self.
sensor,
'sensor/I')
104 self.
tree.Branch(
'side', self.
side,
'side/I')
106 self.
tree.Branch(
'tb', self.
TB,
'tb/I')
112 self.
tree.Branch(
'clsTime', self.
clsTime,
'clsTime/D')
114 self.
tree.Branch(
'clsSize', self.
clsSize,
'clsSize/D')
118 self.
tree.Branch(
'clsSNR', self.
clsSNR,
'clsSNR/D')
120 self.
tree.Branch(
'run', self.
run,
'run/I')
122 self.
tree.Branch(
'exp', self.
exp,
'exp/I')
155 Function that allows to cicle on the events
161 clsTB = svd_evtInfo.getModeByte().getTriggerBin()
162 self.TB[0] = ord(clsTB)
164 self.run[0] = svd_evtMD.getRun()
165 self.exp[0] = svd_evtMD.getExperiment()
167 for svdCluster
in svd_cls:
168 self.
clsTime[0] = svdCluster.getClsTime()
169 self.
clsSize[0] = svdCluster.getSize()
170 self.
clsCharge[0] = svdCluster.getCharge()
171 self.
clsSNR[0] = svdCluster.getSNR()
172 self.
layer[0] = svdCluster.getSensorID().getLayerNumber()
173 self.
ladder[0] = svdCluster.getSensorID().getLadderNumber()
174 self.
sensor[0] = svdCluster.getSensorID().getSensorNumber()
175 self.
side[0] = svdCluster.isUCluster()
177 self.
ftswShift = svd_evtInfo.getSVD2FTSWTimeShift(svdCluster.getFirstFrame())
178 hasT0 = et0.hasEventT0()
180 self.
evtTime[0] = et0.getEventT0()
187 for svdClusterTracks
in svd_clsFromTrks:
192 self.
layerTracks[0] = svdClusterTracks.getSensorID().getLayerNumber()
193 self.
ladderTracks[0] = svdClusterTracks.getSensorID().getLadderNumber()
194 self.
sensorTracks[0] = svdClusterTracks.getSensorID().getSensorNumber()
195 self.
sideTracks[0] = svdClusterTracks.isUCluster()
198 hasT0 = et0.hasEventT0()
209 Terminates te class and produces the output rootfile
223main = b2.create_path()
225rootinput = b2.register_module(
'RootInput')
226rootinput.param(
'inputFileName', inputFile)
227main.add_module(rootinput)
235progress = b2.register_module(
'Progress')
236main.add_module(progress)
A (simplified) python wrapper for StoreArray.
a (simplified) python wrapper for StoreObjPtr.