Skip to content

Commit b7d479f

Browse files
committed
Merge branch 'release/06-00' of ssh://stash.desy.de:7999/b2/basf2 into bugfix/BII-8727-tracking-dqm-patch03
2 parents 8912cb5 + 9888114 commit b7d479f

File tree

72 files changed

+1361
-666
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1361
-666
lines changed

analysis/examples/FEI/B_converted_apply.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
# Actually, the KS finder should be set to True.
3535
# However, here it's set to False because the necessary library is only present on kekcc and not on the build server.
3636
enableNisKsFinder=False,
37+
# Set this argument to True (default value) so that the local database on KEKCC is used.
38+
# It's only set to False here so that this example can be run on bamboo.
3739
enableLocalDB=False,
3840
path=path)
3941
ma.setAnalysisConfigParams({'mcMatchingVersion': 'Belle'}, path)

analysis/examples/FEI/B_converted_train.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@
4242
'validation',
4343
False),
4444
applySkim=True,
45+
# Actually, the KS finder should be set to True.
46+
# However, here it's set to False because the necessary library is only present on kekcc and not on the build server.
4547
enableNisKsFinder=False,
48+
# Set this argument to True (default value) so that the local database on KEKCC is used.
49+
# It's only set to False here so that this example can be run on bamboo.
4650
enableLocalDB=False,
4751
path=path)
4852
else:

analysis/modules/BremsCorrection/src/BremsFinderModule.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ namespace Belle2 {
5656
in the analysis scripts.
5757
5858
The **eclTrackBremFinder** module uses the lepton track PXD and SVD hits and extrapolates them to the ECL;
59-
then looks for ECL clusters with energies between 0.2 and 1 times the track energy and without associated
60-
tracks, and checks if the distance between each of these clusters
61-
and the extrapolated hit is smaller than 0.5 mm. If it is, a *Bremsstrahlung* weighted relation
59+
then looks for ECL clusters with energies between 0.02 and 1 times the track energy and without associated
60+
tracks, and checks if the normalized distance between each of these clusters
61+
and the extrapolated hit is smaller than 0.05. If it is, a *Bremsstrahlung* weighted relation
6262
between said cluster and the track is established. The weight is determined as
6363
6464
.. math::

analysis/scripts/modularAnalysis.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def setAnalysisConfigParams(configParametersAndValues, path):
5555
path.add_module(conf)
5656

5757

58-
def inputMdst(environmentType, filename, path, skipNEvents=0, entrySequence=None, *, parentLevel=0):
58+
def inputMdst(environmentType, filename, path, skipNEvents=0, entrySequence=None, *, parentLevel=0, **kwargs):
5959
"""
6060
Loads the specified ROOT (DST/mDST/muDST) file with the RootInput module.
6161
@@ -74,10 +74,18 @@ def inputMdst(environmentType, filename, path, skipNEvents=0, entrySequence=None
7474
if entrySequence is not None:
7575
entrySequence = [entrySequence]
7676

77-
inputMdstList(environmentType, [filename], path, skipNEvents, entrySequence, parentLevel=parentLevel)
77+
inputMdstList(environmentType, [filename], path, skipNEvents, entrySequence, parentLevel=parentLevel, **kwargs)
7878

7979

80-
def inputMdstList(environmentType, filelist, path, skipNEvents=0, entrySequences=None, *, parentLevel=0):
80+
def inputMdstList(
81+
environmentType,
82+
filelist,
83+
path,
84+
skipNEvents=0,
85+
entrySequences=None,
86+
*,
87+
parentLevel=0,
88+
useB2BIIDBCache=True):
8189
"""
8290
Loads the specified ROOT (DST/mDST/muDST) files with the RootInput module.
8391
@@ -108,6 +116,7 @@ def inputMdstList(environmentType, filelist, path, skipNEvents=0, entrySequences
108116
entrySequences (list(str)): The number sequences (e.g. 23:42,101) defining
109117
the entries which are processed for each inputFileName.
110118
parentLevel (int): Number of generations of parent files (files used as input when creating a file) to be read
119+
useB2BIIDBCache (bool): Loading of local KEKCC database (only to be deactivated in very special cases)
111120
"""
112121

113122
roinput = register_module('RootInput')
@@ -156,6 +165,10 @@ def inputMdstList(environmentType, filelist, path, skipNEvents=0, entrySequences
156165
setAnalysisConfigParams({'mcMatchingVersion': 'Belle'}, path)
157166
import b2bii
158167
b2bii.setB2BII()
168+
if useB2BIIDBCache:
169+
basf2.conditions.metadata_providers = ["/sw/belle/b2bii/database/conditions/b2bii.sqlite"]
170+
basf2.conditions.payload_locations = ["/sw/belle/b2bii/database/conditions/"]
171+
159172
if environmentType == 'MC5':
160173
setAnalysisConfigParams({'mcMatchingVersion': 'MC5'}, path)
161174

analysis/scripts/variables/collections.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
]
141141

142142
#: PID variables
143-
pid = ['kaonID', 'pionID', 'protonID', 'muonID', 'electronID', 'deuteronID',
143+
pid = ['kaonID', 'pionID', 'protonID', 'muonID', 'electronID', 'electronID_noTOP', 'deuteronID',
144144
'binaryPID(211, 13)', 'binaryPID(211, 321)', 'binaryPID(211, 2212)', 'binaryPID(321, 2212)']
145145

146146
#: Replacement for ROEMultiplicities tool

analysis/variables/include/PIDVariables.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,12 @@ namespace Belle2 {
148148
*/
149149
double binaryPID_noSVD(const Particle* part, const std::vector<double>& arguments);
150150

151+
/**
152+
* SPECIAL (TEMP) variable (BII-8444)
153+
* @return electron ID without TOP information
154+
*/
155+
double electronID_noTOP(const Particle* part);
156+
151157
/**
152158
* returns the MVA score for anti-neutron PID (not for neutron)
153159
* -1 means invalid

analysis/variables/src/PIDVariables.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,12 @@ namespace Belle2 {
359359
pdgCodeTest) + ", CDC, TOP, ARICH, ECL, KLM)")->function(part);
360360
}
361361

362+
double electronID_noTOP(const Particle* part)
363+
{
364+
// Excluding TOP for electron ID. This variable is temporary. BII-8444
365+
return Manager::Instance().getVariable("pidProbabilityExpert(11, CDC, SVD, ARICH, ECL, KLM)")->function(part);
366+
}
367+
362368
double antineutronID(const Particle* particle)
363369
{
364370
if (particle->hasExtraInfo("nbarID")) {
@@ -595,6 +601,8 @@ namespace Belle2 {
595601
"(SPECIAL (TEMP) variable) deuteron identification probability defined as :math:`\\mathcal{L}_d/(\\mathcal{L}_e+\\mathcal{L}_\\mu+\\mathcal{L}_\\pi+\\mathcal{L}_K+\\mathcal{L}_p+\\mathcal{L}_d)`, using info from all available detectors *excluding the SVD*");
596602
REGISTER_VARIABLE("binaryPID_noSVD(pdgCode1, pdgCode2)", binaryPID_noSVD,
597603
"Returns the binary probability for the first provided mass hypothesis with respect to the second mass hypothesis using all detector components, *excluding the SVD*.");
604+
REGISTER_VARIABLE("electronID_noTOP", electronID_noTOP,
605+
"(SPECIAL (TEMP) variable) electron identification probability defined as :math:`\\mathcal{L}_e/(\\mathcal{L}_e+\\mathcal{L}_\\mu+\\mathcal{L}_\\pi+\\mathcal{L}_K+\\mathcal{L}_p+\\mathcal{L}_d)`, using info from all available detectors *excluding the TOP*");
598606
REGISTER_VARIABLE("nbarID", antineutronID, R"DOC(
599607
Returns MVA classifier for antineutron PID.
600608

b2bii/examples/BelleMCGeneration.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
import basf2
1515
from generators import add_evtgen_generator
1616

17+
# Use B2BII local cache
18+
basf2.conditions.metadata_providers = ["/sw/belle/b2bii/database/conditions/b2bii.sqlite"]
19+
basf2.conditions.payload_locations = ["/sw/belle/b2bii/database/conditions/"]
20+
1721
# Use B2BII global tag.
1822
basf2.conditions.prepend_globaltag('B2BII_MC')
1923

b2bii/scripts/b2biiConversion.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,15 @@ def convertBelleMdstToBelleIIMdst(inputBelleMDSTFile, applySkim=True,
105105
b2bii.setB2BII()
106106

107107
if enableLocalDB is True:
108-
b2.B2WARNING("B2BII is accessing the payloads from the local database.\n"
109-
"This is the recommended procedure and significantly faster than using the global database.\n"
110-
"Only if you need the latest payloads of the flavor tagging or the FEI,\n"
111-
"you should turn off this feature and set enableLocalDB to True.")
112108
b2.conditions.metadata_providers = ["/sw/belle/b2bii/database/conditions/b2bii.sqlite"]
113109
b2.conditions.payload_locations = ["/sw/belle/b2bii/database/conditions/"]
110+
else:
111+
b2.B2WARNING(
112+
"B2BII is accessing the payloads from the conditions database.\n"
113+
"The recommended procedure is to use the offline database and it is significantly\n"
114+
"faster than using the global database.\n"
115+
"If you need the payloads which are not included in the current offline database,\n"
116+
"please contact b2bii librarian.")
114117

115118
input = b2.register_module('B2BIIMdstInput')
116119
if inputBelleMDSTFile is not None:

calibration/scripts/prompt/__init__.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
prompt_validation_script_package = "prompt.validations."
1616
prompt_validation_script_dir = "calibration/scripts/prompt/validations"
1717

18-
input_data_filters = {"Magnet": {"On": "On",
18+
INPUT_DATA_FILTERS = {"Magnet": {"On": "On",
1919
"Off": "Off",
2020
"Either": "Either"},
2121
"Beam Energy": {"No Beam": "No Beam",
@@ -31,7 +31,7 @@
3131
"cosmic_calib": "cosmic_calib",
3232
"gamma_gamma_calib": "gamma_gamma_calib",
3333
"hadron_calib": "hadron_calib",
34-
"mumutight_calib": "mumutight_calib",
34+
"mumutight_or_highm_calib": "mumutight_or_highm_calib",
3535
"offip_calib": "offip_calib",
3636
"radmumu_calib": "radmumu_calib",
3737
"random_calib": "random_calib",
@@ -81,7 +81,7 @@ class CalibrationSettings(namedtuple('CalSet_Factory',
8181
input_data_filters dictionary e.g. from prompt import input_data_filters with details about data tags and run quality
8282
tags found at: https://calibration.belle2.org/belle2/data_tags/list/.
8383
To exclude specific filters, pre-append with *NOT* e.g.
84-
{"all_events": ["mumutight_calib", "hadron_calib", "Good", "On"],
84+
{"all_events": ["mumutight_or_highm_calib", "hadron_calib", "Good", "On"],
8585
"offres_photon_events": ["gamma_gamma_calib", "Good", "NOT On"]}.
8686
Not selecting a specfic filters (e.g. Magnet) is equivalent to not having any requirements, e.g. (Either)
8787
@@ -121,6 +121,20 @@ def __new__(cls, name, expert_username, description,
121121
raise ValueError("You must specify at least one input data name")
122122
input_data_names = frozenset(input_data_names)
123123

124+
# The input data names in the filters MUST correspond to the input data names for the calibration.
125+
if input_data_filters:
126+
if set(input_data_filters.keys()) != input_data_names:
127+
raise ValueError("The 'input_data_filters' keys don't match the 'input_data_names'!")
128+
# Requested input data filters MUST exist in the ones we defined in the global dictionary.
129+
allowed_filters = {filter_name for category in INPUT_DATA_FILTERS.values() for filter_name in category}
130+
requested_filters = {filter_name.replace("NOT", "", 1).lstrip() for filters in input_data_filters.values()
131+
for filter_name in filters}
132+
if not allowed_filters.issuperset(requested_filters):
133+
raise ValueError("The 'input_data_filters' contains unknown filter names:"
134+
f"{requested_filters.difference(allowed_filters)}")
135+
else:
136+
input_data_filters = {}
137+
124138
if expert_config:
125139
# Check that it's a dictionary and not some other valid JSON object
126140
if not isinstance(expert_config, dict):

0 commit comments

Comments
 (0)