diff --git a/Control/AthenaConfiguration/python/AllConfigFlags.py b/Control/AthenaConfiguration/python/AllConfigFlags.py index bdbaa68e7b170d5a69b322a76adc9fdcb2ff6ee8..72611370a09276402aa3ef9f41d14487a50c0f92 100644 --- a/Control/AthenaConfiguration/python/AllConfigFlags.py +++ b/Control/AthenaConfiguration/python/AllConfigFlags.py @@ -21,7 +21,7 @@ def _createCfgFlags(): acf=AthConfigFlags() - acf.addFlag('Input.Files', ["_ATHENA_GENERIC_INPUTFILE_NAME_",] ) # fromer global.InputFiles + acf.addFlag('Input.Files', ["_ATHENA_GENERIC_INPUTFILE_NAME_",] ) # former global.InputFiles acf.addFlag('Input.SecondaryFiles', []) # secondary input files for DoubleEventSelector acf.addFlag('Input.isMC', lambda prevFlags : GetFileMD(prevFlags.Input.Files).get("isMC",None)) # former global.isMC acf.addFlag('Input.RunNumber', lambda prevFlags : list(GetFileMD(prevFlags.Input.Files).get("RunNumber",None))) # former global.RunNumber @@ -72,6 +72,12 @@ def _createCfgFlags(): acf.addFlag('Output.ESDFileName','myESD.pool.root') acf.addFlag('Output.AODFileName','myAOD.pool.root') acf.addFlag('Output.HISTFileName','myHIST.root') + + # Might move this elsewhere in the future. + # Some flags from https://gitlab.cern.ch/atlas/athena/blob/master/Tracking/TrkDetDescr/TrkDetDescrSvc/python/TrkDetDescrJobProperties.py + # (many, e.g. those that set properties of one tool are not needed) + acf.addFlag('TrackingGeometry.MagneticFileMode', 6) + acf.addFlag('TrackingGeometry.MaterialSource', 'COOL') # Can be COOL, Input or None #Detector Flags: def __detector(): diff --git a/Event/DumpEventDataToJSON/python/DumpEventDataToJSONConfig.py b/Event/DumpEventDataToJSON/python/DumpEventDataToJSONConfig.py index 1539e5bc0e4564526f2d0512afa8ef8ce8796544..155aa6840b42c7d7917b15e933bef09c49287c47 100644 --- a/Event/DumpEventDataToJSON/python/DumpEventDataToJSONConfig.py +++ b/Event/DumpEventDataToJSON/python/DumpEventDataToJSONConfig.py @@ -8,13 +8,18 @@ def DumpEventDataToJSONAlgCfg(configFlags, doExtrap=False, **kwargs): result=ComponentAccumulator() extrapolationEngine="" if doExtrap: + from AtlasGeoModel.GeoModelConfig import GeoModelCfg + gmsAcc=GeoModelCfg( configFlags ) + result.merge(gmsAcc) + from TrkExEngine.AtlasExtrapolationEngineConfig import AtlasExtrapolationEngineCfg extrapAcc = AtlasExtrapolationEngineCfg(configFlags) - - extrapolationEngine = extrapAcc.popPrivateTools() + extrapolationEngine = extrapAcc.getPrimary() result.merge(extrapAcc) - - dumpAlg = DumpEventDataToJsonAlg(OutputLevel=VERBOSE, ExtrapolateTracks=doExtrap, Extrapolator = extrapolationEngine) + + kwargs.setdefault('Extrapolator', extrapolationEngine) + + dumpAlg = DumpEventDataToJsonAlg(ExtrapolateTracks=doExtrap, **kwargs ) result.addEventAlgo(dumpAlg) return result diff --git a/Event/DumpEventDataToJSON/share/DumpEventDataToJson.py b/Event/DumpEventDataToJSON/share/DumpEventDataToJson.py index 81e16124a79e7dd1e453e58092cc02be8a3f2594..1a6b3b209d9f94b235323984b261e09c6e7b2f09 100644 --- a/Event/DumpEventDataToJSON/share/DumpEventDataToJson.py +++ b/Event/DumpEventDataToJSON/share/DumpEventDataToJson.py @@ -35,7 +35,7 @@ if not hasattr(topSequence, "SGInputLoader"): # from IOVSvc.IOVSvcConf import CondSvc # svcMgr += CondSvc() -doExtrap = True +doExtrap = False ExtrapolationEngine="" if (doExtrap): diff --git a/Tracking/TrkDetDescr/TrkDetDescrSvc/python/AtlasTrackingGeometrySvcConfig.py b/Tracking/TrkDetDescr/TrkDetDescrSvc/python/AtlasTrackingGeometrySvcConfig.py index 4022650a844db858f0b76b218968870b574f4c03..4c4bb52b122abed54df064c6b0bfc05aa11c24e6 100644 --- a/Tracking/TrkDetDescr/TrkDetDescrSvc/python/AtlasTrackingGeometrySvcConfig.py +++ b/Tracking/TrkDetDescr/TrkDetDescrSvc/python/AtlasTrackingGeometrySvcConfig.py @@ -3,11 +3,11 @@ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from TrkDetDescrSvc.TrkDetDescrSvcConf import Trk__TrackingGeometrySvc from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__GeometryBuilder -from CaloTrackingGeometry.ConfiguredCaloTrackingGeometryBuilder import ConfiguredCaloTrackingGeometryBuilder -from InDetTrackingGeometry.ConfiguredInDetTrackingGeometryBuilder import ConfiguredInDetTrackingGeometryBuilder -from MuonTrackingGeometry.ConfiguredMuonTrackingGeometry import MuonTrackingGeometryBuilder -from IOVDbSvc.IOVDbSvcConfig import IOVDbSvcCfg, addFolders, addFoldersSplitOnline -from SubDetectorEnvelopes.SubDetectorEnvelopesConfig import EnvelopeDefSvc +from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline +from SubDetectorEnvelopes.SubDetectorEnvelopesConfig import getEnvelopeDefSvc + +# This file is a placeholder - the entire way we build geometry needs to be rewritten so this is to unblock new configuration developments for the moment. +# It is based on: https://gitlab.cern.ch/atlas/athena/blob/master/Tracking/TrkDetDescr/TrkDetDescrSvc/python/AtlasTrackingGeometrySvc.py#L112 def _setupCondDB(flags, CoolDataBaseFolder): result=ComponentAccumulator() @@ -19,68 +19,253 @@ def _setupCondDB(flags, CoolDataBaseFolder): AtlasMaterialTag = materialTagBase+str(version)+sub_version+'_' cfolder = CoolDataBaseFolder +'<tag>TagInfoMajor/'+AtlasMaterialTag+'/GeoAtlas</tag>' - # load the right folders (preparation for calo inclusion) + + print('[ TrackingGeometrySvc ] base material tag : ' + AtlasMaterialTag) + print('[ TrackingGeometrySvc ] translated to COOL: ' + cfolder) + + # load the right folders result.merge( addFoldersSplitOnline(flags,'GLOBAL',[cfolder],[cfolder]) ) return result -def TrackingGeometrySvcCfg( flags ) : - result = ComponentAccumulator() +def _getInDetTrackingGeometryBuilder(name, flags,result, envelopeDefinitionSvc, namePrefix='', setLayerAssociation = True, buildTrtStrawLayers = False): + # Based on https://gitlab.cern.ch/atlas/athena/blob/master/InnerDetector/InDetDetDescr/InDetTrackingGeometry/python/ConfiguredInDetTrackingGeometryBuilder.py + # A lot of comments below are to help people understand differences from the above, in case we need to revert some simplifications I made + # i.e. this is far from complete, but is better than what was there before. + + # beampipe + from InDetTrackingGeometry.InDetTrackingGeometryConf import InDet__BeamPipeBuilder + beamPipeBuilder = InDet__BeamPipeBuilder(name=namePrefix+'BeamPipeBuilder') - AtlasTrackingGeometryName = 'AtlasTrackingGeometry' - atlas_geometry_builder = Trk__GeometryBuilder(name = 'AtlasGeometryBuilder') - result.addPublicTool(atlas_geometry_builder) #TODO remove one day - - AtlasEnvelopeSvc = EnvelopeDefSvc( flags ) - result.addService(AtlasEnvelopeSvc) - - # No Det Flags right now. + result.addPublicTool(beamPipeBuilder) + layerbuilders = [] + binnings = [] + colors = [] + + # Pixel + if flags.Detector.GeometryPixel: + from InDetTrackingGeometry.InDetTrackingGeometryConf import InDet__SiLayerBuilder + PixelLayerBuilder = InDet__SiLayerBuilder(name=namePrefix+'PixelLayerBuilder') + PixelLayerBuilder.PixelCase = True + PixelLayerBuilder.Identification = 'Pixel' + PixelLayerBuilder.SiDetManagerLocation = 'Pixel' + # additional layers - handle with care ! + PixelLayerBuilder.BarrelAdditionalLayerRadii = [ 130 ] # The PST + PixelLayerBuilder.BarrelAdditionalLayerType = [ 0 ] # -- will shift volume boundary to PST + PixelLayerBuilder.EndcapAdditionalLayerPositionsZ = [ -1900. , 1900. ] # DBM + PixelLayerBuilder.EndcapAdditionalLayerType = [ 1 , 1 ] # DBM + # Pixel barrel specifications + # Since we don't have TrkDetFlags, using defaults here. - # Inner Detector - if (False): - InDetTrackingGeometryBuilder = ConfiguredInDetTrackingGeometryBuilder(name ='InDetTrackingGeometryBuilder') - result.addPublicTool(InDetTrackingGeometryBuilder) - # and give it to the Geometry Builder - atlas_geometry_builder.InDetTrackingGeometryBuilder = InDetTrackingGeometryBuilder + # set the layer association + PixelLayerBuilder.SetLayerAssociation = setLayerAssociation + + # the binning type of the layers + PixelLayerBinning = 2 + # add it to tool service + result.addPublicTool(PixelLayerBuilder) + # put them to the caches + layerbuilders += [ PixelLayerBuilder ] + binnings += [ PixelLayerBinning ] + colors += [ 3 ] + + if flags.Detector.GeometrySCT: + # SCT building + from InDetTrackingGeometry.InDetTrackingGeometryConf import InDet__SiLayerBuilder + SCT_LayerBuilder = InDet__SiLayerBuilder(name=namePrefix+'SCT_LayerBuilder') + SCT_LayerBuilder.PixelCase = False + SCT_LayerBuilder.Identification = 'SCT' + SCT_LayerBuilder.SiDetManagerLocation = 'SCT' + # additionall layers - handle with care ! + SCT_LayerBuilder.EndcapAdditionalLayerPositionsZ = [ -2850 , 2850 ] + SCT_LayerBuilder.EndcapAdditionalLayerType = [ 0 , 0 ] + # SCT barrel specifications - use defaults + # SCT endcap specifications - use defaults + # set the layer association + SCT_LayerBuilder.SetLayerAssociation = setLayerAssociation + # the binning type of the layer + SCT_LayerBinning = 2 + # SCT -> ToolSvc + result.addPublicTool(SCT_LayerBuilder) + + # put them to the caches + layerbuilders += [ SCT_LayerBuilder ] + binnings += [ SCT_LayerBinning ] + colors += [ 4 ] + + if flags.Detector.GeometryTRT: + from InDetTrackingGeometry.InDetTrackingGeometryConf import InDet__TRT_LayerBuilder + TRT_LayerBuilder = InDet__TRT_LayerBuilder(name=namePrefix+'TRT_LayerBuilder') + # TRT barrel specifications - assume defaults + # SCT endcap specifications - assume defaults + + # set the binning from bi-aequidistant to arbitrary for complex TRT volumes + TRT_LayerBinning = 1 + if buildTrtStrawLayers: + TRT_LayerBinning = 2 + TRT_LayerBuilder.ModelLayersOnly = False + # TRT -> ToolSvc + result.addPublicTool(TRT_LayerBuilder) - # (Calo) - if (False): - from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__CylinderVolumeCreator - CaloVolumeCreator = Trk__CylinderVolumeCreator("CaloVolumeCreator") - result.addPublicTool(CaloVolumeCreator) - - CaloTrackingGeometryBuilder = ConfiguredCaloTrackingGeometryBuilder(name='CaloTrackingGeometryBuilder'); - CaloTrackingGeometryBuilder.TrackingVolumeCreator = CaloVolumeCreator - CaloTrackingGeometryBuilder.EnvelopeDefinitionSvc = AtlasEnvelopeSvc - CaloTrackingGeometryBuilder.GeometryName = 'Calo' - result.addPublicTool(CaloTrackingGeometryBuilder) - # and give it to the Geometry Builder - atlas_geometry_builder.CaloTrackingGeometryBuilder = CaloTrackingGeometryBuilder - - # (Muon) - if (True): - MuonTrackingGeometryBuilder.EnvelopeDefinitionSvc = AtlasEnvelopeSvc - result.addPublicTool(MuonTrackingGeometryBuilder) - # and give it to the Geometry Builder - atlas_geometry_builder.MuonTrackingGeometryBuilder = MuonTrackingGeometryBuilder - - # the material provider - from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__LayerMaterialProvider - AtlasMaterialProvider = Trk__LayerMaterialProvider('AtlasMaterialProvider') - CoolDataBaseFolder = '/GLOBAL/TrackingGeo/LayerMaterialV2' + # put them to the caches + layerbuilders += [ TRT_LayerBuilder ] + binnings += [ TRT_LayerBinning ] + colors += [ 5 ] + + # helpers for the InDetTrackingGeometry Builder : layer array creator + from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__LayerArrayCreator + InDetLayerArrayCreator = Trk__LayerArrayCreator(name = 'InDetLayerArrayCreator') + InDetLayerArrayCreator.EmptyLayerMode = 2 # deletes empty material layers from arrays + # add to ToolSvc + result.addPublicTool(InDetLayerArrayCreator) + + # helpers for the InDetTrackingGeometry Builder : volume array creator + from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__TrackingVolumeArrayCreator + InDetTrackingVolumeArrayCreator = Trk__TrackingVolumeArrayCreator(name = 'InDetTrackingVolumeArrayCreator') + # add to ToolSvc + result.addPublicTool(InDetTrackingVolumeArrayCreator) + + # helpers for the InDetTrackingGeometry Builder : tracking voluem helper for glueing + from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__TrackingVolumeHelper + InDetTrackingVolumeHelper = Trk__TrackingVolumeHelper(name ='InDetTrackingVolumeHelper') + # the material bins - assume defaults + # add to ToolSvc + result.addPublicTool(InDetTrackingVolumeHelper) + + # helpers for the InDetTrackingGeometry Builder : cylinder volume creator + from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__CylinderVolumeCreator + InDetCylinderVolumeCreator = Trk__CylinderVolumeCreator(name = 'InDetCylinderVolumeCreator') + # give it the layer array creator - assume defaults + # specifiy the binning, passive layers, entry layers - assume defaults + # add to ToolSvc + result.addPublicTool(InDetCylinderVolumeCreator) + + # the tracking geometry builder + from InDetTrackingGeometry.InDetTrackingGeometryConf import InDet__RobustTrackingGeometryBuilder + return InDet__RobustTrackingGeometryBuilder(namePrefix+name, + BeamPipeBuilder = beamPipeBuilder, + LayerBuilders = layerbuilders, + LayerBinningType = binnings, + ColorCodes = colors, + EnvelopeDefinitionSvc = envelopeDefinitionSvc, + VolumeEnclosureDiscPositions = [ 3000., 3450. ], + TrackingVolumeCreator = InDetCylinderVolumeCreator, + LayerArrayCreator = InDetLayerArrayCreator) + + # FIXME - not sure what to do about the following: + # BuildBoundaryLayers = TrkDetFlags.InDetBuildMaterialBoundaries(), + # ReplaceAllJointBoundaries = TrkDetFlags.InDetBuildJointBoundaries(), + # OutputLevel = TrkDetFlags.InDetBuildingOutputLevel(), + # ExitVolumeName = TrkDetFlags.InDetContainerName(), + + # Probably they should just be dropped, but I leave this comment for the moment so reviewers can have a think as well. + + # Barrel Entry layers (in old config) etc were removed in 323990adfce581a635ae1809fd2ecc6a093a704c (!) + +# Replaces https://gitlab.cern.ch/atlas/athena/blob/master/Calorimeter/CaloTrackingGeometry/python/ConfiguredCaloTrackingGeometryBuilder.py +def _getCaloTrackingGeometryBuilder(name, flags,result, envelopeDefinitionSvc, trackingVolumeHelper, namePrefix=''): + # The following replaces LArCalorimeter/LArTrackingGeometry/python/ConfiguredLArVolumeBuilder.py + from LArTrackingGeometry.LArTrackingGeometryConf import LAr__LArVolumeBuilder + lArVolumeBuilder = LAr__LArVolumeBuilder(TrackingVolumeHelper = trackingVolumeHelper,) + result.addPublicTool(lArVolumeBuilder) + + # The following replaces TileCalorimeter/TileTrackingGeometry/python/ConfiguredTileVolumeBuilder.py + from TileTrackingGeometry.TileTrackingGeometryConf import Tile__TileVolumeBuilder + tileVolumeBuilder = Tile__TileVolumeBuilder( TrackingVolumeHelper = trackingVolumeHelper, ) + result.addPublicTool(tileVolumeBuilder) + + from CaloTrackingGeometry.CaloTrackingGeometryConf import Calo__CaloTrackingGeometryBuilder + return Calo__CaloTrackingGeometryBuilder(namePrefix+name, LArVolumeBuilder = lArVolumeBuilder, + TileVolumeBuilder = tileVolumeBuilder, + TrackingVolumeHelper = trackingVolumeHelper, + EnvelopeDefinitionSvc = envelopeDefinitionSvc, + ) + +# Originally this function would use was TrkDetFlags.MaterialSource() and TrkDetFlags.MaterialValidation(). For new configuration, (temporarily?) pass as parameters. +# https://gitlab.cern.ch/atlas/athena/blob/master/Tracking/TrkDetDescr/TrkDetDescrSvc/python/AtlasTrackingGeometrySvc.py#L112 +def TrackingGeometrySvcCfg( flags , name = 'AtlasTrackingGeometrySvc', doMaterialValidation=False ) : + """ + Sets up the Tracking Geometry Service + """ + result = ComponentAccumulator() + atlas_tracking_geometry_name = 'AtlasTrackingGeometry' + atlas_geometry_builder = Trk__GeometryBuilder(name = 'AtlasGeometryBuilder') + + atlas_env_def_service = getEnvelopeDefSvc() + result.addService(atlas_env_def_service) + + # Depending on the job configuration, setup the various detector builders, and add to atlas_geometry_builder + if flags.Detector.GeometryID: + # TODO Not sure how to handle TrkDetFlags, specifically ISF_FatrasCustomGeometry, XMLFastCustomGeometry, SLHC_Geometry + # So, here we only setup the default InDet geometry builder! + inDetTrackingGeometryBuilder = _getInDetTrackingGeometryBuilder(name ='InDetTrackingGeometryBuilder', flags=flags, result=result, envelopeDefinitionSvc=atlas_env_def_service) + result.addPublicTool(inDetTrackingGeometryBuilder) + + atlas_geometry_builder.InDetTrackingGeometryBuilder = inDetTrackingGeometryBuilder + + if flags.Detector.GeometryCalo: + from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__CylinderVolumeCreator + caloVolumeCreator = Trk__CylinderVolumeCreator("CaloVolumeCreator") + result.addPublicTool(caloVolumeCreator) + + from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__TrackingVolumeHelper + trackingVolumeHelper = Trk__TrackingVolumeHelper(name='TrackingVolumeHelper') + result.addPublicTool(trackingVolumeHelper) + + caloTrackingGeometryBuilder = _getCaloTrackingGeometryBuilder(name ='CaloTrackingGeometryBuilder', flags=flags, result=result, envelopeDefinitionSvc=atlas_env_def_service, trackingVolumeHelper=trackingVolumeHelper) + result.addPublicTool(caloTrackingGeometryBuilder) + atlas_geometry_builder.CaloTrackingGeometryBuilder = caloTrackingGeometryBuilder + + if flags.Detector.GeometryMuon: + # Copied from from MuonTrackingGeometry.ConfiguredMuonTrackingGeometry import MuonTrackingGeometryBuilder + from MuonTrackingGeometry.MuonTrackingGeometryConf import Muon__MuonStationTypeBuilder + muonStationTypeBuilder= Muon__MuonStationTypeBuilder(name = 'MuonStationTypeBuilder') + result.addPublicTool(muonStationTypeBuilder) - AtlasMaterialProvider.LayerMaterialMapName = CoolDataBaseFolder - result.addPublicTool(AtlasMaterialProvider) + from MuonTrackingGeometry.MuonTrackingGeometryConf import Muon__MuonStationBuilder + muonStationBuilder= Muon__MuonStationBuilder(name = 'MuonStationBuilder') + muonStationBuilder.StationTypeBuilder = muonStationTypeBuilder + result.addPublicTool(muonStationBuilder) - AtlasGeometryProcessors = [ AtlasMaterialProvider ] + from MuonTrackingGeometry.MuonTrackingGeometryConf import Muon__MuonInertMaterialBuilder + muonInertMaterialBuilder= Muon__MuonInertMaterialBuilder(name = 'MuonInertMaterialBuilder') + result.addPublicTool(muonInertMaterialBuilder) - # Setup DBs - result.merge(_setupCondDB(flags, CoolDataBaseFolder)) + from MuonTrackingGeometry.MuonTrackingGeometryConf import Muon__MuonTrackingGeometryBuilder + muonTrackingGeometryBuilder= Muon__MuonTrackingGeometryBuilder(name = 'MuonTrackingGeometryBuilder', EnvelopeDefinitionSvc=atlas_env_def_service) + result.addPublicTool(muonTrackingGeometryBuilder) - tracking_geometry_service = Trk__TrackingGeometrySvc(name = 'AtlasTrackingGeometrySvc', GeometryBuilder=atlas_geometry_builder) - result.addService(tracking_geometry_service) + atlas_geometry_builder.MuonTrackingGeometryBuilder = muonTrackingGeometryBuilder - return result, tracking_geometry_service + # Now set up processors + atlas_geometry_processors=[] + if flags.TrackingGeometry.MaterialSource == 'COOL': + CoolDataBaseFolder = '/GLOBAL/TrackingGeo/LayerMaterialV2' # Was from TrkDetFlags.MaterialStoreGateKey() + # the material provider + from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__LayerMaterialProvider + atlasMaterialProvider = Trk__LayerMaterialProvider('AtlasMaterialProvider', LayerMaterialMapName=CoolDataBaseFolder) + atlas_geometry_processors += [ atlasMaterialProvider ] + + # Setup DBs + result.merge(_setupCondDB(flags, CoolDataBaseFolder)) + elif flags.TrackingGeometry.MaterialSource == 'Input': + from TrkDetDescrTools.TrkDetDescrToolsConf import Trk__InputLayerMaterialProvider + atlasMaterialProvider = Trk__InputLayerMaterialProvider('AtlasMaterialProvider') + atlas_geometry_processors += [ atlasMaterialProvider ] + + if doMaterialValidation: + from TrkDetDescrTestTools.TrkDetDescrTestToolsConf import Trk__LayerMaterialInspector + atlasLayerMaterialInspector = Trk__LayerMaterialInspector('AtlasLayerMaterialInspector') + atlas_geometry_processors += [ atlasLayerMaterialInspector ] + + svc = Trk__TrackingGeometrySvc( name, GeometryBuilder = atlas_geometry_builder, + TrackingGeometryName = atlas_tracking_geometry_name, + GeometryProcessors = atlas_geometry_processors, + BuildGeometryFromTagInfo = True) + result.addService(svc, primary = True) + + return result + if __name__ == '__main__': from AthenaCommon.Configurable import Configurable Configurable.configurableRun3Behavior=1 @@ -88,11 +273,18 @@ if __name__ == '__main__': from AthenaConfiguration.TestDefaults import defaultTestFiles ConfigFlags.Input.Files = defaultTestFiles.RAW + ConfigFlags.Detector.GeometryPixel = True + ConfigFlags.Detector.GeometrySCT = True + ConfigFlags.Detector.GeometryTRT = True + ConfigFlags.Detector.GeometryLAr = True + ConfigFlags.Detector.GeometryTile = True + ConfigFlags.Detector.GeometryMDT = True + ConfigFlags.Detector.GeometryTGC = True + ConfigFlags.Detector.GeometryCSC = True + ConfigFlags.Detector.GeometryRPC = True ConfigFlags.lock() - from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator - - acc, tracking_geometry_service = TrackingGeometrySvcCfg(ConfigFlags ) + acc = TrackingGeometrySvcCfg(ConfigFlags ) f=open('TrackingGeometrySvcCfg.pkl','w') acc.store(f) diff --git a/Tracking/TrkExtrapolation/TrkExEngine/python/AtlasExtrapolationEngineConfig.py b/Tracking/TrkExtrapolation/TrkExEngine/python/AtlasExtrapolationEngineConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..a4ad619b99699848f49ea99fed355fe8493da6b7 --- /dev/null +++ b/Tracking/TrkExtrapolation/TrkExEngine/python/AtlasExtrapolationEngineConfig.py @@ -0,0 +1,85 @@ + +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + +# New configuration for ATLAS extrapolator +# Based heavily on AtlasExtrapolationEngine.py + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg + +# import the ExtrapolationEngine configurable +from TrkExEngine.TrkExEngineConf import Trk__ExtrapolationEngine as ExEngine + +def AtlasExtrapolationEngineCfg( flags, name = 'Extrapolation', nameprefix='Atlas' ): + result=ComponentAccumulator() + + acc = MagneticFieldSvcCfg(flags) + result.merge(acc) + + # get the correct TrackingGeometry setup + from TrkDetDescrSvc.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg + acc = TrackingGeometrySvcCfg(flags) + trackingGeomSvc = acc.getPrimary() + result.merge(acc) + + from TrkExRungeKuttaPropagator.TrkExRungeKuttaPropagatorConf import Trk__RungeKuttaPropagator as RkPropagator + rungeKuttaPropagator = RkPropagator(name = 'AtlasRungeKuttaPropagator') + result.addPublicTool(rungeKuttaPropagator) #TODO remove one day + + # from the Propagator create a Propagation engine to handle path length + from TrkExEngine.TrkExEngineConf import Trk__PropagationEngine + staticPropagator = Trk__PropagationEngine(name = nameprefix+'StaticPropagation') + # give the tools it needs + staticPropagator.Propagator = rungeKuttaPropagator + # configure output formatting + staticPropagator.OutputPrefix = '[SP] - ' + staticPropagator.OutputPostfix = ' - ' + result.addPublicTool(staticPropagator) #TODO remove one day + + # load the material effects engine + from TrkExEngine.TrkExEngineConf import Trk__MaterialEffectsEngine + materialEffectsEngine = Trk__MaterialEffectsEngine(name = nameprefix+'MaterialEffects') + # configure output formatting + materialEffectsEngine.OutputPrefix = '[ME] - ' + materialEffectsEngine.OutputPostfix = ' - ' + result.addPublicTool(materialEffectsEngine) #TODO remove one day + + + # load the static navigation engine + from TrkExEngine.TrkExEngineConf import Trk__StaticNavigationEngine + staticNavigator = Trk__StaticNavigationEngine(name = nameprefix+'StaticNavigation') + # give the tools it needs + staticNavigator.PropagationEngine = staticPropagator + staticNavigator.MaterialEffectsEngine = materialEffectsEngine + # Geometry name + staticNavigator.TrackingGeometry = trackingGeomSvc.TrackingGeometryName + # configure output formatting + staticNavigator.OutputPrefix = '[SN] - ' + staticNavigator.OutputPostfix = ' - ' + # add to tool service + result.addPublicTool(staticNavigator) #TODO remove one day + + # load the Static ExtrapolationEngine + from TrkExEngine.TrkExEngineConf import Trk__StaticEngine + staticExtrapolator = Trk__StaticEngine(name = nameprefix+'StaticExtrapolation') + # give the tools it needs + staticExtrapolator.PropagationEngine = staticPropagator + staticExtrapolator.MaterialEffectsEngine = materialEffectsEngine + staticExtrapolator.NavigationEngine = staticNavigator + # configure output formatting + staticExtrapolator.OutputPrefix = '[SE] - ' + staticExtrapolator.OutputPostfix = ' - ' + # add to tool service + result.addPublicTool(staticExtrapolator) #TODO remove one day + + # call the base class constructor + extrapolator = ExEngine(name=nameprefix+'Extrapolation', + ExtrapolationEngines = [ staticExtrapolator ], + PropagationEngine = staticPropagator, + NavigationEngine = staticNavigator, + TrackingGeometrySvc = trackingGeomSvc, + OutputPrefix = '[ME] - ', + OutputPostfix = ' - ') + result.addPublicTool(extrapolator, primary=True) + return result + diff --git a/Tracking/TrkExtrapolation/TrkExTools/python/AtlasExtrapolatorConfig.py b/Tracking/TrkExtrapolation/TrkExTools/python/AtlasExtrapolatorConfig.py index 5a7169bc859b985cee1ed1c691b6a791b678f6c6..666dc36a08abf41ef6729f1aef2596515a7acdcc 100644 --- a/Tracking/TrkExtrapolation/TrkExTools/python/AtlasExtrapolatorConfig.py +++ b/Tracking/TrkExtrapolation/TrkExTools/python/AtlasExtrapolatorConfig.py @@ -4,6 +4,7 @@ # Based heavily on AtlasExtrapolator.py from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg # import the Extrapolator configurable from TrkExTools.TrkExToolsConf import Trk__Extrapolator @@ -12,9 +13,13 @@ from TrkExTools.TrkExToolsConf import Trk__Extrapolator def AtlasExtrapolatorCfg( flags, name = 'AtlasExtrapolator' ): result=ComponentAccumulator() + acc = MagneticFieldSvcCfg(flags) + result.merge(acc) + # get the correct TrackingGeometry setup from TrkDetDescrSvc.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg - acc, geom_svc = TrackingGeometrySvcCfg(flags) + acc = TrackingGeometrySvcCfg(flags) + geom_svc = acc.getPrimary() result.merge(acc) # PROPAGATOR DEFAULTS --------------------------------------------------------------------------------------