Commit de029bdf authored by Christos Anastopoulos's avatar Christos Anastopoulos Committed by Walter Lampl
Browse files

Egamma split InDetTool.py to egammaExtrapolators.py and the egamma vertex parts

parent a8335f26
......@@ -64,7 +64,7 @@ CaloClustersInConeTool = ToolFactory(xAOD__CaloClustersInConeTool,
# tool to extrapolate to the calo
from TrackToCalo.TrackToCaloConf import Trk__ParticleCaloExtensionTool, Rec__ParticleCaloCellAssociationTool
#this is just regular extrapolator, but in ToolFactory form
from egammaTools.InDetTools import egammaExtrapolator
from egammaTools.egammaExtrapolators import egammaExtrapolator
CaloExtensionTool = ToolFactory (Trk__ParticleCaloExtensionTool,
Extrapolator = egammaExtrapolator)
......
......@@ -12,7 +12,7 @@ from RecExConfig.RecFlags import rec
from InDetRecExample.InDetJobProperties import InDetFlags
# import base class
from egammaAlgs import egammaAlgsConf
from egammaTools.InDetTools import egammaExtrapolator
from egammaTools.egammaExtrapolators import egammaExtrapolator
from egammaRec.Factories import AlgFactory
from egammaRec import egammaKeys
......
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
__doc__ = "ToolFactory to instantiate EMVertexBuilder with default configuration"
__author__ = "Bruno Lenzi"
from egammaAlgs import egammaAlgsConf
from egammaRec.Factories import FcnWrapper, AlgFactory
from egammaRec.Factories import FcnWrapper, AlgFactory, PublicToolFactory
from egammaRec import egammaKeys
from egammaTrackTools.egammaTrackToolsFactories import EMExtrapolationTools
from egammaTools.InDetTools import egammaInDetTrackSummaryTool, egammaExtrapolator
from egammaTools.egammaExtrapolators import egammaExtrapolator
class VertexFinderToolInstance(FcnWrapper):
def __call__(self):
#
# Configured conversion vertex reconstruction cuts
#
from InDetRecExample.ConfiguredSecondaryVertexCuts import ConfiguredSecondaryVertexCuts
egammaConversionVertexCuts = ConfiguredSecondaryVertexCuts(mode ="EGammaPileUp")
from InDetRecExample.ConfiguredSecVertexFinding import ConfiguredSecVertexFinding
theemvertexfindertool=ConfiguredSecVertexFinding (prefix = "egammaConversion",
VertexCuts = egammaConversionVertexCuts,
TrackParticles = egammaKeys.outputTrackParticleKey(),
SecVertices = egammaKeys.outputConversionKey(),
Extrapolator = egammaExtrapolator(),
TrackSummaryTool = egammaInDetTrackSummaryTool(),
printConfig = False)
return theemvertexfindertool.toolInstance()
EMVertexBuilder = AlgFactory( egammaAlgsConf.EMVertexBuilder,
InputTrackParticleContainerName = egammaKeys.outputTrackParticleKey(),
OutputConversionContainerName = egammaKeys.outputConversionKey(),
VertexFinderTool = VertexFinderToolInstance(),
ExtrapolationTool = EMExtrapolationTools)
def __call__(self):
#################################################################
# egamma InDet summary tool to be used conversion finding
#
# load association tool from Inner Detector to handle pixel ganged
# ambiguities
from InDetAssociationTools.InDetAssociationToolsConf import InDet__InDetPRD_AssociationToolGangedPixels
egammaInDetPrdAssociationTool = PublicToolFactory(InDet__InDetPRD_AssociationToolGangedPixels,
name="egammaInDetPrdAssociationTool",
PixelClusterAmbiguitiesMapName='PixelClusterAmbiguitiesMap')
# Loading Configurable HoleSearchTool
#
from InDetTrackHoleSearch.InDetTrackHoleSearchConf import InDet__InDetTrackHoleSearchTool
egammaInDetHoleSearchTool = PublicToolFactory(InDet__InDetTrackHoleSearchTool,
name="egammaInDetHoleSearchTool",
Extrapolator=egammaExtrapolator)
#
# Load the InDetTrackSummaryHelperTool
#
from AthenaCommon.DetFlags import DetFlags
from InDetTrackSummaryHelperTool.InDetTrackSummaryHelperToolConf import InDet__InDetTrackSummaryHelperTool
egammaInDetTrackSummaryHelperTool = PublicToolFactory(InDet__InDetTrackSummaryHelperTool,
name="egammaInDetSummaryHelper",
AssoTool=egammaInDetPrdAssociationTool,
DoSharedHits=False,
HoleSearch=egammaInDetHoleSearchTool,
usePixel=DetFlags.haveRIO.pixel_on(),
useSCT=DetFlags.haveRIO.SCT_on(),
useTRT=DetFlags.haveRIO.TRT_on())
#
from TrkTrackSummaryTool.TrkTrackSummaryToolConf import Trk__TrackSummaryTool
egammaInDetTrackSummaryTool = PublicToolFactory(Trk__TrackSummaryTool,
name="egammaInDetTrackSummaryTool",
InDetSummaryHelperTool=egammaInDetTrackSummaryHelperTool,
doSharedHits=False,
doHolesInDet=True)
#
# Configured conversion vertex reconstruction cuts
#
from InDetRecExample.ConfiguredSecondaryVertexCuts import ConfiguredSecondaryVertexCuts
egammaConversionVertexCuts = ConfiguredSecondaryVertexCuts(
mode="EGammaPileUp")
from InDetRecExample.ConfiguredSecVertexFinding import ConfiguredSecVertexFinding
theemvertexfindertool = ConfiguredSecVertexFinding(prefix="egammaConversion",
VertexCuts=egammaConversionVertexCuts,
TrackParticles=egammaKeys.outputTrackParticleKey(),
SecVertices=egammaKeys.outputConversionKey(),
Extrapolator=egammaExtrapolator(),
TrackSummaryTool=egammaInDetTrackSummaryTool(),
printConfig=False)
return theemvertexfindertool.toolInstance()
EMVertexBuilder = AlgFactory(egammaAlgsConf.EMVertexBuilder,
InputTrackParticleContainerName=egammaKeys.outputTrackParticleKey(),
OutputConversionContainerName=egammaKeys.outputConversionKey(),
VertexFinderTool=VertexFinderToolInstance(),
ExtrapolationTool=EMExtrapolationTools)
......@@ -9,7 +9,7 @@ from egammaRec.Factories import ToolFactory, PublicToolFactory, AlgFactory, FcnW
from AthenaCommon.BeamFlags import jobproperties
from egammaRec import egammaRecFlags as egRecFlags
egammaRecFlags = egRecFlags.jobproperties.egammaRecFlags
from egammaTools.InDetTools import egammaCaloExtrapolator
from egammaTools.egammaExtrapolators import egammaCaloExtrapolator
from MCTruthClassifier import MCTruthClassifierConf
import AthenaCommon.CfgMgr as CfgMgr
......
......@@ -82,42 +82,4 @@ egammaCaloExtrapolator = ToolFactory(AtlasExtrapolator,
name = 'egammaCaloExtrapolator')
#################################################################
# egamma InDet summary tool to be used conversion finding
#
# load association tool from Inner Detector to handle pixel ganged
# ambiguities
from InDetAssociationTools.InDetAssociationToolsConf import InDet__InDetPRD_AssociationToolGangedPixels
egammaInDetPrdAssociationTool = PublicToolFactory( InDet__InDetPRD_AssociationToolGangedPixels,
name = "egammaInDetPrdAssociationTool",
PixelClusterAmbiguitiesMapName = 'PixelClusterAmbiguitiesMap')
# Loading Configurable HoleSearchTool
#
from InDetTrackHoleSearch.InDetTrackHoleSearchConf import InDet__InDetTrackHoleSearchTool
egammaInDetHoleSearchTool = PublicToolFactory( InDet__InDetTrackHoleSearchTool,
name = "egammaInDetHoleSearchTool",
Extrapolator = egammaExtrapolator)
#
# Load the InDetTrackSummaryHelperTool
#
from AthenaCommon.DetFlags import DetFlags
from InDetTrackSummaryHelperTool.InDetTrackSummaryHelperToolConf import InDet__InDetTrackSummaryHelperTool
egammaInDetTrackSummaryHelperTool = PublicToolFactory( InDet__InDetTrackSummaryHelperTool,
name = "egammaInDetSummaryHelper",
AssoTool = egammaInDetPrdAssociationTool,
DoSharedHits = False,
HoleSearch = egammaInDetHoleSearchTool,
usePixel = DetFlags.haveRIO.pixel_on(),
useSCT = DetFlags.haveRIO.SCT_on(),
useTRT = DetFlags.haveRIO.TRT_on())
#
from TrkTrackSummaryTool.TrkTrackSummaryToolConf import Trk__TrackSummaryTool
egammaInDetTrackSummaryTool = PublicToolFactory( Trk__TrackSummaryTool,
name = "egammaInDetTrackSummaryTool",
InDetSummaryHelperTool = egammaInDetTrackSummaryHelperTool,
doSharedHits = False,
doHolesInDet = True)
......@@ -2,10 +2,10 @@
__doc__ = "ToolFactories to instantiate all egammaCaloTools with default configuration"
__author__ = "Bruno Lenzi , Christos Anastopoulos"
from egammaRec.Factories import FcnWrapper, ToolFactory
from egammaRec.Factories import ToolFactory
from egammaTrackTools import egammaTrackToolsConf
from egammaRec import egammaKeys
from egammaTools.InDetTools import egammaCaloExtrapolator,egammaExtrapolator
from egammaTools.egammaExtrapolators import egammaCaloExtrapolator,egammaExtrapolator
import AthenaCommon.CfgMgr as CfgMgr
EMLastCaloExtensionTool = ToolFactory (CfgMgr.Trk__ParticleCaloExtensionTool,
......
......@@ -50,7 +50,7 @@ TrigCaloFillRectangularCluster = PublicToolFactory( Cccc.CaloFillRectangularClus
# tool to extrapolate to the calo
from TrackToCalo.TrackToCaloConf import Trk__ParticleCaloExtensionTool, Rec__ParticleCaloCellAssociationTool
#this is just regular extrapolator, but in ToolFactory form
from egammaTools.InDetTools import egammaExtrapolator
from egammaTools.egammaExtrapolators import egammaExtrapolator
CaloExtensionTool = ToolFactory (Trk__ParticleCaloExtensionTool,
Extrapolator = egammaExtrapolator)
......
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