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