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

Public Member Functions

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

Detailed Description

 check cluster grouping

Definition at line 108 of file svdGroupingPerformance.py.

Member Function Documentation

◆ event()

def event (   self)
 Event loop

Definition at line 387 of file svdGroupingPerformance.py.

387 def event(self):
388 ''' Event loop'''
389
390 EventT0 = Belle2.PyStoreObj('EventT0')
391 svdEventT0 = math.nan
392 cdcEventT0 = math.nan
393 svd = Belle2.Const.DetectorSet(Belle2.Const.SVD)
394 cdc = Belle2.Const.DetectorSet(Belle2.Const.CDC)
395 top = Belle2.Const.DetectorSet(Belle2.Const.TOP)
396 if EventT0.hasTemporaryEventT0(svd):
397 tmp = EventT0.getTemporaryEventT0s(Belle2.Const.SVD)
398 svdEventT0 = tmp.back().eventT0
399 if EventT0.hasTemporaryEventT0(cdc):
400 tmp = EventT0.getTemporaryEventT0s(Belle2.Const.CDC)
401 cdcEventT0 = tmp.back().eventT0
402
403 if not math.isnan(svdEventT0):
404 self.TH1F_Store[self.TH1F_Index["th1f_svdEventT0"]].Fill(svdEventT0)
405 self.TH1F_Store[self.TH1F_Index["th1f_svdEventT0_State"]].Fill(1)
406 else:
407 self.TH1F_Store[self.TH1F_Index["th1f_svdEventT0_State"]].Fill(0)
408 if not math.isnan(cdcEventT0):
409 self.TH1F_Store[self.TH1F_Index["th1f_cdcEventT0"]].Fill(cdcEventT0)
410 self.TH1F_Store[self.TH1F_Index["th1f_cdcEventT0_State"]].Fill(1)
411 else:
412 self.TH1F_Store[self.TH1F_Index["th1f_cdcEventT0_State"]].Fill(0)
413
414 if not math.isnan(svdEventT0) and not math.isnan(cdcEventT0):
415 self.TH2F_Store[self.TH2F_Index["th2f_svdEventT0_vs_cdcEventT0"]].Fill(svdEventT0, cdcEventT0)
416 self.TH2F_Store[self.TH2F_Index["th2f_svdEventT0_vs_cdcEventT0_rot45pos"]].Fill(
417 svdEventT0 * TMath.Cos(TMath.PiOver4()) + cdcEventT0 * TMath.Sin(TMath.PiOver4()),
418 - svdEventT0 * TMath.Sin(TMath.PiOver4()) + cdcEventT0 * TMath.Cos(TMath.PiOver4()))
419 self.TH2F_Store[self.TH2F_Index["th2f_svdEventT0_vs_cdcEventT0_rot45neg"]].Fill(
420 svdEventT0 * TMath.Cos(-TMath.PiOver4()) + cdcEventT0 * TMath.Sin(-TMath.PiOver4()),
421 - svdEventT0 * TMath.Sin(-TMath.PiOver4()) + cdcEventT0 * TMath.Cos(-TMath.PiOver4()))
422
423 OnlineEventT0 = []
424 if not args.isMC:
425 OnlineEventT0 = Belle2.PyStoreArray('OnlineEventT0s')
426 topOnlineEventT0 = math.nan
427 for evt in OnlineEventT0:
428 if evt.getOnlineEventT0Detector() == top:
429 topOnlineEventT0 = evt.getOnlineEventT0()
430
431 if not math.isnan(topOnlineEventT0) and not math.isnan(svdEventT0):
432 self.TH1F_Store[self.TH1F_Index["th1f_svdEventT0topRef"]].Fill(svdEventT0 - topOnlineEventT0)
433
434 TRGECLData = []
435 if not args.isMC:
436 TRGECLData = Belle2.PyStoreArray('TRGECLUnpackerStores')
437 eclTCEmax = 0
438 for trgHit in TRGECLData:
439 hitWin = trgHit.getHitWin()
440 if hitWin != 3 and hitWin != 4:
441 continue
442 if trgHit.getTCEnergy() > eclTCEmax:
443 eclTCEmax = trgHit.getTCEnergy()
444
445 if eclTCEmax:
446 self.TH1F_Store[self.TH1F_Index["th1f_eclTCEmax"]].Fill(eclTCEmax)
447 self.TH1F_Store[self.TH1F_Index["th1f_eclTCEmax_State"]].Fill(1)
448 if not math.isnan(topOnlineEventT0) and not math.isnan(svdEventT0):
449 self.reso_TH2D_Histograms[self.reso_TH2D_Histogram_Index["reso_eclTCEmax_vs_svdEventT0TopRef"]].Fill(
450 eclTCEmax, svdEventT0 - topOnlineEventT0)
451 else:
452 self.TH1F_Store[self.TH1F_Index["th1f_eclTCEmax_State"]].Fill(0)
453
454 # Pre Tracking
455
456 clusterList = Belle2.PyStoreArray("SVDClusters")
457 if eclTCEmax:
458 self.reso_TH2D_Histograms[self.reso_TH2D_Histogram_Index["reso_eclTCEmax_vs_totalClusters_PreTracking"]].Fill(
459 eclTCEmax, len(clusterList))
460 fillOnce = 0
461 for d in clusterList:
462 clsTime = d.getClsTime()
463
464 self.TH1F_Store[self.TH1F_Index["th1f_clsTime_PreTracking"]].Fill(clsTime)
465 if not math.isnan(cdcEventT0):
466 self.TH1F_Store[self.TH1F_Index["th1f_clsTimeCdcRef_PreTracking"]].Fill(clsTime - cdcEventT0)
467 if not math.isnan(topOnlineEventT0) and eclTCEmax:
468 self.reso_TH2D_Histograms[self.reso_TH2D_Histogram_Index["reso_eclTCEmax_vs_clsTimeTopRef_PreTracking"]].Fill(
469 eclTCEmax, clsTime - topOnlineEventT0)
470
471 groupIds = d.getTimeGroupId()
472 groupInfo = d.getTimeGroupInfo()
473
474 minId = 1000
475 par0 = -1000
476 par1 = -1000
477 par2 = -1000
478 for id in range(len(groupIds)):
479 gr = groupIds[id]
480 if gr < minId:
481 minId = gr
482 if len(groupInfo) > 0:
483 par0, par1, par2 = groupInfo[id]
484
485 if len(groupIds) == 0:
486 minId = -1
487
488 self.TH2F_Store[self.TH2F_Index["th2f_timeGr_vs_clsTime"]].Fill(clsTime, minId)
489 self.TH2F_Store[self.TH2F_Index["th2f_timeGr_vs_grAmp"]].Fill(par0, minId)
490 self.TH2F_Store[self.TH2F_Index["th2f_timeGr_vs_grCenter"]].Fill(par1, minId)
491 self.TH2F_Store[self.TH2F_Index["th2f_timeGr_vs_grWidth"]].Fill(par2, minId)
492
493 if fillOnce == minId and fillOnce < 4:
494 if not math.isnan(cdcEventT0):
495 hname = "th2f_sig" + str(fillOnce) + "GrMean_vs_cdcEventT0"
496 self.TH2F_Store[self.TH2F_Index[hname]].Fill(par1, cdcEventT0)
497 hname = "th2f_sig" + str(fillOnce) + "GrMean_vs_cdcEventT0_rot45neg"
498 self.TH2F_Store[self.TH2F_Index[hname]].Fill(
499 par1 * TMath.Cos(-TMath.PiOver4()) + cdcEventT0 * TMath.Sin(-TMath.PiOver4()),
500 - par1 * TMath.Sin(-TMath.PiOver4()) + cdcEventT0 * TMath.Cos(-TMath.PiOver4()))
501 hname = "th2f_sig" + str(fillOnce) + "GrMean_vs_cdcEventT0_rot45pos"
502 self.TH2F_Store[self.TH2F_Index[hname]].Fill(
503 par1 * TMath.Cos(TMath.PiOver4()) + cdcEventT0 * TMath.Sin(TMath.PiOver4()),
504 - par1 * TMath.Sin(TMath.PiOver4()) + cdcEventT0 * TMath.Cos(TMath.PiOver4()))
505 fillOnce += 1
506
507 if minId == 0:
508 self.TH1F_Store[self.TH1F_Index["th1f_sigClsTime_PreTracking"]].Fill(clsTime)
509 else:
510 self.TH1F_Store[self.TH1F_Index["th1f_bkgClsTime_PreTracking"]].Fill(clsTime)
511
512 # Post Tracking
513
514 recoTrackList = Belle2.PyStoreArray('RecoTracks')
515 nTracks = len(recoTrackList)
516 nClusters = 0
517 for recoTrk in recoTrackList:
518 if not recoTrk.wasFitSuccessful():
519 nTracks -= 1
520 continue
521
522 trackList = recoTrk.getRelationsFrom('Tracks')
523 if len(trackList) == 0:
524 nTracks -= 1
525 continue
526 trkTime0 = trackList[0].getTrackTime()
527
528 self.TH1F_Store[self.TH1F_Index["th1f_trackTime"]].Fill(trkTime0)
529 if not math.isnan(cdcEventT0):
530 self.TH1F_Store[self.TH1F_Index["th1f_trackTimeCDCRef"]].Fill(trkTime0 - cdcEventT0)
531
532 clusterList = recoTrk.getRelationsFrom("SVDClusters")
533 nClusters += len(clusterList)
534 if len(clusterList) == 0:
535 continue
536
537 trkTime = 0
538 for d in clusterList:
539 trkTime += d.getClsTime()
540 trkTime /= len(clusterList)
541
542 for d in clusterList:
543 clsTime = d.getClsTime()
544 groupIds = d.getTimeGroupId()
545 groupInfo = d.getTimeGroupInfo()
546
547 if not math.isnan(svdEventT0):
548 self.TH2F_Store[self.TH2F_Index["th2f_trkTime_vs_clsTime_inSVDEventT0"]].Fill(
549 trkTime0 - clsTime, svdEventT0 - trkTime0)
550 if not math.isnan(cdcEventT0):
551 self.TH2F_Store[self.TH2F_Index["th2f_trkTime_vs_clsTime_inCDCEventT0"]].Fill(
552 trkTime0 - clsTime, cdcEventT0 - trkTime0)
553 self.TH2F_Store[self.TH2F_Index["th2f_aveClsTimeInTrk_vs_cdcEventT0"]].Fill(trkTime, cdcEventT0)
554 if not math.isnan(svdEventT0):
555 self.TH2F_Store[self.TH2F_Index["th2f_aveClsTimeInTrk_vs_clsTime_inSVDEventT0"]].Fill(
556 trkTime - clsTime, svdEventT0 - trkTime)
557 if not math.isnan(cdcEventT0):
558 self.TH2F_Store[self.TH2F_Index["th2f_aveClsTimeInTrk_vs_clsTime_inCDCEventT0"]].Fill(
559 trkTime - clsTime, cdcEventT0 - trkTime)
560
561 self.TH1F_Store[self.TH1F_Index["th1f_clsTime_PostTracking"]].Fill(clsTime)
562 if not math.isnan(cdcEventT0):
563 self.TH1F_Store[self.TH1F_Index["th1f_clsTimeCdcRef_PostTracking"]].Fill(clsTime - cdcEventT0)
564 if not math.isnan(topOnlineEventT0) and eclTCEmax:
565 self.reso_TH2D_Histograms[self.reso_TH2D_Histogram_Index["reso_eclTCEmax_vs_clsTimeTopRef_PostTracking"]].Fill(
566 eclTCEmax, clsTime - topOnlineEventT0)
567
568 minId = 1000
569 par0 = -1000
570 par1 = -1000
571 par2 = -1000
572 if len(groupIds) == 0:
573 minId = -1
574 for id in range(len(groupIds)):
575 gr = groupIds[id]
576 if gr < minId:
577 minId = gr
578 if len(groupInfo) > 0:
579 par0, par1, par2 = groupInfo[id]
580
581 self.TH2F_Store[self.TH2F_Index["th2f_timeGr_vs_clsTime_PostTracking"]].Fill(clsTime, minId)
582
583 if par1 > sigMin and par1 < sigMax:
584 self.TH1F_Store[self.TH1F_Index["th1f_sigClsTime_PostTracking"]].Fill(clsTime)
585 else:
586 self.TH1F_Store[self.TH1F_Index["th1f_bkgClsTime_PostTracking"]].Fill(clsTime)
587
588 if eclTCEmax:
589 self.reso_TH2D_Histograms[self.reso_TH2D_Histogram_Index["reso_eclTCEmax_vs_totalTracks"]].Fill(eclTCEmax, nTracks)
590 self.reso_TH2D_Histograms[self.reso_TH2D_Histogram_Index["reso_eclTCEmax_vs_totalClusters_PostTracking"]].Fill(
591 eclTCEmax, nClusters)
592
The DetectorSet class for sets of detector IDs in the form of EDetector values.
Definition: Const.h:80
A (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:72
a (simplified) python wrapper for StoreObjPtr.
Definition: PyStoreObj.h:67

◆ initialize()

def initialize (   self)
define histograms

Definition at line 111 of file svdGroupingPerformance.py.

111 def initialize(self):
112 '''define histograms'''
113
114 usedBin1 = 100
115 usedBin2 = 2000
116 eclMinVal = 19.5
117 eclMaxVal = 1100.5
118
119 timeBin = int(maxTime - minTime)
120
121
122 self.TH1F_Index = {}
123 self.TH1F_Store = []
124 TH1F_Store_Count = 0
125
126 self.TH2F_Index = {}
127 self.TH2F_Store = []
128 TH2F_Store_Count = 0
129
130 self.reso_TH2D_Histogram_Index = {}
131 self.reso_TH2D_Histograms = []
132 reso_TH2D_Histograms_Count = 0
133
134 self.outputFileName = str(args.fileDir) + str(args.moduleName) + outputFileTag
135 self.f = TFile(self.outputFileName + ".root", "RECREATE")
136
137
138 # EventT0s
139
140 self.TH1F_Store.append(TH1F("th1f_svdEventT0", "SVD EventT0", 500, -50., 50.))
141 self.TH1F_Store[-1].GetXaxis().SetTitle("SVD EventT0 (ns)")
142 self.TH1F_Index["th1f_svdEventT0"] = TH1F_Store_Count
143 TH1F_Store_Count += 1
144 self.TH1F_Store.append(TH1F("th1f_svdEventT0_State", "SVD EventT0 Availability", 2, -0.5, 1.5))
145 self.TH1F_Store[-1].GetXaxis().SetBinLabel(1, "Not Available")
146 self.TH1F_Store[-1].GetXaxis().SetBinLabel(2, "Available")
147 self.TH1F_Index["th1f_svdEventT0_State"] = TH1F_Store_Count
148 TH1F_Store_Count += 1
149
150 self.TH1F_Store.append(TH1F("th1f_cdcEventT0", "CDC EventT0", 500, -50., 50.))
151 self.TH1F_Store[-1].GetXaxis().SetTitle("CDC EventT0 (ns)")
152 self.TH1F_Index["th1f_cdcEventT0"] = TH1F_Store_Count
153 TH1F_Store_Count += 1
154 self.TH1F_Store.append(TH1F("th1f_cdcEventT0_State", "CDC EventT0 Availability", 2, -0.5, 1.5))
155 self.TH1F_Store[-1].GetXaxis().SetBinLabel(1, "Not Available")
156 self.TH1F_Store[-1].GetXaxis().SetBinLabel(2, "Available")
157 self.TH1F_Index["th1f_cdcEventT0_State"] = TH1F_Store_Count
158 TH1F_Store_Count += 1
159
160 # EventT0 - TOP Online EventT0
161
162 self.TH1F_Store.append(TH1F("th1f_svdEventT0topRef", "SVD EventT0 - TOP Online EventT0", 500, -20., 20.))
163 self.TH1F_Store[-1].GetXaxis().SetTitle("SVD EventT0 - TOP Online EventT0 (ns)")
164 self.TH1F_Index["th1f_svdEventT0topRef"] = TH1F_Store_Count
165 TH1F_Store_Count += 1
166
167 # Cluster Time
168
169 self.TH1F_Store.append(TH1F("th1f_clsTime_PreTracking", "(PreTracking) Cluster Time", timeBin, minTime, maxTime))
170 self.TH1F_Store[-1].GetXaxis().SetTitle("Cluster Time (ns)")
171 self.TH1F_Store[-1].SetLineColor(1)
172 self.TH1F_Index["th1f_clsTime_PreTracking"] = TH1F_Store_Count
173 TH1F_Store_Count += 1
174 self.TH1F_Store.append(TH1F("th1f_bkgClsTime_PreTracking", "(PreTracking) Bkg Cluster Time", timeBin, minTime, maxTime))
175 self.TH1F_Store[-1].GetXaxis().SetTitle("Cluster Time (ns)")
176 self.TH1F_Store[-1].SetLineColor(2)
177 self.TH1F_Index["th1f_bkgClsTime_PreTracking"] = TH1F_Store_Count
178 TH1F_Store_Count += 1
179 self.TH1F_Store.append(TH1F("th1f_sigClsTime_PreTracking", "(PreTracking) Sig Cluster Time", timeBin, minTime, maxTime))
180 self.TH1F_Store[-1].GetXaxis().SetTitle("Cluster Time (ns)")
181 self.TH1F_Store[-1].SetLineColor(3)
182 self.TH1F_Index["th1f_sigClsTime_PreTracking"] = TH1F_Store_Count
183 TH1F_Store_Count += 1
184
185 self.TH1F_Store.append(TH1F("th1f_clsTime_PostTracking", "(PostTracking) Cluster Time", timeBin, minTime, maxTime))
186 self.TH1F_Store[-1].GetXaxis().SetTitle("Cluster Time (ns)")
187 self.TH1F_Store[-1].SetLineColor(1)
188 self.TH1F_Index["th1f_clsTime_PostTracking"] = TH1F_Store_Count
189 TH1F_Store_Count += 1
190 self.TH1F_Store.append(TH1F("th1f_bkgClsTime_PostTracking", "(PostTracking) Bkg Cluster Time", timeBin, minTime, maxTime))
191 self.TH1F_Store[-1].GetXaxis().SetTitle("Cluster Time (ns)")
192 self.TH1F_Store[-1].SetLineColor(2)
193 self.TH1F_Index["th1f_bkgClsTime_PostTracking"] = TH1F_Store_Count
194 TH1F_Store_Count += 1
195 self.TH1F_Store.append(TH1F("th1f_sigClsTime_PostTracking", "(PostTracking) Sig Cluster Time", timeBin, minTime, maxTime))
196 self.TH1F_Store[-1].GetXaxis().SetTitle("Cluster Time (ns)")
197 self.TH1F_Store[-1].SetLineColor(3)
198 self.TH1F_Index["th1f_sigClsTime_PostTracking"] = TH1F_Store_Count
199 TH1F_Store_Count += 1
200
201 self.TH1F_Store.append(TH1F("th1f_trackTime", "Track Time", timeBin * 10, minTime, maxTime))
202 self.TH1F_Store[-1].GetXaxis().SetTitle("Track Time (ns)")
203 self.TH1F_Index["th1f_trackTime"] = TH1F_Store_Count
204 TH1F_Store_Count += 1
205 self.TH1F_Store.append(TH1F("th1f_trackTimeCDCRef", "Track Time - CDC EventT0", 10000, -50, 50))
206 self.TH1F_Store[-1].GetXaxis().SetTitle("Track Time - CDC EventT0 (ns)")
207 self.TH1F_Index["th1f_trackTimeCDCRef"] = TH1F_Store_Count
208 TH1F_Store_Count += 1
209
210 # Cluster Time - TOP Online EventT0
211
212 self.TH1F_Store.append(TH1F("th1f_clsTimeCdcRef_PreTracking", "(PreTracking) Cluster Time - CDC EventT0",
213 timeBin * 2, minTime, maxTime))
214 self.TH1F_Store[-1].GetXaxis().SetTitle("Cluster Time - CDC EventT0 (ns)")
215 self.TH1F_Store[-1].SetLineColor(1)
216 self.TH1F_Index["th1f_clsTimeCdcRef_PreTracking"] = TH1F_Store_Count
217 TH1F_Store_Count += 1
218
219 self.TH1F_Store.append(TH1F("th1f_clsTimeCdcRef_PostTracking", "(PostTracking) Cluster Time - CDC EventT0",
220 timeBin * 2, minTime, maxTime))
221 self.TH1F_Store[-1].GetXaxis().SetTitle("Cluster Time - CDC EventT0 (ns)")
222 self.TH1F_Store[-1].SetLineColor(1)
223 self.TH1F_Index["th1f_clsTimeCdcRef_PostTracking"] = TH1F_Store_Count
224 TH1F_Store_Count += 1
225
226 # ECL TC Emax
227
228 self.TH1F_Store.append(TH1F("th1f_eclTCEmax", "ECL E_{max}^{TC}", 1250, 0.5, 1250.5))
229 self.TH1F_Store[-1].GetXaxis().SetTitle("ECL E_{max}^{TC} (ADC)")
230 self.TH1F_Index["th1f_eclTCEmax"] = TH1F_Store_Count
231 TH1F_Store_Count += 1
232 self.TH1F_Store.append(TH1F("th1f_eclTCEmax_State", "ECL E_{max}^{TC} Availability", 2, -0.5, 1.5))
233 self.TH1F_Store[-1].GetXaxis().SetBinLabel(1, "Not Available")
234 self.TH1F_Store[-1].GetXaxis().SetBinLabel(2, "Available")
235 self.TH1F_Index["th1f_eclTCEmax_State"] = TH1F_Store_Count
236 TH1F_Store_Count += 1
237
238 self.TH2F_Store.append(TH2F("th2f_timeGr_vs_grAmp", "Time Group vs Group Amplitude", 60, 0., 300, 21, -1.5, 19.5))
239 self.TH2F_Store[-1].GetXaxis().SetTitle("Group Amplitude")
240 self.TH2F_Store[-1].GetYaxis().SetTitle("Time Group")
241 self.TH2F_Index["th2f_timeGr_vs_grAmp"] = TH2F_Store_Count
242 TH2F_Store_Count += 1
243 self.TH2F_Store.append(TH2F("th2f_timeGr_vs_grCenter", "Time Group vs Group Center", 80, minTime, maxTime, 21, -1.5, 19.5))
244 self.TH2F_Store[-1].GetXaxis().SetTitle("Group Center (ns)")
245 self.TH2F_Store[-1].GetYaxis().SetTitle("Time Group")
246 self.TH2F_Index["th2f_timeGr_vs_grCenter"] = TH2F_Store_Count
247 TH2F_Store_Count += 1
248 self.TH2F_Store.append(TH2F("th2f_timeGr_vs_grWidth", "Time Group vs Group Width", 50, 1, 11, 21, -1.5, 19.5))
249 self.TH2F_Store[-1].GetXaxis().SetTitle("Group Width (ns)")
250 self.TH2F_Store[-1].GetYaxis().SetTitle("Time Group")
251 self.TH2F_Index["th2f_timeGr_vs_grWidth"] = TH2F_Store_Count
252 TH2F_Store_Count += 1
253 self.TH2F_Store.append(TH2F("th2f_timeGr_vs_clsTime", "Time Group vs Cluster Time",
254 timeBin, minTime, maxTime, 21, -1.5, 19.5))
255 self.TH2F_Store[-1].GetXaxis().SetTitle("Cluster Time (ns)")
256 self.TH2F_Store[-1].GetYaxis().SetTitle("Time Group")
257 self.TH2F_Index["th2f_timeGr_vs_clsTime"] = TH2F_Store_Count
258 TH2F_Store_Count += 1
259 self.TH2F_Store.append(TH2F("th2f_timeGr_vs_clsTime_PostTracking", "(PostTracking) Time Group vs Cluster Time",
260 timeBin, minTime, maxTime, 21, -1.5, 19.5))
261 self.TH2F_Store[-1].GetXaxis().SetTitle("Cluster Time (ns)")
262 self.TH2F_Store[-1].GetYaxis().SetTitle("Time Group")
263 self.TH2F_Index["th2f_timeGr_vs_clsTime_PostTracking"] = TH2F_Store_Count
264 TH2F_Store_Count += 1
265
266 for i in range(4):
267 self.TH2F_Store.append(TH2F("th2f_sig" + str(i) + "GrMean_vs_cdcEventT0", "Center of 'Group " +
268 str(i) + "' vs CDC EventT0", 500, -50., 50., 500, -50., 50.))
269 self.TH2F_Store[-1].GetXaxis().SetTitle("Center of 'Group " + str(i) + "' (ns)")
270 self.TH2F_Store[-1].GetYaxis().SetTitle("CDC EventT0 (ns)")
271 self.TH2F_Index["th2f_sig" + str(i) + "GrMean_vs_cdcEventT0"] = TH2F_Store_Count
272 TH2F_Store_Count += 1
273 self.TH2F_Store.append(TH2F("th2f_sig" + str(i) + "GrMean_vs_cdcEventT0_rot45pos",
274 "Center of 'Group " + str(i) + "' vs CDC EventT0 (Rotated 45)",
275 500, -50., 50., 500, -50., 50.))
276 self.TH2F_Store[-1].GetXaxis().SetTitle("Center of 'Group " + str(i) + "' (ns)")
277 self.TH2F_Store[-1].GetYaxis().SetTitle("CDC EventT0 (ns)")
278 self.TH2F_Index["th2f_sig" + str(i) + "GrMean_vs_cdcEventT0_rot45pos"] = TH2F_Store_Count
279 TH2F_Store_Count += 1
280 self.TH2F_Store.append(TH2F("th2f_sig" + str(i) + "GrMean_vs_cdcEventT0_rot45neg",
281 "Center of 'Group " + str(i) + "' vs CDC EventT0 (Rotated -45)",
282 500, -50., 50., 500, -50., 50.))
283 self.TH2F_Store[-1].GetXaxis().SetTitle("Center of 'Group " + str(i) + "' (ns)")
284 self.TH2F_Store[-1].GetYaxis().SetTitle("CDC EventT0 (ns)")
285 self.TH2F_Index["th2f_sig" + str(i) + "GrMean_vs_cdcEventT0_rot45neg"] = TH2F_Store_Count
286 TH2F_Store_Count += 1
287
288 self.TH2F_Store.append(TH2F("th2f_aveClsTimeInTrk_vs_cdcEventT0",
289 "Track Time vs CDC EventT0", 500, -50., 50., 500, -50., 50.))
290 self.TH2F_Store[-1].GetXaxis().SetTitle("<Cluster Time> in Track (ns)")
291 self.TH2F_Store[-1].GetYaxis().SetTitle("CDC EventT0 (ns)")
292 self.TH2F_Index["th2f_aveClsTimeInTrk_vs_cdcEventT0"] = TH2F_Store_Count
293 TH2F_Store_Count += 1
294 self.TH2F_Store.append(TH2F("th2f_svdEventT0_vs_cdcEventT0", "SVD EventT0 vs CDC EventT0",
295 500, -50., 50., 500, -50., 50.))
296 self.TH2F_Store[-1].GetXaxis().SetTitle("SVD EventT0 (ns)")
297 self.TH2F_Store[-1].GetYaxis().SetTitle("CDC EventT0 (ns)")
298 self.TH2F_Index["th2f_svdEventT0_vs_cdcEventT0"] = TH2F_Store_Count
299 TH2F_Store_Count += 1
300 self.TH2F_Store.append(TH2F("th2f_svdEventT0_vs_cdcEventT0_rot45pos",
301 "SVD EventT0 vs CDC EventT0 (Rotated 45)", 500, -50., 50., 500, -50., 50.))
302 self.TH2F_Store[-1].GetXaxis().SetTitle("SVD EventT0 (ns)")
303 self.TH2F_Store[-1].GetYaxis().SetTitle("CDC EventT0 (ns)")
304 self.TH2F_Index["th2f_svdEventT0_vs_cdcEventT0_rot45pos"] = TH2F_Store_Count
305 TH2F_Store_Count += 1
306 self.TH2F_Store.append(TH2F("th2f_svdEventT0_vs_cdcEventT0_rot45neg",
307 "SVD EventT0 vs CDC EventT0 (Rotated -45)", 500, -50., 50., 500, -50., 50.))
308 self.TH2F_Store[-1].GetXaxis().SetTitle("SVD EventT0 (ns)")
309 self.TH2F_Store[-1].GetYaxis().SetTitle("CDC EventT0 (ns)")
310 self.TH2F_Index["th2f_svdEventT0_vs_cdcEventT0_rot45neg"] = TH2F_Store_Count
311 TH2F_Store_Count += 1
312
313 self.TH2F_Store.append(TH2F("th2f_trkTime_vs_clsTime_inCDCEventT0", "Track Time vs Cluster Time",
314 timeBin, minTime, maxTime, timeBin, minTime, maxTime))
315 self.TH2F_Store[-1].GetXaxis().SetTitle("Track Time - Cluster Time (ns)")
316 self.TH2F_Store[-1].GetYaxis().SetTitle("CDC EventT0 - Track Time (ns)")
317 self.TH2F_Index["th2f_trkTime_vs_clsTime_inCDCEventT0"] = TH2F_Store_Count
318 TH2F_Store_Count += 1
319 self.TH2F_Store.append(TH2F("th2f_trkTime_vs_clsTime_inSVDEventT0", "Track Time vs Cluster Time",
320 timeBin, minTime, maxTime, timeBin, minTime, maxTime))
321 self.TH2F_Store[-1].GetXaxis().SetTitle("Track Time - Cluster Time (ns)")
322 self.TH2F_Store[-1].GetYaxis().SetTitle("SVD EventT0 - Track Time (ns)")
323 self.TH2F_Index["th2f_trkTime_vs_clsTime_inSVDEventT0"] = TH2F_Store_Count
324 TH2F_Store_Count += 1
325
326 self.TH2F_Store.append(TH2F("th2f_aveClsTimeInTrk_vs_clsTime_inCDCEventT0", "<Cluster Time> in Track vs Cluster Time",
327 timeBin, minTime, maxTime, timeBin, minTime, maxTime))
328 self.TH2F_Store[-1].GetXaxis().SetTitle("<Cluster Time> in Track - Cluster Time (ns)")
329 self.TH2F_Store[-1].GetYaxis().SetTitle("CDC EventT0 - <Cluster Time> in Track (ns)")
330 self.TH2F_Index["th2f_aveClsTimeInTrk_vs_clsTime_inCDCEventT0"] = TH2F_Store_Count
331 TH2F_Store_Count += 1
332 self.TH2F_Store.append(TH2F("th2f_aveClsTimeInTrk_vs_clsTime_inSVDEventT0", "<Cluster Time> in Track vs Cluster Time",
333 timeBin, minTime, maxTime, timeBin, minTime, maxTime))
334 self.TH2F_Store[-1].GetXaxis().SetTitle("<Cluster Time> in Track - Cluster Time (ns)")
335 self.TH2F_Store[-1].GetYaxis().SetTitle("SVD EventT0 - <Cluster Time> in Track (ns)")
336 self.TH2F_Index["th2f_aveClsTimeInTrk_vs_clsTime_inSVDEventT0"] = TH2F_Store_Count
337 TH2F_Store_Count += 1
338
339 # Resolution w.r.t. ECL TC Emax
340
341 self.reso_TH2D_Histograms.append(TH2F("reso_eclTCEmax_vs_clsTimeTopRef_PreTracking",
342 "(PreTracking) ECL E_{max}^{TC} vs Cluster Time - TOP Online EventT0",
343 usedBin1, eclMinVal, eclMaxVal, usedBin2, -50, 50.))
344 self.reso_TH2D_Histograms[-1].GetXaxis().SetTitle("ECL E_{max}^{TC} (ADC)")
345 self.reso_TH2D_Histograms[-1].GetYaxis().SetTitle("Cluster Time - TOP Online EventT0 (ns)")
346 self.reso_TH2D_Histogram_Index["reso_eclTCEmax_vs_clsTimeTopRef_PreTracking"] = reso_TH2D_Histograms_Count
347 reso_TH2D_Histograms_Count += 1
348 self.reso_TH2D_Histograms.append(TH2F("reso_eclTCEmax_vs_clsTimeTopRef_PostTracking",
349 "(PostTracking) ECL E_{max}^{TC} vs Cluster Time - TOP Online EventT0",
350 usedBin1, eclMinVal, eclMaxVal, usedBin2, -50, 50.))
351 self.reso_TH2D_Histograms[-1].GetXaxis().SetTitle("ECL E_{max}^{TC} (ADC)")
352 self.reso_TH2D_Histograms[-1].GetYaxis().SetTitle("Cluster Time - TOP Online EventT0 (ns)")
353 self.reso_TH2D_Histogram_Index["reso_eclTCEmax_vs_clsTimeTopRef_PostTracking"] = reso_TH2D_Histograms_Count
354 reso_TH2D_Histograms_Count += 1
355
356 self.reso_TH2D_Histograms.append(TH2F("reso_eclTCEmax_vs_svdEventT0TopRef",
357 "ECL E_{max}^{TC} vs SVD EventT0 - TOP Online EventT0",
358 usedBin1, eclMinVal, eclMaxVal, usedBin2, -50, 50.))
359 self.reso_TH2D_Histograms[-1].GetXaxis().SetTitle("ECL E_{max}^{TC} (ADC)")
360 self.reso_TH2D_Histograms[-1].GetYaxis().SetTitle("SVD EventT0 - TOP Online EventT0 (ns)")
361 self.reso_TH2D_Histogram_Index["reso_eclTCEmax_vs_svdEventT0TopRef"] = reso_TH2D_Histograms_Count
362 reso_TH2D_Histograms_Count += 1
363
364 self.reso_TH2D_Histograms.append(TH2F("reso_eclTCEmax_vs_totalTracks",
365 "ECL E_{max}^{TC} vs Total SVD Tracks",
366 usedBin1, eclMinVal, eclMaxVal, 36, -0.5, 35.5))
367 self.reso_TH2D_Histograms[-1].GetXaxis().SetTitle("ECL E_{max}^{TC} (ADC)")
368 self.reso_TH2D_Histograms[-1].GetYaxis().SetTitle("Total SVD Tracks")
369 self.reso_TH2D_Histogram_Index["reso_eclTCEmax_vs_totalTracks"] = reso_TH2D_Histograms_Count
370 reso_TH2D_Histograms_Count += 1
371
372 self.reso_TH2D_Histograms.append(TH2F("reso_eclTCEmax_vs_totalClusters_PreTracking",
373 "(PreTracking) ECL E_{max}^{TC} vs Total SVD Clusters",
374 usedBin1, eclMinVal, eclMaxVal, 1000, 0.5, 1000.5))
375 self.reso_TH2D_Histograms[-1].GetXaxis().SetTitle("ECL E_{max}^{TC} (ADC)")
376 self.reso_TH2D_Histograms[-1].GetYaxis().SetTitle("Total SVD Clusters")
377 self.reso_TH2D_Histogram_Index["reso_eclTCEmax_vs_totalClusters_PreTracking"] = reso_TH2D_Histograms_Count
378 reso_TH2D_Histograms_Count += 1
379 self.reso_TH2D_Histograms.append(TH2F("reso_eclTCEmax_vs_totalClusters_PostTracking",
380 "(PostTracking) ECL E_{max}^{TC} vs Total SVD Clusters",
381 usedBin1, eclMinVal, eclMaxVal, 1000, 0.5, 1000.5))
382 self.reso_TH2D_Histograms[-1].GetXaxis().SetTitle("ECL E_{max}^{TC} (ADC)")
383 self.reso_TH2D_Histograms[-1].GetYaxis().SetTitle("Total SVD Clusters")
384 self.reso_TH2D_Histogram_Index["reso_eclTCEmax_vs_totalClusters_PostTracking"] = reso_TH2D_Histograms_Count
385 reso_TH2D_Histograms_Count += 1
386

◆ terminate()

def terminate (   self)
write

Definition at line 593 of file svdGroupingPerformance.py.

593 def terminate(self):
594 '''write'''
595
596 self.f.mkdir("objects")
597 self.f.cd("objects")
598
599 for hist in self.TH1F_Store:
600 if "_State" in hist.GetName():
601 hist.Scale(1./hist.GetSumOfWeights())
602 hist.Write()
603
604 for hist in self.TH2F_Store:
605 hist.Write()
606
607 for hist in self.reso_TH2D_Histograms:
608 hist.Write()
609
610 self.f.Close()
611
612

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