Belle II Software  release-05-01-25
test2_LowMassTwoTrackPions.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 """
5 <header>
6  <input>../LowMassTwoTrackPions.udst.root</input>
7  <output>../LowMassTwoTrackPions_Validation.root</output>
8  <contact>zhouxy@buaa.edu.cn</contact>
9 </header>
10 """
11 
12 import basf2
13 from modularAnalysis import inputMdst
14 from skim import lowMulti
15 from variables import variables
16 from modularAnalysis import variablesToHistogram
17 
18 LowMassTwoTrackPions_path = basf2.Path()
19 
20 # load input ROOT file
21 inputMdst('default', '../LowMassTwoTrackPions.udst.root', path=LowMassTwoTrackPions_path)
22 
23 variables.addAlias('pip_p_cms', 'daughter(0, useCMSFrame(p))')
24 variables.addAlias('pim_p_cms', 'daughter(1, useCMSFrame(p))')
25 variables.addAlias('gamma_E_cms', 'daughter(2, useCMSFrame(E))')
26 variables.addAlias('pip_theta_lab', 'formula(daughter(0, theta)*180/3.1415927)')
27 variables.addAlias('pim_theta_lab', 'formula(daughter(1, theta)*180/3.1415927)')
28 variables.addAlias('gamma_theta_lab', 'formula(daughter(2, theta)*180/3.1415927)')
29 variables.addAlias('Mpipi', 'daughterInvM(0,1)')
30 
31 variablesHist = [
32  ('pip_p_cms', 60, 0, 6),
33  ('pim_p_cms', 60, 0, 6),
34  ('gamma_E_cms', 60, 0, 6),
35  ('pip_theta_lab', 90, 0, 180),
36  ('pim_theta_lab', 90, 0, 180),
37  ('gamma_theta_lab', 90, 0, 180),
38  ('Mpipi', 80, 0., 4.),
39  ('M', 60, 6., 12.)
40  ]
41 
42 # Output the variables to histograms
44  'vpho:LowMassTwoTrack',
45  variablesHist,
46  filename='../LowMassTwoTrackPions_Validation.root',
47  path=LowMassTwoTrackPions_path)
48 
49 # Process the events
50 basf2.process(LowMassTwoTrackPions_path)
51 
52 # print out the summary
53 print(basf2.statistics)
basf2.process
def process(path, max_event=0)
Definition: __init__.py:25
variablesToHistogram
Definition: variablesToHistogram.py:1