Belle II Software  release-05-02-19
stdPhotons.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
10 
11 from modularAnalysis import fillParticleList, cutAndCopyList
12 
13 
14 def stdPhotons(listtype='loose', path=None):
15  """
16  Function to prepare one of several standardized types of photon lists:
17 
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_Jan2020' gamma list for 60% pi0 efficiency list, optimized in January 2020
23  - 'gamma:pi0eff50_Jan2020' gamma list for 50% pi0 efficiency list, optimized in January 2020
24  - 'gamma:pi0eff40_Jan2020' gamma list for 40% pi0 efficiency list, optimized in January 2020
25  - 'gamma:pi0eff30_Jan2020' gamma list for 30% pi0 efficiency list, optimized in January 2020
26  - 'gamma:pi0eff20_Jan2020' gamma list for 20% pi0 efficiency list, optimized in January 2020
27  - 'gamma:pi0eff10_Jan2020' gamma list for 10% pi0 efficiency list, optimized in January 2020
28  - 'gamma:pi0' gamma list for pi0 list
29  - 'gamma:pi0highE' gamma list for pi0 list, high energy selection
30 
31  - For latest pi0 recommendations see https://confluence.desy.de/display/BI/Neutrals+Performance
32 
33  @param listtype name of standard list
34  @param path modules are added to this path
35  """
36 
37  # all photons (all neutral ECLClusters that have the c_nPhotons hypothesis)
38  if listtype == 'all':
39  fillParticleList('gamma:all', '', True, path)
40  # all photons within the cdc tracking acceptance: remove un track-matched
41  # electrons from outside the tracking acceptance
42  elif listtype == 'cdc':
43  fillParticleList(
44  'gamma:cdc',
45  'theta > 0.296706 and theta < 2.61799',
46  True,
47  path)
48  # clusterErrorTiming < 1e6 removes failed waveform fits, this is not an actual timing cut. A 99% efficienct cut
49  # is already applied on mdst level for photons with E < 50 MeV.
50  elif listtype == 'loose':
51  stdPhotons('cdc', path)
52  cutAndCopyList(
53  'gamma:loose',
54  'gamma:cdc',
55  'clusterErrorTiming < 1e6 and [clusterE1E9 > 0.4 or E > 0.075]',
56  True,
57  path)
58  # additional region dependent energy cuts
59  elif listtype == 'tight':
60  stdPhotons('loose', path)
61  cutAndCopyList(
62  'gamma:tight',
63  'gamma:loose',
64  '[clusterReg == 1 and E > 0.05] or [clusterReg == 2 and E > 0.05] or [clusterReg == 3 and E > 0.075]',
65  True,
66  path)
67  elif listtype == 'pi0eff10_Jan2020':
68  fillParticleList(
69  'gamma:pi0eff10_Jan2020',
70  '[clusterReg==1 and E>0.200] or [clusterReg==2 and E>0.100] or [clusterReg==3 and E>0.180 and clusterE1E9>0.5]',
71  True,
72  path)
73  elif listtype == 'pi0eff20_Jan2020':
74  fillParticleList(
75  'gamma:pi0eff20_Jan2020',
76  '[clusterReg==1 and E>0.120] or [clusterReg==2 and E>0.030] or [clusterReg==3 and E>0.080 and clusterE1E9>0.4]',
77  True,
78  path)
79  elif listtype == 'pi0eff30_Jan2020' or listtype == 'pi0eff40_Jan2020':
80  fillParticleList(
81  f'gamma:{listtype}',
82  '[clusterReg==1 and E>0.080] or [clusterReg==2 and E>0.030] or [clusterReg==3 and E>0.060 ]',
83  True,
84  path)
85  elif listtype == 'pi0eff50_Jan2020':
86  fillParticleList(
87  'gamma:pi0eff50_Jan2020',
88  '[clusterReg==1 and E>0.025] or [clusterReg==2 and E>0.025] or [clusterReg==3 and E>0.040]',
89  True,
90  path)
91  elif listtype == 'pi0eff60_Jan2020':
92  fillParticleList(
93  'gamma:pi0eff60_Jan2020',
94  '[clusterReg==1 and E>0.0225] or [clusterReg==2 and E>0.020] or [clusterReg==3 and E>0.020]',
95  True,
96  path)
97 
98 # Used in skimming code
99 
100 
101 def loadStdSkimPhoton(path):
102  """
103  Function to prepare the skim photon lists.
104 
105  Warning:
106  Should only be used by skims.
107 
108  Parameters:
109  path (basf2.Path): modules are added to this path
110 
111  """
112  stdPhotons('loose', path)
113  cutAndCopyList(
114  'gamma:skim',
115  'gamma:loose',
116  '',
117  True,
118  path)
119 
120 
121 # Only used for Belle via b2bii
122 def loadStdGoodBellePhoton(path):
123  """
124  Load the Belle goodBelle list. Creates a ParticleList named
125  'gamma:goodBelle' with '0.5 < :b2:var:`goodBelleGamma` < 1.5'
126 
127  Warning:
128  Should only be used for Belle analyses using `b2bii`.
129 
130  Parameters:
131  path (basf2.Path): the path to load the modules
132  """
133  fillParticleList('gamma:goodBelle', '0.5 < goodBelleGamma < 1.5', True, path)
stdPhotons
Definition: stdPhotons.py:1