20from ROOT
import Belle2
25 """check the 2D skim with Tracks StoreArray"""
28 """event function of the is2DSkim class"""
29 Tracks = ROOT.Belle2.PyStoreArray(
"Tracks")
30 TRGGRLT3DUnpackerStores = ROOT.Belle2.PyStoreArray(
"TRGCDCT3DUnpackerStores")
38 trackResult = track.getTrackFitResultWithClosestMass(ROOT.Belle2.Const.pion)
39 if trackResult.getPValue() > 0.1:
40 areTracksClean =
False
44 trackResult = track.getTrackFitResultWithClosestMass(ROOT.Belle2.Const.pion)
48 if (trackResult.getHitPatternCDC().getSLayerNHits(2 * iAx) > 3):
51 if (trackResult.getHitPatternCDC().getSLayerNHits(2 * iSt + 1) > 3):
59 for iClk, data
in enumerate(TRGGRLT3DUnpackerStores):
60 if (data.m_t2d_fnf != 0):
63 self.return_value(isTwoTrack
and is2D
and areTracksClean
and enoughHits)
66if __name__ ==
'__main__':
68 basf2.use_central_database(
"development")
70 basf2.use_local_database(ROOT.Belle2.FileSystem.findFile(
"data/trg/cdc/db_CDCFudgeFactorsForSigma.txt"),
"localdb")
72 empty_path = basf2.create_path()
73 skim = basf2.register_module(
is2DSkim())
74 skim.if_value(
'=0', empty_path, basf2.AfterConditionPath.END)
77 main = basf2.create_path()
79 main.add_module(
'RootInput')
80 main.add_module(
'TRGCDCT3DUnpacker')
82 main.add_module(
'Gearbox')
83 main.add_module(
'TRGCDCT3DConverter',
84 hitCollectionName=
'FirmCDCTriggerSegmentHits',
85 addTSToDatastore=
True,
86 EventTimeName=
'FirmBinnedEventT0',
87 addEventTimeToDatastore=
True,
88 inputCollectionName=
'FirmTRGCDC2DFinderTracks',
89 add2DFinderToDatastore=
True,
90 outputCollectionName=
'FirmTRGCDC3DFitterTracks',
91 add3DToDatastore=
True,
93 firmwareResultCollectionName=
'TRGCDCT3DUnpackerStores',
98 'TRGCDCT3DUnpackerStores',
99 'FirmCDCTriggerSegmentHits',
101 'FirmTRGCDC2DFinderTracks',
102 'FirmTRGCDC3DFitterTracks'])
105 print(basf2.statistics)