Skip to content
Snippets Groups Projects

loopy unpacking and multi packing

Merged Sevda Esen requested to merge sevda-loopy-unpacking3 into master
3 files
+ 115
29
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -10,7 +10,9 @@
###############################################################################
"""Helpers for configuring an application to read Moore HLT2 output."""
from __future__ import absolute_import
import os, json, XRootD.client
import functools
import os, json
from .utils import load_file
from .PersistRecoConf import PersistRecoPacking
@@ -89,6 +91,69 @@ def type_map():
return type_map
def load_manifest(fname) :
# needed for backwards compatibility with old style .tck.json files
__lookup = {
1006:
"LHCb::RecSummary",
1541:
"KeyedContainer<LHCb::CaloCluster,Containers::KeyedObjectManager<Containers::hashmap> >",
1542:
"KeyedContainer<LHCb::CaloDigit,Containers::KeyedObjectManager<Containers::hashmap> >",
1543:
"KeyedContainer<LHCb::CaloAdc,Containers::KeyedObjectManager<Containers::hashmap> >",
1550:
"KeyedContainer<LHCb::Event::v1::Track,Containers::KeyedObjectManager<Containers::hashmap> >",
1551:
"KeyedContainer<LHCb::CaloHypo,Containers::KeyedObjectManager<Containers::hashmap> >",
1552:
"KeyedContainer<LHCb::ProtoParticle,Containers::KeyedObjectManager<Containers::hashmap> >",
1553:
"KeyedContainer<LHCb::RecVertex,Containers::KeyedObjectManager<Containers::hashmap> >",
1554:
"KeyedContainer<LHCb::TwoProngVertex,Containers::KeyedObjectManager<Containers::hashmap> >",
1555:
"KeyedContainer<LHCb::WeightsVector,Containers::KeyedObjectManager<Containers::hashmap> >",
1560:
"LHCb::Relation1D<LHCb::Particle,LHCb::VertexBase>",
1561:
"KeyedContainer<LHCb::RichPID,Containers::KeyedObjectManager<Containers::hashmap> >",
1562:
"LHCb::RelationWeighted1D<LHCb::ProtoParticle,LHCb::MCParticle,double>",
1571:
"KeyedContainer<LHCb::MuonPID,Containers::KeyedObjectManager<Containers::hashmap> >",
1581:
"KeyedContainer<LHCb::Particle,Containers::KeyedObjectManager<Containers::hashmap> >",
1582:
"KeyedContainer<LHCb::Vertex,Containers::KeyedObjectManager<Containers::hashmap> >",
1583:
"KeyedContainer<LHCb::FlavourTag,Containers::KeyedObjectManager<Containers::hashmap> >",
1584:
"LHCb::Relation1D<LHCb::Particle,LHCb::RelatedInfoMap>",
1591:
"LHCb::Relation1D<LHCb::Particle,int>",
1660:
"LHCb::Relation1D<LHCb::Particle,LHCb::MCParticle>",
}
d = json.loads(load_file(fname))
# check for old-style .tck.json file (note: this actually has _nothing_ to do with the ANNSvc...)
ann = d.get("HltANNSvc/HltANNSvc", None)
if ann is not None:
# this is an old style .tck.json file -- adapt it on the fly
fix_prefix = lambda x, prefix: prefix + x.removeprefix(prefix + 'p') if x.startswith(prefix + 'p') else x
manifest = {
'PackedLocations':
[(functools.reduce( fix_prefix, ('/Event/Spruce/', '/Event/HLT2/'), loc ), __lookup[t % 10000])
for loc, t in ann['PackedObjectTypes'].items()]
}
else:
manifest = d
return manifest
def mc_unpackers(process='Hlt2',
filtered_mc=True,
configurables=True,
@@ -211,7+276,7 @@
Args:
process (str): 'Turbo' or 'Spruce' or 'Hlt2'.
data_type (str): The data type to configure PersistRecoPacking (only option is Upgrade atm)
mc: MCParticle and MCVertices locations
cfg: configuration needed for finding linker locations
locations: list of packed object locations to unpack
configurables (bool): set to False to use PyConf Algorithm.
Loading