Belle II Software  release-08-01-10
093_cs.py
1 #!/usr/bin/env python3
2 import basf2 as b2
3 import modularAnalysis as ma
4 import stdPi0s
5 from variables import variables as vm
6 
7 # Perform analysis.
8 main = b2.create_path()
9 
10 ma.inputMdstList(
11  filelist=[
12  b2.find_file(
13  "starterkit/2021/B02ks0pi0_sample.root", data_type="examples"
14  ),
15  b2.find_file("starterkit/2021/uubar_sample.root", data_type="examples"),
16  ],
17  entrySequences=["1001:2000", "15001:30000"],
18  path=main,
19 )
20 
21 stdPi0s.stdPi0s(path=main, listtype="eff60_May2020")
22 ma.fillParticleList(
23  decayString="pi+:good", cut="chiProb > 0.001 and pionID > 0.5", path=main
24 )
25 
26 ma.reconstructDecay(
27  decayString="K_S0 -> pi+:good pi-:good", cut="0.480<=M<=0.516", path=main
28 )
29 
30 ma.reconstructDecay(
31  decayString="B0 -> K_S0 pi0:eff60_May2020",
32  cut="5.1 < Mbc < 5.3 and abs(deltaE) < 2",
33  path=main,
34 )
35 
36 ma.buildRestOfEvent(target_list_name="B0", path=main)
37 cleanMask = (
38  "cleanMask",
39  "nCDCHits > 0 and useCMSFrame(p)<=3.2",
40  "p >= 0.05 and useCMSFrame(p)<=3.2",
41 )
42 ma.appendROEMasks(list_name="B0", mask_tuples=[cleanMask], path=main)
43 
44 ma.buildContinuumSuppression(list_name="B0", roe_mask="cleanMask", path=main)
45 
46 main.add_module(
47  "MVAExpert",
48  listNames=["B0"],
49  extraInfoName="ContinuumProbability",
50  identifier="MVAFastBDT.root", # name of the weightfile used
51 )
52 
53 simpleCSVariables = (
54  [ # We will need these variables later to evaluate the training
55  "R2",
56  "thrustBm",
57  "thrustOm",
58  "cosTBTO",
59  "cosTBz",
60  "KSFWVariables(et)",
61  "KSFWVariables(mm2)",
62  "KSFWVariables(hso00)",
63  "KSFWVariables(hso01)",
64  "KSFWVariables(hso02)",
65  "KSFWVariables(hso03)",
66  "KSFWVariables(hso04)",
67  "KSFWVariables(hso10)",
68  "KSFWVariables(hso12)",
69  "KSFWVariables(hso14)",
70  "KSFWVariables(hso20)",
71  "KSFWVariables(hso22)",
72  "KSFWVariables(hso24)",
73  "KSFWVariables(hoo0)",
74  "KSFWVariables(hoo1)",
75  "KSFWVariables(hoo2)",
76  "KSFWVariables(hoo3)",
77  "KSFWVariables(hoo4)",
78  "CleoConeCS(1)",
79  "CleoConeCS(2)",
80  "CleoConeCS(3)",
81  "CleoConeCS(4)",
82  "CleoConeCS(5)",
83  "CleoConeCS(6)",
84  "CleoConeCS(7)",
85  "CleoConeCS(8)",
86  "CleoConeCS(9)",
87  ]
88 )
89 
90 vm.addAlias("ContProb", "extraInfo(ContinuumProbability)")
91 
92 ma.variablesToNtuple(
93  decayString="B0",
94  variables=["ContProb", "isContinuumEvent"] + simpleCSVariables,
95  filename="ContinuumSuppression_applied.root",
96  treename="tree",
97  path=main,
98 )
99 
100 b2.process(main)
def stdPi0s(listtype="eff60_May2020", path=None, beamBackgroundMVAWeight="", fakePhotonMVAWeight="", biasCorrectionTable="")
Definition: stdPi0s.py:22