12from ROOT
import Belle2
13from math
import pi, tan
16generate tracks with particle gun, simulate CDC and CDC trigger, save the output.
27 'pdgCodes': [-13, 13],
29 'momentumGeneration':
'inversePt',
30 'momentumParams': [0.3, 10.],
31 'thetaGeneration':
'uniform',
32 'thetaParams': [35, 145],
33 'phiGeneration':
'uniform',
34 'phiParams': [0, 360],
35 'vertexGeneration':
'uniform',
36 'xVertexParams': [0, 0.0],
37 'yVertexParams': [0, 0.0],
38 'zVertexParams': [-50.0, 50.0]}
45b2.set_random_seed(seed)
49main = b2.create_path()
51empty_path = b2.create_path()
53main.add_module(
'EventInfoSetter', evtNumList=evtnum)
54main.add_module(
'Progress')
55main.add_module(
'Gearbox')
56main.add_module(
'Geometry', components=[
'BeamPipe',
58 'MagneticFieldConstant4LimitedRCDC'])
59particlegun = b2.register_module(
'ParticleGun')
60particlegun.param(particlegun_params)
61main.add_module(particlegun)
64z_SL0 = [-31 - 1.5 / tan(30 / 180. * pi), 57 + 1.5 / tan(17 / 180. * pi)]
70 """Reject tracks with bad combination of z0 and theta"""
73 """Initialization of Skim"""
78 """event function of Skim"""
81 z0 = self.
mc[0].getVertex().Z()
83 vec = self.
mc[0].getMomentum()
85 if z_SL0[0] < z0 + r_SL0 / vec.Pt() * vec.Z() < z_SL0[1]:
91skim.if_false(empty_path)
93main.add_module(
'FullSim')
94main.add_module(
'CDCDigitizer')
104main.add_module(
'CDCTriggerTSF',
108original2d = b2.register_module(
'CDCTrigger2DFinder')
112original2d.param(
'testFilename',
'tracks.txt')
114fast2d = b2.register_module(
'CDCTrigger2DFinder')
118fast2d.param(
'testFilename',
'fasttracks.txt')
119fast2d.param(
'suppressClone',
True)
120fast2d.param(
'outputCollectionName',
"TRGCDC2DFinderFastTracks")
121main.add_module(original2d)
122main.add_module(fast2d)
126main.add_module(
'CDCTriggerETF', trueEventTime=trueEventTime)
128main.add_module(
'CDCTrigger2DFitter')
129main.add_module(
'CDCTrigger2DFitter',
130 inputCollectionName=
"TRGCDC2DFinderFastTracks",
131 outputCollectionName=
"TRGCDC2DFitterFastTracks")
132main.add_module(
'CDCTrigger3DFitter')
133main.add_module(
'CDCTrigger3DFitter',
134 inputCollectionName=
"TRGCDC2DFitterFastTracks",
135 outputCollectionName=
"TRGCDC3DFitterFastTracks")
137main.add_module(
'CDCTriggerNeuro',
139main.add_module(
'CDCTriggerNeuro',
141 inputCollectionName=
"TRGCDC2DFinderFastTracks",
142 outputCollectionName=
"TRGCDCNeuroFastTracks")
146 """analyze the difference between 2D with and without clone suppression"""
149 """Initilization of Ana"""
189 """event function of Ana"""
201 ts_hits = self.
trk2d[0].getRelationsTo(
'CDCTriggerSegmentHits')
202 b2.B2DEBUG(10, f
'TS size: {ts_hits.size()}')
203 fast_ts_hits = self.
fast_trk2d[0].getRelationsTo(
'CDCTriggerSegmentHits')
204 b2.B2DEBUG(10, f
'fast TS size: {fast_ts_hits.size()}')
210 all_numbers =
','.join([
'{}'] * 8)
215 b2.B2INFO(f
'2D fitter retention rate: {self.n2d_fitter / total:.2%} ' +
216 f
'(original)/ {self.n2d_fast_fitter / fast_total:.2%} (fast)')
217 b2.B2INFO(f
'3D fitter retention rate: {self.n3d_fitter / self.n2d_fitter:.2%} ' +
218 f
'(original)/ {self.n3d_fast_fitter / self.n2d_fast_fitter:.2%} (fast)')
219 b2.B2INFO(f
'3D neuro retention rate: {self.n3d_neuro / total:.2%} ' +
220 f
'(original)/ {self.n3d_fast_neuro / fast_total:.2%} (fast)')
223main.add_module(
Ana())
224main.add_module(
'RootOutput', outputFileName=
'cdctrigger.root')
static std::string findFile(const std::string &path, bool silent=false)
Search for given file or directory in local or central release directory, and return absolute path if...
A (simplified) python wrapper for StoreArray.
a (simplified) python wrapper for StoreObjPtr.
n3d_neuro
number of TRGCDCNeuroTracks
fast_trk3d
TRGCDC3DFitterFastTracks.
n2d_finder
number of TRGCDC2DFinderTracks
fast_trk2d
TRGCDC2DFitterFastTracks.
n3d_fitter
number of TRGCDC3DFitterTracks
n3d_fast_neuro
number of TRGCDCNeuroFastTracks
trk2d
TRGCDC2DFitterTracks.
fast_trknt
TRGCDCNeuroFastTracks.
trk3d
TRGCDC3DFitterTracks.
fast_finder_trk2d
TRGCDC2DFinderFastTracks.
n3d_fast_fitter
number of TRGCDC3DFitterFastTracks
finder_trk2d
TRGCDC2DFinderTracks.
n2d_fast_finder
number of TRGCDC2DFinderFastTracks
n2d_fast_fitter
number of TRGCDC2DFitterFastTracks
n2d_fitter
number of TRGCDC2DFitterTracks