diff --git a/Phys/Tesla/python/Tesla/Configuration.py b/Phys/Tesla/python/Tesla/Configuration.py index cfc6fa8aefab1f5cf65fccef9102a9296072730b..5b4f68413c975e1421e5a6452da61817f1c82e3d 100644 --- a/Phys/Tesla/python/Tesla/Configuration.py +++ b/Phys/Tesla/python/Tesla/Configuration.py @@ -31,6 +31,7 @@ from Configurables import ( DataPacking__Unpack_LHCb__CaloClusterPacker_ as UnpackCaloClusters, DecodeRawEvent, DstConf, + EventNodeKiller, EventSelector, Gaudi__DataCopy as DataCopy, Gaudi__DataLink as DataLink, @@ -1206,15 +1207,12 @@ class Tesla(LHCbConfigurableUser): packers += prpacking_stream.packers(identifier=namer('')) # Pack everything else that we've cloned - # (Packed locations made by PackParticlesAndVertices already exist - # at the anonymous stream location) - if output_prefix: - psandvs_packer = PackParticlesAndVertices( - namer('TurboPacker'), - InputStream=turbo_base, - VetoedContainers=prpacking_stream.inputs.values() - ) - packers.append(psandvs_packer) + psandvs_packer = PackParticlesAndVertices( + namer('TurboPacker'), + InputStream=turbo_base, + VetoedContainers=prpacking_stream.inputs.values() + ) + packers.append(psandvs_packer) # Pack the filtered MC particles and vertices if filter_mc: @@ -1240,9 +1238,35 @@ class Tesla(LHCbConfigurableUser): packer.OutputLevel = min(self.getProp('OutputLevel'), self.getProp('PackerOutputLevel')) + # If the stream is anonymous, we must first kill the output of + # PackParticlesAndVertices from HLT2 (which lives in the same + # place) so that we can re-run the algorithm here + # This is done primarily for packing relations tables, which are + # packed by PackParticlesAndVertices but created only in Tesla + node_killers = [] + if not output_prefix: + enk = EventNodeKiller(namer('KillHLT2PackPsAndVsOutput')) + # List of locations produced by PackParticlesAndVertices + enk.Nodes = [os.path.join(turbo_base, p) for p in [ + 'pPhys/Particles', + 'pPhys/Vertices', + 'pPhys/FlavourTags', + 'pPhys/RecVertices', + 'pPhys/Relations', + 'pPhys/P2MCPRelations', + 'pPhys/P2IntRelations', + 'pPhys/PartToRelatedInfoRelations', + 'pRec/ProtoP/Custom', + 'pRec/Muon/CustomPIDs', + 'pRec/Rich/CustomPIDs', + 'pRec/Track/Custom', + 'pPhys/PP2MCPRelations' + ]] + node_killers.append(enk) + packing_seq = GaudiSequencer( namer('TeslaPackingSequence'), - Members=packers, + Members=node_killers + packers, IgnoreFilterPassed=True ) stream_seq.Members.append(packing_seq) @@ -1252,12 +1276,6 @@ class Tesla(LHCbConfigurableUser): os.path.join(turbo_base, 'pRec#*'), os.path.join(turbo_base, 'Hlt2/pRec#*') ] - - # Need to save the *unpacked* relations tables when we aren't - # streaming because we don't run PackParticlesAndVertices in that - # case - if simulation and not output_prefix: - optional_output_locations += [os.path.join(turbo_base, 'Relations#*')] else: # Save everything under the stream prefix optional_output_locations += [