12import modularAnalysis
as ma
18 beamBackgroundMVAWeight="",
19 fakePhotonMVAWeight="",
20 biasCorrectionTable=""):
22 Function to prepare one of several standardized types of photon lists:
24 - 'gamma:all' with no cuts this will be polluted by tracks
from outside the acceptance
25 -
'gamma:cdc' all clusters inside the CDC tracking acceptance
26 -
'gamma:loose' (default)
with some loose quality selections
27 -
'gamma:tight' like loose but
with higher energy cuts depending on detector regions
28 -
'gamma:pi0eff60_May2020' gamma list
for 60% pi0 efficiency list, optimized
in May 2020
29 -
'gamma:pi0eff50_May2020' gamma list
for 50% pi0 efficiency list, optimized
in May 2020
30 -
'gamma:pi0eff40_May2020' gamma list
for 40% pi0 efficiency list, optimized
in May 2020
31 -
'gamma:pi0eff30_May2020' gamma list
for 30% pi0 efficiency list, optimized
in May 2020
32 -
'gamma:pi0eff20_May2020' gamma list
for 20% pi0 efficiency list, optimized
in May 2020
33 -
'gamma:pi0eff10_May2020' gamma list
for 10% pi0 efficiency list, optimized
in May 2020
34 -
'gamma:pi0' gamma list
for pi0 list
35 -
'gamma:pi0highE' gamma list
for pi0 list, high energy selection
37 - For latest pi0 recommendations see https://xwiki.desy.de/xwiki/rest/p/e23c8
40 listtype (str): name of standard list
41 path (basf2.Path): modules are added to this path
42 beamBackgroundMVAWeight (str): type of weight file
for beam background MVA;
if empty, beam background MVA will
not be used
46 `Neutrals Performance XWiki page <https://xwiki.desy.de/xwiki/rest/p/e23c8>`_
47 for information on the beam background MVA.
49 fakePhotonMVAWeight (str): type of weight file
for fake photon MVA;
if empty, fake photon MVA will
not be used
53 `Neutrals Performance XWiki page <https://xwiki.desy.de/xwiki/rest/p/e23c8>`_
54 for information on the fake photon MVA.
56 biasCorrectionTable (str): correction table
for the photon energy bias correction (should only be applied to data)
60 `Neutrals Performance XWiki page <https://xwiki.desy.de/xwiki/rest/p/e23c8>`_
61 for information on the names of available correction tables..
66 ma.fillParticleList(
'gamma:all',
'', writeOut=
True, path=path)
69 elif listtype ==
'cdc':
78 elif listtype ==
'loose':
80 beamBackgroundMVAWeight=beamBackgroundMVAWeight,
81 fakePhotonMVAWeight=fakePhotonMVAWeight,
82 biasCorrectionTable=biasCorrectionTable)
86 'clusterErrorTiming < 1e6 and [clusterE1E9 > 0.4 or E > 0.075]',
90 elif listtype ==
'tight':
92 beamBackgroundMVAWeight=beamBackgroundMVAWeight,
93 fakePhotonMVAWeight=fakePhotonMVAWeight,
94 biasCorrectionTable=biasCorrectionTable)
98 '[clusterReg == 1 and E > 0.05] or [clusterReg == 2 and E > 0.05] or [clusterReg == 3 and E > 0.075]',
101 elif listtype ==
'pi0eff10_May2020':
103 'gamma:pi0eff10_May2020',
104 '[clusterNHits>1.5] and thetaInCDCAcceptance and \
105 [[clusterReg==1 and E>0.200] or [clusterReg==2 and E>0.100] or [clusterReg==3 and E>0.180]] and [clusterE1E9>0.5]',
109 elif listtype ==
'pi0eff20_May2020':
111 'gamma:pi0eff20_May2020',
112 '[clusterNHits>1.5] and thetaInCDCAcceptance and \
113 [[clusterReg==1 and E>0.120] or [clusterReg==2 and E>0.030] or [clusterReg==3 and E>0.080]] and [clusterE1E9>0.4]',
117 elif listtype ==
'pi0eff30_May2020' or listtype ==
'pi0eff40_May2020':
120 '[clusterNHits>1.5] and thetaInCDCAcceptance and \
121 [[clusterReg==1 and E>0.080] or [clusterReg==2 and E>0.030] or [clusterReg==3 and E>0.060 ]]',
125 elif listtype ==
'pi0eff50_May2020':
127 'gamma:pi0eff50_May2020',
128 '[clusterNHits>1.5] and thetaInCDCAcceptance and \
129 [[clusterReg==1 and E>0.025] or [clusterReg==2 and E>0.025] or [clusterReg==3 and E>0.040]]',
133 elif listtype ==
'pi0eff60_May2020':
135 'gamma:pi0eff60_May2020',
136 '[clusterNHits>1.5] and thetaInCDCAcceptance and \
137 [[clusterReg==1 and E>0.0225] or [clusterReg==2 and E>0.020] or [clusterReg==3 and E>0.020]]',
142 raise ValueError(f
"\"{listtype}\" is none of the allowed standardized types of photon lists!")
144 if listtype
not in [
'loose',
'tight']:
145 if beamBackgroundMVAWeight:
146 ma.getBeamBackgroundProbability(particleList=f
'gamma:{listtype}', weight=beamBackgroundMVAWeight, path=path)
147 if fakePhotonMVAWeight:
148 ma.getFakePhotonProbability(particleList=f
'gamma:{listtype}', weight=fakePhotonMVAWeight, path=path)
149 if biasCorrectionTable:
150 ma.correctEnergyBias(inputListNames=[f
'gamma:{listtype}'], tableName=biasCorrectionTable, path=path)
155def loadStdSkimPhoton(path):
157 Function to prepare the skim photon lists.
160 Should only be used by skims.
163 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 path (basf2.Path): the path to load the modules
187 '0.5 < goodBelleGamma < 1.5',
194 '0.5 < goodBelleGamma < 1.5',