13 from simulation
import add_simulation
14 from optparse
import OptionParser
15 from L1trigger
import add_trigger_simulation
16 from reconstruction
import add_cdst_output, add_reconstruction
19 background_files = glob.glob(
'/group/belle2/BGFile/OfficialBKG/phase2/pseudorandom/BGOverlay.physics.0003.*.root')
24 parser = OptionParser()
25 parser.add_option(
'-n',
'--nevents', dest=
'nevents', default=200000,
26 help=
'Number of events to process')
27 parser.add_option(
'-f',
'--file', dest=
'filename',
28 default=
'Bhabha_Prod5_MC.root')
29 parser.add_option(
'-o',
'--output', dest=
'cdstname',
30 default=
'Bhabha_Prod5_MC_cdst.root')
31 (options, args) = parser.parse_args()
33 home = os.environ[
'BELLE2_LOCAL_DIR']
36 b2.set_log_level(b2.LogLevel.ERROR)
39 b2.use_database_chain()
40 b2.use_central_database(
"data_reprocessing_prod5", b2.LogLevel.WARNING)
43 main = b2.create_path()
44 empty = b2.create_path()
47 eventinfosetter = b2.register_module(
'EventInfoSetter')
48 eventinfosetter.param({
'evtNumList': [int(options.nevents)],
'runList': [1]})
49 main.add_module(eventinfosetter)
52 histo = b2.register_module(
'HistoManager')
53 histo.param(
'histoFileName',
'DQMhistograms.root')
54 main.add_module(histo)
57 gearbox = b2.register_module(
'Gearbox', fileName=
"geometry/Beast2_phase2.xml")
58 main.add_module(gearbox)
61 geometry = b2.register_module(
'Geometry')
69 main.add_module(geometry)
72 generator = b2.register_module(
'BabayagaNLOInput')
73 generator.param(
'FinalState',
'ee')
74 generator.param(
'MaxAcollinearity', 180.0)
75 generator.param(
'ScatteringAngleRange', [15., 165.])
76 generator.param(
'FMax', 75000)
77 generator.param(
'MinEnergy', 0.01)
78 generator.param(
'Order',
'exp')
79 generator.param(
'DebugEnergySpread', 0.01)
80 generator.param(
'Epsilon', 0.00005)
81 generatorpreselection = b2.register_module(
'GeneratorPreselection')
82 generatorpreselection.param(
'nChargedMin', 1)
83 generatorpreselection.param(
'nChargedMax', 999)
84 generatorpreselection.param(
'MinChargedP', 4.)
86 generatorpreselection.param(
'MinChargedTheta', 17.)
87 generatorpreselection.param(
'MaxChargedTheta', 36.)
88 generatorpreselection.param(
'applyInCMS',
False)
89 main.add_module(generator)
90 main.add_module(generatorpreselection)
91 generatorpreselection.if_value(
'!=11', empty)
101 allowed_components = [
'PXD',
'SVD',
'CDC',
'ECL',
'TOP',
'ARICH',
'KLM']
102 add_simulation(main, components=allowed_components, bkgfiles=background_files, bkgOverlay=
True)
105 arich_digitizer = b2.register_module(
'ARICHDigitizer')
106 arich_digitizer.param(
'MagneticFieldDistorsion', 1)
107 main.add_module(arich_digitizer)
110 add_trigger_simulation(main, shortTracks=
True, Belle2Phase=
"Phase2")
114 add_reconstruction(main)
117 arichHits = b2.register_module(
'ARICHFillHits')
118 arichHits.param(
'MagFieldCorrection', 1)
119 main.add_module(arichHits)
123 arichreco = b2.register_module(
'ARICHReconstructor')
125 arichreco.param(
'storePhotons', 1)
126 arichreco.param(
'useAlignment', 0)
127 main.add_module(arichreco)
131 arichNtuple = b2.register_module(
'ARICHNtuple')
132 arichNtuple.param(
'outputFile', options.filename)
133 main.add_module(arichNtuple)
137 arichdqm = b2.register_module(
'ARICHDQM')
138 main.add_module(arichdqm)
140 add_cdst_output(main,
True,
'/ghi/fs01/belle2/bdata/users/sachit/' + options.cdstname)
154 progress = b2.register_module(
'Progress')
155 main.add_module(progress)