Skip to content

Use this default name to avoid name collisions with MCTruthAndBkgCatAlg during application configuration

Ryunosuke O'Neil requested to merge avoid-alg-name-collision into master

the default name used to configure MCTruthAndBkgCatAlg is prone to causing errors like this:

Executing application DaVinci v63r10 for binary tag configuration x86_64_v2-centos7-gcc12+detdesc-opt
Executing command:
lb-run --siteroot=/cvmfs/lhcb.cern.ch/lib/ -c x86_64_v2-centos7-gcc12+detdesc-opt --use=AnalysisProductions.v999999999999 --use=ProdConf DaVinci/v63r10 lbexec EMTF_CharmProductionXSec.DaVinciOptions:all_alg_config lbexec_options_00012345_00006789_1.yaml
WARNING:lb-run:Decided best container to use is None
# WARNING: input_stream is set to 'default', but will be reset to '' because current input_process = Hlt2
Traceback (most recent call last):
  File "/tmp/tmpa83wzc60/DBASE/AnalysisProductions/v999999999999/EMTF_CharmProductionXSec/DaVinciOptions/__init__.py", line 46, in all_alg_config
    return alg_config(
  File "/tmp/tmpa83wzc60/DBASE/AnalysisProductions/v999999999999/EMTF_CharmProductionXSec/DaVinciOptions/__init__.py", line 31, in alg_config
    chan_algs = get_alg_config(chan)(options)
  File "/tmp/tmpa83wzc60/DBASE/AnalysisProductions/v999999999999/EMTF_CharmProductionXSec/DaVinciOptions/mesons.py", line 71, in D0ToKmPip_alg_config
    "D0": make_composite_variables(options, data),
  File "/tmp/tmpa83wzc60/DBASE/AnalysisProductions/v999999999999/EMTF_CharmProductionXSec/DaVinciOptions/charm_xsec_tupling.py", line 128, in make_composite_variables
    variables = add_truth_matching_functors(
  File "/tmp/tmpa83wzc60/DBASE/AnalysisProductions/v999999999999/EMTF_CharmProductionXSec/DaVinciOptions/charm_xsec_tupling.py", line 263, in add_truth_matching_functors
    MCTRUTH = MCTruthAndBkgCat(data)
  File "/cvmfs/lhcb.cern.ch/lib/lhcb/ANALYSIS/ANALYSIS_v41r10/InstallArea/x86_64_v2-centos7-gcc12+detdesc-opt/python/DaVinciMCTools/MCTruthAndBkgCat.py", line 114, in __init__
    self.mctruth = MCTruthAndBkgCatAlg(
  File "/cvmfs/lhcb.cern.ch/lib/lhcb/LHCB/LHCB_v54r10/InstallArea/x86_64_v2-centos7-gcc12+detdesc-opt/python/PyConf/tonic.py", line 644, in configurable(wrapped)
    return wrapped(**kwargs)
  File "/cvmfs/lhcb.cern.ch/lib/lhcb/LHCB/LHCB_v54r10/InstallArea/x86_64_v2-centos7-gcc12+detdesc-opt/python/PyConf/importers.py", line 33, in wrapped
    return wrapper(component_type, **kwargs)
  File "/cvmfs/lhcb.cern.ch/lib/lhcb/LHCB/LHCB_v54r10/InstallArea/x86_64_v2-centos7-gcc12+detdesc-opt/python/PyConf/components.py", line 678, in __new__
    _name = _get_unique_name(name, alg_type.getType(), _id)
  File "/cvmfs/lhcb.cern.ch/lib/lhcb/LHCB/LHCB_v54r10/InstallArea/x86_64_v2-centos7-gcc12+detdesc-opt/python/PyConf/components.py", line 141, in _get_unique_name
    raise ConfigurationError(
PyConf.utilities.ConfigurationError: Name collision detected for MCTruthAndBkgCatAlg, identities are 0xb2c0b8bb579cbed5 and 0x5230d0844838cf35. Please make names unique. One possibility is to use a '_{hash}' suffix that will be automatically replaced by a unique hash
ERROR: Failed to call EMTF_CharmProductionXSec.DaVinciOptions:all_alg_config(options), see above for more information.

Merge request reports