Belle II Software  release-05-01-25
2_analysis_1110021010.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 """
5 <header>
6  <input>../1110021010.dst.root</input>
7  <output>1110021010_Validation.root</output>
8  <contact>sam.cunliffe@desy.de</contact>
9 </header>
10 """
11 # Runs a simple analysis on signal [B0 -> rho0 gamma] events. Saves historams
12 # in a format for the validation server. There are better example analysis
13 # scripts in analysis/examples and analysis/examples/tutorials.
14 
15 DECAY_MODE_ID = 1110021010
16 INPUT_FILENAME = "../%i.dst.root" % DECAY_MODE_ID
17 OUTPUT_FILENAME = "%i_Validation.root" % DECAY_MODE_ID
18 
19 import basf2
20 from modularAnalysis import inputMdst, reconstructDecay, matchMCTruth
21 from stdPhotons import stdPhotons
22 from stdCharged import stdPi
23 from validation_tools.metadata import create_validation_histograms
24 from variables import variables as vm # shorthand for the variable manager instance
25 
26 main = basf2.Path()
27 inputMdst('default', INPUT_FILENAME, path=main)
28 
29 stdPi('loose', path=main)
30 stdPhotons('loose', path=main)
31 
32 reconstructDecay('rho0:pipi -> pi+:loose pi-:loose', '0.35 < M < 1.2', path=main)
33 matchMCTruth('rho0:pipi', path=main)
34 
35 reconstructDecay('B0 -> rho0:pipi gamma:loose', '4.8 < M < 5.8', path=main)
36 matchMCTruth('B0', path=main)
37 
38 create_validation_histograms(
39  main, OUTPUT_FILENAME, "B0",
40  variables_1d=[
41  (
42  "Mbc", 180, 5.2, 5.29,
43  r"$B^0\to\rho^0\gamma$ candidates' beam-constrained mass",
44  "Sam Cunliffe <sam.cunliffe@desy.de>",
45  r"The beam-constrained mass distribution of $B^0\to\rho^0\gamma$ decays",
46  "Distribution should be peaking at the nominal $B^0$ mass. Tail towards low mass."
47  "M_{bc} [GeV/c^{2}]", "Candidates",
48  ),
49  (
50  "useRestFrame(daughter(1, E))", 50, 1.5, 4.0,
51  r"The photon energy distribution for $B^0\to\rho^0\gamma$ decays",
52  "Sam Cunliffe <sam.cunliffe@desy.de>; Torben Ferber <torben.ferber@desy.de>",
53  "Sharp distribution at 2.5 GeV. Look for differences in "
54  "the abslute scale. This could be an indication of a loss of photon efficiency.",
55  "E_{\gamma} [GeV]", "Candidates",
56  ),
57  ]
58 )
59 
60 basf2.process(main)
61 print(basf2.statistics)
stdPhotons
Definition: stdPhotons.py:1
basf2.process
def process(path, max_event=0)
Definition: __init__.py:25
validation_tools.metadata
Definition: metadata.py:1