13 from ROOT
import Belle2
14 from math
import pi, tan
17 generate tracks with particle gun, simulate CDC and CDC trigger, save the output.
27 particlegun_params = {
28 'pdgCodes': [-13, 13],
30 'momentumGeneration':
'inversePt',
31 'momentumParams': [0.3, 10.],
32 'thetaGeneration':
'uniform',
33 'thetaParams': [35, 145],
34 'phiGeneration':
'uniform',
35 'phiParams': [0, 360],
36 'vertexGeneration':
'uniform',
37 'xVertexParams': [0, 0.0],
38 'yVertexParams': [0, 0.0],
39 'zVertexParams': [-50.0, 50.0]}
46 b2.set_random_seed(seed)
50 main = b2.create_path()
52 empty_path = b2.create_path()
54 main.add_module(
'EventInfoSetter', evtNumList=evtnum)
55 main.add_module(
'Progress')
56 main.add_module(
'Gearbox')
57 main.add_module(
'Geometry', components=[
'BeamPipe',
59 'MagneticFieldConstant4LimitedRCDC'])
60 particlegun = b2.register_module(
'ParticleGun')
61 particlegun.param(particlegun_params)
62 main.add_module(particlegun)
65 z_SL0 = [-31 - 1.5 /
tan(30 / 180. * pi), 57 + 1.5 /
tan(17 / 180. * pi)]
71 """Reject tracks with bad combination of z0 and theta"""
74 """Initialization of Skim"""
79 """event function of Skim"""
82 z0 = self.
mcmc[0].getVertex().Z()
84 vec = self.
mcmc[0].getMomentum()
86 if z_SL0[0] < z0 + r_SL0 / vec.Pt() * vec.Z() < z_SL0[1]:
92 skim.if_false(empty_path)
94 main.add_module(
'FullSim')
95 main.add_module(
'CDCDigitizer')
103 trueEventTime =
False
105 main.add_module(
'CDCTriggerTSF',
109 original2d = b2.register_module(
'CDCTrigger2DFinder')
113 original2d.param(
'testFilename',
'tracks.txt')
115 fast2d = b2.register_module(
'CDCTrigger2DFinder')
119 fast2d.param(
'testFilename',
'fasttracks.txt')
120 fast2d.param(
'suppressClone',
True)
121 fast2d.param(
'outputCollectionName',
"TRGCDC2DFinderFastTracks")
122 main.add_module(original2d)
123 main.add_module(fast2d)
127 main.add_module(
'CDCTriggerETF', trueEventTime=trueEventTime)
129 main.add_module(
'CDCTrigger2DFitter')
130 main.add_module(
'CDCTrigger2DFitter',
131 inputCollectionName=
"TRGCDC2DFinderFastTracks",
132 outputCollectionName=
"TRGCDC2DFitterFastTracks")
133 main.add_module(
'CDCTrigger3DFitter')
134 main.add_module(
'CDCTrigger3DFitter',
135 inputCollectionName=
"TRGCDC2DFitterFastTracks",
136 outputCollectionName=
"TRGCDC3DFitterFastTracks")
138 main.add_module(
'CDCTriggerNeuro',
140 main.add_module(
'CDCTriggerNeuro',
142 inputCollectionName=
"TRGCDC2DFinderFastTracks",
143 outputCollectionName=
"TRGCDCNeuroFastTracks")
147 """analyze the difference between 2D with and without clone suppression"""
150 """Initilization of Ana"""
190 """event function of Ana"""
202 ts_hits = self.
trk2dtrk2d[0].getRelationsTo(
'CDCTriggerSegmentHits')
203 b2.B2DEBUG(10,
'TS size: {}'.format(ts_hits.size()))
204 fast_ts_hits = self.
fast_trk2dfast_trk2d[0].getRelationsTo(
'CDCTriggerSegmentHits')
205 b2.B2DEBUG(10,
'fast TS size: {}'.format(fast_ts_hits.size()))
211 all_numbers =
','.join([
'{}'] * 8)
216 b2.B2INFO(
'2D fitter retention rate: {:.2%} (original)/ {:.2%} (fast)'.format(
218 b2.B2INFO(
'3D fitter retention rate: {:.2%} (original)/ {:.2%} (fast)'.format(
220 b2.B2INFO(
'3D neuro retention rate: {:.2%} (original)/ {:.2%} (fast)'.format(
224 main.add_module(
Ana())
225 main.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
double tan(double a)
tan for double