Commit 9e38941b authored by Alex Pearce's avatar Alex Pearce
Browse files

Unpack MC objects in RootInTES-dependent locations.

parent 998b4d62
......@@ -88,8 +88,6 @@ class AnalysisConf(LHCbConfigurableUser) :
"""
Define DaVinciAssociators. Do MC unpacking.
"""
self.unpackMC()
if not self.getProp("InputType") in ["MDST"]:
from Configurables import CaloAssociatorsConf
CaloAssociatorsConf ( EnableMCOnDemand = True, OutputLevel = self.getProp("OutputLevel") )
......@@ -100,7 +98,9 @@ class AnalysisConf(LHCbConfigurableUser) :
root_ = '/Event'
if self.getProp( "InputType" ) == 'MDST' and self.getProp('RootInTES') :
root_ = self.getProp('RootInTES')
self.unpackMC(root_)
## offline neutral protoparticles
alg1 = getAlgo (
NeutralPP2MC , ## type
......@@ -139,13 +139,34 @@ class AnalysisConf(LHCbConfigurableUser) :
#
# Unpack MC
#
def unpackMC(self):
def unpackMC(self, rootInTES):
"""
Do MC unpacking
Do MC unpacking for objects under rootInTES
"""
DataOnDemandSvc().NodeMap['/Event/MC'] = 'DataObject'
DataOnDemandSvc().AlgMap["MC/Particles"] = "UnpackMCParticle"
DataOnDemandSvc().AlgMap["MC/Vertices"] = "UnpackMCVertex"
import os
from Configurables import UnpackMCParticle, UnpackMCVertex
mcRoot = os.path.join(rootInTES, "MC")
particlesOutput = os.path.join(mcRoot, "Particles")
verticesOutput = os.path.join(mcRoot, "Vertices")
DataOnDemandSvc().NodeMap[mcRoot] = "DataObject"
DataOnDemandSvc().AlgMap[particlesOutput] = UnpackMCParticle(RootInTES=rootInTES)
DataOnDemandSvc().AlgMap[verticesOutput] = UnpackMCVertex(RootInTES=rootInTES)
log.info("Will unpack MC objects to {0}".format(mcRoot))
# In case any algorithm has a hard-coded dependency on /Event/MC/...,
# creates links from the location under RootInTES to /Event/MC
if mcRoot != "/Event/MC":
from Configurables import Gaudi__DataLink as DataLink
particlesLink = DataLink("MCParticlesLink",
What=particlesOutput,
Target="/Event/MC/Particles")
verticesLink = DataLink("MCVerticesLink",
What=verticesOutput,
Target="/Event/MC/Vertices")
DataOnDemandSvc().AlgMap[particlesLink.Target] = particlesLink
DataOnDemandSvc().AlgMap[verticesLink.Target] = verticesLink
#
# Apply configuration
#
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment