diff --git a/DetectorDescription/RegionSelector/python/RegSelConfig.py b/DetectorDescription/RegionSelector/python/RegSelConfig.py index 60e334dc9eb9a290d92545bb085032f418df4175..d6d64d5d7ffe102653247f021afd3a0f3cb8f9c3 100644 --- a/DetectorDescription/RegionSelector/python/RegSelConfig.py +++ b/DetectorDescription/RegionSelector/python/RegSelConfig.py @@ -28,9 +28,36 @@ def RegSelConfig( flags ): #regSel.TileRegionSelectorTable = tileTable regSel.enableCalo = True + regSel.enableID = True + regSel.enablePixel = True + regSel.enableSCT = True + regSel.enableTRT = True - acc.addService( regSel ) - return acc + from InDetRegionSelector.InDetRegionSelectorConf import SiRegionSelectorTable + pixTable = SiRegionSelectorTable(name = "PixelRegionSelectorTable", + ManagerName = "Pixel", + OutputFile = "RoITablePixel.txt", + PrintHashId = True, + PrintTable = False) + acc.addPublicTool(pixTable) + + from InDetRegionSelector.InDetRegionSelectorConf import SiRegionSelectorTable + sctTable = SiRegionSelectorTable(name = "SCT_RegionSelectorTable", + ManagerName = "SCT", + OutputFile = "RoITableSCT.txt", + PrintHashId = True, + PrintTable = False) + acc.addPublicTool(sctTable) + + from InDetRegionSelector.InDetRegionSelectorConf import TRT_RegionSelectorTable + trtTable = TRT_RegionSelectorTable(name = "TRT_RegionSelectorTable", + ManagerName = "TRT", + OutputFile = "RoITableTRT.txt", + PrintHashId = True, + PrintTable = False) + acc.addPublicTool(trtTable) + + return acc, regSel if __name__ == "__main__": from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator @@ -38,6 +65,6 @@ if __name__ == "__main__": from AthenaConfiguration.AllConfigFlags import ConfigFlags ConfigFlags.Input.Files = ["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1"] - acc = RegSelConfig( ConfigFlags ) + acc,regSel = RegSelConfig( ConfigFlags ) acc.store( file( "test.pkl", "w" ) ) print "All OK" diff --git a/Trigger/TrigValidation/TrigUpgradeTest/python/InDetConfig.py b/Trigger/TrigValidation/TrigUpgradeTest/python/InDetConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..c4cf7b1609705f8b8f1a4aceb997b58b704595e7 --- /dev/null +++ b/Trigger/TrigValidation/TrigUpgradeTest/python/InDetConfig.py @@ -0,0 +1,329 @@ +# +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# + +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator + +def TrigInDetConfig( flags ): + acc = ComponentAccumulator() + + from InDetRecExample.InDetKeys import InDetKeys + #Create IdentifiableCaches + from InDetPrepRawDataFormation.InDetPrepRawDataFormationConf import InDet__CacheCreator + InDetCacheCreatorTrigViews = InDet__CacheCreator(name = "InDetCacheCreatorTrigViews", + Pixel_ClusterKey = "PixelTrigClustersCache", + SCT_ClusterKey = "SCT_ClustersCache", + SpacePointCachePix = "PixelSpacePointCache", + SpacePointCacheSCT = "SctSpacePointCache", + SCTRDOCacheKey = "SctRDOCache", + PixRDOCacheKey = "PixRDOCache",) + + acc.addEventAlgo(InDetCacheCreatorTrigViews) + + from AthenaCommon.CfgGetter import getService + PixelCablingSvc = getService("PixelCablingSvc") + acc.addService(PixelCablingSvc) + + #Only add raw data decoders if we're running over raw data + isMC = flags.Input.isMC + if not isMC: + #Pixel + + from PixelRawDataByteStreamCnv.PixelRawDataByteStreamCnvConf import PixelRodDecoder + InDetPixelRodDecoder = PixelRodDecoder(name = "InDetPixelRodDecoder") + acc.addPublicTool(InDetPixelRodDecoder) + + from PixelRawDataByteStreamCnv.PixelRawDataByteStreamCnvConf import PixelRawDataProviderTool + InDetPixelRawDataProviderTool = PixelRawDataProviderTool(name = "InDetPixelRawDataProviderTool", + Decoder = InDetPixelRodDecoder) + acc.addPublicTool(InDetPixelRawDataProviderTool) + + + # load the PixelRawDataProvider + from PixelRawDataByteStreamCnv.PixelRawDataByteStreamCnvConf import PixelRawDataProvider + InDetPixelRawDataProvider = PixelRawDataProvider(name = "InDetPixelRawDataProvider", + RDOKey = InDetKeys.PixelRDOs(), + ProviderTool = InDetPixelRawDataProviderTool,) + #OutputLevel = INFO) + InDetPixelRawDataProvider.isRoI_Seeded = True + InDetPixelRawDataProvider.RoIs = "EMRoIs" + InDetPixelRawDataProvider.RDOCacheKey = InDetCacheCreatorTrigViews.PixRDOCacheKey + + acc.addEventAlgo(InDetPixelRawDataProvider) + + + from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline + extra_folders = addFoldersSplitOnline(flags, "INDET", "/Indet/Onl/Beampos", "/Indet/Beampos", className="AthenaAttributeList") + acc.merge(extra_folders) + + from BeamSpotConditions.BeamSpotConditionsConf import BeamSpotCondAlg + acc.addCondAlgo(BeamSpotCondAlg( "BeamSpotCondAlg" )) + + + + #SCT + from SCT_RawDataByteStreamCnv.SCT_RawDataByteStreamCnvConf import SCT_RodDecoder + InDetSCTRodDecoder = SCT_RodDecoder(name = "InDetSCTRodDecoder") + acc.addPublicTool(InDetSCTRodDecoder) + + from SCT_RawDataByteStreamCnv.SCT_RawDataByteStreamCnvConf import SCTRawDataProviderTool + InDetSCTRawDataProviderTool = SCTRawDataProviderTool(name = "InDetSCTRawDataProviderTool", + Decoder = InDetSCTRodDecoder) + acc.addPublicTool(InDetSCTRawDataProviderTool) + + # load the SCTRawDataProvider + from SCT_RawDataByteStreamCnv.SCT_RawDataByteStreamCnvConf import SCTRawDataProvider + InDetSCTRawDataProvider = SCTRawDataProvider(name = "InDetSCTRawDataProvider", + RDOKey = InDetKeys.SCT_RDOs(), + ProviderTool = InDetSCTRawDataProviderTool, ) + #OutputLevel = INFO) + InDetSCTRawDataProvider.isRoI_Seeded = True + InDetSCTRawDataProvider.RoIs = "EMRoIs" + InDetSCTRawDataProvider.RDOCacheKey = InDetCacheCreatorTrigViews.SCTRDOCacheKey + + acc.addEventAlgo(InDetSCTRawDataProvider) + + # load the SCTEventFlagWriter + from SCT_RawDataByteStreamCnv.SCT_RawDataByteStreamCnvConf import SCTEventFlagWriter + InDetSCTEventFlagWriter = SCTEventFlagWriter(name = "InDetSCTEventFlagWriter") + + acc.addEventAlgo(InDetSCTEventFlagWriter) + + + #TRT + from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_CalDbSvc + InDetTRTCalDbSvc = TRT_CalDbSvc() + acc.addService(InDetTRTCalDbSvc) + + from TRT_ConditionsServices.TRT_ConditionsServicesConf import TRT_StrawStatusSummarySvc + InDetTRTStrawStatusSummarySvc = TRT_StrawStatusSummarySvc(name = "InDetTRTStrawStatusSummarySvc") + acc.addService(InDetTRTStrawStatusSummarySvc) + + from TRT_RawDataByteStreamCnv.TRT_RawDataByteStreamCnvConf import TRT_RodDecoder + InDetTRTRodDecoder = TRT_RodDecoder(name = "InDetTRTRodDecoder", + LoadCompressTableDB = True)#(globalflags.DataSource() != 'geant4')) + acc.addPublicTool(InDetTRTRodDecoder) + + from TRT_RawDataByteStreamCnv.TRT_RawDataByteStreamCnvConf import TRTRawDataProviderTool + InDetTRTRawDataProviderTool = TRTRawDataProviderTool(name = "InDetTRTRawDataProviderTool", + Decoder = InDetTRTRodDecoder) + acc.addPublicTool(InDetTRTRawDataProviderTool) + + + # load the TRTRawDataProvider + from TRT_RawDataByteStreamCnv.TRT_RawDataByteStreamCnvConf import TRTRawDataProvider + InDetTRTRawDataProvider = TRTRawDataProvider(name = "InDetTRTRawDataProvider", + RDOKey = "TRT_RDOs", + ProviderTool = InDetTRTRawDataProviderTool) + InDetTRTRawDataProvider.isRoI_Seeded = True + InDetTRTRawDataProvider.RoIs = "EMRoIs" + + acc.addEventAlgo(InDetTRTRawDataProvider) + + + #Pixel clusterisation + + from SiClusterizationTool.SiClusterizationToolConf import InDet__ClusterMakerTool + InDetClusterMakerTool = InDet__ClusterMakerTool(name = "InDetClusterMakerTool", + PixelCalibSvc = None, + PixelOfflineCalibSvc = None, + UsePixelCalibCondDB = False) + + acc.addPublicTool(InDetClusterMakerTool) + + + from SiClusterizationTool.SiClusterizationToolConf import InDet__MergedPixelsTool + InDetMergedPixelsTool = InDet__MergedPixelsTool(name = "InDetMergedPixelsTool", + globalPosAlg = InDetClusterMakerTool, + MinimalSplitSize = 0, + MaximalSplitSize = 49, + MinimalSplitProbability = 0, + DoIBLSplitting = True, + SplitClusterAmbiguityMap= InDetKeys.SplitClusterAmbiguityMap()) + acc.addPublicTool(InDetMergedPixelsTool) + + from SiClusterizationTool.SiClusterizationToolConf import InDet__PixelGangedAmbiguitiesFinder + InDetPixelGangedAmbiguitiesFinder = InDet__PixelGangedAmbiguitiesFinder(name = "InDetPixelGangedAmbiguitiesFinder") + acc.addPublicTool(InDetPixelGangedAmbiguitiesFinder) + + from InDetPrepRawDataFormation.InDetPrepRawDataFormationConf import InDet__PixelClusterization + InDetPixelClusterization = InDet__PixelClusterization(name = "InDetPixelClusterization", + clusteringTool = InDetMergedPixelsTool, + gangedAmbiguitiesFinder = InDetPixelGangedAmbiguitiesFinder, + DetectorManagerName = InDetKeys.PixelManager(), + DataObjectName = InDetKeys.PixelRDOs(), + AmbiguitiesMap = 'TrigPixelClusterAmbiguitiesMap', + ClustersName = "PixelTrigClusters",)# OutputLevel = INFO) + InDetPixelClusterization.isRoI_Seeded = True + InDetPixelClusterization.RoIs = "EMRoIs" + InDetPixelClusterization.ClusterContainerCacheKey = InDetCacheCreatorTrigViews.Pixel_ClusterKey + + acc.addEventAlgo(InDetPixelClusterization) + + from SCT_ConditionsTools.SCT_FlaggedConditionToolSetup import SCT_FlaggedConditionToolSetup + sct_FlaggedConditionToolSetup = SCT_FlaggedConditionToolSetup() + sct_FlaggedConditionToolSetup.setup() + InDetSCT_FlaggedConditionTool = sct_FlaggedConditionToolSetup.getTool() + + from SCT_ConditionsTools.SCT_ConditionsSummaryToolSetup import SCT_ConditionsSummaryToolSetup + sct_ConditionsSummaryToolSetup = SCT_ConditionsSummaryToolSetup() + sct_ConditionsSummaryToolSetup = SCT_ConditionsSummaryToolSetup("InDetSCT_ConditionsSummaryTool") + sct_ConditionsSummaryToolSetup.setup() + InDetSCT_ConditionsSummaryTool = sct_ConditionsSummaryToolSetup.getTool() + condTools = [] + for condToolHandle in InDetSCT_ConditionsSummaryTool.ConditionsTools: + condTool = condToolHandle.typeAndName + if condTool not in condTools: + if condTool != InDetSCT_FlaggedConditionTool.getFullName(): + condTools.append(condTool) + sct_ConditionsSummaryToolSetupWithoutFlagged = SCT_ConditionsSummaryToolSetup("InDetSCT_ConditionsSummaryToolWithoutFlagged") + sct_ConditionsSummaryToolSetupWithoutFlagged.setup() + InDetSCT_ConditionsSummaryToolWithoutFlagged = sct_ConditionsSummaryToolSetupWithoutFlagged.getTool() + InDetSCT_ConditionsSummaryToolWithoutFlagged.ConditionsTools = condTools + + # + # --- SCT_ClusteringTool (public) + # + from SiClusterizationTool.SiClusterizationToolConf import InDet__SCT_ClusteringTool + InDetSCT_ClusteringTool = InDet__SCT_ClusteringTool(name = "InDetSCT_ClusteringTool", + globalPosAlg = InDetClusterMakerTool, + conditionsTool = InDetSCT_ConditionsSummaryToolWithoutFlagged) + # + # --- SCT_Clusterization algorithm + # + + from InDetPrepRawDataFormation.InDetPrepRawDataFormationConf import InDet__SCT_Clusterization + InDetSCT_Clusterization = InDet__SCT_Clusterization(name = "InDetSCT_Clusterization", + clusteringTool = InDetSCT_ClusteringTool, + # ChannelStatus = InDetSCT_ChannelStatusAlg, + DataObjectName = InDetKeys.SCT_RDOs(), + ClustersName = "SCT_TrigClusters", + conditionsTool = InDetSCT_ConditionsSummaryToolWithoutFlagged) + InDetSCT_Clusterization.isRoI_Seeded = True + InDetSCT_Clusterization.RoIs = "EMRoIs" + InDetSCT_Clusterization.ClusterContainerCacheKey = InDetCacheCreatorTrigViews.SCT_ClusterKey + + acc.addEventAlgo(InDetSCT_Clusterization) + + + #Space points and FTF + + from SiSpacePointTool.SiSpacePointToolConf import InDet__SiSpacePointMakerTool + InDetSiSpacePointMakerTool = InDet__SiSpacePointMakerTool(name = "InDetSiSpacePointMakerTool") + acc.addPublicTool(InDetSiSpacePointMakerTool) + + from AthenaCommon.DetFlags import DetFlags + from SiSpacePointFormation.SiSpacePointFormationConf import InDet__SiTrackerSpacePointFinder + InDetSiTrackerSpacePointFinder = InDet__SiTrackerSpacePointFinder(name = "InDetSiTrackerSpacePointFinder", + SiSpacePointMakerTool = InDetSiSpacePointMakerTool, + PixelsClustersName = "PixelTrigClusters", + SCT_ClustersName = "SCT_TrigClusters", + SpacePointsPixelName = "PixelTrigSpacePoints", + SpacePointsSCTName = "SCT_TrigSpacePoints", + SpacePointsOverlapName = InDetKeys.OverlapSpacePoints(), + ProcessPixels = DetFlags.haveRIO.pixel_on(), + ProcessSCTs = DetFlags.haveRIO.SCT_on(), + ProcessOverlaps = DetFlags.haveRIO.SCT_on(), + SpacePointCacheSCT = InDetCacheCreatorTrigViews.SpacePointCacheSCT, + SpacePointCachePix = InDetCacheCreatorTrigViews.SpacePointCachePix,) + #OutputLevel=INFO) + + acc.addEventAlgo(InDetSiTrackerSpacePointFinder) + + + #from IOVSvc.IOVSvcConf import CondSvc + #acc.addService(CondSvc()) + + + #from TrigInDetConf.TrigInDetRecCommonTools import InDetTrigFastTrackSummaryTool + #from TrigInDetConf.TrigInDetPostTools import InDetTrigParticleCreatorToolFTF + + #from InDetTrigParticleCreation.InDetTrigParticleCreationConf import InDet__TrigTrackingxAODCnvMT + #theTrackParticleCreatorAlg = InDet__TrigTrackingxAODCnvMT(name = "InDetTrigTrackParticleCreatorAlg", + # doIBLresidual = False, + # TrackName = "TrigFastTrackFinder_Tracks", + # TrackParticlesName = "xAODTracks", + # ParticleCreatorTool = InDetTrigParticleCreatorToolFTF) + #theTrackParticleCreatorAlg.roiCollectionName = "EMRoIs" + #acc.addEventAlgo(theTrackParticleCreatorAlg) + + from AtlasGeoModel.GeoModelConfig import GeoModelCfg + gmc,geoModelSvc = GeoModelCfg( ConfigFlags ) + acc.merge( gmc ) + + from GeometryDBSvc.GeometryDBSvcConf import GeometryDBSvc + acc.addService(GeometryDBSvc("InDetGeometryDBSvc")) + + from AthenaCommon import CfgGetter + geoModelSvc.DetectorTools += [ CfgGetter.getPrivateTool("PixelDetectorTool", checkType=True) ] + +# if (DetFlags.detdescr.BCM_on() ) : + from AthenaCommon.AppMgr import ToolSvc + from BCM_GeoModel.BCM_GeoModelConf import InDetDD__BCM_Builder + bcmTool = InDetDD__BCM_Builder() + ToolSvc += bcmTool + geoModelSvc.DetectorTools['PixelDetectorTool'].BCM_Tool = bcmTool + + from BLM_GeoModel.BLM_GeoModelConf import InDetDD__BLM_Builder + blmTool = InDetDD__BLM_Builder() + ToolSvc += blmTool + geoModelSvc.DetectorTools['PixelDetectorTool'].BLM_Tool = blmTool + + geoModelSvc.DetectorTools['PixelDetectorTool'].useDynamicAlignFolders = True #InDetGeometryFlags.useDynamicAlignFolders() + +#if ( DetFlags.detdescr.SCT_on() ): + # Current atlas specific code + from AthenaCommon import CfgGetter + geoModelSvc.DetectorTools += [ CfgGetter.getPrivateTool("SCT_DetectorTool", checkType=True) ] + + geoModelSvc.DetectorTools['SCT_DetectorTool'].useDynamicAlignFolders = True #InDetGeometryFlags.useDynamicAlignFolders() + +# if ( DetFlags.detdescr.TRT_on() ): + from TRT_GeoModel.TRT_GeoModelConf import TRT_DetectorTool + trtDetectorTool = TRT_DetectorTool() + if ( DetFlags.simulate.TRT_on() ): + trtDetectorTool.DoXenonArgonMixture = True + trtDetectorTool.DoKryptonMixture = True + trtDetectorTool.useDynamicAlignFolders = True #InDetGeometryFlags.useDynamicAlignFolders() + geoModelSvc.DetectorTools += [ trtDetectorTool ] + acc.addService(geoModelSvc) + + from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg + mfsc, mag_field_svc = MagneticFieldSvcCfg(flags) + acc.merge( mfsc ) + acc.addService(mag_field_svc) + + + return acc + +if __name__ == "__main__": + from AthenaCommon.Configurable import Configurable + from AthenaCommon.CFElements import parOR, seqOR, seqAND + Configurable.configurableRun3Behavior=1 + + from AthenaConfiguration.AllConfigFlags import ConfigFlags + ConfigFlags.Input.Files = ["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TrigP1Test/data17_13TeV.00327265.physics_EnhancedBias.merge.RAW._lb0100._SFO-1._0001.1"] + ConfigFlags.Trigger.LVL1ConfigFile = "LVL1config_Physics_pp_v7.xml" + ConfigFlags.lock() + + acc = ComponentAccumulator() + from L1Decoder.L1DecoderConfig import L1DecoderCfg + l1DecoderAcc, l1DecoderAlg = L1DecoderCfg( ConfigFlags ) + acc.addEventAlgo(l1DecoderAlg) + acc.merge(l1DecoderAcc) + from ByteStreamCnvSvc.ByteStreamConfig import TrigBSReadCfg + acc.merge(TrigBSReadCfg(ConfigFlags)) + + acc.merge( TrigInDetConfig( ConfigFlags ) ) + from RegionSelector.RegSelConfig import RegSelConfig + rsc, regSel = RegSelConfig( ConfigFlags ) + regSel.enableCalo = False # turn off calo, certainly a better way to do this... + acc.merge( rsc ) + acc.addService(regSel) + + #from AthenaConfiguration.MainServicesConfig import MainServicesSerialCfg + #acc.merge( MainServicesSerialCfg( ) ) + + acc.printConfig() + acc.store( open("test.pkl", "w") ) + print 'All ok' diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py b/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py index e96fa11e74f39e731f0967797addacd15d711197..2ab9062bdeed244bf8972e9ca5cd58d8e187ecb0 100644 --- a/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py +++ b/Trigger/TrigValidation/TrigUpgradeTest/share/newJOtest.py @@ -81,7 +81,14 @@ acc.getService("IOVDbSvc").Folders += ['/TagInfo<metaOnly/>'] # setup algorithm sequences here, need few additional components from RegionSelector.RegSelConfig import RegSelConfig -acc.merge( RegSelConfig( flags ) ) +rsc, regSel = RegSelConfig( ConfigFlags ) +regSel.enableCalo=True +regSel.enableID=False +regSel.enablePixel = False +regSel.enableSCT = False +regSel.enableTRT = False +acc.merge( rsc ) +acc.addService(regSel) acc.getEventAlgo( "TrigSignatureMoniMT" ).OutputLevel=DEBUG print acc.getEventAlgo( "TrigSignatureMoniMT" )