Skip to content
Snippets Groups Projects
Commit f9df34f8 authored by Eduardo Rodrigues's avatar Eduardo Rodrigues
Browse files

Merge branch 'apearce-LHCBPS-1807' into '2017-patches'

Truth-match objects beyond the standard HLT2 reconstruction in Tesla

See merge request !246

(cherry picked from commit 89ed5446)

86cfcf02 Truth match additional Track and ProtoParticle containers.
5d0b2b2c Hard-code the list of extra locations.
1b95995a Clarify NeverFail logic.
parent feccdcb3
No related branches found
No related tags found
1 merge request!248Truth-match objects beyond the standard HLT2 reconstruction in Tesla
......@@ -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.
......@@ -625,12 +659,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']]
......@@ -720,7 +758,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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment