Belle II Software  release-08-01-10
dqmNeuro_generateSWinput.py
1 
8 
9 import basf2 as b2
10 from ROOT import Belle2
11 import glob
12 from reconstruction import add_reconstruction
13 
14 from simulation import add_simulation
15 import os
16 
17 b2.set_random_seed(1)
18 bkgdir = "/remote/neurobelle/data/bckg/OfficialBKG/15thCampaign/phase3/set0/"
19 thrange = [10, 170]
20 particlegun_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 
34 main = b2.create_path()
35 main.add_module('EventInfoSetter', evtNumList=5000) # , expList=[7], runList=[3525])
36 main.add_module('Gearbox')
37 main.add_module('Geometry')
38 main.add_module('BeamBkgMixer',
39  backgroundFiles=glob.glob(os.path.join(bkgdir, '*usual*.root')),
40  overallScaleFactor=1,
41  components=['CDC'])
42 particlegun = b2.register_module('ParticleGun')
43 particlegun.param(particlegun_params)
44 main.add_module(particlegun)
45 
46 add_simulation(main)
47 # main.add_module('FullSim')
48 main.add_module('CDCDigitizer')
49 main.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')
53 main.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')
57 main.add_module('CDCTrigger2DFinder',
58  minHits=4,
59  minHitsShort=4,
60  minPt=0.3,
61  hitCollectionName='CDCTriggerSegmentHits',
62  outputCollectionName='CDCTrigger2DFinderTracks')
63 main.add_module('CDCTrigger2DFinder',
64  minHits=4,
65  minHitsShort=4,
66  minPt=0.3,
67  hitCollectionName='CDCTriggerNNInputSegmentHits',
68  outputCollectionName='CDCTriggerNNInput2DFinderTracks')
69 main.add_module('CDCTriggerETF',
70  hitCollectionName='CDCTriggerNNInputSegmentHits')
71 main.add_module('CDCTriggerNeuro',
72  hitCollectionName='CDCTriggerNNInputSegmentHits',
73  outputCollectionName='CDCTriggerNeuroTracks',
74  inputCollectionName='CDCTriggerNNInput2DFinderTracks',
75  fixedPoint=True,
76  writeMLPinput=True)
77 add_reconstruction(main)
78 
79 
80 main.add_module('RootOutput', outputFileName="phase3bckg-0-reco_sim.root")
81 main.add_module('Progress')
82 b2.process(main)
83 print(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:148