Belle II Software development
dqmNeuro_generateSWinput.py
1
8
9import basf2 as b2
10from ROOT import Belle2
11import glob
12from reconstruction import add_reconstruction
13
14from simulation import add_simulation
15import os
16
17b2.set_random_seed(1)
18bkgdir = "/remote/neurobelle/data/bckg/OfficialBKG/15thCampaign/phase3/set0/"
19thrange = [10, 170]
20particlegun_params = {
21 'pdgCodes': [-13, 13], # muons
22 'nTracks': 1, # single tracks
23 'momentumGeneration': 'inversePt', # uniform in the track curvature
24 'momentumParams': [0.3, 10.], # 0.3: minimum pt for standard track finder
25 'thetaGeneration': 'uniformCos', # uniform in solid angle
26 'thetaParams': thrange, # hit SL 6 from z in [-50, 50]
27 'phiGeneration': 'uniform', # uniform in solid angle
28 'phiParams': [0, 360], # full phi
29 'vertexGeneration': 'uniform', # uniform vertex distribution
30 'xVertexParams': [0, 0.0], # vertex on z-axis
31 'yVertexParams': [0, 0.0], # vertex on z-axis
32 'zVertexParams': [0.0, 0.0]} # target range for training
33
34main = b2.create_path()
35main.add_module('EventInfoSetter', evtNumList=5000) # , expList=[7], runList=[3525])
36main.add_module('Gearbox')
37main.add_module('Geometry')
38main.add_module('BeamBkgMixer',
39 backgroundFiles=glob.glob(os.path.join(bkgdir, '*usual*.root')),
40 overallScaleFactor=1,
41 components=['CDC'])
42particlegun = b2.register_module('ParticleGun')
43particlegun.param(particlegun_params)
44main.add_module(particlegun)
45
46add_simulation(main)
47# main.add_module('FullSim')
48main.add_module('CDCDigitizer')
49main.add_module('CDCTriggerTSF',
50 InnerTSLUTFile=Belle2.FileSystem.findFile("trg/cdc/data/innerLUT_v2.2.coe"),
51 OuterTSLUTFile=Belle2.FileSystem.findFile("trg/cdc/data/outerLUT_v2.2.coe"),
52 TSHitCollectionName='CDCTriggerNNInputSegmentHits')
53main.add_module('CDCTriggerTSF',
54 InnerTSLUTFile=Belle2.FileSystem.findFile("trg/cdc/data/innerLUT_v2.2.coe"),
55 OuterTSLUTFile=Belle2.FileSystem.findFile("trg/cdc/data/outerLUT_v2.2.coe"),
56 TSHitCollectionName='CDCTriggerSegmentHits')
57main.add_module('CDCTrigger2DFinder',
58 minHits=4,
59 minHitsShort=4,
60 minPt=0.3,
61 hitCollectionName='CDCTriggerSegmentHits',
62 outputCollectionName='CDCTrigger2DFinderTracks')
63main.add_module('CDCTrigger2DFinder',
64 minHits=4,
65 minHitsShort=4,
66 minPt=0.3,
67 hitCollectionName='CDCTriggerNNInputSegmentHits',
68 outputCollectionName='CDCTriggerNNInput2DFinderTracks')
69main.add_module('CDCTriggerETF',
70 hitCollectionName='CDCTriggerNNInputSegmentHits')
71main.add_module('CDCTriggerNeuro',
72 hitCollectionName='CDCTriggerNNInputSegmentHits',
73 outputCollectionName='CDCTriggerNeuroTracks',
74 inputCollectionName='CDCTriggerNNInput2DFinderTracks',
75 fixedPoint=True,
76 writeMLPinput=True)
77add_reconstruction(main)
78
79
80main.add_module('RootOutput', outputFileName="phase3bckg-0-reco_sim.root")
81main.add_module('Progress')
82b2.process(main)
83print(b2.statistics)
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...
Definition: FileSystem.cc:151