11 from modularAnalysis
import fillParticleList, cutAndCopyList
14 def stdPhotons(listtype='loose', path=None, loadPhotonBeamBackgroundMVA=False):
16 Function to prepare one of several standardized types of photon lists:
18 - 'gamma:all' with no cuts this will be polluted by tracks from outside the acceptance
19 - 'gamma:cdc' all clusters inside the CDC tracking acceptance
20 - 'gamma:loose' (default) with some loose quality selections
21 - 'gamma:tight' like loose but with higher energy cuts depending on detector regions
22 - 'gamma:pi0eff60_May2020' gamma list for 60% pi0 efficiency list, optimized in May 2020
23 - 'gamma:pi0eff50_May2020' gamma list for 50% pi0 efficiency list, optimized in May 2020
24 - 'gamma:pi0eff40_May2020' gamma list for 40% pi0 efficiency list, optimized in May 2020
25 - 'gamma:pi0eff30_May2020' gamma list for 30% pi0 efficiency list, optimized in May 2020
26 - 'gamma:pi0eff20_May2020' gamma list for 20% pi0 efficiency list, optimized in May 2020
27 - 'gamma:pi0eff10_May2020' gamma list for 10% pi0 efficiency list, optimized in May 2020
28 - 'gamma:pi0' gamma list for pi0 list
29 - 'gamma:pi0highE' gamma list for pi0 list, high energy selection
31 - For latest pi0 recommendations see https://confluence.desy.de/display/BI/Neutrals+Performance
34 listtype (str): name of standard list
35 path (basf2.Path): modules are added to this path
36 loadPhotonBeamBackgroundMVA (bool): If true, photon candidates will be assigned a beam background probability.
41 fillParticleList(
'gamma:all',
'', writeOut=
True, path=path,
42 loadPhotonBeamBackgroundMVA=loadPhotonBeamBackgroundMVA)
45 elif listtype ==
'cdc':
51 loadPhotonBeamBackgroundMVA=loadPhotonBeamBackgroundMVA
55 elif listtype ==
'loose':
56 stdPhotons(
'cdc', path, loadPhotonBeamBackgroundMVA=loadPhotonBeamBackgroundMVA)
60 'clusterErrorTiming < 1e6 and [clusterE1E9 > 0.4 or E > 0.075]',
64 elif listtype ==
'tight':
65 stdPhotons(
'loose', path, loadPhotonBeamBackgroundMVA=loadPhotonBeamBackgroundMVA)
69 '[clusterReg == 1 and E > 0.05] or [clusterReg == 2 and E > 0.05] or [clusterReg == 3 and E > 0.075]',
72 elif listtype ==
'pi0eff10_May2020':
74 'gamma:pi0eff10_May2020',
75 '[clusterNHits>1.5] and [0.2967< clusterTheta<2.6180] and \
76 [[clusterReg==1 and E>0.200] or [clusterReg==2 and E>0.100] or [clusterReg==3 and E>0.180]] and [clusterE1E9>0.5]',
79 loadPhotonBeamBackgroundMVA=loadPhotonBeamBackgroundMVA
81 elif listtype ==
'pi0eff20_May2020':
83 'gamma:pi0eff20_May2020',
84 '[clusterNHits>1.5] and [0.2967< clusterTheta<2.6180] and \
85 [[clusterReg==1 and E>0.120] or [clusterReg==2 and E>0.030] or [clusterReg==3 and E>0.080]] and [clusterE1E9>0.4]',
88 loadPhotonBeamBackgroundMVA=loadPhotonBeamBackgroundMVA
90 elif listtype ==
'pi0eff30_May2020' or listtype ==
'pi0eff40_May2020':
93 '[clusterNHits>1.5] and [0.2967< clusterTheta<2.6180] and \
94 [[clusterReg==1 and E>0.080] or [clusterReg==2 and E>0.030] or [clusterReg==3 and E>0.060 ]]',
97 loadPhotonBeamBackgroundMVA=loadPhotonBeamBackgroundMVA
99 elif listtype ==
'pi0eff50_May2020':
101 'gamma:pi0eff50_May2020',
102 '[clusterNHits>1.5] and [0.2967< clusterTheta<2.6180] and \
103 [[clusterReg==1 and E>0.025] or [clusterReg==2 and E>0.025] or [clusterReg==3 and E>0.040]]',
106 loadPhotonBeamBackgroundMVA=loadPhotonBeamBackgroundMVA
108 elif listtype ==
'pi0eff60_May2020':
110 'gamma:pi0eff60_May2020',
111 '[clusterNHits>1.5] and [0.2967< clusterTheta<2.6180] and \
112 [[clusterReg==1 and E>0.0225] or [clusterReg==2 and E>0.020] or [clusterReg==3 and E>0.020]]',
115 loadPhotonBeamBackgroundMVA=loadPhotonBeamBackgroundMVA
118 raise ValueError(f
"\"{listtype}\" is none of the allowed standardized types of photon lists!")
123 def loadStdSkimPhoton(path):
125 Function to prepare the skim photon lists.
128 Should only be used by skims.
131 path (basf2.Path): modules are added to this path
134 stdPhotons(
'loose', path, loadPhotonBeamBackgroundMVA=
False)
144 def loadStdGoodBellePhoton(path):
146 Load the Belle goodBelle list. Creates a ParticleList named
147 'gamma:goodBelle' with '0.5 < :b2:var:`goodBelleGamma` < 1.5'
150 Should only be used for Belle analyses using `b2bii`.
153 path (basf2.Path): the path to load the modules
155 fillParticleList(
'gamma:goodBelle',
'0.5 < goodBelleGamma < 1.5',
True, path, loadPhotonBeamBackgroundMVA=
False)