11import modularAnalysis
as ma
17 beamBackgroundMVAWeight="",
18 fakePhotonMVAWeight="",
19 biasCorrectionTable=""):
21 Function to prepare one of several standardized types of photon lists:
23 - 'gamma:all' with no cuts this will be polluted by tracks
from outside the acceptance
24 -
'gamma:cdc' all clusters inside the CDC tracking acceptance
25 -
'gamma:loose' (default)
with some loose quality selections
26 -
'gamma:tight' like loose but
with higher energy cuts depending on detector regions
27 -
'gamma:pi0eff60_May2020' gamma list
for 60% pi0 efficiency list, optimized
in May 2020
28 -
'gamma:pi0eff50_May2020' gamma list
for 50% pi0 efficiency list, optimized
in May 2020
29 -
'gamma:pi0eff40_May2020' gamma list
for 40% pi0 efficiency list, optimized
in May 2020
30 -
'gamma:pi0eff30_May2020' gamma list
for 30% pi0 efficiency list, optimized
in May 2020
31 -
'gamma:pi0eff20_May2020' gamma list
for 20% pi0 efficiency list, optimized
in May 2020
32 -
'gamma:pi0eff10_May2020' gamma list
for 10% pi0 efficiency list, optimized
in May 2020
33 -
'gamma:pi0' gamma list
for pi0 list
34 -
'gamma:pi0highE' gamma list
for pi0 list, high energy selection
36 - For latest pi0 recommendations see https://xwiki.desy.de/xwiki/rest/p/e23c8
39 listtype (str): name of standard list
40 path (basf2.Path): modules are added to this path
41 beamBackgroundMVAWeight (str): type of weight file
for beam background MVA;
if empty, beam background MVA will
not be used
45 `Neutrals Performance XWiki page <https://xwiki.desy.de/xwiki/rest/p/e23c8>`_
46 for information on the beam background MVA.
48 fakePhotonMVAWeight (str): type of weight file
for fake photon MVA;
if empty, fake photon MVA will
not be used
52 `Neutrals Performance XWiki page <https://xwiki.desy.de/xwiki/rest/p/e23c8>`_
53 for information on the fake photon MVA.
55 biasCorrectionTable (str): correction table
for the photon energy bias correction (should only be applied to data)
59 `Neutrals Performance XWiki page <https://xwiki.desy.de/xwiki/rest/p/e23c8>`_
60 for information on the names of available correction tables..
65 ma.fillParticleList(
'gamma:all',
'', writeOut=
True, path=path)
68 elif listtype ==
'cdc':
77 elif listtype ==
'loose':
79 beamBackgroundMVAWeight=beamBackgroundMVAWeight,
80 fakePhotonMVAWeight=fakePhotonMVAWeight,
81 biasCorrectionTable=biasCorrectionTable)
85 'clusterErrorTiming < 1e6 and [clusterE1E9 > 0.4 or E > 0.075]',
89 elif listtype ==
'tight':
91 beamBackgroundMVAWeight=beamBackgroundMVAWeight,
92 fakePhotonMVAWeight=fakePhotonMVAWeight,
93 biasCorrectionTable=biasCorrectionTable)
97 '[clusterReg == 1 and E > 0.05] or [clusterReg == 2 and E > 0.05] or [clusterReg == 3 and E > 0.075]',
100 elif listtype ==
'pi0eff10_May2020':
102 'gamma:pi0eff10_May2020',
103 '[clusterNHits>1.5] and thetaInCDCAcceptance and \
104 [[clusterReg==1 and E>0.200] or [clusterReg==2 and E>0.100] or [clusterReg==3 and E>0.180]] and [clusterE1E9>0.5]',
108 elif listtype ==
'pi0eff20_May2020':
110 'gamma:pi0eff20_May2020',
111 '[clusterNHits>1.5] and thetaInCDCAcceptance and \
112 [[clusterReg==1 and E>0.120] or [clusterReg==2 and E>0.030] or [clusterReg==3 and E>0.080]] and [clusterE1E9>0.4]',
116 elif listtype ==
'pi0eff30_May2020' or listtype ==
'pi0eff40_May2020':
119 '[clusterNHits>1.5] and thetaInCDCAcceptance and \
120 [[clusterReg==1 and E>0.080] or [clusterReg==2 and E>0.030] or [clusterReg==3 and E>0.060 ]]',
124 elif listtype ==
'pi0eff50_May2020':
126 'gamma:pi0eff50_May2020',
127 '[clusterNHits>1.5] and thetaInCDCAcceptance and \
128 [[clusterReg==1 and E>0.025] or [clusterReg==2 and E>0.025] or [clusterReg==3 and E>0.040]]',
132 elif listtype ==
'pi0eff60_May2020':
134 'gamma:pi0eff60_May2020',
135 '[clusterNHits>1.5] and thetaInCDCAcceptance and \
136 [[clusterReg==1 and E>0.0225] or [clusterReg==2 and E>0.020] or [clusterReg==3 and E>0.020]]',
141 raise ValueError(f
"\"{listtype}\" is none of the allowed standardized types of photon lists!")
143 if listtype
not in [
'loose',
'tight']:
144 if beamBackgroundMVAWeight:
145 ma.getBeamBackgroundProbability(particleList=f
'gamma:{listtype}', weight=beamBackgroundMVAWeight, path=path)
146 if fakePhotonMVAWeight:
147 ma.getFakePhotonProbability(particleList=f
'gamma:{listtype}', weight=fakePhotonMVAWeight, path=path)
148 if biasCorrectionTable:
149 ma.correctEnergyBias(inputListNames=[f
'gamma:{listtype}'], tableName=biasCorrectionTable, path=path)
154def loadStdSkimPhoton(path):
156 Function to prepare the skim photon lists.
159 Should only be used by skims.
162 path (basf2.Path): modules are added to this path
175def loadStdGoodBellePhoton(path):
177 Load the Belle goodBelle list. Creates a ParticleList named
178 'gamma:goodBelle' with '0.5 < :b2:var:`goodBelleGamma` < 1.5'
181 Should only be used
for Belle analyses using `b2bii`.
184 path (basf2.Path): the path to load the modules
186 ma.fillParticleList('gamma:goodBelle',
'0.5 < goodBelleGamma < 1.5',
True, path)