Commit 3a551b97 authored by Tomasz Bold's avatar Tomasz Bold Committed by Frank Winklmeier
Browse files

Integrate egamma EMBremCollectionBulder in new JO reco test

parent 213dc137
......@@ -129,7 +129,7 @@ def ClusterMakerToolCfg(flags, name="InDetClusterMakerTool", **kwargs) :
return acc
def TrackToVertexCfg(flags, name="TrackToVertex", **kwargs):
def TrackToVertexCfg(flags, name="AtlasTrackToVertexTool", **kwargs):
result = ComponentAccumulator()
if "Extrapolator" not in kwargs:
from TrkConfig.AtlasExtrapolatorConfig import AtlasExtrapolatorCfg
......
......@@ -877,33 +877,27 @@ def InDetGsfMaterialUpdatorCfg(name='InDetGsfMaterialUpdator', **kwargs) :
acc.setPrivateTools(GsfMaterialMixtureConvolution)
return acc
def InDetGsfExtrapolatorCfg(flags, name='InDetGsfExtrapolator', **kwargs) :
def InDetGsfExtrapolatorCfg(flags, name='GsfExtrapolator', **kwargs) :
the_name = makeName(name,kwargs)
acc = ComponentAccumulator()
if 'Propagators' not in kwargs :
from InDetConfig.InDetRecToolConfig import InDetPropagatorCfg
InDetPropagator = acc.popToolsAndMerge(InDetPropagatorCfg(flags))
acc.addPublicTool(InDetPropagator)
kwargs.setdefault('Propagators', [ InDetPropagator ])
kwargs['Propagators'] = [ acc.getPrimaryAndMerge(InDetPropagatorCfg(flags)) ]
if 'Navigator' not in kwargs :
from InDetConfig.InDetRecToolConfig import InDetNavigatorCfg
InDetNavigator = acc.popToolsAndMerge(InDetNavigatorCfg(flags))
acc.addPublicTool(InDetNavigator)
kwargs.setdefault('Navigator', InDetNavigator)
kwargs['Navigator'] = acc.getPrimaryAndMerge(InDetNavigatorCfg(flags))
if 'GsfMaterialConvolution' not in kwargs :
InDetGsfMaterialUpdato = acc.popToolsAndMerge(InDetGsfMaterialUpdatorCfg())
acc.addPublicTool(InDetGsfMaterialUpdato)
kwargs.setdefault('GsfMaterialConvolution', InDetGsfMaterialUpdato)
kwargs['GsfMaterialConvolution'] = acc.popToolsAndMerge(InDetGsfMaterialUpdatorCfg())
kwargs.setdefault('SearchLevelClosestParameters', 10)
kwargs.setdefault('StickyConfiguration', True)
kwargs.setdefault('SurfaceBasedMaterialEffects', False)
GsfExtrapolator = CompFactory.Trk.GsfExtrapolator(name = the_name, **kwargs)
acc.setPrivateTools(GsfExtrapolator)
print("REMOVEME", the_name, kwargs)
extrapolatorTool = CompFactory.Trk.GsfExtrapolator(name = the_name, **kwargs)
acc.setPrivateTools(extrapolatorTool)
return acc
def GaussianSumFitterCfg(flags, name='GaussianSumFitter', **kwargs) :
......
......@@ -55,7 +55,16 @@ def RecoSteering(flags):
acc.merge(PFCfg(flags))
# physics objects
# egamma
# egamma TODO move these fragments to proper place configuring entire egamma - so it can be unit tested
from egammaAlgs.egammaSelectedTrackCopyConfig import egammaSelectedTrackCopyCfg
acc.merge(egammaSelectedTrackCopyCfg(flags))
from egammaAlgs.EMBremCollectionBuilderConfig import EMBremCollectionBuilderCfg
acc.merge(EMBremCollectionBuilderCfg(flags))
# TBC
# from egammaAlgs.egammaRecBuilderConfig import egammaRecBuilderCfg
# acc.merge(egammaRecBuilderCfg(flags))
# jets
# btagging
if tryConfiguringAll:
......
......@@ -25,4 +25,7 @@ CaloTopoCluster.CaloClusterBadChannelList.CaloBadChanTool.TileBadChanTool = Calo
InDetSCTRawDataProvider = SCTRawDataProvider
InDetPixelRawDataProvider = PixelRawDataProvider
InDetPixelRawDataProvider.RegSelTool_Pixel = PixelRawDataProvider.RegSelTool_Pixel
InDetPixelClusterization.InDetMergedPixelsTool.PixelConditionsSummaryTool = InDetPixelClusterization.InDetMergedPixelsTool.InDetPixelConditionsSummaryTool
\ No newline at end of file
InDetPixelClusterization.InDetMergedPixelsTool.PixelConditionsSummaryTool = InDetPixelClusterization.InDetMergedPixelsTool.InDetPixelConditionsSummaryTool
#egamma
EMBremCollectionBuilder.GSFBuildInDetParticleCreatorTool.AtlasTrackToVertexTool = EMBremCollectionBuilder.GSFBuildInDetParticleCreatorTool.TrackToVertex.AtlasExtrapolator
......@@ -3,17 +3,35 @@
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaConfiguration.ComponentFactory import CompFactory
def EMBremCollectionBuilderCfg(flags,
name="EMBremCollectionBuilder",
**kwargs):
acc = ComponentAccumulator()
# FIXME runtime testing required this, but since this is not a direct dependency it should be added elsewhere, but I do not know where yet
if not flags.Input.isMC:
from LumiBlockComps.LumiBlockMuWriterConfig import LumiBlockMuWriterCfg
acc.merge(LumiBlockMuWriterCfg(flags))
if "TrackRefitTool" not in kwargs:
from egammaTrackTools.egammaTrackToolsConfig import egammaTrkRefitterToolCfg
kwargs["TrackRefitTool"] = acc.popToolsAndMerge( egammaTrkRefitterToolCfg(flags) )
if "TrackParticleCreatorTool" not in kwargs:
from InDetConfig.TrackRecoConfig import TrackParticleCreatorToolCfg
kwargs["TrackParticleCreatorTool"] = acc.popToolsAndMerge(TrackParticleCreatorToolCfg(flags, "GSFBuildInDetParticleCreatorTool"))
# TBC
# if "TrackRefitTool" not in kwargs:
# kwargs["TrackRefitTool"] = acc.popToolsAndMerge( )
kwargs["TrackParticleCreatorTool"] = acc.getPrimaryAndMerge(TrackParticleCreatorToolCfg(flags, name="GSFBuildInDetParticleCreatorTool", BadClusterID = 3))
if "TrackSlimmingTool" not in kwargs:
slimmingTool = CompFactory.Trk.TrackSlimmingTool(name="GSFBuildInDetTrackSlimmingTool", KeepOutliers=True)
kwargs["TrackSlimmingTool"] = slimmingTool
if "TrackSummaryTool" not in kwargs:
from egammaTrackTools.egammaTrackToolsConfig import GSFTrackSummaryToolCfg
kwargs["TrackSummaryTool"] = acc.popToolsAndMerge(GSFTrackSummaryToolCfg(flags))
kwargs.setdefault("usePixel", True) # TODO configure according to some doPixel, presumably flags.Detector.EnablePixel, same for src
kwargs.setdefault("useSCT", True)
alg = CompFactory.EMBremCollectionBuilder(name, **kwargs)
acc.addEventAlgo(alg)
return acc
\ No newline at end of file
......@@ -6,11 +6,9 @@ from egammaTrackTools.egammaTrackToolsConfig import EMExtrapolationToolsCfg
from AthenaCommon.Logging import logging
from AthenaConfiguration.ComponentFactory import CompFactory
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from egammaCaloTools.egammaCaloToolsFactories import egammaCheckEnergyDepositTool
egammaCaloClusterSelector = CompFactory.egammaCaloClusterSelector
egammaSelectedTrackCopy = CompFactory.egammaSelectedTrackCopy
def egammaSelectedTrackCopyCfg(
flags,
name='egammaSelectedTrackCopy',
......@@ -28,16 +26,17 @@ def egammaSelectedTrackCopyCfg(
EMEtSplittingFraction=0.7,
EMFCut=0.5
)
kwargs["egammaCaloClusterSelector"] = egammaCaloClusterGSFSelector
kwargs.setdefault("egammaCheckEnergyDepositTool",
egammaCheckEnergyDepositTool())
if "ExtrapolationTool" not in kwargs:
extraptool = EMExtrapolationToolsCfg(flags)
extraptool = EMExtrapolationToolsCfg(flags, name="EMExtrapolationTools")
kwargs["ExtrapolationTool"] = extraptool.popPrivateTools()
acc.merge(extraptool)
if "ExtrapolationToolCommonCache" not in kwargs:
from egammaTrackTools.egammaTrackToolsConfig import EMExtrapolationToolsCacheCfg
kwargs["ExtrapolationToolCommonCache"] = acc.popToolsAndMerge(EMExtrapolationToolsCacheCfg(flags))
kwargs.setdefault(
"ClusterContainerName",
flags.Egamma.Keys.Internal.EgammaTopoClusters)
......
......@@ -21,7 +21,7 @@ def EMTrackMatchBuilderCfg(flags, name='EMTrackMatchBuilder', **kwargs):
kwargs["ExtrapolationTool"] = extrapcache.popPrivateTools()
acc.merge(extrapcache)
kwargs.setdefault("TrackParticlesName", flags.Egamma.Keys.Output.GSFTrackParticles)
kwargs.setdefault("TrackParticlesName", flags.Egamma.Keys.Input.TrackParticles) # TODO restore proper input once LRT tracking is in place Egamma.Keys.Output.GSFTrackParticles)
kwargs.setdefault("broadDeltaEta", 0.1) # candidate match is done in 2 times this so +- 0.2
kwargs.setdefault("broadDeltaPhi", 0.15) # candidate match is done in 2 times this so +- 0.3
kwargs.setdefault("useCandidateMatch", True)
......
......@@ -59,10 +59,42 @@ def EMExtrapolationToolsCacheCfg(flags, **kwargs):
kwargs.setdefault("useLastCaching", True)
return EMExtrapolationToolsCfg(flags, **kwargs)
def GSFTrackSummaryToolCfg(flags, name="GSFBuildInDetTrackSummaryTool", **kwargs):
acc = ComponentAccumulator()
if "InDetSummaryHelperTool" not in kwargs:
from InDetConfig.InDetRecToolConfig import InDetTrackSummaryHelperToolCfg
kwargs["InDetSummaryHelperTool"] = acc.getPrimaryAndMerge(InDetTrackSummaryHelperToolCfg(flags, name="GSFBuildTrackSummaryHelperTool"))
if "PixelToTPIDTool" not in kwargs:
from InDetConfig.TrackingCommonConfig import InDetPixelToTPIDToolCfg
kwargs["PixelToTPIDTool"] = acc.popToolsAndMerge(InDetPixelToTPIDToolCfg(flags, name="GSFBuildPixelToTPIDTool"))
if "TRT_ElectronPidTool" not in kwargs:
from InDetConfig.TrackingCommonConfig import InDetTRT_ElectronPidToolCfg
kwargs["TRT_ElectronPidTool"] = acc.popToolsAndMerge(InDetTRT_ElectronPidToolCfg(flags, name="GSFBuildTRT_ElectronPidTool"))
summaryTool = CompFactory.Trk.TrackSummaryTool(name, **kwargs)
acc.setPrivateTools( summaryTool )
return acc
# egammaTrkRefitterTool also needs a config, but depends on some
# tracking that is not ready
# CaloCluster_OnTrackBuilder is currently not used at all
def egammaTrkRefitterToolCfg(flags, name='GSFRefitterTool', **kwargs):
acc = ComponentAccumulator()
kwargs.setdefault("useBeamSpot", False)
kwargs.setdefault("ReintegrateOutliers", True)
if "Extrapolator" not in kwargs:
from InDetConfig.InDetRecToolConfig import InDetExtrapolatorCfg
kwargs["Extrapolator"] = acc.getPrimaryAndMerge(InDetExtrapolatorCfg(flags, name="egammaExtrapolator"))
if "FitterTool" not in kwargs:
from InDetConfig.TrackingCommonConfig import GaussianSumFitterCfg
kwargs["FitterTool"] = acc.popToolsAndMerge( GaussianSumFitterCfg(flags, name="GSFTrackFitter") )
tool = CompFactory.egammaTrkRefitterTool(name, **kwargs)
acc.setPrivateTools(tool)
return acc
if __name__ == "__main__":
......
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