Belle II Software  release-05-01-25
B2A705-EventKinematics.py
1 #!/usr/bin/env python3
2 
3 
14 
15 
16 import basf2 as b2
17 import modularAnalysis as ma
18 import variables.collections as vc
19 
20 # create path
21 my_path = b2.create_path()
22 
23 # load input ROOT file
24 ma.inputMdst(environmentType='default',
25  filename=b2.find_file('B02D0pi0_D02pi0pi0.root', 'examples', False),
26  path=my_path)
27 
28 # calculate the event kinematics variables using the most likely mass
29 # hypothesis for each track and applying the predefined selection criteria
30 # for tracks (pt > 0.1 and thetaInCDCAcceptance and abs(dz) < 3 and dr < 0.5)
31 # and for photons (E > 0.05 and thetaInCDCAcceptance)
32 ma.buildEventKinematics(default_cleanup=True, fillWithMostLikely=True, path=my_path)
33 
34 # The predefined collection 'event_kinematics' contains all variables that
35 # require the Event Kinematics module to be run. Those are the total missing
36 # momentum of the event as well as its x-, y-, and z-component, both in the
37 # lab and in the CMS frame. Furthermore, the variable collection contains the
38 # missing energy of the event in the CMS frame, the missing mass squared of
39 # the event, the total visible energy of the event in the CMS frame and the
40 # total energy of all photons in the event.
41 ma.variablesToNtuple('', vc.event_kinematics, filename='B2A705-EventKinematics.root', path=my_path)
42 
43 # Process the events
44 b2.process(my_path)
45 # print out the summary
46 print(b2.statistics)
variables.collections
Definition: collections.py:1