Belle II Software
development
stdKlongs.py
1
#!/usr/bin/env python3
2
3
10
11
from
basf2
import
B2FATAL, B2WARNING
12
from
modularAnalysis
import
fillParticleList
13
14
15
def
stdKlongs
(listtype='allklm', path=None):
16
"""
17
Warning:
18
This function is a placeholder for Klong selections. Currently
19
everything but the 'allklm' and 'allecl' lists is disabled pending study.
20
21
By default, prepares the 'K_L0:allklm' list with no cuts (all KLM clusters are loaded).
22
It's possible to provide the argument 'allecl' to create a list of all ECL clusters loaded as Klong candidates.
23
24
Parameters:
25
listtype (str): name of standard list options (currently only
26
'allklm' and 'allecl' are supported/recommended)
27
path (basf2.Path): modules are added to this path
28
"""
29
30
# all KLM clusters
31
if
listtype ==
'allklm'
:
32
B2WARNING(
'The Klong particles in the list "allklm" are exclusively built from KLMClusters!'
)
33
fillParticleList(
'K_L0:allklm'
,
'[isFromKLM > 0] and [klmClusterKlId >= 0] and [klmClusterKlId <= 1]'
,
True
, path)
34
# all ECL clusters
35
elif
listtype ==
'allecl'
:
36
B2WARNING(
'The Klong particles in the list "allecl" are exclusively built from ECLClusters!'
)
37
fillParticleList(
'K_L0:allecl'
,
'isFromECL > 0'
,
True
, path)
38
else
:
39
B2FATAL(
"""
40
41
Only the particle lists 'allklm' (Klongs built from KLM clusters) and 'allecl' (Klongs built from neutral ECLCluster) are
42
currently supported. Please use:
43
44
stdKlongs('allklm', path=mypath)
45
"""
)
46
# # loose KLs, removes buggy KLM clusters
47
# elif listtype == 'veryLoose':
48
# stdKlongs('all', path)
49
# selection = 'E > 0.5 and E < 10. and klmClusterTiming > -10 and klmClusterTiming < 100.'
50
# B2WARNING("The standard Klong lists are not studied or optimised yet. ")
51
# B2WARNING("Beware that anything more complex than the 'all' list may not work as desired (or at all).")
52
# B2WARNING("You will have the following cuts applied: %s" % selection)
53
# cutAndCopyList(
54
# 'K_L0:veryLoose',
55
# 'K_L0:all',
56
# selection,
57
# True,
58
# path)
59
#
60
# # additional cuts on KL_ID
61
# elif listtype == 'loose':
62
# stdKlongs('all', path)
63
# selection = 'E > 0.5 and E < 10. and klmClusterTiming > -10 and klmClusterTiming < 100. and klmClusterKlId > 0.04'
64
# B2WARNING("The standard Klong lists are not studied or optimised yet. ")
65
# B2WARNING("Beware that anything more complex than the 'all' list may not work as desired (or at all).")
66
# B2WARNING("You will have the following cuts applied: %s" % selection)
67
# cutAndCopyList(
68
# 'K_L0:loose',
69
# 'K_L0:all',
70
# selection,
71
# True,
72
# path)
73
#
74
# # additional cuts on KL_ID
75
# elif listtype == 'tight':
76
# stdKlongs('loose', path)
77
# tight_selection = 'klmClusterKlId > 0.2'
78
# B2WARNING("With the following additional tight selection: %s" % tight_selection)
79
# cutAndCopyList(
80
# 'K_L0:tight',
81
# 'K_L0:loose',
82
# tight_selection,
83
# True,
84
# path)
stdKlongs
Definition
stdKlongs.py:1
analysis
scripts
stdKlongs.py
Generated on Mon Sep 1 2025 02:45:59 for Belle II Software by
1.13.2