DaVinci cannot use standard_particles when input is from Hlt2 or (Sprucing)

Discussion started here https://mattermost.web.cern.ch/lhcb/pl/g7qd6bxciirqupaagt8q95z8cw .

Trying to do

from Hlt2Conf.standard_particles import make_long_muons
long_muons = make_long_muons()

results in the error message

UnpackChargedProtos                   ERROR UnpackChargedProtos : Cannot retrieve /Event/pRec/ProtoP/Charged from transient store.

This means it is looking in locations which were used in Brunel and only works on very old DST files.

Doing

from PyConf.reading import _get_unpacked
from Hlt2Conf.standard_particles import _make_particles
hlt2_protos = lambda : _get_unpacked(type_name='ProtoParticles', location="/Event/HLT2/Rec/ProtoP/Charged")
long_muons = _make_particles(species="muon", get_track_selector=get_long_track_selector, make_protoparticles=hlt2_protos)

works.

Looking into standard_particles.py, protoparticles are taken from

from RecoConf.reconstruction_objects import make_charged_protoparticles

make_charged_protoparticles gets the protoparticles from the reconstruction function in the same module. And above error results from using the default arguments which assume the data having been persisted with legacy software.

The reconstruction function in principle acts, via configurable parameters, as the switch between running the reconstruction or taking a persisted reconstruction. However, the function is not configured when starting DaVinci with lbexec . A reconstruction function from PyConf.reading is configured but not the one necessary for standard_particles.

Possible fixes:

  • Properly configure reconstruction from Hlt2Conf.reconstruction_objects.
  • Add test in DaVinci which uses standard_particles using Sprucing or Hlt2 output.
Edited by Sascha Stahl