diff --git a/InnerDetector/InDetG4/BCM_G4_SD/python/BCM_G4_SDConfig.py b/InnerDetector/InDetG4/BCM_G4_SD/python/BCM_G4_SDConfig.py index 692968ff501f9f20e3594342f75afa1d45f84100..90084efb58e9dbbaa9ee87482deb8d04bed7a197 100644 --- a/InnerDetector/InDetG4/BCM_G4_SD/python/BCM_G4_SDConfig.py +++ b/InnerDetector/InDetG4/BCM_G4_SD/python/BCM_G4_SDConfig.py @@ -10,9 +10,11 @@ def getBCMSensorSD(name="BCMSensorSD", **kwargs): bare_collection_name = "BCMHits" mergeable_collection_suffix = "_G4" merger_input_property = "BCMHits" + region = "ID" hits_collection_name = generate_mergeable_collection_name(bare_collection_name, mergeable_collection_suffix, - merger_input_property) + merger_input_property, + region) kwargs.setdefault("LogicalVolumeNames", ["Pixel::bcmDiamondLog"]) kwargs.setdefault("OutputCollectionNames", [hits_collection_name]) return CfgMgr.BCMSensorSDTool(name, **kwargs) diff --git a/InnerDetector/InDetG4/BLM_G4_SD/python/BLM_G4_SDConfig.py b/InnerDetector/InDetG4/BLM_G4_SD/python/BLM_G4_SDConfig.py index f4f5488b2ab4da173e8a0f0b3955037d9e426e49..79b99735924da032f1ae26151555c343cda4b824 100644 --- a/InnerDetector/InDetG4/BLM_G4_SD/python/BLM_G4_SDConfig.py +++ b/InnerDetector/InDetG4/BLM_G4_SD/python/BLM_G4_SDConfig.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from AthenaCommon import CfgMgr from G4AtlasApps.SimFlags import simFlags @@ -10,9 +10,11 @@ def getBLMSensorSD(name="BLMSensorSD", **kwargs): bare_collection_name = "BLMHits" mergeable_collection_suffix = "_G4" merger_input_property = "BLMHits" + region = "ID" hits_collection_name = generate_mergeable_collection_name(bare_collection_name, mergeable_collection_suffix, - merger_input_property) + merger_input_property, + region) kwargs.setdefault("LogicalVolumeNames", ["Pixel::blmDiamondLog"]) kwargs.setdefault("OutputCollectionNames", [hits_collection_name]) return CfgMgr.BLMSensorSDTool(name, **kwargs) diff --git a/InnerDetector/InDetG4/PixelG4_SD/python/PixelG4_SDConfig.py b/InnerDetector/InDetG4/PixelG4_SD/python/PixelG4_SDConfig.py index 2348cf5c91cba77749d92c44b581be9b0489f7f7..161d2683335e946429427c6dda5edc3b0fb1ea0f 100644 --- a/InnerDetector/InDetG4/PixelG4_SD/python/PixelG4_SDConfig.py +++ b/InnerDetector/InDetG4/PixelG4_SD/python/PixelG4_SDConfig.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from AthenaCommon import CfgMgr from G4AtlasApps.SimFlags import simFlags @@ -10,9 +10,11 @@ def getPixelSensorSD(name="PixelSensorSD", **kwargs): bare_collection_name = "PixelHits" mergeable_collection_suffix = "_G4" merger_input_property = "PixelHits" + region = "ID" hits_collection_name = generate_mergeable_collection_name(bare_collection_name, mergeable_collection_suffix, - merger_input_property) + merger_input_property, + region) kwargs.setdefault("LogicalVolumeNames", ["Pixel::siBLayLog","Pixel::siLog","Pixel::dbmDiamondLog"]) #kwargs.setdefault("LogicalVolumeNames", ["Pixel::siBLayLog","Pixel::siLog"]) kwargs.setdefault("OutputCollectionNames", [hits_collection_name]) diff --git a/InnerDetector/InDetG4/SCT_G4_SD/python/SCT_G4_SDConfig.py b/InnerDetector/InDetG4/SCT_G4_SD/python/SCT_G4_SDConfig.py index 12e86c04d138a5e61e172bda4fc6591d6125f65b..1055b364626458fd88e2fc7bbc50c05841895b39 100644 --- a/InnerDetector/InDetG4/SCT_G4_SD/python/SCT_G4_SDConfig.py +++ b/InnerDetector/InDetG4/SCT_G4_SD/python/SCT_G4_SDConfig.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from AthenaCommon import CfgMgr from G4AtlasApps.SimFlags import simFlags @@ -10,9 +10,11 @@ def getSctSensorSD(name="SctSensorSD", **kwargs): bare_collection_name = "SCT_Hits" mergeable_collection_suffix = "_G4" merger_input_property = "SCTHits" + region = "ID" hits_collection_name = generate_mergeable_collection_name(bare_collection_name, mergeable_collection_suffix, - merger_input_property) + merger_input_property, + region) kwargs.setdefault("LogicalVolumeNames", ["SCT::BRLSensor","SCT::ECSensor0","SCT::ECSensor1", "SCT::ECSensor2","SCT::ECSensor3"]) kwargs.setdefault("OutputCollectionNames", [hits_collection_name]) diff --git a/InnerDetector/InDetG4/TRT_G4_SD/python/TRT_G4_SDConfig.py b/InnerDetector/InDetG4/TRT_G4_SD/python/TRT_G4_SDConfig.py index d8c4d674ba650585e29eef3982ac1217bae95255..d14cdc5417644177ca2a4002c59c2a0895ce4400 100644 --- a/InnerDetector/InDetG4/TRT_G4_SD/python/TRT_G4_SDConfig.py +++ b/InnerDetector/InDetG4/TRT_G4_SD/python/TRT_G4_SDConfig.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from AthenaCommon import CfgMgr from G4AtlasApps.SimFlags import simFlags @@ -10,9 +10,11 @@ def getTRTSensitiveDetector(name="TRTSensitiveDetector", **kwargs): bare_collection_name = "TRTUncompressedHits" mergeable_collection_suffix = "_G4" merger_input_property = "TRTUncompressedHits" + region = "ID" hits_collection_name = generate_mergeable_collection_name(bare_collection_name, mergeable_collection_suffix, - merger_input_property) + merger_input_property, + region) logicalVolumeNames = ["TRT::Gas","TRT::GasMA"] from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags as geoFlags if ( geoFlags.Run() in ["RUN2", "RUN3"] ) : diff --git a/LArCalorimeter/LArG4/LArG4SD/python/LArG4SDConfig.py b/LArCalorimeter/LArG4/LArG4SD/python/LArG4SDConfig.py index 61260cfb216e0e9f5619fbba8b940775fd86667c..0f9d4e3d72ba3cdef2d61deb16d9848e09a1599f 100644 --- a/LArCalorimeter/LArG4/LArG4SD/python/LArG4SDConfig.py +++ b/LArCalorimeter/LArG4/LArG4SD/python/LArG4SDConfig.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from AthenaCommon import CfgMgr @@ -126,9 +126,11 @@ def getLArEMBSensitiveDetector(name="LArEMBSensitiveDetector", **kwargs): bare_collection_name = "LArHitEMB" mergeable_collection_suffix = "_G4" merger_input_property = "LArEMBHits" + region = "CALO" hits_collection_name = generate_mergeable_collection_name(bare_collection_name, mergeable_collection_suffix, - merger_input_property) + merger_input_property, + region) ## Main configuration kwargs.setdefault("StacVolumes",["LArMgr::LAr::EMB::STAC"]) kwargs.setdefault("PresamplerVolumes",["LArMgr::LAr::Barrel::Presampler::Module"]) @@ -143,9 +145,11 @@ def getLArEMECSensitiveDetector(name="LArEMECSensitiveDetector", **kwargs): bare_collection_name = "LArHitEMEC" mergeable_collection_suffix = "_G4" merger_input_property = "LArEMECHits" + region = "CALO" hits_collection_name = generate_mergeable_collection_name(bare_collection_name, mergeable_collection_suffix, - merger_input_property) + merger_input_property, + region) from G4AtlasApps.SimFlags import simFlags if simFlags.SimLayout.get_Value() not in ["tb_LArH6_2002","tb_LArH6EC_2002"]: kwargs.setdefault("NegIWVolumes",["LArMgr::LAr::EMEC::Neg::InnerWheel"]) @@ -165,9 +169,11 @@ def getLArFCALSensitiveDetector(name="LArFCALSensitiveDetector", **kwargs): bare_collection_name = "LArHitFCAL" mergeable_collection_suffix = "_G4" merger_input_property = "LArFCALHits" + region = "CALO" hits_collection_name = generate_mergeable_collection_name(bare_collection_name, mergeable_collection_suffix, - merger_input_property) + merger_input_property, + region) kwargs.setdefault("FCAL1Volumes",["LArMgr::LAr::FCAL::Module1::Gap"]) kwargs.setdefault("FCAL2Volumes",["LArMgr::LAr::FCAL::Module2::Gap"]) kwargs.setdefault("FCAL3Volumes",["LArMgr::LAr::FCAL::Module3::Gap"]) @@ -182,9 +188,11 @@ def getLArHECSensitiveDetector(name="LArHECSensitiveDetector", **kwargs): bare_collection_name = "LArHitHEC" mergeable_collection_suffix = "_G4" merger_input_property = "LArHECHits" + region = "CALO" hits_collection_name = generate_mergeable_collection_name(bare_collection_name, mergeable_collection_suffix, - merger_input_property) + merger_input_property, + region) #kwargs.setdefault("SliceVolumes",["LAr::HEC::Module::Depth::Slice"]) #kwargs.setdefault("LocalVolumes",["LAr::HEC::Module::Depth::Slice::Local"]) kwargs.setdefault("WheelVolumes",["LArMgr::LAr::HEC::Module::Depth::Slice"]) diff --git a/MuonSpectrometer/MuonG4/MuonG4SD/python/MuonG4SDConfig.py b/MuonSpectrometer/MuonG4/MuonG4SD/python/MuonG4SDConfig.py index 8951047a9e4644f24c55ef8df7570c4f9b34183e..5bbb723dc026b7770be259892cf9f47c05add321 100644 --- a/MuonSpectrometer/MuonG4/MuonG4SD/python/MuonG4SDConfig.py +++ b/MuonSpectrometer/MuonG4/MuonG4SD/python/MuonG4SDConfig.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from AthenaCommon import CfgMgr @@ -9,9 +9,11 @@ def getCSCSensitiveDetectorCosmics(name="CSCSensitiveDetectorCosmics", **kwargs) bare_collection_name = "CSC_Hits" mergeable_collection_suffix = "_G4" merger_input_property = "CSCHits" + region = "MUON" hits_collection_name = generate_mergeable_collection_name(bare_collection_name, mergeable_collection_suffix, - merger_input_property) + merger_input_property, + region) kwargs.setdefault("LogicalVolumeNames", ["Muon::CscArCO2"]) kwargs.setdefault("OutputCollectionNames", [hits_collection_name]) return CfgMgr.CSCSensitiveDetectorCosmicsTool(name, **kwargs) @@ -21,9 +23,11 @@ def getCSCSensitiveDetector(name="CSCSensitiveDetector", **kwargs): bare_collection_name = "CSC_Hits" mergeable_collection_suffix = "_G4" merger_input_property = "CSCHits" + region = "MUON" hits_collection_name = generate_mergeable_collection_name(bare_collection_name, mergeable_collection_suffix, - merger_input_property) + merger_input_property, + region) kwargs.setdefault("LogicalVolumeNames", ["Muon::CscArCO2"]) kwargs.setdefault("OutputCollectionNames", [hits_collection_name]) return CfgMgr.CSCSensitiveDetectorTool(name, **kwargs) @@ -39,9 +43,11 @@ def getMDTSensitiveDetectorCosmics(name="MDTSensitiveDetectorCosmics", **kwargs) bare_collection_name = "MDT_Hits" mergeable_collection_suffix = "_G4" merger_input_property = "MDTHits" + region = "MUON" hits_collection_name = generate_mergeable_collection_name(bare_collection_name, mergeable_collection_suffix, - merger_input_property) + merger_input_property, + region) kwargs.setdefault("LogicalVolumeNames", ["Muon::SensitiveGas"]) kwargs.setdefault("OutputCollectionNames", [hits_collection_name]) return CfgMgr.MDTSensitiveDetectorCosmicsTool(name, **kwargs) @@ -51,9 +57,11 @@ def getMDTSensitiveDetector(name="MDTSensitiveDetector", **kwargs): bare_collection_name = "MDT_Hits" mergeable_collection_suffix = "_G4" merger_input_property = "MDTHits" + region = "MUON" hits_collection_name = generate_mergeable_collection_name(bare_collection_name, mergeable_collection_suffix, - merger_input_property) + merger_input_property, + region) kwargs.setdefault("LogicalVolumeNames", ["Muon::SensitiveGas"]) kwargs.setdefault("OutputCollectionNames", [hits_collection_name]) return CfgMgr.MDTSensitiveDetectorTool(name, **kwargs) @@ -69,9 +77,11 @@ def getRPCSensitiveDetectorCosmics(name="RPCSensitiveDetectorCosmics", **kwargs) bare_collection_name = "RPC_Hits" mergeable_collection_suffix = "_G4" merger_input_property = "RPCHits" + region = "MUON" hits_collection_name = generate_mergeable_collection_name(bare_collection_name, mergeable_collection_suffix, - merger_input_property) + merger_input_property, + region) kwargs.setdefault("LogicalVolumeNames", ["Muon::gazGap"]) kwargs.setdefault("OutputCollectionNames", [bare_collection_name]) return CfgMgr.RPCSensitiveDetectorCosmicsTool(name, **kwargs) @@ -81,9 +91,11 @@ def getRPCSensitiveDetector(name="RPCSensitiveDetector", **kwargs): bare_collection_name = "RPC_Hits" mergeable_collection_suffix = "_G4" merger_input_property = "RPCHits" + region = "MUON" hits_collection_name = generate_mergeable_collection_name(bare_collection_name, mergeable_collection_suffix, - merger_input_property) + merger_input_property, + region) kwargs.setdefault("LogicalVolumeNames", ["Muon::gazGap"]) kwargs.setdefault("OutputCollectionNames", [hits_collection_name]) return CfgMgr.RPCSensitiveDetectorTool(name, **kwargs) @@ -93,9 +105,11 @@ def getTGCSensitiveDetectorCosmics(name="TGCSensitiveDetectorCosmics", **kwargs) bare_collection_name = "TGC_Hits" mergeable_collection_suffix = "_G4" merger_input_property = "TGCHits" + region = "MUON" hits_collection_name = generate_mergeable_collection_name(bare_collection_name, mergeable_collection_suffix, - merger_input_property) + merger_input_property, + region) kwargs.setdefault("LogicalVolumeNames", ["Muon::muo::TGCGas"]) kwargs.setdefault("OutputCollectionNames", [hits_collection_name]) return CfgMgr.TGCSensitiveDetectorCosmicsTool(name, **kwargs) @@ -105,9 +119,11 @@ def getTGCSensitiveDetector(name="TGCSensitiveDetector", **kwargs): bare_collection_name = "TGC_Hits" mergeable_collection_suffix = "_G4" merger_input_property = "TGCHits" + region = "MUON" hits_collection_name = generate_mergeable_collection_name(bare_collection_name, mergeable_collection_suffix, - merger_input_property) + merger_input_property, + region) kwargs.setdefault("LogicalVolumeNames", ["Muon::muo::TGCGas"]) kwargs.setdefault("OutputCollectionNames", [hits_collection_name]) return CfgMgr.TGCSensitiveDetectorTool(name, **kwargs) diff --git a/Simulation/ISF/ISF_Config/python/FlagSetters.py b/Simulation/ISF/ISF_Config/python/FlagSetters.py index 12d1dc36c72b0e619648fc1fc753df9596419764..959a5d1242b04cdcd2704c0263f3bc1996c8e814 100644 --- a/Simulation/ISF/ISF_Config/python/FlagSetters.py +++ b/Simulation/ISF/ISF_Config/python/FlagSetters.py @@ -46,7 +46,8 @@ def configureFlagsBase(): def configureFlagsFullG4(): from G4AtlasApps.SimFlags import simFlags simFlags.SimulationFlavour = "FullG4" - ISF_Flags.HITSMergingRequired = False + mergeDict = {'ID':False, 'CALO':False, 'MUON':False} + ISF_Flags.HITSMergingRequired.get_Value().update(mergeDict) ISF_Flags.ParticleBroker = "ISF_ParticleBrokerSvcNoOrdering" return @@ -111,6 +112,8 @@ def configureFlagsATLFASTII(): simFlags.SimulationFlavour = "AtlfastII" # TODO: can we rename this to "ATLFASTII" ? from ISF_Config.ISF_jobProperties import ISF_Flags ISF_Flags.UsingGeant4 = True + mergeDict = {'ID':False, 'CALO':True, 'MUON':False} + ISF_Flags.HITSMergingRequired.get_Value().update(mergeDict) ISF_Flags.ParticleBroker = "ISF_AFIIParticleBrokerSvc" return @@ -159,6 +162,9 @@ def configureFlagsATLFASTIIF(): from TrkDetDescrSvc.TrkDetDescrJobProperties import TrkDetFlags TrkDetFlags.MaterialVersion=21 TrkDetFlags.TRT_BuildStrawLayers=True + from ISF_Config.ISF_jobProperties import ISF_Flags + mergeDict = {'ID':True, 'CALO':True, 'MUON':True} + ISF_Flags.HITSMergingRequired.get_Value().update(mergeDict) return def configureFlagsFatras_newExtrapolation(): @@ -187,6 +193,9 @@ def configureFlagsG4HS_FastPileup(): from TrkDetDescrSvc.TrkDetDescrJobProperties import TrkDetFlags TrkDetFlags.MaterialVersion=21 TrkDetFlags.TRT_BuildStrawLayers=True + from ISF_Config.ISF_jobProperties import ISF_Flags + mergeDict = {'ID':True, 'CALO':True, 'MUON':True} + ISF_Flags.HITSMergingRequired.get_Value().update(mergeDict) return def configureFlagsATLFASTIIF_IDOnly(): @@ -219,6 +228,8 @@ def configureFlagsATLFASTIIF_G4MS(): def configureFlagsMultiSimTest(): from ISF_Config.ISF_jobProperties import ISF_Flags ISF_Flags.UsingGeant4 = True + mergeDict = {'ID':True, 'CALO':True, 'MUON':True} + ISF_Flags.HITSMergingRequired.get_Value().update(mergeDict) return def configureFlagsG4GammaCones(): diff --git a/Simulation/ISF/ISF_Config/python/ISF_jobProperties.py b/Simulation/ISF/ISF_Config/python/ISF_jobProperties.py index f4597a059061bd34f454f27a0fc23d38b0f592c0..1c25b4c16b3b3079e7ec0215cd51eefbd7c71e8b 100644 --- a/Simulation/ISF/ISF_Config/python/ISF_jobProperties.py +++ b/Simulation/ISF/ISF_Config/python/ISF_jobProperties.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration ## @file ISF_Config/python/ISF_jobProperties.py ## @purpose Python module to hold common flags to configure JobOptions @@ -109,8 +109,13 @@ class Simulator(JobProperty): class HITSMergingRequired(JobProperty): """The configured set of simulators requires merging of HITS collections""" statusOn = True - allowedTypes = ['bool'] - StoredValue = True + allowedTypes = ['dict'] + StoredValue = {'ID':True, 'CALO':True, 'MUON':True} + def anyOn(self): + if self.statusOn: + return (True in self.StoredValue.values()) + else: + return False class UsingGeant4(JobProperty): """Will this job be using Geant4?""" diff --git a/Simulation/ISF/ISF_Config/share/ISF_ConfigJobInclude.py b/Simulation/ISF/ISF_Config/share/ISF_ConfigJobInclude.py index 4b491de00da8d49bf9689a709ebb30147ca76237..7b6acb3b0c0dffa8b223fb72939ef5465d7e9349 100644 --- a/Simulation/ISF/ISF_Config/share/ISF_ConfigJobInclude.py +++ b/Simulation/ISF/ISF_Config/share/ISF_ConfigJobInclude.py @@ -156,7 +156,7 @@ from ISF_Example.ISF_Metadata import createSimulationParametersMetadata, configu createSimulationParametersMetadata() configureRunNumberOverrides() -if ISF_Flags.HITSMergingRequired(): +if ISF_Flags.HITSMergingRequired.anyOn(): topSequence += collection_merger_alg #-------------------------------------------------------------- diff --git a/Simulation/ISF/ISF_Config/test/test_Sim_tf_configuration.py b/Simulation/ISF/ISF_Config/test/test_Sim_tf_configuration.py index e4908d8f030098b9a73384c8694d6e3edbe21d7f..7d8da577eb8a0aea80db5734b48a7119275b712c 100755 --- a/Simulation/ISF/ISF_Config/test/test_Sim_tf_configuration.py +++ b/Simulation/ISF/ISF_Config/test/test_Sim_tf_configuration.py @@ -65,19 +65,19 @@ class TestATLFASTII(unittest.TestCase): actual_last_ath_alg_sequence_entry) def test___ISF_Collection_merger_InputBCMHits_contains_only_G4_collection(self): - expected_input_hits = ['BCMHits_G4'] + expected_input_hits = [] self._assert_ISF_CollectionMerger_property_unordered_equal( 'InputBCMHits', expected_input_hits) def test___ISF_Collection_merger_InputBLMHits_contains_only_G4_collection(self): - expected_input_hits = ['BLMHits_G4'] + expected_input_hits = [] self._assert_ISF_CollectionMerger_property_unordered_equal( 'InputBLMHits', expected_input_hits) def test___ISF_Collection_merger_InputCSCHits_contains_only_G4_collection(self): - expected_input_hits = ['CSC_Hits_G4'] + expected_input_hits = [] self._assert_ISF_CollectionMerger_property_unordered_equal( 'InputCSCHits', expected_input_hits) @@ -113,37 +113,37 @@ class TestATLFASTII(unittest.TestCase): expected_input_hits) def test___ISF_Collection_merger_InputMDTHits_contains_only_G4_collection(self): - expected_input_hits = ['MDT_Hits_G4'] + expected_input_hits = [] self._assert_ISF_CollectionMerger_property_unordered_equal( 'InputMDTHits', expected_input_hits) def test___ISF_Collection_merger_InputPixelHits_contains_only_G4_collection(self): - expected_input_hits = ['PixelHits_G4'] + expected_input_hits = [] self._assert_ISF_CollectionMerger_property_unordered_equal( 'InputPixelHits', expected_input_hits) def test___ISF_Collection_merger_InputRPCHits_contains_only_G4_collection(self): - expected_input_hits = ['RPC_Hits_G4'] + expected_input_hits = [] self._assert_ISF_CollectionMerger_property_unordered_equal( 'InputRPCHits', expected_input_hits) def test___ISF_Collection_merger_InputSCTHits_contains_only_G4_collection(self): - expected_input_hits = ['SCT_Hits_G4'] + expected_input_hits = [] self._assert_ISF_CollectionMerger_property_unordered_equal( 'InputSCTHits', expected_input_hits) def test___ISF_Collection_merger_InputTGCHits_contains_only_G4_collection(self): - expected_input_hits = ['TGC_Hits_G4'] + expected_input_hits = [] self._assert_ISF_CollectionMerger_property_unordered_equal( 'InputTGCHits', expected_input_hits) def test___ISF_Collection_merger_InputTRTUncompressedHits_contains_only_G4_collection(self): - expected_input_hits = ['TRTUncompressedHits_G4'] + expected_input_hits = [] self._assert_ISF_CollectionMerger_property_unordered_equal( 'InputTRTUncompressedHits', expected_input_hits) diff --git a/Simulation/ISF/ISF_Core/ISF_Algorithms/python/collection_merger_helpers.py b/Simulation/ISF/ISF_Core/ISF_Algorithms/python/collection_merger_helpers.py index 8b8709a34c30b9d3b5363e72d35daa81fd2a17f0..b14785ebf728f3496453bc651eb8e9bd0ba149e5 100644 --- a/Simulation/ISF/ISF_Core/ISF_Algorithms/python/collection_merger_helpers.py +++ b/Simulation/ISF/ISF_Core/ISF_Algorithms/python/collection_merger_helpers.py @@ -6,7 +6,8 @@ from AthenaCommon.AthenaCommonFlags import athenaCommonFlags def generate_mergeable_collection_name(bare_collection_name, mergeable_collection_suffix, - merger_input_property): + merger_input_property, + region): """ Generates and returns a collection name that is also registered to the ISF CollectionMerger algorithm. @@ -19,7 +20,7 @@ def generate_mergeable_collection_name(bare_collection_name, CollectionMerger algorithm to add the mergeable collection to. """ hardscatterSG = "OriginalEvent_SG/" - if simFlags.ISFRun() and ISF_Flags.HITSMergingRequired(): + if simFlags.ISFRun() and ISF_Flags.HITSMergingRequired.get_Value().get(region,True): mergeable_collection = '{bare}{suffix}'.format( bare=bare_collection_name, suffix=mergeable_collection_suffix diff --git a/Simulation/ISF/ISF_Core/ISF_Algorithms/python/test/test_collection_merger_helpers.py b/Simulation/ISF/ISF_Core/ISF_Algorithms/python/test/test_collection_merger_helpers.py index c7c2a069759840ad5f36892d205e940594b087d2..41854bf88efab457a1b28fb5aa08f3398abe3f9e 100755 --- a/Simulation/ISF/ISF_Core/ISF_Algorithms/python/test/test_collection_merger_helpers.py +++ b/Simulation/ISF/ISF_Core/ISF_Algorithms/python/test/test_collection_merger_helpers.py @@ -22,28 +22,34 @@ class Test_generate_mergeable_collection_name(unittest.TestCase): def test_isISFRunAndHITSMergingRequired_expectBareNameWithSuffixReturned(self): simFlags.ISFRun.set_Value(True) - ISF_Flags.HITSMergingRequired.set_Value(True) + mergeDict = {'ID':True, 'CALO':True, 'MUON':True} + ISF_Flags.HITSMergingRequired.get_Value().update(mergeDict) bare_collection_name = 'aTestCollection' collection_suffix = '_TESTSUFFIX' merger_input_property = 'PixelHits' + region = 'ID' actual_collection_name = generate_mergeable_collection_name(bare_collection_name, collection_suffix, - merger_input_property) + merger_input_property, + region) expected_collection_name = 'aTestCollection_TESTSUFFIX' self.assertEqual(expected_collection_name, actual_collection_name) def test_isISFRunAndHITSMergingRequiredWithEmptyCollectionMergerAlgorithm_expectCollectionAddedToCollectionMergerAlgorithm(self): simFlags.ISFRun.set_Value(True) - ISF_Flags.HITSMergingRequired.set_Value(True) + mergeDict = {'ID':True, 'CALO':True, 'MUON':True} + ISF_Flags.HITSMergingRequired.get_Value().update(mergeDict) bare_collection_name = 'aTestCollection' collection_suffix = '_TESTSUFFIX' merger_input_property = 'PixelHits' + region = 'ID' actual_collection_name = generate_mergeable_collection_name(bare_collection_name, collection_suffix, - merger_input_property) + merger_input_property, + region) collection_merger = getAlgorithm('ISF_CollectionMerger') actual_collection_merger_input = collection_merger.InputPixelHits @@ -54,28 +60,34 @@ class Test_generate_mergeable_collection_name(unittest.TestCase): def test_isISFRunAndNoHITSMergingRequired_expectBareCollectionNameReturned(self): simFlags.ISFRun.set_Value(True) - ISF_Flags.HITSMergingRequired.set_Value(False) + mergeDict = {'ID':False, 'CALO':True, 'MUON':False} + ISF_Flags.HITSMergingRequired.get_Value().update(mergeDict) bare_collection_name = 'aTestCollection' collection_suffix = '_TESTSUFFIX' merger_input_property = 'PixelHits' + region = 'ID' actual_collection_name = generate_mergeable_collection_name(bare_collection_name, collection_suffix, - merger_input_property) + merger_input_property, + region) expected_collection_name = 'aTestCollection' self.assertEqual(expected_collection_name, actual_collection_name) def test_isISFRunAndNoHITSMergingRequiredWithEmptyCollectionMergerAlgorithm_expectCollectionMergerAlgorithmUntouched(self): simFlags.ISFRun.set_Value(True) - ISF_Flags.HITSMergingRequired.set_Value(False) + mergeDict = {'ID':False, 'CALO':True, 'MUON':False} + ISF_Flags.HITSMergingRequired.get_Value().update(mergeDict) bare_collection_name = 'aTestCollection' collection_suffix = '_TESTSUFFIX' merger_input_property = 'PixelHits' + region = 'ID' actual_collection_name = generate_mergeable_collection_name(bare_collection_name, collection_suffix, - merger_input_property) + merger_input_property, + region) collection_merger = getAlgorithm('ISF_CollectionMerger') actual_collection_merger_input = collection_merger.InputPixelHits @@ -86,42 +98,51 @@ class Test_generate_mergeable_collection_name(unittest.TestCase): def test_isNotISFRunAndNoHITSMergingRequired_expectBareCollectioNameReturned(self): simFlags.ISFRun.set_Value(False) - ISF_Flags.HITSMergingRequired.set_Value(False) + mergeDict = {'ID':False, 'CALO':True, 'MUON':False} + ISF_Flags.HITSMergingRequired.get_Value().update(mergeDict) bare_collection_name = 'aTestCollection' collection_suffix = '_TESTSUFFIX' merger_input_property = 'PixelHits' + region = 'ID' actual_collection_name = generate_mergeable_collection_name(bare_collection_name, collection_suffix, - merger_input_property) + merger_input_property, + region) expected_collection_name = 'aTestCollection' self.assertEqual(expected_collection_name, actual_collection_name) def test_isNotISFRunAndHITSMergingRequired_expectBareCollectioNameReturned(self): simFlags.ISFRun.set_Value(False) - ISF_Flags.HITSMergingRequired.set_Value(True) + mergeDict = {'ID':True, 'CALO':True, 'MUON':True} + ISF_Flags.HITSMergingRequired.get_Value().update(mergeDict) bare_collection_name = 'aTestCollection' collection_suffix = '_TESTSUFFIX' merger_input_property = 'PixelHits' + region = 'ID' actual_collection_name = generate_mergeable_collection_name(bare_collection_name, collection_suffix, - merger_input_property) + merger_input_property, + region) expected_collection_name = 'aTestCollection' self.assertEqual(expected_collection_name, actual_collection_name) def test_isNotISFRunAndNoHITSMergingRequired_expectCollectionMergerAlgorithmUntouched(self): simFlags.ISFRun.set_Value(False) - ISF_Flags.HITSMergingRequired.set_Value(False) + mergeDict = {'ID':True, 'CALO':True, 'MUON':True} + ISF_Flags.HITSMergingRequired.get_Value().update(mergeDict) bare_collection_name = 'aTestCollection' collection_suffix = '_TESTSUFFIX' merger_input_property = 'PixelHits' + region = 'ID' actual_collection_name = generate_mergeable_collection_name(bare_collection_name, collection_suffix, - merger_input_property) + merger_input_property, + region) collection_merger = getAlgorithm('ISF_CollectionMerger') actual_collection_merger_input = collection_merger.InputPixelHits @@ -132,14 +153,17 @@ class Test_generate_mergeable_collection_name(unittest.TestCase): def test_isNotISFRunAndHITSMergingRequired_expectCollectionMergerAlgorithmUntouched(self): simFlags.ISFRun.set_Value(False) - ISF_Flags.HITSMergingRequired.set_Value(True) + mergeDict = {'ID':True, 'CALO':True, 'MUON':True} + ISF_Flags.HITSMergingRequired.get_Value().update(mergeDict) bare_collection_name = 'aTestCollection' collection_suffix = '_TESTSUFFIX' merger_input_property = 'PixelHits' + region = 'ID' actual_collection_name = generate_mergeable_collection_name(bare_collection_name, collection_suffix, - merger_input_property) + merger_input_property, + region) collection_merger = getAlgorithm('ISF_CollectionMerger') actual_collection_merger_input = collection_merger.InputPixelHits diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/python/AdditionalConfig.py b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/python/AdditionalConfig.py index b84cd62a7c45adc984dbeb6f49e7687d67fee32c..dcf32af210c16336ff176b054096264bfced6788 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/python/AdditionalConfig.py +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/python/AdditionalConfig.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration """ Tools configurations for ISF_FastCaloSimServices @@ -800,41 +800,47 @@ def getPileupFastShowerCellBuilderTool(name="ISF_PileupFastShowerCellBuilderTool def getFastHitConvertTool(name="ISF_FastHitConvertTool", **kwargs): mergeable_collection_suffix = "_FastCaloSim" + region = "CALO" EMB_hits_bare_collection_name = "LArHitEMB" EMB_hits_merger_input_property = "LArEMBHits" EMB_hits_collection_name = generate_mergeable_collection_name( EMB_hits_bare_collection_name, mergeable_collection_suffix, - EMB_hits_merger_input_property) + EMB_hits_merger_input_property, + region) EMEC_hits_bare_collection_name = "LArHitEMEC" EMEC_hits_merger_input_property = "LArEMECHits" EMEC_hits_collection_name = generate_mergeable_collection_name( EMEC_hits_bare_collection_name, mergeable_collection_suffix, - EMEC_hits_merger_input_property) + EMEC_hits_merger_input_property, + region) FCAL_hits_bare_collection_name = "LArHitFCAL" FCAL_hits_merger_input_property = "LArFCALHits" FCAL_hits_collection_name = generate_mergeable_collection_name( FCAL_hits_bare_collection_name, mergeable_collection_suffix, - FCAL_hits_merger_input_property) + FCAL_hits_merger_input_property, + region) HEC_hits_bare_collection_name = "LArHitHEC" HEC_hits_merger_input_property = "LArHECHits" HEC_hits_collection_name = generate_mergeable_collection_name( HEC_hits_bare_collection_name, mergeable_collection_suffix, - HEC_hits_merger_input_property) + HEC_hits_merger_input_property, + region) tile_hits_bare_collection_name = "TileHitVec" tile_hits_merger_input_property = "TileHits" tile_hits_collection_name = generate_mergeable_collection_name( tile_hits_bare_collection_name, mergeable_collection_suffix, - tile_hits_merger_input_property) + tile_hits_merger_input_property, + region) kwargs.setdefault('embHitContainername', EMB_hits_collection_name) kwargs.setdefault('emecHitContainername', EMEC_hits_collection_name) diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsID/python/ISF_FatrasToolsIDConfig.py b/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsID/python/ISF_FatrasToolsIDConfig.py index 2d886c6d9adef141c4273128059eb7207bb58aaa..51022cc45476a150ffef99d6832f8d1125ba422f 100644 --- a/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsID/python/ISF_FatrasToolsIDConfig.py +++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsID/python/ISF_FatrasToolsIDConfig.py @@ -12,9 +12,11 @@ def getFatrasHitCreatorPixel(name="ISF_FatrasHitCreatorPixel", **kwargs): bare_collection_name = "PixelHits" mergeable_collection_suffix = "_Fatras" merger_input_property = "PixelHits" + region = 'ID' hits_collection_name = generate_mergeable_collection_name(bare_collection_name, mergeable_collection_suffix, - merger_input_property) + merger_input_property, + region) from G4AtlasApps.SimFlags import simFlags kwargs.setdefault("RandomNumberService" , simFlags.RandomSvc() ) @@ -36,9 +38,11 @@ def getFatrasHitCreatorSCT(name="ISF_FatrasHitCreatorSCT", **kwargs): bare_collection_name = "SCT_Hits" mergeable_collection_suffix = "_Fatras" merger_input_property = "SCTHits" + region = 'ID' hits_collection_name = generate_mergeable_collection_name(bare_collection_name, mergeable_collection_suffix, - merger_input_property) + merger_input_property, + region) from G4AtlasApps.SimFlags import simFlags kwargs.setdefault("RandomNumberService" , simFlags.RandomSvc() ) kwargs.setdefault("RandomStreamName" , ISF_FatrasFlags.RandomStreamName()) @@ -59,9 +63,11 @@ def getFatrasHitCreatorTRT(name="ISF_FatrasHitCreatorTRT", **kwargs): bare_collection_name = "TRTUncompressedHits" mergeable_collection_suffix = "_Fatras" merger_input_property = "TRTUncompressedHits" + region = 'ID' hits_collection_name = generate_mergeable_collection_name(bare_collection_name, mergeable_collection_suffix, - merger_input_property) + merger_input_property, + region) from G4AtlasApps.SimFlags import simFlags kwargs.setdefault("RandomNumberService" , simFlags.RandomSvc() ) kwargs.setdefault("RandomStreamName" , ISF_FatrasFlags.RandomStreamName()) diff --git a/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsMS/python/ISF_FatrasToolsMSConfig.py b/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsMS/python/ISF_FatrasToolsMSConfig.py index 2e508636cc4e518d78b3d9e0073be207a240fd6e..7e94eba9422e44513c04a442c1de7387a97ecc8c 100644 --- a/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsMS/python/ISF_FatrasToolsMSConfig.py +++ b/Simulation/ISF/ISF_Fatras/ISF_FatrasToolsMS/python/ISF_FatrasToolsMSConfig.py @@ -8,27 +8,32 @@ from ISF_FatrasServices.ISF_FatrasJobProperties import ISF_FatrasFlags ################################################################################ def getFatrasSimHitCreatorMS(name="ISF_FatrasSimHitCreatorMS", **kwargs): mergeable_collection_suffix = "_Fatras" + region = 'MUON' mdt_bare_collection_name = "MDT_Hits" mdt_merger_input_property = "MDTHits" mdt_hits_collection_name = generate_mergeable_collection_name(mdt_bare_collection_name, mergeable_collection_suffix, - mdt_merger_input_property) + mdt_merger_input_property, + region) rpc_bare_collection_name = "RPC_Hits" rpc_merger_input_property = "RPCHits" rpc_hits_collection_name = generate_mergeable_collection_name(rpc_bare_collection_name, mergeable_collection_suffix, - rpc_merger_input_property) + rpc_merger_input_property, + region) tgc_bare_collection_name = "TGC_Hits" tgc_merger_input_property = "TGCHits" tgc_hits_collection_name = generate_mergeable_collection_name(tgc_bare_collection_name, mergeable_collection_suffix, - tgc_merger_input_property) + tgc_merger_input_property, + region) csc_bare_collection_name = "CSC_Hits" csc_merger_input_property = "CSCHits" csc_hits_collection_name = generate_mergeable_collection_name(csc_bare_collection_name, mergeable_collection_suffix, - csc_merger_input_property) + csc_merger_input_property, + region) from G4AtlasApps.SimFlags import simFlags kwargs.setdefault("RandomNumberService" , simFlags.RandomSvc() ) diff --git a/TileCalorimeter/TileG4/TileAncillary/MinBiasScintillator/python/MinBiasScintillatorConfig.py b/TileCalorimeter/TileG4/TileAncillary/MinBiasScintillator/python/MinBiasScintillatorConfig.py index ad1193366c7515a9eccc907a2ceb3f79d01a4d7f..5701f69bd18fdd2e6fdbec1a711ff55a9b1e560c 100644 --- a/TileCalorimeter/TileG4/TileAncillary/MinBiasScintillator/python/MinBiasScintillatorConfig.py +++ b/TileCalorimeter/TileG4/TileAncillary/MinBiasScintillator/python/MinBiasScintillatorConfig.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from AthenaCommon import CfgMgr @@ -9,9 +9,11 @@ def getMinBiasScintillatorSD(name="MinBiasScintillatorSD", **kwargs): bare_collection_name = "MBTSHits" mergeable_collection_suffix = "_G4" merger_input_property = "MBTSHits" + region = "CALO" hits_collection_name = generate_mergeable_collection_name(bare_collection_name, mergeable_collection_suffix, - merger_input_property) + merger_input_property, + region) kwargs.setdefault("LogicalVolumeNames", ["LArMgr::MBTS1", "LArMgr::MBTS2"]) kwargs.setdefault("OutputCollectionNames", [hits_collection_name]) from G4AtlasApps.SimFlags import simFlags diff --git a/TileCalorimeter/TileG4/TileGeoG4SD/python/TileGeoG4SDConfig.py b/TileCalorimeter/TileG4/TileGeoG4SD/python/TileGeoG4SDConfig.py index f7a800593e6982a36fd8acd8216cdb49bd2de2d0..3d6e69cd41a3b603a25997a8661de5487d6b2593 100644 --- a/TileCalorimeter/TileG4/TileGeoG4SD/python/TileGeoG4SDConfig.py +++ b/TileCalorimeter/TileG4/TileGeoG4SD/python/TileGeoG4SDConfig.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration from AthenaCommon import CfgMgr @@ -9,9 +9,11 @@ def getTileGeoG4SD(name="TileGeoG4SD", **kwargs): bare_collection_name = "TileHitVec" mergeable_collection_suffix = "_G4" merger_input_property = "TileHits" + region = "CALO" hits_collection_name = generate_mergeable_collection_name(bare_collection_name, mergeable_collection_suffix, - merger_input_property) + merger_input_property, + region) kwargs.setdefault("LogicalVolumeNames", ["Tile::Scintillator"]) kwargs.setdefault("OutputCollectionNames", [hits_collection_name]) diff --git a/Tools/FullChainTransforms/share/FastChainSkeleton.EVGENtoRDO.py b/Tools/FullChainTransforms/share/FastChainSkeleton.EVGENtoRDO.py index 6db7ebdd2429ceb0b93c77d15d233b2c1cf08f6c..056509e7d502d61efa0cc89242ae9f4527e44a65 100644 --- a/Tools/FullChainTransforms/share/FastChainSkeleton.EVGENtoRDO.py +++ b/Tools/FullChainTransforms/share/FastChainSkeleton.EVGENtoRDO.py @@ -830,7 +830,7 @@ collection_merger_alg = CfgGetter.getAlgorithm('ISF_CollectionMerger') SimKernel = CfgGetter.getAlgorithm(ISF_Flags.Simulator.KernelName()) -if ISF_Flags.HITSMergingRequired(): +if ISF_Flags.HITSMergingRequired.anyOn(): topSequence += collection_merger_alg #--------------------------------------------------------------