Belle II Software development
collectKinematicConstrainedMuMu.py
1#!/usr/bin/env python
2
3
10
11import basf2
12
13import simulation as sim
14import reconstruction as reco
15import modularAnalysis as ana
16import beamparameters as beam
17
18main = basf2.create_path()
19
20main.add_module("RootInput")
21# main.add_module("EventInfoSetter")
22main.add_module("Gearbox")
23main.add_module("Geometry")
24main.add_module("HistoManager", histoFileName="CollectorOutput.root")
25beam.add_beamparameters(main, 'Y4S', 10.5796, vertex=[0., 0., 0.])
26
27# main.add_module('PairGen', pdgCode=13)
28sim.add_simulation(main)
29reco.add_reconstruction(main, pruneTracks=False)
30
31# Pre-fit with beam+vertex constraint decays for alignment
32ana.fillParticleList('mu+:qed', 'muonID > 0.1 and useCMSFrame(p) > 2.', writeOut=True, path=main)
33ana.reconstructDecay('Z0:mumu -> mu-:qed mu+:qed', 'InvM > 10.5296 and InvM < 10.6296', writeOut=True, path=main)
34
35ana.vertexRaveDaughtersUpdate('Z0:mumu', 0.0, path=main, silence_warning=True)
36
37ana.matchMCTruth('mu+:qed', main)
38ana.matchMCTruth('Z0:mumu', main)
39
40ana.printVariableValues('Z0:mumu', ['E', 'deltaE', 'M', 'InvM', 'mcPDG', 'p', 'Ecms'], path=main)
41ana.printVariableValues('mu+:qed', ['E', 'deltaE', 'M', 'mcPDG', 'p', 'muonID'], path=main)
42
43main.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'])
48main.add_module(
49 'MillepedeCollector',
50 components=['beamparameters'],
51 primaryTwoBodyDecays=['Z0:mumu'], tracks=[],
52 calibrateVertex=True,
53 useGblTree=False)
54
55main.add_module('RootOutput')
56main.add_module("Progress")
57
58basf2.print_path(main)
59basf2.process(main)
60print(basf2.statistics)