Belle II Software  release-05-01-25
inclusiveReconstruction.py
1 #!/usr/bin/env python3
2 
3 # Doxygen should skip this script
4 # @cond
5 
6 """
7 An example script to reconstruct unspecified particles and the use of MC
8 matching tools for inclusive analyses with sum-of-exclusive method.
9 """
10 
11 __authors__ = "Sam Cunliffe and Yo Sato"
12 
13 import basf2
14 from ROOT import Belle2
15 from modularAnalysis import inputMdst, reconstructDecay, matchMCTruth, \
16  copyLists, variablesToNtuple
17 from variables.utils import create_aliases_for_selected
18 from variables import variables as vm # shorthand for the variable manager instance
19 from stdCharged import stdE, stdK, stdPi
20 from stdPi0s import stdPi0s
21 
22 mypath = basf2.create_path()
23 testinput = Belle2.FileSystem.findFile('analysis/tests/mdst.root')
24 inputMdst("default", testinput, path=mypath)
25 
26 stdPi0s("all", path=mypath)
27 stdE("loose", path=mypath)
28 stdK("loose", path=mypath)
29 stdPi("loose", path=mypath)
30 
31 reconstructDecay("@Xsd:0 -> K+:loose pi-:loose", "", path=mypath)
32 reconstructDecay("@Xsd:1 -> K+:loose pi-:loose pi0:all", "", path=mypath)
33 
34 copyLists("Xsd:comb", ["Xsd:0", "Xsd:1"], path=mypath)
35 # copyList("@Xsd:comb", ["Xsd:0", "Xsd:1"], path=mypath) # this can't work
36 
37 reconstructDecay("B0:inclusive -> Xsd:comb e+:loose e-:loose",
38  "5.2 < Mbc < 5.3", path=mypath)
39 
40 matchMCTruth("B0:inclusive", path=mypath)
41 
42 interesting_variables = ['isSignal', "Mbc", "deltaE", "isUnspecified"]
43 interesting_variables += create_aliases_for_selected(
44  ["px", "py", "pz", "E", "isSignal", "mcErrors", "isUnspecified"],
45  "B0:inclusive -> ^Xsd:comb ^e+:loose ^e-:loose")
46 
47 vm.printAliases()
48 
49 variablesToNtuple("B0:inclusive", interesting_variables, path=mypath)
50 
51 basf2.process(mypath)
52 print(basf2.statistics)
53 
54 # @endcond
variablesToNtuple
Definition: variablesToNtuple.py:1
basf2.process
def process(path, max_event=0)
Definition: __init__.py:25
stdPi0s
Definition: stdPi0s.py:1
variables.utils
Definition: utils.py:1
Belle2::FileSystem::findFile
static std::string findFile(const std::string &path, bool silent=false)
Search for given file or directory in local or central release directory, and return absolute path if...
Definition: FileSystem.cc:147