diff --git a/LArCalorimeter/LArDigitization/python/LArDigitizationConfigNew.py b/LArCalorimeter/LArDigitization/python/LArDigitizationConfigNew.py index 48da45addad4227fab71c49bdf6b60c88f31b6e1..f298a64ef2ec5e2e7e505063125537e4fd60282c 100644 --- a/LArCalorimeter/LArDigitization/python/LArDigitizationConfigNew.py +++ b/LArCalorimeter/LArDigitization/python/LArDigitizationConfigNew.py @@ -13,6 +13,11 @@ from LArDigitization.LArDigitizationConf import LArPileUpTool, LArDigitMaker from CommissionUtils.CommissionUtilsConf import CosmicTriggerTimeTool from SGComps.SGCompsConf import AddressRemappingSvc, ProxyProviderSvc from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg +from LArCabling.LArCablingConfig import LArFebRodMappingCfg, LArCalibIdMappingCfg +from CaloConditions.CaloConditionsConfig import CaloTriggerTowerCfg +from LArL1Sim.LArL1SimConf import LArTTL1Maker +from RngComps.RandomServices import RNG + def useLArFloat(flags): """Return bool for simplified transient LArHit with float E,time""" @@ -25,17 +30,6 @@ def useLArFloat(flags): return False return True -def LArItemList(): - """Return list of item names needed for LAr output""" - ItemList = [ - "LArRawChannelContainer#*", - "LArDigitContainer#*", - "LArDigitContainer#*LArDigitContainer_MC", - "LArDigitContainer#LArDigitContainer_MC_Thinned", - "LArHitContainer#HGTDDigitContainer_MC", - "LArTTL1Container#*", - ] - return ItemList def LArRangeEMCfg(flags, name="LArRangeEM", **kwargs): """Return a PileUpXingFoldertool for ElectroMagnetic calorimeter""" @@ -50,6 +44,7 @@ def LArRangeEMCfg(flags, name="LArRangeEM", **kwargs): "LArHitContainer#LArHitEMEC"]) return PileUpXingFolder(name, **kwargs) + def LArRangeHECCfg(flags, name="LArRangeHEC", **kwargs): """Return a PileUpXingFoldertool for Hadronic End-Cap""" # bunch crossing range in ns @@ -61,6 +56,7 @@ def LArRangeHECCfg(flags, name="LArRangeHEC", **kwargs): kwargs.setdefault("ItemList", ["LArHitContainer#LArHitHEC"]) return PileUpXingFolder(name, **kwargs) + def LArRangeFCALCfg(flags, name="LArRangeFCAL", **kwargs): """Return a PileUpXingFoldertool for Forward Calorimeters""" # bunch crossing range in ns @@ -72,8 +68,9 @@ def LArRangeFCALCfg(flags, name="LArRangeFCAL", **kwargs): kwargs.setdefault("ItemList", ["LArHitContainer#LArHitFCAL"]) return PileUpXingFolder(name, **kwargs) + def LArPileUpToolCfg(flags, name="LArPileUpTool", **kwargs): - """Return a ComponentAccumulator with configured LArPileUpTool""" + """Return ComponentAccumulator with configured LArPileUpTool""" acc = LArGMCfg(flags) #The LArPileupTool needs: Noise, fSampl, Pedestal,Shape ADC2MeV @@ -115,7 +112,7 @@ def LArPileUpToolCfg(flags, name="LArPileUpTool", **kwargs): kwargs.setdefault("UseTriggerTime", True) kwargs.setdefault("TriggerTimeToolName", CosmicTriggerTimeTool()) # pileup configuration "algorithm" way - if not flags.Digitization.DoXingByXingPileUp : + if not flags.Digitization.DoXingByXingPileUp: if flags.Digitization.Pileup or flags.Detector.OverlayLAr: kwargs.setdefault("PileUp", True) kwargs.setdefault("useLArFloat", useLArFloat(flags)) @@ -127,19 +124,58 @@ def LArPileUpToolCfg(flags, name="LArPileUpTool", **kwargs): "LArHitContainer#LArHitFCAL->LArHitFloatContainer#LArHitFCAL" ] acc.addService(AddressRemappingSvc(TypeKeyOverwriteMaps=maps, ProxyDict="ActiveStoreSvc")) - acc.addService(ProxyProviderSvc(ProviderNames=["AddressRemappingSvc"])) + acc.addService(ProxyProviderSvc(ProviderNames=["AddressRemappingSvc"])) acc.setPrivateTools(LArPileUpTool(name, **kwargs)) return acc -def LArDigitMakerCfg(flags, name="LArDigitMaker", **kwargs): - """Return a ComponentAccumulator with configured LArDigitMaker algorithm""" + +def LArDigitMakerBasicCfg(flags, name="LArDigitMaker", **kwargs): + """Return ComponentAccumulator with configured LArDigitMaker algorithm""" acc = ComponentAccumulator() if "LArPileUpTool" not in kwargs: tool = acc.popToolsAndMerge(LArPileUpToolCfg(flags)) kwargs["LArPileUpTool"] = tool - acc.addEventAlgo(LArDigitMaker(name, **kwargs)) - acc.merge(OutputStreamCfg(flags, "RDO", LArItemList())) + return acc + + +def LArDigitMakerCfg(flags, name="LArDigitMaker", **kwargs): + """Return ComponentAccumulator with configured LArDigitMaker algorithm and Output""" + acc = LArDigitMakerBasicCfg(flags, name, **kwargs) + LArItemList = [ + "LArRawChannelContainer#*", + "LArDigitContainer#*", + "LArDigitContainer#*LArDigitContainer_MC", + "LArDigitContainer#LArDigitContainer_MC_Thinned", + "LArHitContainer#HGTDDigitContainer_MC", + ] + acc.merge(OutputStreamCfg(flags, "RDO", LArItemList)) + return acc + + +def LArTriggerDigitizationBasicCfg(flags, **kwargs): + """Return ComponentAccumulator for LAr Trigger Tower""" + acc = LArDigitMakerBasicCfg(flags) + acc.merge(LArFebRodMappingCfg(flags)) + acc.merge(LArCalibIdMappingCfg(flags)) + acc.merge(CaloTriggerTowerCfg(flags)) + # trigger tower algo + kwargs.setdefault("NoiseOnOff", flags.Digitization.DoCaloNoise) + if not flags.Digitization.DoXingByXingPileUp: + if flags.Digitization.Pileup or flags.Detector.OverlayLAr: + kwargs.setdefault("PileUp", True) + if flags.Digitization.PileUpPremixing: + kwargs.setdefault("EmTTL1ContainerName", flags.Overlay.BkgPrefix + "LArTTL1EM") + kwargs.setdefault("HadTTL1ContainerName", flags.Overlay.BkgPrefix + "LArTTL1HAD") + acc.addEventAlgo(LArTTL1Maker(**kwargs)) + return acc + + +def LArTriggerDigitizationCfg(flags, **kwargs): + """Return ComponentAccumulator for LAr Trigger Tower and Output""" + acc = LArTriggerDigitizationBasicCfg(flags) + acc.merge(LArDigitMakerCfg(flags)) + acc.merge(OutputStreamCfg(flags, "RDO", ["LArTTL1Container#*"])) return acc diff --git a/Simulation/Digitization/test/DigitizationConfigNew_test.py b/Simulation/Digitization/test/DigitizationConfigNew_test.py index 7325549014997c987439a439e522f5a0e5f61132..0a6432429508a3ab3c632bfd8faf6cee62fb2571 100755 --- a/Simulation/Digitization/test/DigitizationConfigNew_test.py +++ b/Simulation/Digitization/test/DigitizationConfigNew_test.py @@ -19,7 +19,7 @@ from MDT_Digitization.MDT_DigitizationConfigNew import MDT_DigitizerDigitToRDOCf from TGC_Digitization.TGC_DigitizationConfigNew import TGC_DigitizerDigitToRDOCfg from RPC_Digitization.RPC_DigitizationConfigNew import RPC_DigitizerDigitToRDOCfg from CSC_Digitization.CSC_DigitizationConfigNew import CSC_DigitBuilderDigitToRDOCfg -from LArDigitization.LArDigitizationConfigNew import LArDigitMakerCfg +from LArDigitization.LArDigitizationConfigNew import LArTriggerDigitizationCfg from TileSimAlgs.TileDigitizationConfig import TileDigitizationCfg, TileTriggerDigitizationCfg # Set up logging and new style config @@ -44,7 +44,7 @@ acc.merge(MDT_DigitizerDigitToRDOCfg(ConfigFlags)) acc.merge(TGC_DigitizerDigitToRDOCfg(ConfigFlags)) acc.merge(RPC_DigitizerDigitToRDOCfg(ConfigFlags)) acc.merge(CSC_DigitBuilderDigitToRDOCfg(ConfigFlags)) -acc.merge(LArDigitMakerCfg(ConfigFlags)) +acc.merge(LArTriggerDigitizationCfg(ConfigFlags)) acc.merge(TileDigitizationCfg(ConfigFlags)) acc.merge(TileTriggerDigitizationCfg(ConfigFlags)) # Dump config