Delay in accessing unpacked pointers
If trying to access the Track or PID objects - which are attached to ProtoParticle as pointers - immediately after their unpacking, they are not directly available (null pointers). There seems to be a delay before these unpacked objects are put in TES and become available. This behaviour is at first glance not expected - could it be a remnant of the past practices?
To reproduce:
If putting the following printout immediately after the unpacking unpack( pproto, *part, pprotos, protos, carry );
in l. 174: https://gitlab.cern.ch/lhcb/LHCb/-/blob/master/Event/EventPacker/src/lib/PackedProtoParticle.cpp#L174
if(part->track())
parent().info() << "Found track: " << part->track()->key() << endmsg;
else parent().info() << "Track is nullpointer" << endmsg;
if(part->muonPID())
parent().info() << "Found MuonPID: " << part->muonPID()->key() << endmsg;
else parent().info() << "MuonPID is nullpointer" << endmsg;
if(part->richPID())
parent().info() << "Found RichPID :" << part->richPID()->key() << endmsg;
else parent().info() << "RichPID is nullpointer" << endmsg;
the “X is nullpointer” message will always appear. Same happens if trying to access the objects in l. 160 (end of unpack function per-proto-particle) or in after their respective unpacking (l. 108 for track, l. 117 RichPID, l. 126 MuonPID ).
Clearly somewhere down the pipeline things sort themselves out. An example: using the PrintProtoParticle
https://gitlab.cern.ch/lhcb/LHCb/-/blob/master/Event/RecreatePIDTools/src/PrintProtoParticles.cpp algorithm in DaVinci for running over a dst will access the objects without issue.
pps = get_charged_protoparticles("Long")
printed_pps = PrintProtoParticles(Input = pps)
config = make_config(options, [pps, printed_pps])