Belle II Software development
svdCoGCalibrationAnalysisTool Class Reference
Inheritance diagram for svdCoGCalibrationAnalysisTool:

Public Member Functions

def initialize (self)
 
def event (self)
 
def terminate (self)
 

Public Attributes

 outputFileName
 name of the output file provided by the user
 
 layer
 layer array for the tree
 
 ladder
 ladder array for the tree
 
 sensor
 sensor array for the tree
 
 side
 side array for the tree
 
 TB
 TB array for the tree.
 
 evtTime
 T0 array for the tree.
 
 evtTimeSync
 T0Sync array for the tree.
 
 clsTime
 cluster time array for the tree
 
 clsSize
 cluster size array for the tree
 
 clsCharge
 cluster charge array for the tree
 
 clsSNR
 cluster SNR array for the tree
 
 run
 run number array for the tree
 
 exp
 experiment number array for the tree
 
 layerTracks
 layer array for the tree for clusters associated to tracks
 
 ladderTracks
 ladder array for the tree for clusters associated to tracks
 
 sensorTracks
 sensor array for the tree for clusters associated to tracks
 
 sideTracks
 side array for the tree for clusters associated to tracks
 
 evtTimeTracks
 T0 array for the tree for clusters associated to tracks.
 
 evtTimeSyncTracks
 T0Sync array for the tree for clusters associated to tracks.
 
 clsTimeTracks
 cluster time array for the tree for clusters associated to tracks
 
 clsSizeTracks
 cluster size array for the tree for clusters associated to tracks
 
 clsChargeTracks
 cluster charge array for the tree for clusters associated to tracks
 
 clsSNRTracks
 cluster SNR array for the tree for clusters associated to tracks
 
 tree
 tree for clusters
 
 treeTracks
 tree for clusters, branch for layer number
 
 ftswShift
 correction to pass to the FTSW reference system
 
 ftswShiftTracks
 correction to pass to the FTSW reference system
 
 tFile
 creation of TFile
 

Detailed Description

Class used to check the goodness of the CoG time calibration

Definition at line 33 of file svdCoGCalibrationAnalysisToolModule.py.

Member Function Documentation

◆ event()

def event (   self)
Function that allows to cicle on the events

Definition at line 153 of file svdCoGCalibrationAnalysisToolModule.py.

153 def event(self):
154 """
155 Function that allows to cicle on the events
156 """
157 svd_cls = Belle2.PyStoreArray(svd_Clusters)
158 svd_clsFromTrks = Belle2.PyStoreArray(svd_ClustersFromTracks)
159 et0 = Belle2.PyStoreObj(time0)
160 svd_evtInfo = Belle2.PyStoreObj(svd_EventInfo)
161 clsTB = svd_evtInfo.getModeByte().getTriggerBin()
162 self.TB[0] = ord(clsTB)
163 svd_evtMD = Belle2.PyStoreObj(svd_EventMD)
164 self.run[0] = svd_evtMD.getRun()
165 self.exp[0] = svd_evtMD.getExperiment()
166
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()
176
177 self.ftswShift = svd_evtInfo.getSVD2FTSWTimeShift(svdCluster.getFirstFrame())
178 hasT0 = et0.hasEventT0()
179 if hasT0:
180 self.evtTime[0] = et0.getEventT0()
181 self.evtTimeSync[0] = et0.getEventT0() - self.ftswShift
182 else:
183 self.evtTime[0] = -999
184 self.evtTimeSync[0] = -999
185 self.tree.Fill()
186
187 for svdClusterTracks in svd_clsFromTrks:
188 self.clsTimeTracks[0] = svdClusterTracks.getClsTime()
189 self.clsSizeTracks[0] = svdClusterTracks.getSize()
190 self.clsChargeTracks[0] = svdClusterTracks.getCharge()
191 self.clsSNRTracks[0] = svdClusterTracks.getSNR()
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()
196
197 self.ftswShiftTracks = svd_evtInfo.getSVD2FTSWTimeShift(svdCluster.getFirstFrame())
198 hasT0 = et0.hasEventT0()
199 if hasT0:
200 self.evtTimeTracks[0] = et0.getEventT0()
201 self.evtTimeSyncTracks[0] = et0.getEventT0() - self.ftswShiftTracks
202 else:
203 self.evtTimeTracks[0] = -999
204 self.evtTimeSyncTracks[0] = -999
205 self.treeTracks.Fill()
206
A (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:72
a (simplified) python wrapper for StoreObjPtr.
Definition: PyStoreObj.h:67

◆ initialize()

def initialize (   self)
Initialize object (histograms, lists, ...) used by the class

Definition at line 38 of file svdCoGCalibrationAnalysisToolModule.py.

38 def initialize(self):
39 """
40 Initialize object (histograms, lists, ...) used by the class
41 """
42
43 self.outputFileName = outputFile
44
45 self.layer = np.zeros(1, dtype=int)
46
47 self.ladder = np.zeros(1, dtype=int)
48
49 self.sensor = np.zeros(1, dtype=int)
50
51 self.side = np.zeros(1, dtype=int)
52
53 self.TB = np.zeros(1, dtype=int)
54
55 self.evtTime = np.zeros(1, dtype=float)
56
57 self.evtTimeSync = np.zeros(1, dtype=float)
58
59 self.clsTime = np.zeros(1, dtype=float)
60
61 self.clsSize = np.zeros(1, dtype=float)
62
63 self.clsCharge = np.zeros(1, dtype=float)
64
65 self.clsSNR = np.zeros(1, dtype=float)
66
67 self.run = np.zeros(1, dtype=int)
68
69 self.exp = np.zeros(1, dtype=int)
70
71
72 self.layerTracks = np.zeros(1, dtype=int)
73
74 self.ladderTracks = np.zeros(1, dtype=int)
75
76 self.sensorTracks = np.zeros(1, dtype=int)
77
78 self.sideTracks = np.zeros(1, dtype=int)
79
80 self.evtTimeTracks = np.zeros(1, dtype=float)
81
82 self.evtTimeSyncTracks = np.zeros(1, dtype=float)
83
84 self.clsTimeTracks = np.zeros(1, dtype=float)
85
86 self.clsSizeTracks = np.zeros(1, dtype=float)
87
88 self.clsChargeTracks = np.zeros(1, dtype=float)
89
90 self.clsSNRTracks = np.zeros(1, dtype=float)
91
92 # self.tFile = TFile(self.outputFileName, 'recreate')
93 # self.tFile.cd()
94
95
96 self.tree = TTree('cls', 'tree')
97
98 self.tree.Branch('layer', self.layer, 'layer/I')
99
100 self.tree.Branch('ladder', self.ladder, 'ladder/I')
101
102 self.tree.Branch('sensor', self.sensor, 'sensor/I')
103
104 self.tree.Branch('side', self.side, 'side/I')
105
106 self.tree.Branch('tb', self.TB, 'tb/I')
107
108 self.tree.Branch('evtT0', self.evtTime, 'evtT0/D')
109
110 self.tree.Branch('evtT0Sync', self.evtTimeSync, 'evtT0Sync/D')
111
112 self.tree.Branch('clsTime', self.clsTime, 'clsTime/D')
113
114 self.tree.Branch('clsSize', self.clsSize, 'clsSize/D')
115
116 self.tree.Branch('clsCharge', self.clsCharge, 'clsCharge/D')
117
118 self.tree.Branch('clsSNR', self.clsSNR, 'clsSNR/D')
119
120 self.tree.Branch('run', self.run, 'run/I')
121
122 self.tree.Branch('exp', self.exp, 'exp/I')
123
124
125 self.treeTracks = TTree('clsTracks', 'treeTracks')
126
127 self.treeTracks.Branch('layer', self.layerTracks, 'layer/I')
128
129 self.treeTracks.Branch('ladder', self.ladderTracks, 'ladder/I')
130
131 self.treeTracks.Branch('sensor', self.sensorTracks, 'sensor/I')
132
133 self.treeTracks.Branch('side', self.sideTracks, 'side/I')
134
135 self.treeTracks.Branch('tb', self.TB, 'tb/I')
136
137 self.treeTracks.Branch('evtT0', self.evtTimeTracks, 'evtT0/D')
138
139 self.treeTracks.Branch('evtT0Sync', self.evtTimeSyncTracks, 'evtT0Sync/D')
140
141 self.treeTracks.Branch('clsTime', self.clsTimeTracks, 'clsTime/D')
142
143 self.treeTracks.Branch('clsSize', self.clsSizeTracks, 'clsSize/D')
144
145 self.treeTracks.Branch('clsCharge', self.clsChargeTracks, 'clsCharge/D')
146
147 self.treeTracks.Branch('clsSNR', self.clsSNRTracks, 'clsSNR/D')
148
149 self.treeTracks.Branch('run', self.run, 'run/I')
150
151 self.treeTracks.Branch('exp', self.exp, 'exp/I')
152

◆ terminate()

def terminate (   self)
Terminates te class and produces the output rootfile

Definition at line 207 of file svdCoGCalibrationAnalysisToolModule.py.

207 def terminate(self):
208 """
209 Terminates te class and produces the output rootfile
210 """
211
212 self.tFile = TFile(self.outputFileName, 'recreate')
213 self.tFile.cd()
214 self.tree.Write()
215 self.treeTracks.Write()
216 self.tFile.Close()
217 del self.tFile
218
219# conditions.override_globaltags()
220# conditions.globaltags = ["online"]
221
222

Member Data Documentation

◆ clsCharge

clsCharge

cluster charge array for the tree

Definition at line 63 of file svdCoGCalibrationAnalysisToolModule.py.

◆ clsChargeTracks

clsChargeTracks

cluster charge array for the tree for clusters associated to tracks

Definition at line 88 of file svdCoGCalibrationAnalysisToolModule.py.

◆ clsSize

clsSize

cluster size array for the tree

Definition at line 61 of file svdCoGCalibrationAnalysisToolModule.py.

◆ clsSizeTracks

clsSizeTracks

cluster size array for the tree for clusters associated to tracks

Definition at line 86 of file svdCoGCalibrationAnalysisToolModule.py.

◆ clsSNR

clsSNR

cluster SNR array for the tree

Definition at line 65 of file svdCoGCalibrationAnalysisToolModule.py.

◆ clsSNRTracks

clsSNRTracks

cluster SNR array for the tree for clusters associated to tracks

Definition at line 90 of file svdCoGCalibrationAnalysisToolModule.py.

◆ clsTime

clsTime

cluster time array for the tree

Definition at line 59 of file svdCoGCalibrationAnalysisToolModule.py.

◆ clsTimeTracks

clsTimeTracks

cluster time array for the tree for clusters associated to tracks

Definition at line 84 of file svdCoGCalibrationAnalysisToolModule.py.

◆ evtTime

evtTime

T0 array for the tree.

Definition at line 55 of file svdCoGCalibrationAnalysisToolModule.py.

◆ evtTimeSync

evtTimeSync

T0Sync array for the tree.

Definition at line 57 of file svdCoGCalibrationAnalysisToolModule.py.

◆ evtTimeSyncTracks

evtTimeSyncTracks

T0Sync array for the tree for clusters associated to tracks.

Definition at line 82 of file svdCoGCalibrationAnalysisToolModule.py.

◆ evtTimeTracks

evtTimeTracks

T0 array for the tree for clusters associated to tracks.

Definition at line 80 of file svdCoGCalibrationAnalysisToolModule.py.

◆ exp

exp

experiment number array for the tree

Definition at line 69 of file svdCoGCalibrationAnalysisToolModule.py.

◆ ftswShift

ftswShift

correction to pass to the FTSW reference system

Definition at line 177 of file svdCoGCalibrationAnalysisToolModule.py.

◆ ftswShiftTracks

ftswShiftTracks

correction to pass to the FTSW reference system

Definition at line 197 of file svdCoGCalibrationAnalysisToolModule.py.

◆ ladder

ladder

ladder array for the tree

Definition at line 47 of file svdCoGCalibrationAnalysisToolModule.py.

◆ ladderTracks

ladderTracks

ladder array for the tree for clusters associated to tracks

Definition at line 74 of file svdCoGCalibrationAnalysisToolModule.py.

◆ layer

layer

layer array for the tree

Definition at line 45 of file svdCoGCalibrationAnalysisToolModule.py.

◆ layerTracks

layerTracks

layer array for the tree for clusters associated to tracks

Definition at line 72 of file svdCoGCalibrationAnalysisToolModule.py.

◆ outputFileName

outputFileName

name of the output file provided by the user

Definition at line 43 of file svdCoGCalibrationAnalysisToolModule.py.

◆ run

run

run number array for the tree

Definition at line 67 of file svdCoGCalibrationAnalysisToolModule.py.

◆ sensor

sensor

sensor array for the tree

Definition at line 49 of file svdCoGCalibrationAnalysisToolModule.py.

◆ sensorTracks

sensorTracks

sensor array for the tree for clusters associated to tracks

Definition at line 76 of file svdCoGCalibrationAnalysisToolModule.py.

◆ side

side

side array for the tree

Definition at line 51 of file svdCoGCalibrationAnalysisToolModule.py.

◆ sideTracks

sideTracks

side array for the tree for clusters associated to tracks

Definition at line 78 of file svdCoGCalibrationAnalysisToolModule.py.

◆ TB

TB

TB array for the tree.

Definition at line 53 of file svdCoGCalibrationAnalysisToolModule.py.

◆ tFile

tFile

creation of TFile

Definition at line 212 of file svdCoGCalibrationAnalysisToolModule.py.

◆ tree

tree

tree for clusters

Definition at line 96 of file svdCoGCalibrationAnalysisToolModule.py.

◆ treeTracks

treeTracks

tree for clusters, branch for layer number

tree for clusters, branch for ladder number

tree for clusters, branch for sensor number

tree for clusters, branch for side

tree for clusters, branch for trigger bin

tree for clusters, branch for T0

tree for clusters, branch for T0Sync

tree for clusters, branch for cluster time

tree for clusters, branch for cluster size

tree for clusters, branch for cluster charge

tree for clusters, branch for cluster SNR

tree for clusters, branch for run number

tree for clusters, branch for exp number

tree for clusters associated to tracks

Definition at line 125 of file svdCoGCalibrationAnalysisToolModule.py.


The documentation for this class was generated from the following file: