Belle II Software development
collectMassConstrainedJPsiKshort.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
17import generators as gen
18
19
20main = basf2.create_path()
21
22# main.add_module("RootInput")
23main.add_module("EventInfoSetter")
24main.add_module("Gearbox")
25main.add_module("Geometry")
26main.add_module("HistoManager", histoFileName="CollectorOutput.root")
27beam.add_beamparameters(main, 'Y4S', None, vertex=[0., 0., 0.])
28
29gen.add_evtgen_generator(main, finalstate='signal', signaldecfile='/home/tadeas/belle2/clean_master/decfiles/dec/1111440100.dec')
30
31sim.add_simulation(main)
32reco.add_reconstruction(main, pruneTracks=False, add_muid_hits=True)
33main.add_module('DAFRecoFitter')
34# Pre-fit with beam+vertex constraint decays for alignment
35ana.fillParticleList('mu+:Jpsi', 'muonID > 0.1', writeOut=True, path=main)
36ana.fillParticleList('pi+:K_S0', 'pionID > 0.1', writeOut=True, path=main)
37ana.reconstructDecay('J/psi:mumu -> mu-:Jpsi mu+:Jpsi', 'InvM > 2.9969 and InvM < 3.1969', writeOut=True, path=main)
38ana.reconstructDecay('K_S0:pipi -> pi-:K_S0 pi+:K_S0', 'InvM > 0.44761 and InvM < 0.54761', writeOut=True, path=main)
39
40ana.vertexRaveDaughtersUpdate('J/psi:mumu', 0.0, path=main, silence_warning=True)
41ana.vertexRaveDaughtersUpdate('K_S0:pipi', 0.0, path=main, silence_warning=True)
42
43ana.printVariableValues('J/psi:mumu', ['InvM'], path=main)
44ana.printVariableValues('K_S0:pipi', ['InvM'], path=main)
45
46m1 = 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'])
51main.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'])
56main.add_module(
57 'MillepedeCollector',
58 components=[],
59 twoBodyDecays=['K_S0:pipi', 'J/psi:mumu'], tracks=[], primaryVertices=[],
60 calibrateVertex=True,
61 useGblTree=False)
62
63main.add_module('RootOutput')
64main.add_module("Progress")
65
66basf2.print_path(main)
67basf2.process(main)
68print(basf2.statistics)