Skip to content

Commit 563b94a

Browse files
committed
Merge pull request #620 in B2/basf2 from feature/modify-TDCPV-skim-for-K_S0-pi0-gamma-rel6 to release/06-00
* commit '2a00fcd4f5a7a53779c32f3e39a97341f058dc5f': modified test script to be consistent with the implementation recover a mistakenly removed line add SkimHighEFF in stdPi0s and modified TDCPV_qqs skim add eff60_May2020_nomcmatch in stdPi0s
2 parents 28b6e57 + 2a00fcd commit 563b94a

File tree

3 files changed

+70
-7
lines changed

3 files changed

+70
-7
lines changed

analysis/scripts/stdPi0s.py

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,28 @@ def stdPi0s(listtype="eff60_May2020", path=None, loadPhotonBeamBackgroundMVA=Fal
8383
stdPi0s('eff50_May2020_nomcmatch', path, loadPhotonBeamBackgroundMVA)
8484
ma.cutAndCopyList('pi0:eff50_May2020', 'pi0:eff50_May2020_nomcmatch', '', True, path)
8585
ma.matchMCTruth('pi0:eff50_May2020', path)
86-
elif 'eff60_May2020' == listtype:
86+
elif 'eff60_May2020_nomcmatch' == listtype:
8787
stdPhotons('pi0eff60_May2020', path, loadPhotonBeamBackgroundMVA)
88-
ma.reconstructDecay('pi0:eff60_May2020 -> gamma:pi0eff60_May2020 gamma:pi0eff60_May2020', '0.03<InvM', 1, True, path)
88+
ma.reconstructDecay(
89+
'pi0:eff60_May2020_nomcmatch -> gamma:pi0eff60_May2020 gamma:pi0eff60_May2020',
90+
'0.03<InvM',
91+
1,
92+
True,
93+
path)
94+
elif 'eff60_May2020' == listtype:
95+
stdPi0s('eff60_May2020_nomcmatch', path, loadPhotonBeamBackgroundMVA)
96+
ma.cutAndCopyList('pi0:eff60_May2020', 'pi0:eff60_May2020_nomcmatch', '', True, path)
8997
ma.matchMCTruth('pi0:eff60_May2020', path)
9098

9199
# skim list(s)
92100
elif listtype == 'skim':
93101
stdPi0s('eff50_May2020_nomcmatch', path, loadPhotonBeamBackgroundMVA)
94102
ma.cutAndCopyList('pi0:skim', 'pi0:eff50_May2020_nomcmatch', '', True, path)
95103
kFit('pi0:skim', 0.0, 'mass', path=path)
104+
elif listtype == 'SkimHighEff':
105+
stdPi0s('eff60_May2020_nomcmatch', path, loadPhotonBeamBackgroundMVA)
106+
ma.cutAndCopyList('pi0:SkimHighEff', 'pi0:eff60_May2020_nomcmatch', '', True, path)
107+
kFit('pi0:SkimHighEff', 0.0, 'mass', path=path)
96108

97109
# same lists with, but with mass constraints fits
98110
elif listtype == 'allFit':
@@ -126,7 +138,7 @@ def stdPi0s(listtype="eff60_May2020", path=None, loadPhotonBeamBackgroundMVA=Fal
126138
else:
127139
raise ValueError(f"\"{listtype}\" is none of the allowed standardized types of pi0 lists!")
128140

129-
# pi0 list for skims (and ONLY for skims)
141+
# pi0 list(s) for skims (and ONLY for skims)
130142

131143

132144
def loadStdSkimPi0(path):
@@ -141,3 +153,17 @@ def loadStdSkimPi0(path):
141153
142154
"""
143155
stdPi0s('skim', path, loadPhotonBeamBackgroundMVA=False)
156+
157+
158+
def loadStdSkimHighEffPi0(path):
159+
"""
160+
Function to prepare the high-efficiency skim pi0 lists based on eff60_May2020 list.
161+
162+
Warning:
163+
Should only be used by skims.
164+
165+
Parameters:
166+
path (basf2.Path) modules are added to this path
167+
168+
"""
169+
stdPi0s('SkimHighEff', path, loadPhotonBeamBackgroundMVA=False)

analysis/tests/test_std_pi0s.py

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,15 @@ def test_default_list_works(self):
7272
"""Check that the default list type works."""
7373
stdPi0s_signature = inspect.signature(stdPi0s.stdPi0s)
7474
default_listtype = stdPi0s_signature.parameters["listtype"].default
75-
self._check_list(expected_lists=["pi0" + default_listtype, "pi0" + default_listtype, default_listtype])
75+
self._check_list(
76+
expected_lists=[
77+
"pi0" +
78+
default_listtype,
79+
"pi0" +
80+
default_listtype,
81+
default_listtype +
82+
"_nomcmatch",
83+
default_listtype])
7684

7785
def test_all_list(self):
7886
"""check that the builder function works with the all list"""
@@ -111,9 +119,22 @@ def test_eff50_May2020_list(self):
111119
"eff50_May2020_nomcmatch",
112120
"eff50_May2020"])
113121

122+
def test_eff60_May2020_nomcmatch_list(self):
123+
"""check that the builder function works with the eff50_May2020_nomcmatch list"""
124+
self._check_list("eff60_May2020_nomcmatch",
125+
expected_lists=["pi0eff60_May2020",
126+
"pi0eff60_May2020",
127+
"eff60_May2020_nomcmatch"])
128+
114129
def test_eff60_May2020_list(self):
115130
"""check that the builder function works with the eff60_May2020 list"""
116-
self._check_list("eff60_May2020", expected_lists=["pi0eff60_May2020", "pi0eff60_May2020", "eff60_May2020"])
131+
self._check_list(
132+
"eff60_May2020",
133+
expected_lists=[
134+
"pi0eff60_May2020",
135+
"pi0eff60_May2020",
136+
"eff60_May2020_nomcmatch",
137+
"eff60_May2020"])
117138

118139
def test_allfit_list(self):
119140
"""check that the builder function works with the allFit list"""
@@ -177,6 +198,7 @@ def test_eff60_May2020fit_list(self):
177198
expected_lists=[
178199
"pi0eff60_May2020",
179200
"pi0eff60_May2020",
201+
'eff60_May2020_nomcmatch',
180202
"eff60_May2020",
181203
"eff60_May2020Fit"])
182204

@@ -190,6 +212,16 @@ def test_skim(self):
190212
"eff50_May2020_nomcmatch",
191213
"skim"])
192214

215+
def test_SkimHighEff(self):
216+
"""check that the builder function works with the skim list"""
217+
self._check_list(
218+
std_function=stdPi0s.loadStdSkimHighEffPi0,
219+
expected_lists=[
220+
"pi0eff60_May2020",
221+
"pi0eff60_May2020",
222+
"eff60_May2020_nomcmatch",
223+
"SkimHighEff"])
224+
193225

194226
if __name__ == '__main__':
195227
unittest.main()

skim/scripts/skim/WGs/tdcpv.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from skim import BaseSkim, fancy_skim_header
2222
from stdCharged import stdE, stdK, stdMu, stdPi
2323
from stdPhotons import stdPhotons
24-
from stdPi0s import loadStdSkimPi0, stdPi0s
24+
from stdPi0s import loadStdSkimPi0, stdPi0s, loadStdSkimHighEffPi0
2525
from stdV0s import stdKshorts
2626
from variables import variables as vm
2727
from stdKlongs import stdKlongs
@@ -73,6 +73,7 @@ class TDCPV_qqs(BaseSkim):
7373
* ``eta:SkimHighEff``
7474
* ``pi0:eff40_May2020``
7575
* ``pi0:skim``
76+
* ``pi0:SkimHighEff``
7677
* ``rho0:SkimHighEff``
7778
* ``omega:SkimHighEff``
7879
* ``f_0:SkimHighEff``
@@ -81,7 +82,8 @@ class TDCPV_qqs(BaseSkim):
8182
* ``omega:SkimHighEff``
8283
* ``K*0:SkimHighEff``
8384
* ``gamma:E15 , cut : 1.4 < E < 4``
84-
* ``k_S0:merged``
85+
* ``gamma:ECMS16 , cut : 1.6 < useCMSFrame(E)``
86+
* ``K_S0:merged``
8587
* ``K+:1%``
8688
8789
**Cuts used**:
@@ -108,6 +110,7 @@ def load_standard_lists(self, path):
108110
loadStdSkimHighEffTracks('pi', path=path)
109111
loadStdSkimHighEffTracks('K', path=path)
110112
loadStdSkimPi0(path=path)
113+
loadStdSkimHighEffPi0(path=path)
111114
stdKshorts(path=path)
112115
stdPi0s("eff40_May2020", path=path, loadPhotonBeamBackgroundMVA=False)
113116

@@ -121,6 +124,7 @@ def load_standard_lists(self, path):
121124

122125
def additional_setup(self, path):
123126
ma.cutAndCopyList('gamma:E15', 'gamma:all', '1.4<E<4', path=path)
127+
ma.cutAndCopyList('gamma:ECMS16', 'gamma:all', '1.6<useCMSFrame(E)', path=path)
124128

125129
def build_lists(self, path):
126130
vm.addAlias('E_ECL_pi_TDCPV', 'totalECLEnergyOfParticlesInList(pi+:TDCPV_eventshape)')
@@ -145,6 +149,7 @@ def build_lists(self, path):
145149
'pi+:SkimHighEff pi-:SkimHighEff K_S0:merged',
146150
'pi+:SkimHighEff pi-:SkimHighEff K_S0:merged gamma:E15',
147151
'pi0:skim K_S0:merged gamma:E15',
152+
'pi0:SkimHighEff K_S0:merged gamma:ECMS16',
148153
]
149154

150155
bu_qqs_Channels = [

0 commit comments

Comments
 (0)