11 import modularAnalysis
as ma
17 loadPhotonBeamBackgroundMVA=False,
18 loadPhotonHadronicSplitOffMVA=False,
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://confluence.desy.de/display/BI/Neutrals+Performance
39 listtype (str): name of standard list
40 path (basf2.Path): modules are added to this path
41 loadPhotonBeamBackgroundMVA (bool): If true, photon candidates will be assigned a beam background probability.
42 loadPhotonHadronicSplitOffMVA (bool): If true, photon candidates will be assigned a hadronic split-off probability.
43 biasCorrectionTable (str): correction table for the photon energy bias correction (should only be applied to data)
47 `Neutrals Performance Confluence page <https://confluence.desy.de/display/BI/Neutrals+Performance>`_
48 for information on the names of available correction tables..
53 ma.fillParticleList(
'gamma:all',
'', writeOut=
True, path=path,
54 loadPhotonBeamBackgroundMVA=loadPhotonBeamBackgroundMVA,
55 loadPhotonHadronicSplitOffMVA=loadPhotonHadronicSplitOffMVA)
58 elif listtype ==
'cdc':
64 loadPhotonBeamBackgroundMVA=loadPhotonBeamBackgroundMVA,
65 loadPhotonHadronicSplitOffMVA=loadPhotonHadronicSplitOffMVA
69 elif listtype ==
'loose':
71 loadPhotonBeamBackgroundMVA=loadPhotonBeamBackgroundMVA,
72 loadPhotonHadronicSplitOffMVA=loadPhotonHadronicSplitOffMVA,
73 biasCorrectionTable=biasCorrectionTable)
77 'clusterErrorTiming < 1e6 and [clusterE1E9 > 0.4 or E > 0.075]',
81 elif listtype ==
'tight':
83 loadPhotonBeamBackgroundMVA=loadPhotonBeamBackgroundMVA,
84 loadPhotonHadronicSplitOffMVA=loadPhotonHadronicSplitOffMVA,
85 biasCorrectionTable=biasCorrectionTable)
89 '[clusterReg == 1 and E > 0.05] or [clusterReg == 2 and E > 0.05] or [clusterReg == 3 and E > 0.075]',
92 elif listtype ==
'pi0eff10_May2020':
94 'gamma:pi0eff10_May2020',
95 '[clusterNHits>1.5] and [0.2967< clusterTheta<2.6180] and \
96 [[clusterReg==1 and E>0.200] or [clusterReg==2 and E>0.100] or [clusterReg==3 and E>0.180]] and [clusterE1E9>0.5]',
99 loadPhotonBeamBackgroundMVA=loadPhotonBeamBackgroundMVA,
100 loadPhotonHadronicSplitOffMVA=loadPhotonHadronicSplitOffMVA
102 elif listtype ==
'pi0eff20_May2020':
104 'gamma:pi0eff20_May2020',
105 '[clusterNHits>1.5] and [0.2967< clusterTheta<2.6180] and \
106 [[clusterReg==1 and E>0.120] or [clusterReg==2 and E>0.030] or [clusterReg==3 and E>0.080]] and [clusterE1E9>0.4]',
109 loadPhotonBeamBackgroundMVA=loadPhotonBeamBackgroundMVA,
110 loadPhotonHadronicSplitOffMVA=loadPhotonHadronicSplitOffMVA
112 elif listtype ==
'pi0eff30_May2020' or listtype ==
'pi0eff40_May2020':
115 '[clusterNHits>1.5] and [0.2967< clusterTheta<2.6180] and \
116 [[clusterReg==1 and E>0.080] or [clusterReg==2 and E>0.030] or [clusterReg==3 and E>0.060 ]]',
119 loadPhotonBeamBackgroundMVA=loadPhotonBeamBackgroundMVA,
120 loadPhotonHadronicSplitOffMVA=loadPhotonHadronicSplitOffMVA
122 elif listtype ==
'pi0eff50_May2020':
124 'gamma:pi0eff50_May2020',
125 '[clusterNHits>1.5] and [0.2967< clusterTheta<2.6180] and \
126 [[clusterReg==1 and E>0.025] or [clusterReg==2 and E>0.025] or [clusterReg==3 and E>0.040]]',
129 loadPhotonBeamBackgroundMVA=loadPhotonBeamBackgroundMVA,
130 loadPhotonHadronicSplitOffMVA=loadPhotonHadronicSplitOffMVA
132 elif listtype ==
'pi0eff60_May2020':
134 'gamma:pi0eff60_May2020',
135 '[clusterNHits>1.5] and [0.2967< clusterTheta<2.6180] and \
136 [[clusterReg==1 and E>0.0225] or [clusterReg==2 and E>0.020] or [clusterReg==3 and E>0.020]]',
139 loadPhotonBeamBackgroundMVA=loadPhotonBeamBackgroundMVA,
140 loadPhotonHadronicSplitOffMVA=loadPhotonHadronicSplitOffMVA
143 raise ValueError(f
"\"{listtype}\" is none of the allowed standardized types of photon lists!")
145 if biasCorrectionTable
and listtype
not in [
'loose',
'tight']:
146 ma.correctEnergyBias(inputListNames=[f
'gamma:{listtype}'], tableName=biasCorrectionTable, path=path)
151 def loadStdSkimPhoton(path):
153 Function to prepare the skim photon lists.
156 Should only be used by skims.
159 path (basf2.Path): modules are added to this path
172 def loadStdGoodBellePhoton(path):
174 Load the Belle goodBelle list. Creates a ParticleList named
175 'gamma:goodBelle' with '0.5 < :b2:var:`goodBelleGamma` < 1.5'
178 Should only be used for Belle analyses using `b2bii`.
181 path (basf2.Path): the path to load the modules
183 ma.fillParticleList(
'gamma:goodBelle',
'0.5 < goodBelleGamma < 1.5',
True, path)