diff --git a/Phys/Tesla/python/Tesla/Configuration.py b/Phys/Tesla/python/Tesla/Configuration.py index 7c7373af2ce9cf75dbf2fb29b29958f0c882c9a5..68ff6bf6656cdca5c3512b161b67c025e985b2d4 100644 --- a/Phys/Tesla/python/Tesla/Configuration.py +++ b/Phys/Tesla/python/Tesla/Configuration.py @@ -71,6 +71,40 @@ from LHCbKernel.Configuration import * from RawEventCompat.Configuration import ReverseDict as RawEventLocationsToBanks +# Locations of Track and ProtoParticle objects created in HLT2 that are not +# defined as part of the 'standard reconstruction' that is saved in PersistReco +# We need to know these locations in Tesla so that we can truth match the objects +# See LHCBPS-1807 for more details, and how this list was obtained +_extra_track_locations = [ + # These two locations are defined as part of the standard HLT2 reconstruction + # 'Hlt2/Track/Best/Downstream', + # 'Hlt2/Track/Best/Long', + 'Hlt2/Track/Best/LongDownstreamClones', + 'Hlt2/Track/Best/LongV0Vertices', + 'Hlt2/Track/Best/Muon', + 'Hlt2/Track/Best/Ttrack', + 'Hlt2/Track/ComplementForward', + 'Hlt2/Track/Downstream', + 'Hlt2/Track/Forward', + 'Hlt2/Track/Match', + 'Hlt2/Track/Seeding', + 'Hlt2/TrackBest/PID/MuonSegments', + 'Hlt2/TrackEff/Track/FullDownstream', + 'Hlt2/TrackEff/Track/MuonTT', + 'Hlt2/TrackEff/Track/StandaloneMuon', + 'Hlt2/TrackEff/Track/VeloMuon' +] +_extra_protoparticle_locations = [ + # These two locations are defined as part of the standard HLT2 reconstruction + # 'Hlt2/ProtoP/Downstream/Charged/WithAllPIDs', + # 'Hlt2/ProtoP/Long/Charged/WithAllPIDs', + 'Hlt2/ProtoP/Best/FullDownstream', + 'Hlt2/ProtoP/Best/MuonTT', + 'Hlt2/ProtoP/Best/VeloMuon', + 'Hlt2/ProtoP/Hlt2/TrackEff/Velo' +] + + def _strip_root(root, locs): """Return list of paths `loc` stripped of the `root` prefix. @@ -623,12 +657,16 @@ class Tesla(LHCbConfigurableUser): def _configureTruthMatching(self, name, packing): output_level = self.getProp('OutputLevel') + extra_track_locs = [os.path.join('/Event', self.base, l) for l in _extra_track_locations] + extra_proto_locs = [os.path.join('/Event', self.base, l) for l in _extra_protoparticle_locations] # Locations of the objects we want to truth-match track_locs = [packing.outputs['Hlt2LongTracks'], packing.outputs['Hlt2DownstreamTracks']] + track_locs += extra_track_locs proto_locs = [packing.outputs['Hlt2LongProtos'], packing.outputs['Hlt2DownstreamProtos']] + proto_locs += extra_proto_locs cluster_locs = [packing.outputs['Hlt2CaloClusters']] neutral_locs = [packing.outputs['Hlt2NeutralProtos']] @@ -718,7 +756,11 @@ class Tesla(LHCbConfigurableUser): DataCopy('Copy{0}'.format(loc.replace('/', '')), What=loc, Target=os.path.join(base, loc), - NeverFail=False, + # It's very possible that the extra locations + # might not exist, so no relations table will be + # created; we don't mind the copying failing in + # those cases + NeverFail=True if loc.replace('Relations/', '/Event/') in (extra_track_locs + extra_proto_locs) else False, OutputLevel=output_level) for loc in relationsLocations if self.base in loc