diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/CMakeLists.txt b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/CMakeLists.txt index 17cd376f6394fec6fda574f6f3ebeeb501d57e57..6542ea727d5a829b2469097c0e82b2dde3226710 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/CMakeLists.txt +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/CMakeLists.txt @@ -56,5 +56,5 @@ atlas_add_component( PixelConditionsAlgorithms PixelCablingLib PixelConditionsAlgorithmsLib PathResolver ) # Install files from the package: -#atlas_install_joboptions( share/*.py ) +atlas_install_python_modules( python/*.py ) diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/python/PixelConditionsConfig.py b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/python/PixelConditionsConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..3b6b18a75f5a8d625073b6009956abbf37f70d16 --- /dev/null +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/python/PixelConditionsConfig.py @@ -0,0 +1,101 @@ +"""Define functions to configure Pixel conditions algorithms + +Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +""" +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from IOVDbSvc.IOVDbSvcConfig import addFolders +from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import ( + PixelConfigCondAlg, PixelOfflineCalibCondAlg, PixelChargeCalibCondAlg +) + +def PixelConfigCondAlgCfg(flags, name="PixelConfigCondAlg", **kwargs): + """Return a ComponentAccumulator with configured PixelConfigCondAlg""" + acc = ComponentAccumulator() + acc.merge(addFolders(flags, "/PIXEL/PixMapOverlay", "PIXEL_OFL", className="CondAttrListCollection")) + # FIXME commented properties are not currently accepted by PixelConfigCondAlg + CondArgs = {} + CondArgs.update( + BunchSpace=25.0, + UseCalibConditions=True, + #BarrelAnalogThreshold=[-1,-1,-1,-1], + BarrelToTThreshold=[-1, 5, 5, 5], + BarrelCrossTalk=[0.06,0.06,0.06,0.06], + BarrelThermalNoise=[160.0,160.0,160.0,160.0], + #BarrelNoiseOccupancy=[5e-8,5e-8,5e-8,5e-8], + #BarrelDisableProbability=[9e-3,9e-3,9e-3,9e-3], + IBLNoiseShape=[0.0,1.0], + BLayerNoiseShape=[0.00000, 0.00596, 0.03491, 0.07058, 0.11991, 0.17971, 0.24105, 0.29884, 0.35167, 0.39912, 0.44188, 0.48016, 0.51471, 0.54587, 0.57405, 0.59958, 0.62288, 0.64411, 0.66360, 0.68159, 0.69823, 0.71362, 0.72781, 0.74096, 0.75304, 0.76415, 0.77438, 0.78383, 0.79256, 0.80066, 0.80821, 0.81547, 0.82246, 0.82918, 0.83501, 0.84054, 0.84576, 0.85078, 0.85558, 0.86018, 0.86455, 0.86875, 0.87273, 0.87653, 0.88020, 0.88369, 0.88705, 0.89027, 0.89336, 0.89633, 0.89921, 0.90195, 0.90460, 0.90714, 0.90961, 0.91198, 0.91426, 0.91644, 0.91853, 0.92055, 0.92250, 0.92435, 0.92611, 0.92782, 0.92947, 0.93105, 0.93257, 0.93404, 0.93547, 0.93688, 0.93822, 0.93953, 0.94079, 0.94201, 0.94318, 0.94432, 0.94542, 0.94649, 0.94751, 0.94851, 0.94949, 0.95045, 0.95137, 0.95227, 0.95314, 0.95399, 0.95483, 0.95563, 0.95646, 0.95729, 0.95812, 0.95896, 0.95980, 0.96063, 0.96144, 0.96224, 0.96301, 0.96377, 0.96451, 0.96521, 0.96590, 0.96657, 0.96722, 0.96787, 0.96849, 0.96911, 0.96971, 0.97031, 0.97090, 0.97148, 0.97204, 0.97260, 0.97314, 0.97367, 0.97421, 0.97474, 0.97525, 0.97576, 0.97627, 0.97676, 0.97722, 0.97769, 0.97815, 0.97861, 0.97906, 0.97950, 0.97992, 0.98033, 0.98073, 0.98111, 0.98147, 0.98182, 0.98216, 0.98249, 0.98281, 0.98312, 0.98343, 0.98374, 0.98402, 0.98430, 0.98456, 0.98482, 0.98507, 0.98532, 0.98555, 0.98579, 0.98602, 0.98624, 0.98646, 0.98668, 0.98690, 0.98711, 0.98732, 0.98753, 0.98773, 0.98793, 0.98813, 0.98832, 0.98851, 0.98870, 0.98888, 0.98907, 0.98925, 0.98943, 0.98961, 0.98979, 0.98996, 0.99014, 0.99031, 0.99048, 0.99064, 0.99081, 0.99098, 0.99114, 0.99131, 0.99147, 0.99163, 0.99179, 0.99194, 0.99210, 0.99225, 0.99240, 0.99256, 0.99271, 0.99286, 0.99300, 0.99315, 0.99329, 0.99344, 0.99358, 0.99372, 0.99386, 0.99400, 0.99414, 0.99427, 0.99440, 0.99453, 0.99466, 0.99479, 0.99491, 0.99503, 0.99515, 0.99527, 0.99538, 0.99549, 0.99560, 0.99571, 0.99582, 0.99592, 0.99602, 0.99613, 0.99623, 0.99633, 0.99643, 0.99653, 0.99662, 0.99672, 0.99682, 0.99691, 0.99701, 0.99710, 0.99719, 0.99728, 0.99737, 0.99746, 0.99755, 0.99764, 0.99772, 0.99781, 0.99790, 0.99798, 0.99806, 0.99814, 0.99823, 0.99831, 0.99839, 0.99847, 0.99855, 0.99863, 0.99871, 0.99879, 0.99887, 0.99895, 0.99902, 0.99910, 0.99918, 0.99925, 0.99933, 0.99940, 0.99948, 0.99955, 0.99963, 0.99971, 0.99978, 0.99985, 0.99993, 1.00000], + PixelNoiseShape=[0.00000, 0.00596, 0.03491, 0.07058, 0.11991, 0.17971, 0.24105, 0.29884, 0.35167, 0.39912, 0.44188, 0.48016, 0.51471, 0.54587, 0.57405, 0.59958, 0.62288, 0.64411, 0.66360, 0.68159, 0.69823, 0.71362, 0.72781, 0.74096, 0.75304, 0.76415, 0.77438, 0.78383, 0.79256, 0.80066, 0.80821, 0.81547, 0.82246, 0.82918, 0.83501, 0.84054, 0.84576, 0.85078, 0.85558, 0.86018, 0.86455, 0.86875, 0.87273, 0.87653, 0.88020, 0.88369, 0.88705, 0.89027, 0.89336, 0.89633, 0.89921, 0.90195, 0.90460, 0.90714, 0.90961, 0.91198, 0.91426, 0.91644, 0.91853, 0.92055, 0.92250, 0.92435, 0.92611, 0.92782, 0.92947, 0.93105, 0.93257, 0.93404, 0.93547, 0.93688, 0.93822, 0.93953, 0.94079, 0.94201, 0.94318, 0.94432, 0.94542, 0.94649, 0.94751, 0.94851, 0.94949, 0.95045, 0.95137, 0.95227, 0.95314, 0.95399, 0.95483, 0.95563, 0.95646, 0.95729, 0.95812, 0.95896, 0.95980, 0.96063, 0.96144, 0.96224, 0.96301, 0.96377, 0.96451, 0.96521, 0.96590, 0.96657, 0.96722, 0.96787, 0.96849, 0.96911, 0.96971, 0.97031, 0.97090, 0.97148, 0.97204, 0.97260, 0.97314, 0.97367, 0.97421, 0.97474, 0.97525, 0.97576, 0.97627, 0.97676, 0.97722, 0.97769, 0.97815, 0.97861, 0.97906, 0.97950, 0.97992, 0.98033, 0.98073, 0.98111, 0.98147, 0.98182, 0.98216, 0.98249, 0.98281, 0.98312, 0.98343, 0.98374, 0.98402, 0.98430, 0.98456, 0.98482, 0.98507, 0.98532, 0.98555, 0.98579, 0.98602, 0.98624, 0.98646, 0.98668, 0.98690, 0.98711, 0.98732, 0.98753, 0.98773, 0.98793, 0.98813, 0.98832, 0.98851, 0.98870, 0.98888, 0.98907, 0.98925, 0.98943, 0.98961, 0.98979, 0.98996, 0.99014, 0.99031, 0.99048, 0.99064, 0.99081, 0.99098, 0.99114, 0.99131, 0.99147, 0.99163, 0.99179, 0.99194, 0.99210, 0.99225, 0.99240, 0.99256, 0.99271, 0.99286, 0.99300, 0.99315, 0.99329, 0.99344, 0.99358, 0.99372, 0.99386, 0.99400, 0.99414, 0.99427, 0.99440, 0.99453, 0.99466, 0.99479, 0.99491, 0.99503, 0.99515, 0.99527, 0.99538, 0.99549, 0.99560, 0.99571, 0.99582, 0.99592, 0.99602, 0.99613, 0.99623, 0.99633, 0.99643, 0.99653, 0.99662, 0.99672, 0.99682, 0.99691, 0.99701, 0.99710, 0.99719, 0.99728, 0.99737, 0.99746, 0.99755, 0.99764, 0.99772, 0.99781, 0.99790, 0.99798, 0.99806, 0.99814, 0.99823, 0.99831, 0.99839, 0.99847, 0.99855, 0.99863, 0.99871, 0.99879, 0.99887, 0.99895, 0.99902, 0.99910, 0.99918, 0.99925, 0.99933, 0.99940, 0.99948, 0.99955, 0.99963, 0.99971, 0.99978, 0.99985, 0.99993, 1.00000], + FEI3BarrelLatency=[ -1, 151, 256, 256], + FEI3BarrelHitDuplication=[False, False, False, False], + FEI3BarrelSmallHitToT=[-1, -1, -1, -1], + FEI3BarrelTimingSimTune=[2015,2015,2015,2015], + FEI4BarrelHitDiscConfig=[2], + #EndcapAnalogThreshold=[-1,-1,-1,], + EndcapToTThreshold=[ 5, 5, 5], + EndcapCrossTalk=[0.06,0.06,0.06], + EndcapThermalNoise=[160.0,160.0,160.0], + #EndcapNoiseOccupancy=[5e-8,5e-8,5e-8], + #EndcapDisableProbability=[9e-3,9e-3,9e-3], + #EndcapNoiseShape=[[0.0,1.0],[0.0,1.0],[0.0,1.0]], + FEI3EndcapLatency=[256, 256, 256], + FEI3EndcapHitDuplication=[False, False, False], + FEI3EndcapSmallHitToT=[-1, -1, -1], + FEI3EndcapTimingSimTune=[2015,2015,2015], + #DBMAnalogThreshold=[-1,-1,-1], + DBMToTThreshold=[-1,-1,-1], + DBMCrossTalk=[0.06,0.06,0.06], + DBMThermalNoise=[160.0,160.0,160.0], + #DBMNoiseOccupancy=[5e-8,5e-8,5e-8], + #DBMDisableProbability=[9e-3,9e-3,9e-3], + #DBMNoiseShape=[[0.0,1.0],[0.0,1.0],[0.0,1.0]], + FEI4EndcapHitDiscConfig=[2,2,2], + ) + if flags.Beam.Type == "cosmics": + CondArgs.update( + UseComTime=True, + BarrelTimeJitter=[25.0,25.0,25.0,25.0], + EndcapTimeJitter=[25.0,25.0,25.0], + DBMTimeJitter=[25.0,25.0,25.0], + BarrelNumberOfBCID=[8,8,8,8], + EndcapNumberOfBCID=[8,8,8], + DBMNumberOfBCID=[8,8,8], + BarrelTimeOffset=[100.0,100.0,100.0,100.0], + EndcapTimeOffset=[100.0,100.0,100.0], + DBMTimeOffset=[100.0,100.0,100.0], + ) + else: + CondArgs.update( + UseComTime=False, + BarrelTimeJitter=[0.0,0.0,0.0,0.0], + EndcapTimeJitter=[0.0,0.0,0.0], + DBMTimeJitter=[0.0,0.0,0.0], + BarrelNumberOfBCID=[1,1,1,1], + EndcapNumberOfBCID=[1,1,1], + DBMNumberOfBCID=[1,1,1], + BarrelTimeOffset=[5.0,5.0,5.0,5.0], + EndcapTimeOffset=[5.0,5.0,5.0], + DBMTimeOffset=[5.0,5.0,5.0], + ) + # set default kwargs + CondArgs.update(kwargs) + acc.addCondAlgo(PixelConfigCondAlg(name, **CondArgs)) + return acc + +def PixelChargeCalibCondAlgCfg(flags, name="PixelChargeCalibCondAlg", **kwargs): + """Return a ComponentAccumulator with configured PixelChargeCalibCondAlg""" + acc = ComponentAccumulator() + acc.merge(addFolders(flags, "/PIXEL/PixCalib", "PIXEL_OFL", className="CondAttrListCollection")) + kwargs.setdefault("ReadKey", "/PIXEL/PixCalib") + acc.addCondAlgo(PixelChargeCalibCondAlg(name, **kwargs)) + return acc + +def PixelOfflineCalibCondAlgCfg(flags, name="PixelOfflineCalibCondAlg", **kwargs): + """Return a ComponentAccumulator with configured PixelOfflineCalibCondAlg""" + acc = ComponentAccumulator() + acc.merge(addFolders(flags, "/PIXEL/PixReco", "PIXEL_OFL", className="DetCondCFloat")) + kwargs.setdefault("ReadKey", "/PIXEL/PixReco") + kwargs.setdefault("InputSource", 2) + acc.addCondAlgo(PixelOfflineCalibCondAlg(name, **kwargs)) + return acc + diff --git a/InnerDetector/InDetConditions/PixelConditionsTools/CMakeLists.txt b/InnerDetector/InDetConditions/PixelConditionsTools/CMakeLists.txt index 8c38cd1036d1ec528cc590a31f3cf6ac80b5a5da..0209bebcef783579de54bb7e819f634d7cd1a298 100644 --- a/InnerDetector/InDetConditions/PixelConditionsTools/CMakeLists.txt +++ b/InnerDetector/InDetConditions/PixelConditionsTools/CMakeLists.txt @@ -51,12 +51,6 @@ atlas_add_component( PixelConditionsTools INCLUDE_DIRS ${CORAL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} LINK_LIBRARIES ${CORAL_LIBRARIES} ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} AthenaKernel GeoPrimitives GaudiKernel AthenaBaseComps SGTools AthenaPoolUtilities DetDescrConditions Identifier PixelConditionsData PixelCoralClientUtils InDetIdentifier GeoModelUtilities InDetReadoutGeometry PathResolver ${extra_lib} ) -if( NOT SIMULATIONBASE ) - atlas_add_test( PixelConditionsConfig_test - SCRIPT test/PixelConditionsConfig_test.py - PROPERTIES TIMEOUT 300 ) -endif() - # Install files from the package: atlas_install_headers( PixelConditionsTools ) atlas_install_joboptions( share/*.py ) diff --git a/InnerDetector/InDetConditions/PixelConditionsTools/python/PixelConditionsSummaryConfig.py b/InnerDetector/InDetConditions/PixelConditionsTools/python/PixelConditionsSummaryConfig.py index 1f5af82d70f289d60b5d0bd5910644c69b3be4c4..22fccb9d3d1c05e53409654b8d293909b254c5d2 100644 --- a/InnerDetector/InDetConditions/PixelConditionsTools/python/PixelConditionsSummaryConfig.py +++ b/InnerDetector/InDetConditions/PixelConditionsTools/python/PixelConditionsSummaryConfig.py @@ -1,13 +1,13 @@ -"""Define methods to configure PixelConditionsSummary +"""Define a function to configure PixelConditionsSummaryCfg Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration """ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator -from IOVDbSvc.IOVDbSvcConfig import addFolders, addFoldersSplitOnline +from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline, addFolders from PixelConditionsTools.PixelConditionsToolsConf import PixelConditionsSummaryTool from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelTDAQCondAlg -from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelConfigCondAlg from PixelConditionsTools.PixelDCSConditionsConfig import PixelDCSConditionsCfg +from PixelConditionsAlgorithms.PixelConditionsConfig import PixelConfigCondAlgCfg def PixelConditionsSummaryCfg(flags, name="PixelConditionsSummary", **kwargs): """Return configured ComponentAccumulator and tool for PixelDCSConditions""" @@ -27,9 +27,7 @@ def PixelConditionsSummaryCfg(flags, name="PixelConditionsSummary", **kwargs): acc.merge(addFolders(flags, PixelDeadMapFolder, "PIXEL_OFL","CondAttrListCollection")) acc.merge(addFoldersSplitOnline(flags, "PIXEL", "/PIXEL/Onl/PixMapOverlay", "/PIXEL/PixMapOverlay", "CondAttrListCollection")) - acc.addCondAlgo(PixelConfigCondAlg(name=name + "CondAlg", - UseDeadMap=kwargs["UseDeadMap"], - ReadDeadMapKey=PixelDeadMapFolder)) - tool = PixelConditionsSummaryTool(name=name + "Tool", **kwargs) - return acc, tool + acc.merge(PixelConfigCondAlgCfg(flags, UseDeadMap=kwargs["UseDeadMap"], ReadDeadMapKey=PixelDeadMapFolder)) + acc.setPrivateTools(PixelConditionsSummaryTool(name=name + "Tool", **kwargs)) + return acc diff --git a/InnerDetector/InDetConditions/PixelConditionsTools/test/PixelConditionsConfig_test.py b/InnerDetector/InDetConditions/PixelConditionsTools/test/PixelConditionsConfig_test.py deleted file mode 100755 index 182a291c0788e270f6af93675e74d3064ce548d8..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/PixelConditionsTools/test/PixelConditionsConfig_test.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env python -"""Run tests on PixelConditionsTools/python/*Config.py scripts - -Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -""" -from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator -from AthenaConfiguration.AllConfigFlags import ConfigFlags -from AthenaConfiguration.TestDefaults import defaultTestFiles -from AthenaCommon.Logging import log -from AthenaCommon.Constants import DEBUG -from AthenaCommon.Configurable import Configurable -from PixelConditionsTools.PixelDCSConditionsConfig import PixelDCSConditionsCfg -from PixelConditionsTools.PixelConditionsSummaryConfig import PixelConditionsSummaryCfg - -# test setup -log.setLevel(DEBUG) -Configurable.configurableRun3Behavior = True -ConfigFlags.Input.Files = defaultTestFiles.HITS -# test -DCSAcc = PixelDCSConditionsCfg(ConfigFlags, name="DCSTest") -SummaryAcc, SummaryTool = PixelConditionsSummaryCfg(ConfigFlags, name="SummaryTest") -# prevent raise on __del__ -DCSAcc.wasMerged() -SummaryAcc.wasMerged() - diff --git a/InnerDetector/InDetConditions/SiPropertiesTool/python/SCT_SiPropertiesConfig.py b/InnerDetector/InDetConditions/SiPropertiesTool/python/SCT_SiPropertiesConfig.py index 5ce6c514b4dd68c1f46f3265f1dcef6beda68678..d6922564b5769825a4132939bac83a61ee268818 100644 --- a/InnerDetector/InDetConditions/SiPropertiesTool/python/SCT_SiPropertiesConfig.py +++ b/InnerDetector/InDetConditions/SiPropertiesTool/python/SCT_SiPropertiesConfig.py @@ -20,7 +20,7 @@ def SCT_SiPropertiesCfg(flags, name="SCTSiPropertiesCondAlg", **kwargs): acc = ComponentAccumulator() tool = kwargs.get("SiPropertiesTool", SCT_SiPropertiesToolCfg(flags)) alg = SCTSiPropertiesCondAlg(name, **kwargs) - acc.addEventAlgo(alg) + acc.addCondAlgo(alg) acc.setPrivateTools(tool) return acc diff --git a/InnerDetector/InDetDigitization/BCM_Digitization/python/BCM_DigitizationConfigNew.py b/InnerDetector/InDetDigitization/BCM_Digitization/python/BCM_DigitizationConfigNew.py index cf5932a14943204ce41331e446e3724162bf10bb..65503e3ac15b21be5eaf907d4b7cdb6ef31f24ee 100755 --- a/InnerDetector/InDetDigitization/BCM_Digitization/python/BCM_DigitizationConfigNew.py +++ b/InnerDetector/InDetDigitization/BCM_Digitization/python/BCM_DigitizationConfigNew.py @@ -5,6 +5,7 @@ Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration from RngComps.RandomServices import RNG, AthEngines from PileUpComps.PileUpCompsConf import PileUpXingFolder from PixelGeoModel.PixelGeoModelConfig import PixelGeometryCfg +from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg from BCM_Digitization.BCM_DigitizationConf import BCM_DigitizationTool, BCM_Digitization # The earliest and last bunch crossing times for which interactions will be sent @@ -15,7 +16,11 @@ def BCM_FirstXing(): def BCM_LastXing(): return 0 -def BCM_RangeCfg(flags, name="BCM_Range" , **kwargs): +def BCM_ItemList(): + """Return list of item names needed for BCM output""" + return ["InDetSimDataCollection#*", "BCM_RDO_Container#*"] + +def BCM_RangeCfg(flags, name="BCM_Range", **kwargs): """Return a BCM configured PileUpXingFolder tool""" kwargs.setdefault("FirstXing", BCM_FirstXing()) kwargs.setdefault("LastXing", BCM_LastXing()) @@ -62,6 +67,8 @@ def BCM_DigitizationCfg(flags, name="BCM_OverlayDigitization", **kwargs): tool = acc.popToolsAndMerge(BCM_DigitizationToolCfg(flags, **kwargs)) kwargs["DigitizationTool"] = tool acc.addEventAlgo(BCM_Digitization(name, **kwargs)) + # FIXME once OutputStreamCfg merges correctly + #acc.merge(OutputStreamCfg(flags, "RDO", BCM_ItemList())) return acc def BCM_OverlayDigitizationToolCfg(flags, name="BCM_OverlayDigitizationTool", **kwargs): @@ -75,5 +82,6 @@ def BCM_OverlayDigitizationCfg(flags, name="BCM_OverlayDigitization", **kwargs): tool = acc.popToolsAndMerge(BCM_OverlayDigitizationToolCfg(flags, **kwargs)) kwargs.setdefault("DigitizationTool", tool) acc.addEventAlgo(BCM_Digitization(name, **kwargs)) + acc.merge(OutputStreamCfg(flags, "RDO", BCM_ItemList())) return acc diff --git a/InnerDetector/InDetDigitization/BCM_Digitization/test/BCM_DigitizationConfigNew_test.py b/InnerDetector/InDetDigitization/BCM_Digitization/test/BCM_DigitizationConfigNew_test.py index a2b4330e42c22a465bea92b809351f6e1dc58200..0575f83d9eb6b8d86f980efaedb9c8375cd14b8c 100755 --- a/InnerDetector/InDetDigitization/BCM_Digitization/test/BCM_DigitizationConfigNew_test.py +++ b/InnerDetector/InDetDigitization/BCM_Digitization/test/BCM_DigitizationConfigNew_test.py @@ -12,7 +12,6 @@ from AthenaConfiguration.AllConfigFlags import ConfigFlags from AthenaConfiguration.MainServicesConfig import MainServicesSerialCfg from AthenaConfiguration.TestDefaults import defaultTestFiles from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg -from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg from Digitization.DigitizationConfigFlags import createDigitizationCfgFlags from OverlayCommonAlgs.OverlayConfigFlags import createOverlayCfgFlags from BCM_Digitization.BCM_DigitizationConfigNew import BCM_DigitizationCfg @@ -31,12 +30,6 @@ ConfigFlags.lock() acc = MainServicesSerialCfg() acc.merge(PoolReadCfg(ConfigFlags)) acc.merge(BCM_DigitizationCfg(ConfigFlags)) -# Add configuration to write HITS pool file -ItemList = [ - "InDetSimDataCollection#*", - "BCM_RDO_Container#*", -] -acc.merge(OutputStreamCfg(ConfigFlags, "RDO", ItemList=ItemList)) # Dump config acc.getService("StoreGateSvc").Dump=True acc.getService("ConditionStore").Dump = True diff --git a/InnerDetector/InDetDigitization/PixelDigitization/CMakeLists.txt b/InnerDetector/InDetDigitization/PixelDigitization/CMakeLists.txt index 144705dfd91a03da196197a6aae44f84438ebd2a..efc5c66009bcf37bf2dd4968aa5c51949e7f4f40 100644 --- a/InnerDetector/InDetDigitization/PixelDigitization/CMakeLists.txt +++ b/InnerDetector/InDetDigitization/PixelDigitization/CMakeLists.txt @@ -44,6 +44,10 @@ atlas_add_component( PixelDigitization INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${HEPMC_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} AthenaBaseComps GaudiKernel CommissionEvent AthenaKernel PileUpToolsLib StoreGateLib SGtests Identifier xAODEventInfo GeneratorObjects PixelConditionsData SiPropertiesToolLib InDetIdentifier InDetReadoutGeometry SiDigitization InDetRawData InDetSimData InDetSimEvent HitManagement PathResolver ) +atlas_add_test( PixelDigitizationConfigNew_test + SCRIPT test/PixelDigitizationConfigNew_test.py + PROPERTIES TIMEOUT 300 ) + # Install files from the package: atlas_install_headers( PixelDigitization ) atlas_install_python_modules( python/*.py ) diff --git a/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfigNew.py b/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfigNew.py new file mode 100644 index 0000000000000000000000000000000000000000..934e1c82c4fd024903ec93a021666acfc81e39f6 --- /dev/null +++ b/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfigNew.py @@ -0,0 +1,209 @@ +"""Define methods to construct configured Pixel Digitization tools and algorithms + +Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +""" +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline, addFolders +from PileUpComps.PileUpCompsConf import PileUpXingFolder +from PixelCabling.PixelCablingConfigNew import PixelCablingSvcCfg +from PixelDigitization.PixelDigitizationConf import ( + PixelDigitizationTool, PixelDigitization, ChargeCollProbSvc, + EnergyDepositionTool, SensorSimPlanarTool, SensorSim3DTool, + RD53SimTool, FEI4SimTool, FEI3SimTool, +) +from SiPropertiesTool.PixelSiPropertiesConfig import PixelSiPropertiesCfg +from SiLorentzAngleTool.PixelLorentzAngleConfig import PixelLorentzAngleCfg +from PixelConditionsTools.PixelConditionsSummaryConfig import PixelConditionsSummaryCfg +from PixelConditionsAlgorithms.PixelConditionsConfig import PixelChargeCalibCondAlgCfg, PixelOfflineCalibCondAlgCfg +from PixelGeoModel.PixelGeoModelConfig import PixelGeometryCfg +from StoreGate.StoreGateConf import StoreGateSvc +from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg + +# The earliest and last bunch crossing times for which interactions will be sent +# to the Pixel Digitization code +def Pixel_FirstXing(flags): + if flags.Beam.estimatedLuminosity > 0.5e33: + return -25 + else: + return -50 + +def Pixel_LastXing(flags): + if flags.Beam.estimatedLuminosity > 0.5e33: + if flags.Beam.BunchSpacing > 50: + return 75 + else: + return 25 + else: + return 100 + +def PixelItemList(): + """Return list of item names needed for Pixel output""" + return ["InDet::SiClusterContainer#*", "InDet::PixelGangedClusterAmbiguities#*", "PixelRDO_Container#*"] + +def ChargeCollProbSvcCfg(name="ChargeCollProbSvc", **kwargs): + """Return a Charge Collection Prob service""" + return ChargeCollProbSvc(name, **kwargs) + +def EnergyDepositionToolCfg(flags, name="EnergyDepositionTool", **kwargs): + """Return a configured EnergyDepositionTool""" + kwargs.setdefault("DeltaRayCut", 117.) + kwargs.setdefault("nCols", 5) + kwargs.setdefault("LoopLimit", 100000) + kwargs.setdefault("doBichsel", True) + kwargs.setdefault("doBichselBetaGammaCut", 0.7) # dEdx not quite consistent below this + kwargs.setdefault("doDeltaRay", False) # needs validation + kwargs.setdefault("doPU", True) + return EnergyDepositionTool(name, **kwargs) + +def SensorSimPlanarToolCfg(flags, name="SensorSimPlanarTool", **kwargs): + """Return a ComponentAccumulator with configured SensorSimPlanarTool""" + acc = PixelSiPropertiesCfg(flags) + SiTool = acc.popPrivateTools() + LorentzTool = acc.popToolsAndMerge(PixelLorentzAngleCfg(flags)) + kwargs.setdefault("SiPropertiesTool", SiTool) + kwargs.setdefault("LorentzAngleTool", LorentzTool) + acc.setPrivateTools(SensorSimPlanarTool(name, **kwargs)) + return acc + +def SensorSim3DToolCfg(flags, name="SensorSim3DTool", **kwargs): + """Return a ComponentAccumulator with configured SensorSim3DTool""" + acc = PixelSiPropertiesCfg(flags) + SiTool = acc.popPrivateTools() + LorentzTool = acc.popToolsAndMerge(PixelLorentzAngleCfg(flags)) + kwargs.setdefault("SiPropertiesTool", SiTool) + acc.setPrivateTools(SensorSim3DTool(name, **kwargs)) + return acc + +def BarrelRD53SimToolCfg(flags, name="BarrelRD53SimTool", **kwargs): + """Return a RD53SimTool configured for Barrel""" + kwargs.setdefault("BarrelEC", 0) + return RD53SimTool(name, **kwargs) + +def EndcapRD53SimToolCfg(flags, name="EndcapRD53SimTool", **kwargs): + """Return a RD53SimTool configured for Endcap""" + kwargs.setdefault("BarrelEC", 2) + return RD53SimTool(name, **kwargs) + +def BarrelFEI4SimToolCfg(flags, name="BarrelFEI4SimTool", **kwargs): + """Return a FEI4SimTool configured for Barrel""" + kwargs.setdefault("BarrelEC", 0) + return FEI4SimTool(name, **kwargs) + +def DBMFEI4SimToolCfg(flags, name="DBMFEI4SimTool", **kwargs): + """Return a FEI4SimTool configured for Endcap""" + kwargs.setdefault("BarrelEC", 4) + return FEI4SimTool(name, **kwargs) + +def BarrelFEI3SimToolCfg(flags, name="BarrelFEI3SimTool", **kwargs): + """Return a FEI3SimTool configured for Barrel""" + kwargs.setdefault("BarrelEC", 0) + return FEI3SimTool(name, **kwargs) + +def EndcapFEI3SimToolCfg(flags, name="EndcapFEI3SimTool", **kwargs): + """Return a FEI3SimTool configured for Endcap""" + kwargs.setdefault("BarrelEC", 2) + return FEI3SimTool(name, **kwargs) + +def PixelDigitizationBasicToolCfg(flags, name="PixelDigitizationTool", **kwargs): + """Return a ComponentAccumulator with configured PixelDigitizationTool""" + acc = PixelGeometryCfg(flags) + acc.popToolsAndMerge(PixelConditionsSummaryCfg(flags)) + acc.merge(PixelChargeCalibCondAlgCfg(flags)) + acc.popToolsAndMerge(PixelSiPropertiesCfg(flags)) + acc.popToolsAndMerge(PixelLorentzAngleCfg(flags)) + acc.merge(PixelCablingSvcCfg(flags)) + acc.merge(PixelOfflineCalibCondAlgCfg(flags)) + # set up tool handle lists + chargeTools = [] + feSimTools = [] + chargeTools.append(acc.popToolsAndMerge(SensorSimPlanarToolCfg(flags))) + if flags.GeoModel.Run == "RUN4": + feSimTools.append(BarrelRD53SimToolCfg(flags)) + feSimTools.append(EndcapRD53SimToolCfg(flags)) + else: + chargeTools.append(acc.popToolsAndMerge(SensorSim3DToolCfg(flags))) + feSimTools.append(BarrelFEI4SimToolCfg(flags)) + feSimTools.append(DBMFEI4SimToolCfg(flags)) + feSimTools.append(BarrelFEI3SimToolCfg(flags)) + feSimTools.append(EndcapFEI3SimToolCfg(flags)) + kwargs.setdefault("InputObjectName", "PixelHits") + kwargs.setdefault("ChargeTools", chargeTools) + kwargs.setdefault("FrontEndSimTools", feSimTools) + kwargs.setdefault("EnergyDepositionTool", EnergyDepositionToolCfg(flags)) + if flags.Digitization.DoXingByXingPileUp: + kwargs.setdefault("FirstXing", Pixel_FirstXing(flags)) + kwargs.setdefault("LastXing", Pixel_LastXing(flags)) + acc.setPrivateTools(PixelDigitizationTool(name, **kwargs)) + return acc + +def PixelDigitizationToolCfg(flags, name="PixelDigitizationTool", **kwargs): + """Return a ComponentAccumulator with configured BasicPixelDigitizationTool""" + kwargs.setdefault("HardScatterSplittingMode", 0) + return PixelDigitizationBasicToolCfg(flags, name, **kwargs) + +def PixelGeantinoTruthDigitizationToolCfg(flags, name="PixelGeantinoTruthDigitizationTool", **kwargs): + """Return a configured PixelDigitizationTool""" + kwargs.setdefault("ParticleBarcodeVeto", 0) + return PixelDigitizationTool(name, **kwargs) + +def PixelDigitizationHSToolCfg(flags, name="PixelDigitizationToolHS", **kwargs): + """Return a ComponentAccumulator with PixelDigitizationTool configured for Hard Scatter""" + kwargs.setdefault("HardScatterSplittingMode", 1) + return PixelDigitizationBasicToolCfg(flags, name, **kwargs) + +def PixelDigitizationPUToolCfg(flags, name="PixelDigitizationToolPU", **kwargs): + """Return a ComponentAccumulator with PixelDigitizationTool configured for PileUp""" + kwargs.setdefault("HardScatterSplittingMode", 2) + kwargs.setdefault("RDOCollName", "Pixel_PU_RDOs") + kwargs.setdefault("SDOCollName", "Pixel_PU_SDO_Map") + return PixelDigitizationBasicToolCfg(flags, name, **kwargs) + +def PixelDigitizationSplitNoMergePUToolCfg(flags, name="PixelDigitizationToolSplitNoMergePU", **kwargs): + """Return a ComponentAccumulator with PixelDigitizationTool configured for PileUpPixelHits""" + kwargs.setdefault("HardScatterSplittingMode", 0) + kwargs.setdefault("InputObjectName", "PileupPixelHits") + kwargs.setdefault("RDOCollName", "Pixel_PU_RDOs") + kwargs.setdefault("SDOCollName", "Pixel_PU_SDO_Map") + return PixelDigitizationBasicToolCfg(flags, name, **kwargs) + +def PixelDigitizationOverlayToolCfg(flags, name="PixelDigitizationOverlayTool", **kwargs): + """Return a ComponentAccumulator with PixelDigitizationTool configured for overlay""" + acc = ComponentAccumulator() + acc.addService(StoreGateSvc(flags.Overlay.Legacy.EventStore)) + kwargs.setdefault("EvtStore", flags.Overlay.Legacy.EventStore) + kwargs.setdefault("RDOCollName", flags.Overlay.Legacy.EventStore + "+PixelRDOs") + kwargs.setdefault("SDOCollName", flags.Overlay.Legacy.EventStore + "+PixelSDO_Map") + kwargs.setdefault("HardScatterSplittingMode", 0) + return PixelDigitizationBasicToolCfg(flags, name, **kwargs) + +def PixelRangeCfg(flags, name="PixelRange", **kwargs): + """Return a configured PileUpXingFolder tool""" + kwargs.setdefault("FirstXing", Pixel_FirstXing(flags)) + kwargs.setdefault("LastXing", Pixel_LastXing(flags)) + kwargs.setdefault("CacheRefreshFrequency", 1.0) # default 0 no dataproxy reset + kwargs.setdefault("ItemList", ["SiHitCollection#PixelHits"]) + return PileUpXingFolder(name, **kwargs) + +def PixelDigitizationCfg(toolCfg, flags, name="PixelDigitization", **kwargs): + """Return a ComponentAccumulator with toolCfg type Pixel digitization""" + acc = ComponentAccumulator() + if "DigitizationTool" not in kwargs: + tool = acc.popToolsAndMerge(toolCfg(flags)) + kwargs["DigitizationTool"] = tool + acc.addEventAlgo(PixelDigitization(name, **kwargs)) + # FIXME once OutputStreamCfg merges correctly + #acc.merge(OutputStreamCfg(flags, "RDO", PixelItemList())) + return acc + +def PixelDigitizationHSCfg(flags, name="PixelDigitizationHS", **kwargs): + """Return a ComponentAccumulator with Hard Scatter Pixel Digitization""" + return PixelDigitizationCfg(PixelDigitizationHSToolCfg, flags, name, **kwargs) + +def PixelDigitizationPUCfg(flags, name="PixelDigitizationPU", **kwargs): + """Return a ComponentAccumulator with Hard Scatter Pixel Digitization""" + return PixelDigitizationCfg(PixelDigitizationPUToolCfg, flags, name, **kwargs) + +def PixelDigitizationOverlayCfg(flags, name="PixelDigitizationOverlay", **kwargs): + """Return a ComponentAccumulator with Hard Scatter Pixel Digitization""" + return PixelDigitizationCfg(PixelDigitizationOverlayToolCfg, flags, name, **kwargs) + diff --git a/InnerDetector/InDetDigitization/PixelDigitization/test/PixelDigitizationConfigNew_test.py b/InnerDetector/InDetDigitization/PixelDigitization/test/PixelDigitizationConfigNew_test.py new file mode 100755 index 0000000000000000000000000000000000000000..94c4e0b8bd1465f16fea8d23f25a9025fe35537d --- /dev/null +++ b/InnerDetector/InDetDigitization/PixelDigitization/test/PixelDigitizationConfigNew_test.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python +"""Run tests on SCT_DigitizationConfigNew.py + +Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +""" +import sys +from AthenaCommon.Logging import log +from AthenaCommon.Constants import DEBUG +from AthenaCommon.Configurable import Configurable +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.AllConfigFlags import ConfigFlags +from AthenaConfiguration.MainServicesConfig import MainServicesSerialCfg +from AthenaConfiguration.TestDefaults import defaultTestFiles +from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg +from PixelGeoModel.PixelGeoModelConfig import PixelGeometryCfg +from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg +from PixelDigitization.PixelDigitizationConfigNew import ( + ChargeCollProbSvcCfg, EnergyDepositionToolCfg, SensorSimPlanarToolCfg, SensorSim3DToolCfg, + BarrelRD53SimToolCfg, EndcapRD53SimToolCfg, BarrelFEI4SimToolCfg, DBMFEI4SimToolCfg, + BarrelFEI3SimToolCfg, EndcapFEI3SimToolCfg, PixelDigitizationBasicToolCfg, PixelDigitizationToolCfg, + PixelGeantinoTruthDigitizationToolCfg, PixelDigitizationHSToolCfg, PixelDigitizationPUToolCfg, + PixelDigitizationSplitNoMergePUToolCfg, PixelDigitizationOverlayToolCfg, PixelRangeCfg, + PixelDigitizationHSCfg, PixelDigitizationPUCfg, PixelDigitizationOverlayCfg, +) +from Digitization.DigitizationConfigFlags import createDigitizationCfgFlags +from OverlayCommonAlgs.OverlayConfigFlags import createOverlayCfgFlags + +# Set up logging and new style config +log.setLevel(DEBUG) +Configurable.configurableRun3Behavior = True +# Configure +ConfigFlags.join(createDigitizationCfgFlags()) +ConfigFlags.join(createOverlayCfgFlags()) +ConfigFlags.Input.Files = defaultTestFiles.HITS +ConfigFlags.IOVDb.GlobalTag = "OFLCOND-MC16-SDR-16" +ConfigFlags.GeoModel.Align.Dynamic = False +ConfigFlags.GeoModel.Type = "BrlIncl4.0_ref" +ConfigFlags.Beam.NumberOfCollisions = 0. +ConfigFlags.lock() +# Construct our accumulator to run +acc = MainServicesSerialCfg() +acc.merge(PoolReadCfg(ConfigFlags)) +acc.merge(PixelDigitizationHSCfg(ConfigFlags)) +# Dump config +acc.getService("StoreGateSvc").Dump = True +acc.getService("ConditionStore").Dump = True +acc.printConfig(withDetails=True) +ConfigFlags.dump() +# Execute and finish +sc = acc.run(maxEvents=3) +# Success should be 0 +sys.exit(not sc.isSuccess()) + diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfigNew.py b/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfigNew.py index 7ea7668edcfc20668bdd2756f7fc499af81cf812..b2dbc01bb6e9ab2a9c5e3fa78d928faf213bfc19 100644 --- a/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfigNew.py +++ b/InnerDetector/InDetDigitization/SCT_Digitization/python/SCT_DigitizationConfigNew.py @@ -14,6 +14,7 @@ from SCT_Digitization.SCT_DigitizationConf import ( SCT_Digitization, ) from PileUpComps.PileUpCompsConf import PileUpXingFolder +from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg from SCT_ConditionsTools.SCT_ConditionsToolsConf import SCT_RadDamageSummaryTool from SCT_GeoModel.SCT_GeoModelConfig import SCT_GeometryCfg from SCT_ConditionsTools.SCT_DCSConditionsConfig import SCT_DCSConditionsCfg @@ -31,6 +32,10 @@ def SCT_FirstXing(): def SCT_LastXing(): return 25 +def SCT_ItemList(): + """Return list of item names needed for SCT output""" + return ["InDet::SiClusterContainer#*", "SCT_RDO_Container#*"] + def SCT_DigitizationCommonCfg(flags, name="SCT_DigitizationToolCommon", **kwargs): """Return a ComponentAccumulator with common SCT digitization tool config""" acc = SCT_GeometryCfg(flags) @@ -235,6 +240,8 @@ def SCT_DigitizationCfg(toolCfg, flags, name="SCT_Digitization", **kwargs): kwargs["DigitizationTool"] = tool alg = SCT_Digitization(name, **kwargs) acc.addEventAlgo(alg) + # FIXME once OutputStreamCfg merges correctly + #acc.merge(OutputStreamCfg(flags, "RDO", SCT_ItemList())) return acc def SCT_DigitizationHSCfg(flags, name="SCT_DigitizationHS", **kwargs): diff --git a/InnerDetector/InDetDigitization/SCT_Digitization/test/SCT_DigitizationConfigNew_test.py b/InnerDetector/InDetDigitization/SCT_Digitization/test/SCT_DigitizationConfigNew_test.py index 2650be8f0092b0ddbc74fb4dce74927bdcc9b3e7..807153b9fdf55099898f656840185facb45fbdd9 100755 --- a/InnerDetector/InDetDigitization/SCT_Digitization/test/SCT_DigitizationConfigNew_test.py +++ b/InnerDetector/InDetDigitization/SCT_Digitization/test/SCT_DigitizationConfigNew_test.py @@ -12,14 +12,7 @@ from AthenaConfiguration.MainServicesConfig import MainServicesSerialCfg from AthenaConfiguration.TestDefaults import defaultTestFiles from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg from AtlasGeoModel.InDetGMConfig import InDetGeometryCfg -from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg -from SCT_Digitization.SCT_DigitizationConfigNew import ( - SCT_RandomDisabledCellGeneratorCfg, SCT_AmpCfg, SCT_SurfaceChargesGeneratorCfg, - SCT_FrontEndCfg, SCT_FrontEndPileupCfg, SCT_DigitizationCommonCfg, SCT_DigitizationToolCfg, - SCT_DigitizationToolGeantinoTruthCfg, SCT_DigitizationToolHSCfg, SCT_DigitizationToolPUCfg, - SCT_DigitizationToolSplitNoMergePUCfg, SCT_DigitizationToolOverlayCfg, SCT_DigitizationHSCfg, - SCT_DigitizationPUCfg, SCT_DigitizationOverlayCfg, SCT_RangeCfg, -) +from SCT_Digitization.SCT_DigitizationConfigNew import SCT_DigitizationHSCfg from Digitization.DigitizationConfigFlags import createDigitizationCfgFlags from OverlayCommonAlgs.OverlayConfigFlags import createOverlayCfgFlags @@ -34,54 +27,10 @@ ConfigFlags.IOVDb.GlobalTag = "OFLCOND-MC16-SDR-16" ConfigFlags.GeoModel.Align.Dynamic = False ConfigFlags.Concurrency.NumThreads = 1 ConfigFlags.lock() -# Function tests -tacc = SCT_DigitizationCommonCfg(ConfigFlags) -tacc.popPrivateTools() -acc1=SCT_DigitizationToolCfg(ConfigFlags) -acc1.popPrivateTools() -tacc.merge(acc1) -acc2=SCT_DigitizationToolHSCfg(ConfigFlags) -acc2.popPrivateTools() -tacc.merge(acc2) -acc3=SCT_DigitizationToolPUCfg(ConfigFlags) -acc3.popPrivateTools() -tacc.merge(acc3) -acc4=SCT_DigitizationToolOverlayCfg(ConfigFlags) -acc4.popPrivateTools() -tacc.merge(acc4) -acc6=SCT_DigitizationToolSplitNoMergePUCfg(ConfigFlags) -acc6.popPrivateTools() -tacc.merge(acc6) -acc7=SCT_DigitizationToolGeantinoTruthCfg(ConfigFlags) -acc7.popPrivateTools() -tacc.merge(acc7) -tool = SCT_RandomDisabledCellGeneratorCfg(ConfigFlags) -tool = SCT_AmpCfg(ConfigFlags) -acc8=SCT_SurfaceChargesGeneratorCfg(ConfigFlags) -acc8.popPrivateTools() -tacc.merge(acc8) -acc9=SCT_FrontEndCfg(ConfigFlags) -acc9.popPrivateTools() -tacc.merge(acc9) -acc10=SCT_FrontEndPileupCfg(ConfigFlags) -acc10.popPrivateTools() -tacc.merge(acc10) -tool = SCT_RangeCfg(ConfigFlags) -acc5=SCT_DigitizationHSCfg(ConfigFlags) -acc5.popPrivateTools() -tacc.merge(acc5) -tacc.merge(SCT_DigitizationPUCfg(ConfigFlags)) -tacc.merge(SCT_DigitizationOverlayCfg(ConfigFlags)) -# reset to prevent errors on deletion -tacc.__init__() # Construct our accumulator to run acc = MainServicesSerialCfg() acc.merge(PoolReadCfg(ConfigFlags)) acc.merge(SCT_DigitizationHSCfg(ConfigFlags)) -# Add configuration to write HITS pool file -outConfig = OutputStreamCfg(ConfigFlags, "RDO", - ItemList=["InDet::SiClusterContainer#*", "SCT_RDO_Container#*"]) -acc.merge(outConfig) # Dump config acc.getService("StoreGateSvc").Dump = True acc.getService("ConditionStore").Dump = True diff --git a/InnerDetector/InDetDigitization/TRT_Digitization/CMakeLists.txt b/InnerDetector/InDetDigitization/TRT_Digitization/CMakeLists.txt index b90c97ac7e839d4bec5c3691045452eb43a1a1d4..fe0b09ff1b1d09f5b7fe4c88b7966d049349106d 100644 --- a/InnerDetector/InDetDigitization/TRT_Digitization/CMakeLists.txt +++ b/InnerDetector/InDetDigitization/TRT_Digitization/CMakeLists.txt @@ -44,6 +44,10 @@ atlas_add_component( TRT_Digitization INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${HEPPDT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} ${HEPPDT_LIBRARIES} ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} GaudiKernel AthenaBaseComps AthenaKernel PileUpToolsLib AthenaPoolUtilities GeoModelUtilities GeoPrimitives Identifier EventInfo GeneratorObjects TRT_ConditionsData TRT_ConditionsServicesLib InDetIdentifier InDetReadoutGeometry InDetRawData InDetSimData InDetSimEvent MagFieldInterfaces HitManagement ) +atlas_add_test( TRT_DigitizationConfigNew_test + SCRIPT test/TRT_DigitizationConfigNew_test.py + PROPERTIES TIMEOUT 300 ) + # Install files from the package: atlas_install_headers( TRT_Digitization ) atlas_install_python_modules( python/*.py ) diff --git a/InnerDetector/InDetDigitization/TRT_Digitization/python/TRT_DigitizationConfigNew.py b/InnerDetector/InDetDigitization/TRT_Digitization/python/TRT_DigitizationConfigNew.py new file mode 100644 index 0000000000000000000000000000000000000000..4064f61c2509ff7ce6c5e9823b15a876d54b5eb6 --- /dev/null +++ b/InnerDetector/InDetDigitization/TRT_Digitization/python/TRT_DigitizationConfigNew.py @@ -0,0 +1,146 @@ +"""Define methods to construct configured TRT Digitization tools and algorithms + +Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +""" +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from TRT_Digitization.TRT_DigitizationConf import TRTDigitizationTool, TRTDigitization +from TRT_GeoModel.TRT_GeoModelConfig import TRT_GeometryCfg +from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg +from TRT_PAI_Process.TRT_PAI_ProcessConfigNew import TRT_PAI_Process_XeToolCfg +from TRT_PAI_Process.TRT_PAI_ProcessConfigNew import TRT_PAI_Process_ArToolCfg +from TRT_PAI_Process.TRT_PAI_ProcessConfigNew import TRT_PAI_Process_KrToolCfg +from PileUpComps.PileUpCompsConf import PileUpXingFolder +from PartPropSvc.PartPropSvcConf import PartPropSvc +from StoreGate.StoreGateConf import StoreGateSvc +from IOVDbSvc.IOVDbSvcConfig import addFolders +from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg + +# The earliest and last bunch crossing times for which interactions will be sent +# to the TRT Digitization code +def TRT_FirstXing(): + return -50 + +def TRT_LastXing(): + return 50 + +def TRT_ItemList(): + """Return list of item names needed for TRT output""" + return ["InDet::TRT_DriftCircleContainer#*", "TRT_RDO_Container#*"] + +def TRT_RangeCfg(flags, name="TRTRange", **kwargs): + """Return an TRT configured PileUpXingFolder tool""" + kwargs.setdefault("FirstXing", TRT_FirstXing()) + kwargs.setdefault("LastXing", TRT_LastXing()) + kwargs.setdefault("CacheRefreshFrequency", 1.0) #default 0 no dataproxy reset + kwargs.setdefault("ItemList", ["TRTUncompressedHitCollection#TRTUncompressedHits"]) + return PileUpXingFolder(name, **kwargs) + +def TRT_DigitizationBasicToolCfg(flags, name="TRT_DigitizationBasicTool", **kwargs): + """Return a ComponentAccumulator with common TRT digitization tool config""" + acc = TRT_GeometryCfg(flags) + acc.merge(MagneticFieldSvcCfg(flags)) + # included options + acc.addService(PartPropSvc(InputFile="PDGTABLE.MeV=PDG")) + if flags.Detector.Overlay and flags.Input.isMC: + acc.merge(addFolders("/TRT/Cond/DigVers", "TRT_OFL")) + # default arguments + kwargs.setdefault("PAI_Tool_Xe", TRT_PAI_Process_XeToolCfg(flags)) + kwargs.setdefault("PAI_Tool_Ar", TRT_PAI_Process_ArToolCfg(flags)) + kwargs.setdefault("PAI_Tool_Kr", TRT_PAI_Process_KrToolCfg(flags)) + if not flags.Digitization.DoInnerDetectorNoise: + kwargs.setdefault("Override_noiseInSimhits", 0) + kwargs.setdefault("Override_noiseInUnhitStraws", 0) + kwargs.setdefault("Override_TrtRangeCutProperty", 0.05) # todo flags.InnerDetector.TRTRangeCut) + if flags.Beam.Type == "cosmics": + kwargs.setdefault("PrintDigSettings", True) + kwargs.setdefault("Override_cosmicFlag", 0) + kwargs.setdefault("Override_doCosmicTimingPit", 1) + kwargs.setdefault("Override_jitterTimeOffset", 0.) + kwargs.setdefault("Override_timeCorrection", 0) + if flags.Digitization.DoXingByXingPileUp: + kwargs.setdefault("FirstXing", TRT_FirstXing()) + kwargs.setdefault("LastXing", TRT_LastXing()) + tool = TRTDigitizationTool(name, **kwargs) + acc.setPrivateTools(tool) + return acc + +def TRT_DigitizationToolCfg(flags, name="TRT_DigitizationTool", **kwargs): + """Return a ComponentAccumulator with configured TRT digitization tool""" + if flags.Digitization.PileUpPremixing: + kwargs.setdefault("OutputObjectName", flags.Overlay.BkgPrefix + "TRT_RDOs") + kwargs.setdefault("OutputSDOName", flags.Overlay.BkgPrefix + "TRT_SDO_Map") + else: + kwargs.setdefault("OutputObjectName", "TRT_RDOs") + kwargs.setdefault("OutputSDOName", "TRT_SDO_Map") + kwargs.setdefault("HardScatterSplittingMode", 0) + return TRT_DigitizationBasicToolCfg(flags, name, **kwargs) + +def TRT_DigitizationGeantinoTruthToolCfg(flags, name="TRT_GeantinoTruthDigitizationTool", **kwargs): + """Return a ComponentAccumulator with Geantino configured TRT digitization tool""" + kwargs.setdefault("ParticleBarcodeVeto", 0) + return TRT_DigitizationToolCfg(flags, name, **kwargs) + +def TRT_DigitizationHSToolCfg(flags, name="TRT_DigitizationToolHS", **kwargs): + """Return a ComponentAccumulator with Hard Scatter configured TRT digitization tool""" + kwargs.setdefault("OutputObjectName", "TRT_RDOs") + kwargs.setdefault("OutputSDOName", "TRT_SDO_Map") + kwargs.setdefault("HardScatterSplittingMode", 1) + return TRT_DigitizationBasicToolCfg(flags, name, **kwargs) + +def TRT_DigitizationPUToolCfg(flags, name="TRT_DigitizationToolPU", **kwargs): + """Return a ComponentAccumulator with Pile Up configured TRT digitization tool""" + kwargs.setdefault("OutputObjectName", "TRT_PU_RDOs") + kwargs.setdefault("OutputSDOName", "TRT_PU_SDO_Map") + kwargs.setdefault("HardScatterSplittingMode", 2) + return TRT_DigitizationBasicToolCfg(flags, name, **kwargs) + +def TRT_DigitizationSplitNoMergePUToolCfg(flags, name="TRT_DigitizationToolSplitNoMergePU", **kwargs): + """Return a ComponentAccumulator with PileUpPixelHits configured TRT digitization tool""" + kwargs.setdefault("HardScatterSplittingMode", 0) + kwargs.setdefault("DataObjectName", "PileupTRTUncompressedHits") + kwargs.setdefault("OutputObjectName", "TRT_PU_RDOs") + kwargs.setdefault("OutputSDOName", "TRT_PU_SDO_Map") + kwargs.setdefault("Override_noiseInSimhits", 0) + kwargs.setdefault("Override_noiseInUnhitStraws", 0) + return TRT_DigitizationBasicToolCfg(flags, name, **kwargs) + +def TRT_DigitizationOverlayToolCfg(flags, name="TRT_OverlayDigitizationTool", **kwargs): + """Return a ComponentAccumulator with configured Overlay TRT digitization tool""" + acc = ComponentAccumulator() + acc.addService(StoreGateSvc(flags.Overlay.Legacy.EventStore)) + kwargs.setdefault("OutputObjectName", flags.Overlay.Legacy.EventStore + "+TRT_RDOs") + kwargs.setdefault("OutputSDOName", flags.Overlay.Legacy.EventStore + "+TRT_SDO_Map") + kwargs.setdefault("HardScatterSplittingMode", 0) + kwargs.setdefault("Override_getT0FromData", 0) + kwargs.setdefault("Override_noiseInSimhits", 0) + kwargs.setdefault("Override_noiseInUnhitStraws", 0) + kwargs.setdefault("Override_isOverlay", 1) + tool = acc.popToolsAndMerge(TRT_DigitizationBasicToolCfg(flags, name, **kwargs)) + acc.setPrivateTools(tool) + return acc + +def TRT_DigitizationCfg(toolCfg, flags, name="TRT_Digitization", **kwargs): + """Return a ComponentAccumulator with toolCfg type TRT digitization""" + acc = ComponentAccumulator() + if "DigitizationTool" not in kwargs: + tool = acc.popToolsAndMerge(toolCfg(flags)) + kwargs["DigitizationTool"] = tool + print("#"*200) + print(tool) + acc.addEventAlgo(TRTDigitization(name, **kwargs)) + # FIXME once OutputStreamCfg merges correctly + #acc.merge(OutputStreamCfg(flags, "RDO", TRT_ItemList())) + return acc + +def TRT_DigitizationHSCfg(flags, name="TRT_DigitizationHS", **kwargs): + """Return a ComponentAccumulator configured for Hard Scatter TRT digitization""" + return TRT_DigitizationCfg(TRT_DigitizationHSToolCfg, flags, name, **kwargs) + +def TRT_DigitizationPUCfg(flags, name="TRT_DigitizationPU", **kwargs): + """Return a ComponentAccumulator configured for Pile Up TRT digitization""" + return TRT_DigitizationCfg(TRT_DigitizationPUToolCfg, flags, name, **kwargs) + +def TRT_DigitizationOverlayCfg(flags, name="TRT_OverlayDigitization", **kwargs): + """Return a ComponentAccumulator configured for Overlay TRT digitization""" + return TRT_DigitizationCfg(TRT_DigitizationOverlayToolCfg, flags, name, **kwargs) + diff --git a/InnerDetector/InDetDigitization/TRT_Digitization/test/TRT_DigitizationConfigNew_test.py b/InnerDetector/InDetDigitization/TRT_Digitization/test/TRT_DigitizationConfigNew_test.py new file mode 100755 index 0000000000000000000000000000000000000000..6d04981e1a7a4318e32020c6775f79ec073692b4 --- /dev/null +++ b/InnerDetector/InDetDigitization/TRT_Digitization/test/TRT_DigitizationConfigNew_test.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python +"""Run tests on TRT_DigitizationConfigNew.py + +Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +""" +import sys +from AthenaCommon.Logging import log +from AthenaCommon.Constants import DEBUG +from AthenaCommon.Configurable import Configurable +from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator +from AthenaConfiguration.AllConfigFlags import ConfigFlags +from AthenaConfiguration.MainServicesConfig import MainServicesSerialCfg +from AthenaConfiguration.TestDefaults import defaultTestFiles +from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg +from AtlasGeoModel.InDetGMConfig import InDetGeometryCfg +from TRT_Digitization.TRT_DigitizationConfigNew import TRT_DigitizationHSCfg +from Digitization.DigitizationConfigFlags import createDigitizationCfgFlags +from OverlayCommonAlgs.OverlayConfigFlags import createOverlayCfgFlags + +# Set up logging and new style config +log.setLevel(DEBUG) +Configurable.configurableRun3Behavior = True +# Configure +ConfigFlags.join(createDigitizationCfgFlags()) +ConfigFlags.join(createOverlayCfgFlags()) +ConfigFlags.Input.Files = defaultTestFiles.HITS +ConfigFlags.IOVDb.GlobalTag = "OFLCOND-MC16-SDR-16" +ConfigFlags.GeoModel.Align.Dynamic = False +ConfigFlags.Concurrency.NumThreads = 1 +ConfigFlags.lock() +# Construct our accumulator to run +acc = MainServicesSerialCfg() +acc.merge(PoolReadCfg(ConfigFlags)) +acc.merge(TRT_DigitizationHSCfg(ConfigFlags)) +# Dump config +acc.getService("StoreGateSvc").Dump = True +acc.getService("ConditionStore").Dump = True +acc.printConfig(withDetails=True) +ConfigFlags.dump() +# Execute and finish +sc = acc.run(maxEvents=3) +# Success should be 0 +sys.exit(not sc.isSuccess()) + diff --git a/InnerDetector/InDetSimUtils/TRT_PAI_Process/python/TRT_PAI_ProcessConfigNew.py b/InnerDetector/InDetSimUtils/TRT_PAI_Process/python/TRT_PAI_ProcessConfigNew.py new file mode 100644 index 0000000000000000000000000000000000000000..dee123833fa77573dd11a1f77b49c2dafc965b58 --- /dev/null +++ b/InnerDetector/InDetSimUtils/TRT_PAI_Process/python/TRT_PAI_ProcessConfigNew.py @@ -0,0 +1,21 @@ +"""Define methods to construct configured TRT_PAI_Process tools + +Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +""" +from TRT_PAI_Process.TRT_PAI_ProcessConf import TRT_PAI_Process + +def TRT_PAI_Process_XeToolCfg(flags, name="TRT_PAI_Process_Xe", **kwargs): + """Return a Xenon-configured TRT_PAI_Process""" + kwargs.setdefault("GasType", "Xenon") + return TRT_PAI_Process(name, **kwargs) + +def TRT_PAI_Process_ArToolCfg(flags, name="TRT_PAI_Process_Ar", **kwargs): + """Return an Argon-configured TRT_PAI_Process""" + kwargs.setdefault("GasType", "Argon") + return TRT_PAI_Process(name, **kwargs) + +def TRT_PAI_Process_KrToolCfg(flags, name="TRT_PAI_Process_Kr", **kwargs): + """Return a Krypton-configured TRT_PAI_Process""" + kwargs.setdefault("GasType", "Krypton") + return TRT_PAI_Process(name, **kwargs) + diff --git a/MuonSpectrometer/MuonDigitization/CSC_Digitization/python/CSC_DigitizationConfigNew.py b/MuonSpectrometer/MuonDigitization/CSC_Digitization/python/CSC_DigitizationConfigNew.py index b21d517cd77d4bb9c0041f9962f02daac097d242..4f45185c364d83f99d2a1f997c7f60f266726ce6 100644 --- a/MuonSpectrometer/MuonDigitization/CSC_Digitization/python/CSC_DigitizationConfigNew.py +++ b/MuonSpectrometer/MuonDigitization/CSC_Digitization/python/CSC_DigitizationConfigNew.py @@ -4,6 +4,7 @@ Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration """ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from StoreGate.StoreGateConf import StoreGateSvc +from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg from MuonConfig.MuonCalibConfig import CscCoolStrSvcCfg from CSC_Digitization.CSC_DigitizationConf import ( @@ -19,6 +20,10 @@ def CSC_FirstXing(): def CSC_LastXing(): return 175 +def CSC_ItemList(): + """Return list of item names needed for CSC output""" + return ["MuonSimDataCollection#*", "CscSimDataCollection#CSC_SDO", "CscRawDataContainer#*"] + def CSC_RangeToolCfg(flags, name="CSC_Range", **kwargs): """Return a PileUpXingFolder tool configured for CSC""" kwargs.setdefault("FirstXing", CSC_FirstXing()) @@ -57,6 +62,8 @@ def CSC_DigitBuilderCfg(flags, name="CSC_DigitBuilder", **kwargs): tool = acc.popToolsAndMerge(CSC_DigitizationToolCfg(flags)) kwargs.setdefault("DigitizationTool", tool) acc.addEventAlgo(CscDigitBuilder(name, **kwargs)) + # FIXME once OutputStreamCfg merges correctly + #acc.merge(OutputStreamCfg(flags, "RDO", CSC_ItemList())) return acc def CSC_OverlayDigitizationToolCfg(flags, name="CSC_OverlayDigitizationTool",**kwargs): @@ -77,5 +84,7 @@ def CSC_OverlayDigitBuilderCfg(flags, name="CSC_OverlayDigitBuilder", **kwargs): tool = acc.popToolsAndMerge(CSC_OverlayDigitizationToolCfg(flags)) kwargs.setdefault("DigitizationTool", tool) acc.addEventAlgo(CscDigitBuilder(name, **kwargs)) + # FIXME once OutputStreamCfg merges correctly + #acc.merge(OutputStreamCfg(flags, "RDO", CSC_ItemList())) return acc diff --git a/MuonSpectrometer/MuonDigitization/CSC_Digitization/test/CSC_DigitizationConfigNew_test.py b/MuonSpectrometer/MuonDigitization/CSC_Digitization/test/CSC_DigitizationConfigNew_test.py index 273eb55f767d7488d78101e38881d5878397fa08..e8a4275eafb5a3929b2a39fa97966c66d146ab5f 100755 --- a/MuonSpectrometer/MuonDigitization/CSC_Digitization/test/CSC_DigitizationConfigNew_test.py +++ b/MuonSpectrometer/MuonDigitization/CSC_Digitization/test/CSC_DigitizationConfigNew_test.py @@ -10,7 +10,6 @@ from AthenaCommon.Configurable import Configurable from AthenaConfiguration.TestDefaults import defaultTestFiles from AthenaConfiguration.MainServicesConfig import MainServicesSerialCfg from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg -from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg from Digitization.DigitizationConfigFlags import createDigitizationCfgFlags from OverlayCommonAlgs.OverlayConfigFlags import createOverlayCfgFlags from AthenaConfiguration.AllConfigFlags import ConfigFlags @@ -31,13 +30,6 @@ ConfigFlags.lock() acc = MainServicesSerialCfg() acc.merge(PoolReadCfg(ConfigFlags)) acc.merge(CSC_DigitBuilderCfg(ConfigFlags)) -# Add configuration to write HITS pool file -ItemList = [ - "CscSimDataCollection#CSC_SDO", - "MuonSimDataCollection#*", - "CscRawDataContainer#*", -] -acc.merge(OutputStreamCfg(ConfigFlags, "RDO", ItemList=ItemList)) # Dump config acc.getService("StoreGateSvc").Dump = True acc.getService("ConditionStore").Dump = True diff --git a/MuonSpectrometer/MuonDigitization/MDT_Digitization/python/MDT_DigitizationConfigNew.py b/MuonSpectrometer/MuonDigitization/MDT_Digitization/python/MDT_DigitizationConfigNew.py index e3c0488e4bfca29a14c52f19513c19ddcc0bc3b5..377f6ba2137763ccd2f3d89055b1c4ebb095511c 100644 --- a/MuonSpectrometer/MuonDigitization/MDT_Digitization/python/MDT_DigitizationConfigNew.py +++ b/MuonSpectrometer/MuonDigitization/MDT_Digitization/python/MDT_DigitizationConfigNew.py @@ -4,6 +4,7 @@ Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration """ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from StoreGate.StoreGateConf import StoreGateSvc +from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg from MDT_Digitization.MDT_DigitizationConf import ( MdtDigitizationTool, MDT_Response_DigiTool, RT_Relation_DB_DigiTool, MDT_Digitizer @@ -19,6 +20,10 @@ def MDT_LastXing(): # was 800 for large time window return 150 +def MDT_ItemList(): + """Return list of item names needed for MDT output""" + return ["MuonSimDataCollection#*", "MdtCsmContainer#*"] + def MDT_RangeToolCfg(flags, name="MDT_Range", **kwargs): """Return a PileUpXingFolder tool configured for MDT""" kwargs.setdefault("FirstXing", MDT_FirstXing()) @@ -65,6 +70,8 @@ def MDT_DigitizerCfg(flags, name="MDT_Digitizer", **kwargs): tool = acc.popToolsAndMerge(MDT_DigitizationToolCfg(flags)) kwargs.setdefault("DigitizationTool", tool) acc.addEventAlgo(MDT_Digitizer(name, **kwargs)) + # FIXME once OutputStreamCfg merges correctly + #acc.merge(OutputStreamCfg(flags, "RDO", MDT_ItemList())) return acc def MDT_OverlayDigitizationToolCfg(flags, name="MDT_OverlayDigitizationTool",**kwargs): @@ -84,5 +91,7 @@ def MDT_OverlayDigitizerCfg(flags, name="MDT_OverlayDigitizer", **kwargs): tool = acc.popToolsAndMerge(MDT_OverlayDigitizationToolCfg(flags)) kwargs.setdefault("DigitizationTool", tool) acc.addEventAlgo(MDT_Digitizer(name, **kwargs)) + # FIXME once OutputStreamCfg merges correctly + #acc.merge(OutputStreamCfg(flags, "RDO", MDT_ItemList())) return acc diff --git a/MuonSpectrometer/MuonDigitization/MDT_Digitization/test/MDT_DigitizationConfigNew_test.py b/MuonSpectrometer/MuonDigitization/MDT_Digitization/test/MDT_DigitizationConfigNew_test.py index 4619c070e44032af34b9ce4c844e40d6c1118163..8d315f05c3f450fc80f3783082f80008c27fd6c0 100755 --- a/MuonSpectrometer/MuonDigitization/MDT_Digitization/test/MDT_DigitizationConfigNew_test.py +++ b/MuonSpectrometer/MuonDigitization/MDT_Digitization/test/MDT_DigitizationConfigNew_test.py @@ -10,7 +10,6 @@ from AthenaCommon.Configurable import Configurable from AthenaConfiguration.TestDefaults import defaultTestFiles from AthenaConfiguration.MainServicesConfig import MainServicesSerialCfg from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg -from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg from AthenaConfiguration.AllConfigFlags import ConfigFlags from Digitization.DigitizationConfigFlags import createDigitizationCfgFlags from OverlayCommonAlgs.OverlayConfigFlags import createOverlayCfgFlags @@ -30,12 +29,6 @@ ConfigFlags.lock() acc = MainServicesSerialCfg() acc.merge(PoolReadCfg(ConfigFlags)) acc.merge(MDT_DigitizerCfg(ConfigFlags)) -# Add configuration to write HITS pool file -ItemList = [ - "MuonSimDataCollection#*", - "MdtCsmContainer#*", -] -acc.merge(OutputStreamCfg(ConfigFlags, "RDO", ItemList=ItemList)) # Dump config acc.getService("StoreGateSvc").Dump = True acc.getService("ConditionStore").Dump = True diff --git a/MuonSpectrometer/MuonDigitization/RPC_Digitization/python/RPC_DigitizationConfigNew.py b/MuonSpectrometer/MuonDigitization/RPC_Digitization/python/RPC_DigitizationConfigNew.py index efd6075344d8b8b32062a37d586e09a9b9ae6d09..c8cbb8b5c876189f39b9ca84654173a1c6aedf9f 100644 --- a/MuonSpectrometer/MuonDigitization/RPC_Digitization/python/RPC_DigitizationConfigNew.py +++ b/MuonSpectrometer/MuonDigitization/RPC_Digitization/python/RPC_DigitizationConfigNew.py @@ -4,6 +4,7 @@ Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration """ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from StoreGate.StoreGateConf import StoreGateSvc +from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg from RPC_Digitization.RPC_DigitizationConf import RpcDigitizationTool, RPC_Digitizer from PileUpComps.PileUpCompsConf import PileUpXingFolder @@ -17,6 +18,10 @@ def RPC_FirstXing(): def RPC_LastXing(): return 125 +def RPC_ItemList(): + """Return list of item names needed for RPC output""" + return ["MuonSimDataCollection#*", "RpcPadContainer#*"] + def RPC_RangeToolCfg(flags, name="RPC_Range", **kwargs): """Return a PileUpXingFolder tool configured for RPC""" kwargs.setdefault("FirstXing", RPC_FirstXing()) @@ -80,6 +85,8 @@ def RPC_DigitizerCfg(flags, name="RPC_Digitizer", **kwargs): tool = acc.popToolsAndMerge(RPC_DigitizationToolCfg(flags)) kwargs.setdefault("DigitizationTool", tool) acc.addEventAlgo(RPC_Digitizer(name,**kwargs)) + # FIXME once OutputStreamCfg merges correctly + #acc.merge(OutputStreamCfg(flags, "RDO", RPC_ItemList())) return acc def RPC_OverlayDigitizationToolCfg(flags, name="RPC_DigitizationTool", **kwargs): @@ -98,6 +105,8 @@ def RPC_OverlayDigitizerCfg(flags, name="RPC_OverlayDigitizer", **kwargs): acc = MuonGeoModelCfg(flags) tool = acc.popToolsAndMerge(RPC_OverlayDigitizationToolCfg(flags)) kwargs.setdefault("DigitizationTool", tool) - acc.addEventAlgo(RPC_Digitizer(name,**kwargs)) + acc.addEventAlgo(RPC_Digitizer(name, **kwargs)) + # FIXME once OutputStreamCfg merges correctly + #acc.merge(OutputStreamCfg(flags, "RDO", RPC_ItemList())) return acc diff --git a/MuonSpectrometer/MuonDigitization/RPC_Digitization/test/RPC_DigitizationConfigNew_test.py b/MuonSpectrometer/MuonDigitization/RPC_Digitization/test/RPC_DigitizationConfigNew_test.py index f6a3bddc490e093b7eed96c04ce5560bdf39d275..66b438930d4158d823374be5fc1bd7a1853146f2 100755 --- a/MuonSpectrometer/MuonDigitization/RPC_Digitization/test/RPC_DigitizationConfigNew_test.py +++ b/MuonSpectrometer/MuonDigitization/RPC_Digitization/test/RPC_DigitizationConfigNew_test.py @@ -10,7 +10,6 @@ from AthenaCommon.Configurable import Configurable from AthenaConfiguration.TestDefaults import defaultTestFiles from AthenaConfiguration.MainServicesConfig import MainServicesSerialCfg from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg -from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg from AthenaConfiguration.AllConfigFlags import ConfigFlags from Digitization.DigitizationConfigFlags import createDigitizationCfgFlags from OverlayCommonAlgs.OverlayConfigFlags import createOverlayCfgFlags @@ -34,12 +33,6 @@ ConfigFlags.lock() acc = MainServicesSerialCfg() acc.merge(PoolReadCfg(ConfigFlags)) acc.merge(RPC_DigitizerCfg(ConfigFlags)) -# Add configuration to write HITS pool file -ItemList = [ - "MuonSimDataCollection#*", - "RpcPadContainer#*", -] -acc.merge(OutputStreamCfg(ConfigFlags, "RDO", ItemList=ItemList)) # Dump config acc.getService("StoreGateSvc").Dump = True acc.getService("ConditionStore").Dump = True diff --git a/MuonSpectrometer/MuonDigitization/TGC_Digitization/python/TGC_DigitizationConfigNew.py b/MuonSpectrometer/MuonDigitization/TGC_Digitization/python/TGC_DigitizationConfigNew.py index d562ab5346e567264607a06027cd10b073627adb..5a4227425a830ec5030c60bf07a20ec3ab4b66e1 100644 --- a/MuonSpectrometer/MuonDigitization/TGC_Digitization/python/TGC_DigitizationConfigNew.py +++ b/MuonSpectrometer/MuonDigitization/TGC_Digitization/python/TGC_DigitizationConfigNew.py @@ -4,6 +4,7 @@ Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration """ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from StoreGate.StoreGateConf import StoreGateSvc +from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg from TGC_Digitization.TGC_DigitizationConf import TgcDigitizationTool, TGCDigitizer from PileUpComps.PileUpCompsConf import PileUpXingFolder @@ -16,6 +17,10 @@ def TGC_FirstXing(): def TGC_LastXing(): return 75 +def TGC_ItemList(): + """Return list of item names needed for TGC output""" + return ["MuonSimDataCollection#*", "TgcRdoContainer#*"] + def TGC_RangeToolCfg(flags, name="TGC_Range", **kwargs): """Return a PileUpXingFolder tool configured for TGC""" kwargs.setdefault("FirstXing", TGC_FirstXing()) @@ -44,6 +49,8 @@ def TGC_DigitizerCfg(flags, name="TGC_Digitizer", **kwargs): tool = acc.popToolsAndMerge(TGC_DigitizationToolCfg(flags)) kwargs.setdefault("DigitizationTool", tool) acc.addEventAlgo(TGCDigitizer(name,**kwargs)) + # FIXME once OutputStreamCfg merges correctly + #acc.merge(OutputStreamCfg(flags, "RDO", TGC_ItemList())) return acc def TGC_OverlayDigitizationToolCfg(flags, name="TGC_OverlayDigitizationTool", **kwargs): @@ -54,7 +61,7 @@ def TGC_OverlayDigitizationToolCfg(flags, name="TGC_OverlayDigitizationTool", ** if not flags.Detector.Overlay: kwargs.setdefault("OutputSDOName", flags.Overlay.Legacy.EventStore + "+TGC_SDO") kwargs.setdefault("EvtStore", flags.Overlay.Legacy.EventStore) - acc.setPrivateTools(TgcDigitizationTool(name,**kwargs)) + acc.setPrivateTools(TgcDigitizationTool(name, **kwargs)) return acc def TGC_OverlayDigitizerCfg(flags, name="TGC_OverlayDigitizer", **kwargs): @@ -62,6 +69,8 @@ def TGC_OverlayDigitizerCfg(flags, name="TGC_OverlayDigitizer", **kwargs): acc = MuonGeoModelCfg(flags) tool = acc.popToolsAndMerge(TGC_OverlayDigitizationToolCfg(flags)) kwargs.setdefault("DigitizationTool", tool) - acc.addEventAlgo(TGCDigitizer(name,**kwargs)) + acc.addEventAlgo(TGCDigitizer(name, **kwargs)) + # FIXME once OutputStreamCfg merges correctly + #acc.merge(OutputStreamCfg(flags, "RDO", TGC_ItemList())) return acc diff --git a/MuonSpectrometer/MuonDigitization/TGC_Digitization/test/TGC_DigitizationConfigNew_test.py b/MuonSpectrometer/MuonDigitization/TGC_Digitization/test/TGC_DigitizationConfigNew_test.py index 6e2829991db4a3edab9a21d6c0ff8f6501861cc5..464aab67813e4ef0d1088ecef6a8d512cfd1a84a 100755 --- a/MuonSpectrometer/MuonDigitization/TGC_Digitization/test/TGC_DigitizationConfigNew_test.py +++ b/MuonSpectrometer/MuonDigitization/TGC_Digitization/test/TGC_DigitizationConfigNew_test.py @@ -10,7 +10,6 @@ from AthenaCommon.Configurable import Configurable from AthenaConfiguration.TestDefaults import defaultTestFiles from AthenaConfiguration.MainServicesConfig import MainServicesSerialCfg from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg -from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg from Digitization.DigitizationConfigFlags import createDigitizationCfgFlags from OverlayCommonAlgs.OverlayConfigFlags import createOverlayCfgFlags from AthenaConfiguration.AllConfigFlags import ConfigFlags @@ -34,12 +33,6 @@ ConfigFlags.lock() acc = MainServicesSerialCfg() acc.merge(PoolReadCfg(ConfigFlags)) acc.merge(TGC_DigitizerCfg(ConfigFlags)) -# Add configuration to write HITS pool file -ItemList = [ - "MuonSimDataCollection#*", - "TgcRdoContainer#*", -] -acc.merge(OutputStreamCfg(ConfigFlags, "RDO", ItemList=ItemList)) # Dump config acc.getService("StoreGateSvc").Dump = True acc.getService("ConditionStore").Dump = True diff --git a/Simulation/Digitization/test/DigitizationConfigNew_test.py b/Simulation/Digitization/test/DigitizationConfigNew_test.py index aa8471b16240e2d0e400ff342aad86ed12b00bb6..c6d95a6640b4f465e5dfb7161c89fbed2c529989 100755 --- a/Simulation/Digitization/test/DigitizationConfigNew_test.py +++ b/Simulation/Digitization/test/DigitizationConfigNew_test.py @@ -7,16 +7,16 @@ import sys from AthenaCommon.Logging import log from AthenaCommon.Constants import DEBUG from AthenaCommon.Configurable import Configurable -from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.AllConfigFlags import ConfigFlags from AthenaConfiguration.MainServicesConfig import MainServicesSerialCfg from AthenaConfiguration.TestDefaults import defaultTestFiles from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg -from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg from Digitization.DigitizationConfigFlags import createDigitizationCfgFlags from OverlayCommonAlgs.OverlayConfigFlags import createOverlayCfgFlags from BCM_Digitization.BCM_DigitizationConfigNew import BCM_DigitizationCfg from SCT_Digitization.SCT_DigitizationConfigNew import SCT_DigitizationHSCfg +from TRT_Digitization.TRT_DigitizationConfigNew import TRT_DigitizationHSCfg +from PixelDigitization.PixelDigitizationConfigNew import PixelDigitizationHSCfg from MDT_Digitization.MDT_DigitizationConfigNew import MDT_DigitizerCfg from TGC_Digitization.TGC_DigitizationConfigNew import TGC_DigitizerCfg from RPC_Digitization.RPC_DigitizationConfigNew import RPC_DigitizerCfg @@ -33,30 +33,33 @@ ConfigFlags.Output.RDOFileName = "myRDO.pool.root" ConfigFlags.IOVDb.GlobalTag = "OFLCOND-MC16-SDR-16" ConfigFlags.GeoModel.Align.Dynamic = False ConfigFlags.Concurrency.NumThreads = 1 +ConfigFlags.GeoModel.Type = "BrlIncl4.0_ref" +ConfigFlags.Beam.NumberOfCollisions = 0. ConfigFlags.lock() # Construct our accumulator to run acc = MainServicesSerialCfg() acc.merge(PoolReadCfg(ConfigFlags)) acc.merge(BCM_DigitizationCfg(ConfigFlags)) acc.merge(SCT_DigitizationHSCfg(ConfigFlags)) +acc.merge(TRT_DigitizationHSCfg(ConfigFlags)) +acc.merge(PixelDigitizationHSCfg(ConfigFlags)) acc.merge(MDT_DigitizerCfg(ConfigFlags)) acc.merge(TGC_DigitizerCfg(ConfigFlags)) acc.merge(RPC_DigitizerCfg(ConfigFlags)) acc.merge(CSC_DigitBuilderCfg(ConfigFlags)) -# add output configuration -ItemList = [ - "InDetSimDataCollection#*", - "BCM_RDO_Container#*", - "InDet::SiClusterContainer#*", - "SCT_RDO_Container#*", - "MuonSimDataCollection#*", - "MdtCsmContainer#*", - "TgcRdoContainer#*", - "RpcPadContainer#*", - "CscSimDataCollection#CSC_SDO", - "CscRawDataContainer#*", -] -acc.merge(OutputStreamCfg(ConfigFlags, "RDO", ItemList=ItemList)) +# FIXME once OutputStreamCfg merges correctly +from BCM_Digitization.BCM_DigitizationConfigNew import BCM_ItemList +from SCT_Digitization.SCT_DigitizationConfigNew import SCT_ItemList +from TRT_Digitization.TRT_DigitizationConfigNew import TRT_ItemList +from PixelDigitization.PixelDigitizationConfigNew import PixelItemList +from MDT_Digitization.MDT_DigitizationConfigNew import MDT_ItemList +from TGC_Digitization.TGC_DigitizationConfigNew import TGC_ItemList +from RPC_Digitization.RPC_DigitizationConfigNew import RPC_ItemList +from CSC_Digitization.CSC_DigitizationConfigNew import CSC_ItemList +from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg +ItemList = BCM_ItemList() + SCT_ItemList() + TRT_ItemList() + PixelItemList() + MDT_ItemList() + TGC_ItemList() + RPC_ItemList() + CSC_ItemList() +ItemList = list(set(ItemList)) # remove duplicates +acc.merge(OutputStreamCfg(ConfigFlags, "RDO", ItemList)) # Dump config acc.getService("StoreGateSvc").Dump = True acc.getService("ConditionStore").Dump = True