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