13 import simulation
as sim
14 import reconstruction
as reco
15 import modularAnalysis
as ana
16 import beamparameters
as beam
18 main = basf2.create_path()
20 main.add_module(
"RootInput")
22 main.add_module(
"Gearbox")
23 main.add_module(
"Geometry")
24 main.add_module(
"HistoManager", histoFileName=
"CollectorOutput.root")
25 beam.add_beamparameters(main,
'Y4S', 10.5796, vertex=[0., 0., 0.])
28 sim.add_simulation(main)
29 reco.add_reconstruction(main, pruneTracks=
False)
32 ana.fillParticleList(
'mu+:qed',
'muonID > 0.1 and useCMSFrame(p) > 2.', writeOut=
True, path=main)
33 ana.reconstructDecay(
'Z0:mumu -> mu-:qed mu+:qed',
'InvM > 10.5296 and InvM < 10.6296', writeOut=
True, path=main)
35 ana.vertexRaveDaughtersUpdate(
'Z0:mumu', 0.0, path=main, silence_warning=
True)
37 ana.matchMCTruth(
'mu+:qed', main)
38 ana.matchMCTruth(
'Z0:mumu', main)
40 ana.printVariableValues(
'Z0:mumu', [
'E',
'deltaE',
'M',
'InvM',
'mcPDG',
'p',
'Ecms'], path=main)
41 ana.printVariableValues(
'mu+:qed', [
'E',
'deltaE',
'M',
'mcPDG',
'p',
'muonID'], path=main)
43 main.add_module(
'VariablesToEventBasedTree',
44 particleList=
'Z0:mumu',
45 variables=[
'InvM',
'Ecms',
46 'daughter(0, p)',
'daughter(1, p)'],
47 event_variables=[
'nTracks',
'expNum',
'runNum',
'evtNum'])
50 components=[
'beamparameters'],
51 primaryTwoBodyDecays=[
'Z0:mumu'], tracks=[],
55 main.add_module(
'RootOutput')
56 main.add_module(
"Progress")
58 basf2.print_path(main)
60 print(basf2.statistics)