Belle II Software  release-08-01-10
collectMassConstrainedJPsiKshort.py
1 #!/usr/bin/env python
2 
3 
10 
11 import basf2
12 
13 import simulation as sim
14 import reconstruction as reco
15 import modularAnalysis as ana
16 import beamparameters as beam
17 import generators as gen
18 
19 
20 main = basf2.create_path()
21 
22 # main.add_module("RootInput")
23 main.add_module("EventInfoSetter")
24 main.add_module("Gearbox")
25 main.add_module("Geometry")
26 main.add_module("HistoManager", histoFileName="CollectorOutput.root")
27 beam.add_beamparameters(main, 'Y4S', None, vertex=[0., 0., 0.])
28 
29 gen.add_evtgen_generator(main, finalstate='signal', signaldecfile='/home/tadeas/belle2/clean_master/decfiles/dec/1111440100.dec')
30 
31 sim.add_simulation(main)
32 reco.add_reconstruction(main, pruneTracks=False, add_muid_hits=True)
33 main.add_module('DAFRecoFitter')
34 # Pre-fit with beam+vertex constraint decays for alignment
35 ana.fillParticleList('mu+:Jpsi', 'muonID > 0.1', writeOut=True, path=main)
36 ana.fillParticleList('pi+:K_S0', 'pionID > 0.1', writeOut=True, path=main)
37 ana.reconstructDecay('J/psi:mumu -> mu-:Jpsi mu+:Jpsi', 'InvM > 2.9969 and InvM < 3.1969', writeOut=True, path=main)
38 ana.reconstructDecay('K_S0:pipi -> pi-:K_S0 pi+:K_S0', 'InvM > 0.44761 and InvM < 0.54761', writeOut=True, path=main)
39 
40 ana.vertexRaveDaughtersUpdate('J/psi:mumu', 0.0, path=main, silence_warning=True)
41 ana.vertexRaveDaughtersUpdate('K_S0:pipi', 0.0, path=main, silence_warning=True)
42 
43 ana.printVariableValues('J/psi:mumu', ['InvM'], path=main)
44 ana.printVariableValues('K_S0:pipi', ['InvM'], path=main)
45 
46 m1 = main.add_module('VariablesToEventBasedTree', fileName='Jpsi.root',
47  particleList='J/psi:mumu',
48  variables=['InvM', 'Ecms',
49  'daughter(0, p)', 'daughter(1, p)'],
50  event_variables=['nTracks', 'expNum', 'runNum', 'evtNum'])
51 main.add_module('VariablesToEventBasedTree', fileName='K_S0.root',
52  particleList='K_S0:pipi',
53  variables=['InvM', 'Ecms',
54  'daughter(0, p)', 'daughter(1, p)'],
55  event_variables=['nTracks', 'expNum', 'runNum', 'evtNum'])
56 main.add_module(
57  'MillepedeCollector',
58  components=[],
59  twoBodyDecays=['K_S0:pipi', 'J/psi:mumu'], tracks=[], primaryVertices=[],
60  calibrateVertex=True,
61  useGblTree=False)
62 
63 main.add_module('RootOutput')
64 main.add_module("Progress")
65 
66 basf2.print_path(main)
67 basf2.process(main)
68 print(basf2.statistics)