def getStandardInDetPileUpTools(): from AthenaCommon.DetFlags import DetFlags from Digitization.DigitizationFlags import digitizationFlags PileUpToolsList = [] if DetFlags.digitize.BCM_on(): PileUpToolsList += [ "BCM_DigitizationTool" ] if DetFlags.digitize.pixel_on(): if 'doFastPixelDigi' in digitizationFlags.experimentalDigi(): PileUpToolsList += [ "PixelFastDigitizationTool" ] elif 'doLightPixelDigi' in digitizationFlags.experimentalDigi(): PileUpToolsList += [ "PixelLightDigitizationTool" ] elif 'doSmearedPixelDigi' in digitizationFlags.experimentalDigi(): PileUpToolsList += [ "PixelSmearedDigitizationTool" ] elif digitizationFlags.doRadiationDamage(): PileUpToolsList += [ "PixelRadDamDigitizationTool" ] else: PileUpToolsList += [ "PixelDigitizationTool" ] if DetFlags.digitize.SCT_on(): if 'doFastSCT_Digi' in digitizationFlags.experimentalDigi(): PileUpToolsList += [ "SCT_FastDigitizationTool" ] else: PileUpToolsList += [ "SCT_DigitizationTool" ] if DetFlags.digitize.TRT_on(): if 'doFastTRT_Digi' in digitizationFlags.experimentalDigi(): PileUpToolsList += [ "TRTFastDigitizationTool" ] else: PileUpToolsList += [ "TRTDigitizationTool" ] return PileUpToolsList
def FastClusterMakerTool(name="FastClusterMakerTool", **kwargs): from Digitization.DigitizationFlags import digitizationFlags #FIXME: at some point we should move away from being dependent on the experimentalDigi flags. if 'doFastSCT_Digi' in digitizationFlags.experimentalDigi( ) and not 'doFastPixelDigi' in digitizationFlags.experimentalDigi(): kwargs.setdefault("UsePixelCalibCondDB", False) kwargs.setdefault("PixelCalibSvc", "") kwargs.setdefault("PixelOfflineCalibSvc", "") else: from AthenaCommon.Include import include include("PixelConditionsServices/PixelDCSSvc_jobOptions.py") include.block("PixelConditionsServices/PixelDCSSvc_jobOptions.py") from AthenaCommon.AppMgr import ToolSvc if not hasattr(ToolSvc, "PixelRecoDbTool"): from PixelConditionsTools.PixelConditionsToolsConf import PixelRecoDbTool ToolSvc += PixelRecoDbTool() ToolSvc.PixelRecoDbTool.InputSource = 1 # setup PixelCalibDbTool in ToolSvc if not hasattr(ToolSvc, "PixelCalibDbTool"): from PixelConditionsTools.PixelConditionsToolsConf import PixelCalibDbTool ToolSvc += PixelCalibDbTool() from IOVDbSvc.CondDB import conddb if not conddb.folderRequested('/PIXEL/PixCalib'): conddb.addFolder("PIXEL_OFL", "/PIXEL/PixCalib") if not conddb.folderRequested('/PIXEL/ReadoutSpeed'): conddb.addFolder("PIXEL_OFL", "/PIXEL/ReadoutSpeed") from AthenaCommon.AppMgr import ServiceMgr if not hasattr(ServiceMgr, "PixelCalibSvc"): from PixelConditionsServices.PixelConditionsServicesConf import PixelCalibSvc InDetPixelCalibSvc = PixelCalibSvc() ServiceMgr += InDetPixelCalibSvc if not hasattr(ServiceMgr, "PixelSiPropertiesSvc"): from SiLorentzAngleSvc.LorentzAngleSvcSetup import lorentzAngleSvc from SiPropertiesSvc.SiPropertiesSvcConf import SiPropertiesSvc PixelSiPropertiesSvc = SiPropertiesSvc( name="PixelSiPropertiesSvc", DetectorName="Pixel", SiConditionsServices=lorentzAngleSvc.pixelSiliconConditionsSvc) ServiceMgr += PixelSiPropertiesSvc if not hasattr(ServiceMgr, "PixelOfflineCalibSvc"): from PixelConditionsServices.PixelConditionsServicesConf import PixelOfflineCalibSvc ServiceMgr += PixelOfflineCalibSvc() ServiceMgr.PixelOfflineCalibSvc.HDCFromCOOL = False from AthenaCommon import CfgMgr return CfgMgr.InDet__ClusterMakerTool(name, **kwargs)
def getLArRawChannelBuilder(name="LArRawChannelBuilder" , **kwargs): from AthenaCommon.AppMgr import ToolSvc kwargs.setdefault('LArRawChannelKey', "LArRawChannels") from Digitization.DigitizationFlags import digitizationFlags if digitizationFlags.PileUpPremixing and 'OverlayMT' in digitizationFlags.experimentalDigi(): from OverlayCommonAlgs.OverlayFlags import overlayFlags kwargs.setdefault('LArDigitKey', overlayFlags.bkgPrefix() + 'LArDigitContainer_MC') else: kwargs.setdefault('LArDigitKey', 'LArDigitContainer_MC') #Call required Cond-Algos: from LArRecUtils.LArAutoCorrTotalCondAlgDefault import LArAutoCorrTotalCondAlgDefault from LArRecUtils.LArOFCCondAlgDefault import LArOFCCondAlgDefault from LArRecUtils.LArADC2MeVCondAlgDefault import LArADC2MeVCondAlgDefault #The order matters when running w/o MT LArADC2MeVCondAlgDefault() LArAutoCorrTotalCondAlgDefault() LArOFCCondAlgDefault() kwargs.setdefault("ShapeKey","LArShapeSym") from LArROD.LArRODFlags import larRODFlags kwargs.setdefault('firstSample',larRODFlags.firstSample()) return CfgMgr.LArRawChannelBuilderAlg(name, **kwargs)
def getStandardInTimeOnlyTruthPileUpTools(): from AthenaCommon.DetFlags import DetFlags PileUpToolsList = [] if DetFlags.pileup.Truth_on(): from Digitization.DigitizationFlags import digitizationFlags if 'NewMerge' in digitizationFlags.experimentalDigi(): if not athenaCommonFlags.DoFullChain(): PileUpToolsList += ["NewMergeMcEventCollTool_Signal"] if digitizationFlags.doLowPtMinBias.get_Value(): PileUpToolsList += [ "InTimeOnlyNewMergeMcEventCollTool_MinBias" ] if digitizationFlags.doHighPtMinBias.get_Value(): PileUpToolsList += [ "InTimeOnlyNewMergeMcEventCollTool_HighPtMinBias" ] if digitizationFlags.doCavern.get_Value(): PileUpToolsList += ["InTimeOnlyNewMergeMcEventCollTool_Cavern"] if digitizationFlags.doBeamGas.get_Value( ) or digitizationFlags.doBeamHalo.get_Value(): PileUpToolsList += [ "InTimeOnlyNewMergeMcEventCollTool_HaloGas" ] else: PileUpToolsList += ["InTimeOnlyMcEventCollTool"] PileUpToolsList += ["MergeTruthJetsTool"] if not athenaCommonFlags.DoFullChain( ) and DetFlags.writeRDOPool.Muon_on( ): #possibly this should be digitize.Muon_on() PileUpToolsList += ["MergeMuonEntryLayerTool"] if DetFlags.writeRDOPool.Calo_on( ): #possibly this should be digitize.Calo_on() PileUpToolsList += ["MergeCalibHitsTool"] return PileUpToolsList
def MergeCalibHitsTool(name="MergeCalibHitsTool", **kwargs): if digitizationFlags.doXingByXingPileUp(): # PileUpTool approach kwargs.setdefault("FirstXing", CalibHit_FirstXing()) kwargs.setdefault("LastXing", CalibHit_LastXing()) if 'OldTileCalibHitContainers' in digitizationFlags.experimentalDigi(): kwargs.setdefault("OldFormat", True) return CfgMgr.MergeCalibHitsTool(name, **kwargs)
def SignalOnlyMcEventCollTool(name="SignalOnlyMcEventCollTool", **kwargs): if digitizationFlags.doXingByXingPileUp(): # PileUpTool approach kwargs.setdefault("FirstXing", 0) kwargs.setdefault("LastXing", 0) keys = ['SimpleMerge', 'NewMerge'] if set(keys).isdisjoint(set(digitizationFlags.experimentalDigi())): kwargs.setdefault("OnlySaveSignalTruth", True) return genericMergeMcEventCollTool(name, **kwargs)
def getSCT_SurfaceChargesGenerator(name="SCT_SurfaceChargesGenerator", **kwargs): ## Set up services used by SCT_SurfaceChargesGenerator # Set up SCT_DCSConditiosnTool from SCT_ConditionsTools.SCT_DCSConditionsToolSetup import SCT_DCSConditionsToolSetup sct_DCSConditionsToolSetup = SCT_DCSConditionsToolSetup() sct_DCSConditionsToolSetup.setup() # Set up SCT_SiliconConditionsTool from SCT_ConditionsTools.SCT_SiliconConditionsToolSetup import SCT_SiliconConditionsToolSetup sct_SiliconConditionsToolSetup = SCT_SiliconConditionsToolSetup() sct_SiliconConditionsToolSetup.setDcsTool( sct_DCSConditionsToolSetup.getTool()) sct_SiliconConditionsToolSetup.setup() # Set up SCT_SiPropertiesTool from SiPropertiesTool.SCT_SiPropertiesToolSetup import SCT_SiPropertiesToolSetup sct_SiPropertiesToolSetup = SCT_SiPropertiesToolSetup() sct_SiPropertiesToolSetup.setSiliconTool( sct_SiliconConditionsToolSetup.getTool()) sct_SiPropertiesToolSetup.setup() ## Charge trapping tool - used by SCT_SurfaceChargesGenerator from AthenaCommon.AppMgr import ToolSvc ## SiLorentzAngleTool for SCT_SurfaceChargesGenerator from SiLorentzAngleTool.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup() kwargs.setdefault("FixedTime", -999) kwargs.setdefault("SubtractTime", -999) kwargs.setdefault("SurfaceDriftTime", 10 * Units.ns) kwargs.setdefault("NumberOfCharges", 1) kwargs.setdefault("SmallStepLength", 5 * Units.micrometer) kwargs.setdefault("DepletionVoltage", 70) kwargs.setdefault("BiasVoltage", 150) kwargs.setdefault("SiPropertiesTool", sct_SiPropertiesToolSetup.getTool()) kwargs.setdefault("LorentzAngleTool", sctLorentzAngleToolSetup.SCTLorentzAngleTool) from AthenaCommon.GlobalFlags import globalflags kwargs.setdefault("isOverlay", globalflags.isOverlay()) # kwargs.setdefault("doTrapping", True) # ATL-INDET-INT-2016-019 from Digitization.DigitizationFlags import digitizationFlags if 'doDetailedSurfChargesGen' in digitizationFlags.experimentalDigi(): kwargs.setdefault("ChargeDriftModel", 1) kwargs.setdefault("EFieldModel", 2) kwargs.setdefault("MagneticField", -2.0) kwargs.setdefault("SensorTemperature", 273.15) kwargs.setdefault("TransportTimeStep", 0.25) kwargs.setdefault("TransportTimeMax", 25.0) from SCT_Digitization.SCT_DigitizationConf import SCT_DetailedSurfaceChargesGenerator return SCT_DetailedSurfaceChargesGenerator(name, **kwargs) else: from SCT_ConditionsTools.SCT_ConditionsToolsConf import SCT_RadDamageSummaryTool kwargs.setdefault( "RadDamageSummaryTool", SCT_RadDamageSummaryTool(name="InDetSCT_RadDamageSummaryTool")) from SCT_Digitization.SCT_DigitizationConf import SCT_SurfaceChargesGenerator return SCT_SurfaceChargesGenerator(name, **kwargs)
def configure(self): mlog = logging.getLogger( 'TileL2FromRawChGetter::configure:' ) mlog.info ('entering') # get handle to upstream object try: from TileL2Algs.TileL2FromRawChGetter import TileL2FromRawChGetter theTileL2FromRawChGetter=TileL2FromRawChGetter() except Exception: mlog.error("could not get handle to TileL2FromRawChGetter Quit") traceback.print_exc() return False if not theTileL2FromRawChGetter.usable(): if not self.ignoreConfigError(): mlog.error("TileL2FromRawChGetter unusable. Quit.") return False else: mlog.error("TileL2FromRawChGetter unusable. Continue nevertheless") # Instantiation of the C++ algorithm try: from TileL2Algs.TileL2AlgsConf import TileRawChannelToL2 except Exception: mlog.error("could not import TileL2Algs.TileRawChannelToL2") traceback.print_exc() return False theTileRawChannelToL2=TileRawChannelToL2() self._TileRawChannelToL2Handle = theTileRawChannelToL2 # sets output key from Digitization.DigitizationFlags import digitizationFlags if digitizationFlags.PileUpPremixing and 'OverlayMT' in digitizationFlags.experimentalDigi(): from OverlayCommonAlgs.OverlayFlags import overlayFlags theTileRawChannelToL2.TileL2Container = overlayFlags.bkgPrefix() + self.outputKey() else: theTileRawChannelToL2.TileL2Container = self.outputKey() # register output in objKeyStore from RecExConfig.ObjKeyStore import objKeyStore objKeyStore.addStreamESD(self.outputType(),self.outputKey()) # now add algorithm to topSequence # this should always come at the end mlog.info(" now adding to topSequence") from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() topSequence += theTileRawChannelToL2 return True
def MergeMuonExitLayerTool(name="MergeMuonExitLayerTool", **kwargs): kwargs.setdefault("TrackRecordCollKey", "MuonExitLayer") if digitizationFlags.PileUpPremixing and 'OverlayMT' in digitizationFlags.experimentalDigi( ): from OverlayCommonAlgs.OverlayFlags import overlayFlags kwargs.setdefault("TrackRecordCollOutputKey", overlayFlags.bkgPrefix() + "MuonExitLayer") else: kwargs.setdefault("TrackRecordCollOutputKey", "MuonExitLayer") return MergeTrackRecordCollTool(name, **kwargs)
def CscDigitToCscRDOTool(name, **kwargs): from Digitization.DigitizationFlags import digitizationFlags if digitizationFlags.PileUpPremixing and 'OverlayMT' in digitizationFlags.experimentalDigi( ): from OverlayCommonAlgs.OverlayFlags import overlayFlags kwargs.setdefault("OutputObjectName", overlayFlags.bkgPrefix() + "CSCRDO") else: kwargs.setdefault("OutputObjectName", "CSCRDO") return BaseCscDigitToCscRDOTool(name, **kwargs)
def getRpcDigitToRpcRDO(name="RpcDigitToRpcRDO", **kwargs): from Digitization.DigitizationFlags import digitizationFlags if digitizationFlags.PileUpPremixing and 'OverlayMT' in digitizationFlags.experimentalDigi( ): from OverlayCommonAlgs.OverlayFlags import overlayFlags kwargs.setdefault("OutputObjectName", overlayFlags.bkgPrefix() + "RPCPAD") else: kwargs.setdefault("OutputObjectName", "RPCPAD") return CfgMgr.RpcDigitToRpcRDO(name, **kwargs)
def BCM_DigitizationTool(name="BCM_DigitizationTool", **kwargs): from Digitization.DigitizationFlags import digitizationFlags kwargs.setdefault("HitCollName", "BCMHits") if not digitizationFlags.doInDetNoise.get_Value(): kwargs.setdefault("ModNoise", [0., 0., 0., 0., 0., 0., 0., 0.]) else: kwargs.setdefault( "ModNoise", [90.82, 90.82, 90.82, 90.82, 90.82, 90.82, 90.82, 90.82]) kwargs.setdefault("ModSignal", [450.0, 450.0, 450.0, 450.0, 450.0, 450.0, 450.0, 450.0]) kwargs.setdefault("NinoThr", [330.0, 330.0, 330.0, 330.0, 330.0, 330.0, 330.0, 330.0]) kwargs.setdefault("EffDistanceParam", 4.0) kwargs.setdefault("EffSharpnessParam", 0.11) kwargs.setdefault("TimeDelay", 9.0) kwargs.setdefault("MIPDeposit", 0.33) # BCM with diamond #kwargs.setdefault("MIPDeposit", 0.25) # BCM with graphite if digitizationFlags.doXingByXingPileUp(): kwargs.setdefault("FirstXing", BCM_FirstXing()) kwargs.setdefault("LastXing", BCM_LastXing()) from AthenaCommon.GlobalFlags import globalflags if globalflags.isOverlay(): from OverlayCommonAlgs.OverlayFlags import overlayFlags if overlayFlags.isOverlayMT(): kwargs.setdefault("OnlyUseContainerName", False) kwargs.setdefault("OutputRDOKey", overlayFlags.sigPrefix() + "BCM_RDOs") kwargs.setdefault("OutputSDOKey", overlayFlags.sigPrefix() + "BCM_SDO_Map") else: kwargs.setdefault("OutputRDOKey", overlayFlags.evtStore() + "+BCM_RDOs") kwargs.setdefault("OutputSDOKey", overlayFlags.evtStore() + "+BCM_SDO_Map") else: if digitizationFlags.PileUpPremixing and 'OverlayMT' in digitizationFlags.experimentalDigi( ): from OverlayCommonAlgs.OverlayFlags import overlayFlags kwargs.setdefault("OutputRDOKey", overlayFlags.bkgPrefix() + "BCM_RDOs") kwargs.setdefault("OutputSDOKey", overlayFlags.bkgPrefix() + "BCM_SDO_Map") else: kwargs.setdefault("OutputRDOKey", "BCM_RDOs") kwargs.setdefault("OutputSDOKey", "BCM_SDO_Map") from AthenaCommon import CfgMgr return CfgMgr.BCM_DigitizationTool(name, **kwargs)
def genericMergeMcEventCollTool(name="MergeMcEventCollTool", **kwargs): if digitizationFlags.PileUpPremixing and 'OverlayMT' in digitizationFlags.experimentalDigi( ): from OverlayCommonAlgs.OverlayFlags import overlayFlags kwargs.setdefault("TruthCollOutputKey", overlayFlags.bkgPrefix() + "TruthEvent") else: kwargs.setdefault("TruthCollOutputKey", "TruthEvent") kwargs.setdefault("TruthCollInputKey", "TruthEvent") if 'SimpleMerge' in digitizationFlags.experimentalDigi(): if not digitizationFlags.doXingByXingPileUp(): # Algorithm approach kwargs.setdefault("PileUpMergeSvc", "PileUpMergeSvc") return CfgMgr.SimpleMergeMcEventCollTool(name, **kwargs) elif 'NewMerge' in digitizationFlags.experimentalDigi(): if not digitizationFlags.doXingByXingPileUp(): # Algorithm approach kwargs.setdefault("PileUpMergeSvc", "PileUpMergeSvc") if digitizationFlags.doLowPtMinBias: kwargs.setdefault("ExpectLowPtMinBiasBackgroundCollection", True) if digitizationFlags.doHighPtMinBias: kwargs.setdefault("ExpectHighPtMinBiasBackgroundCollection", True) # Default `PileUpType` to "Unknown" kwargs.setdefault("PileUpType", -1) return CfgMgr.NewMergeMcEventCollTool(name, **kwargs) else: kwargs.setdefault("LowTimeToKeep", -50.5) kwargs.setdefault("HighTimeToKeep", 50.5) kwargs.setdefault("KeepUnstable", False) kwargs.setdefault("AbsEtaMax", 5.0) kwargs.setdefault("OutOfTimeAbsEtaMax", 3.0) kwargs.setdefault("rRange", 20.0) kwargs.setdefault("zRange", 200.0) #kwargs.setdefault("ptMin", 0.4*GeV) #kwargs.setdefault("EKinMin", 1.0*MeV) kwargs.setdefault("SaveCavernBackground", True) kwargs.setdefault("SaveInTimeMinBias", True) kwargs.setdefault("SaveOutOfTimeMinBias", True) kwargs.setdefault("SaveRestOfMinBias", False) kwargs.setdefault("AddBackgroundCollisionVertices", True) kwargs.setdefault("CompressOutputCollection", False) #kwargs.setdefault("CopyCompleteGenEvents", True) return CfgMgr.MergeMcEventCollTool(name, **kwargs)
def getInTimeOnlyNewMergeMcEventCollTool_HaloGas( name="InTimeOnlyNewMergeMcEventCollTool_HaloGas", **kwargs): from Digitization import PileUpEventType kwargs.setdefault("PileUpType", PileUpEventType.HaloGas) if digitizationFlags.PileUpPremixing and 'OverlayMT' in digitizationFlags.experimentalDigi( ): from OverlayCommonAlgs.OverlayFlags import overlayFlags kwargs.setdefault("TruthCollOutputKey", overlayFlags.bkgPrefix() + "TruthEvent_HaloGas") else: kwargs.setdefault("TruthCollOutputKey", "TruthEvent_HaloGas") return getInTimeOnlyNewMergeMcEventCollTool_Base(name, **kwargs)
def getBeamSpotFixerAlg(name="BeamSpotFixerAlg", **kwargs): kwargs.setdefault('InputKey', 'Input_EventInfo') from Digitization.DigitizationFlags import digitizationFlags if digitizationFlags.PileUpPremixing and 'OverlayMT' in digitizationFlags.experimentalDigi( ): from OverlayCommonAlgs.OverlayFlags import overlayFlags kwargs.setdefault('OutputKey', overlayFlags.bkgPrefix() + 'EventInfo') else: kwargs.setdefault('OutputKey', 'EventInfo') return CfgMgr.Simulation__BeamSpotFixerAlg(name, **kwargs)
def PixelDigitizationTool(name="PixelDigitizationTool", **kwargs): kwargs.setdefault("HardScatterSplittingMode", 0) if digitizationFlags.PileUpPremixing and 'OverlayMT' in digitizationFlags.experimentalDigi( ): from OverlayCommonAlgs.OverlayFlags import overlayFlags kwargs.setdefault("RDOCollName", overlayFlags.bkgPrefix() + "PixelRDOs") kwargs.setdefault("SDOCollName", overlayFlags.bkgPrefix() + "PixelSDO_Map") else: kwargs.setdefault("RDOCollName", "PixelRDOs") kwargs.setdefault("SDOCollName", "PixelSDO_Map") return BasicPixelDigitizationTool(name, **kwargs)
def getFastInDetPileUpTools(): from AthenaCommon.DetFlags import DetFlags from Digitization.DigitizationFlags import digitizationFlags PileUpToolsList = [] if DetFlags.digitize.BCM_on(): PileUpToolsList += ["BCM_DigitizationTool"] if DetFlags.digitize.pixel_on(): if 'doFastPixelDigi' in digitizationFlags.experimentalDigi(): PileUpToolsList += ["PixelFastDigitizationTool"] else: PileUpToolsList += ["PixelDigitizationTool"] if DetFlags.digitize.SCT_on(): if 'doFastSCT_Digi' in digitizationFlags.experimentalDigi(): PileUpToolsList += ["SCT_FastDigitizationTool"] else: PileUpToolsList += ["SCT_DigitizationTool"] if DetFlags.digitize.TRT_on(): if 'doFastTRT_Digi' in digitizationFlags.experimentalDigi(): PileUpToolsList += ["TRTFastDigitizationTool"] else: PileUpToolsList += ["TRTDigitizationTool"] return PileUpToolsList
def TRTDigitizationTool(name="TRTDigitizationTool", **kwargs): from Digitization.DigitizationFlags import digitizationFlags if digitizationFlags.PileUpPremixing and 'OverlayMT' in digitizationFlags.experimentalDigi( ): from OverlayCommonAlgs.OverlayFlags import overlayFlags kwargs.setdefault("OutputObjectName", overlayFlags.bkgPrefix() + "TRT_RDOs") kwargs.setdefault("OutputSDOName", overlayFlags.bkgPrefix() + "TRT_SDO_Map") else: kwargs.setdefault("OutputObjectName", "TRT_RDOs") kwargs.setdefault("OutputSDOName", "TRT_SDO_Map") kwargs.setdefault("HardScatterSplittingMode", 0) return BasicTRTDigitizationTool(name, **kwargs)
def standardDigiOutputExpected( keys=['doFastPixelDigi', 'doFastSCT_Digi', 'doFastTRT_Digi']): noStandardDigi = True from Digitization.DigitizationFlags import digitizationFlags if standardDigiConfig(): for key in keys: noStandardDigi = noStandardDigi and key in digitizationFlags.experimentalDigi( ) else: noStandardDigi = not set([ 'SplitNoMergeFFPileUpToolsAlg', 'FastPileUpToolsAlg' ]).isdisjoint(set([digitizationFlags.digiSteeringConf.get_Value() ])) return not noStandardDigi
def fastDigiOutputExpected( keys=['doFastPixelDigi', 'doFastSCT_Digi', 'doFastTRT_Digi']): noFastDigi = False from Digitization.DigitizationFlags import digitizationFlags if standardDigiConfig(): noFastDigi = set(keys).isdisjoint( set(digitizationFlags.experimentalDigi())) else: noFastDigi = set([ 'SplitNoMergeFFPileUpToolsAlg', 'SplitNoMergeSFPileUpToolsAlg', 'SplitNoMergeFSPileUpToolsAlg', 'FastPileUpToolsAlg' ]).isdisjoint(set([digitizationFlags.digiSteeringConf.get_Value() ])) return not noFastDigi
def getStandardPileUpToolsAlg(name="StandardPileUpToolsAlg", **kwargs): kwargs.setdefault('PileUpTools', getStandardPileUpToolsList()) kwargs.setdefault('ExtraInputs', [('xAOD::EventInfo', 'EventInfo')]) from Digitization.DigitizationFlags import digitizationFlags if digitizationFlags.doXingByXingPileUp(): if digitizationFlags.PileUpPremixing and 'OverlayMT' in digitizationFlags.experimentalDigi( ): from OverlayCommonAlgs.OverlayFlags import overlayFlags kwargs.setdefault('EventInfoKey', overlayFlags.bkgPrefix() + 'EventInfo') else: kwargs.setdefault('EventInfoKey', 'EventInfo') return CfgMgr.PileUpToolsAlg(name, **kwargs) else: return CfgMgr.DigitizationAlg(name, **kwargs)
def MergeRecoTimingObjTool(name="MergeRecoTimingObjTool", **kwargs): if digitizationFlags.doXingByXingPileUp(): # PileUpTool approach kwargs.setdefault("FirstXing", TimingObj_FirstXing()) kwargs.setdefault("LastXing", TimingObj_LastXing()) kwargs.setdefault("RecoTimingObjInputKey", "EVNTtoHITS_timings") if digitizationFlags.PileUpPremixing and 'OverlayMT' in digitizationFlags.experimentalDigi( ): from OverlayCommonAlgs.OverlayFlags import overlayFlags kwargs.setdefault("RecoTimingObjOutputKey", overlayFlags.bkgPrefix() + "EVNTtoHITS_timings") else: kwargs.setdefault("RecoTimingObjOutputKey", "EVNTtoHITS_timings") return CfgMgr.MergeRecoTimingObjTool(name, **kwargs)
def getGeantinoTruthInDetPileUpTools(): from AthenaCommon.DetFlags import DetFlags from Digitization.DigitizationFlags import digitizationFlags PileUpToolsList = [] unsupportedKeys = ['doFastPixelDigi', 'doLightPixelDigi', 'doSmearedPixelDigi', 'doFastSCT_Digi', 'doFastTRT_Digi'] if not set(unsupportedKeys).isdisjoint(set(digitizationFlags.experimentalDigi())): print "DigiAlgConfig.py ERROR The following digitizationFlags.experimentalDigi settings are not supported when digiSteeringConf is set to", digitizationFlags.digitSteeringConf.get_Value(), ": ", str(unsupportedKeys), " and will be ignored." if DetFlags.digitize.BCM_on(): PileUpToolsList += [ "BCM_DigitizationTool" ] if DetFlags.digitize.pixel_on(): PileUpToolsList += [ "PixelGeantinoTruthDigitizationTool" ] if DetFlags.digitize.SCT_on(): PileUpToolsList += [ "SCT_GeantinoTruthDigitizationTool" ] if DetFlags.digitize.TRT_on(): PileUpToolsList += [ "TRTGeantinoTruthDigitizationTool" ] return PileUpToolsList
def getNewMergeMcEventCollTool_Base(name="NewMergeMcEventCollTool_Base", **kwargs): if digitizationFlags.doXingByXingPileUp(): # PileUpTool approach kwargs.setdefault("FirstXing", -30000) kwargs.setdefault("LastXing", 30000) if digitizationFlags.PileUpPremixing and 'OverlayMT' in digitizationFlags.experimentalDigi( ): from OverlayCommonAlgs.OverlayFlags import overlayFlags kwargs.setdefault("TruthCollOutputKey", overlayFlags.bkgPrefix() + "TruthEvent") else: kwargs.setdefault("TruthCollOutputKey", "TruthEvent") kwargs.setdefault("TruthCollInputKey", "TruthEvent") if not digitizationFlags.doXingByXingPileUp(): # Algorithm approach kwargs.setdefault("PileUpMergeSvc", "PileUpMergeSvc") # Default `PileUpType` to "Unknown" kwargs.setdefault("PileUpType", -1) return CfgMgr.NewMergeMcEventCollTool(name, **kwargs)
def getStandardSignalOnlyTruthPileUpTools(): from AthenaCommon.DetFlags import DetFlags PileUpToolsList = [] if DetFlags.pileup.Truth_on(): from Digitization.DigitizationFlags import digitizationFlags if 'NewMerge' in digitizationFlags.experimentalDigi(): if not athenaCommonFlags.DoFullChain(): PileUpToolsList += ["NewMergeMcEventCollTool_Signal"] else: PileUpToolsList += ["SignalOnlyMcEventCollTool"] PileUpToolsList += ["MergeTruthJetsTool"] if not athenaCommonFlags.DoFullChain( ) and DetFlags.writeRDOPool.Muon_on( ): #possibly this should be digitize.Muon_on() PileUpToolsList += ["MergeMuonEntryLayerTool"] if DetFlags.writeRDOPool.Calo_on( ): #possibly this should be digitize.Calo_on() PileUpToolsList += ["MergeCalibHitsTool"] return PileUpToolsList
def getMergeTruthJetsTool(name="MergeTruthJetsTool", **kwargs): if digitizationFlags.doXingByXingPileUp(): # PileUpTool approach kwargs.setdefault("FirstXing", TruthJet_FirstXing()) kwargs.setdefault("LastXing", TruthJet_LastXing()) if digitizationFlags.PileUpPremixing and 'OverlayMT' in digitizationFlags.experimentalDigi( ): from OverlayCommonAlgs.OverlayFlags import overlayFlags kwargs.setdefault("InTimeOutputTruthJetCollKey", overlayFlags.bkgPrefix() + "InTimeAntiKt4TruthJets") kwargs.setdefault( "OutOfTimeTruthJetCollKey", overlayFlags.bkgPrefix() + "OutOfTimeAntiKt4TruthJets") else: kwargs.setdefault("InTimeOutputTruthJetCollKey", "InTimeAntiKt4TruthJets") kwargs.setdefault("OutOfTimeTruthJetCollKey", "OutOfTimeAntiKt4TruthJets") return CfgMgr.MergeTruthJetsTool(name, **kwargs)
def checkTRT_DigitizationConfiguration(): logDigiConfigChecker = logging.getLogger('DigiConfigChecker') from AthenaCommon.DetFlags import DetFlags if DetFlags.simulateLVL1.TRT_on(): from AthenaCommon.BeamFlags import jobproperties from Digitization.DigitizationFlags import digitizationFlags if (jobproperties.Beam.beamType != "cosmics") and ( 'RUNTRTLVL1' not in digitizationFlags.experimentalDigi()): DetFlags.simulateLVL1.TRT_setOff() logDigiConfigChecker.info( "Switching DetFlags.simulateLVL1.TRT_setOff()") logDigiConfigChecker.info( "Experts may enable LVL1 TrigT1TRT simulation by setting RUNTRTLVL1=True in a preExec or in their main job options." ) if DetFlags.simulateLVL1.TRT_on() and DetFlags.pileup.any_on(): logDigiConfigChecker.warning( "LVL1::TrigT1TRT is not pile-up-friendly using it in this case may significantly degrade performance." ) return
def getCalibRange(name="CalibRange", **kwargs): # bunch crossing range in ns kwargs.setdefault('FirstXing', CalibHit_FirstXing()) kwargs.setdefault('LastXing', CalibHit_LastXing()) ItemList = [] ItemList += [ "CaloCalibrationHitContainer#LArCalibrationHitActive", "CaloCalibrationHitContainer#LArCalibrationHitDeadMaterial", "CaloCalibrationHitContainer#LArCalibrationHitInactive" ] from Digitization.DigitizationFlags import digitizationFlags if 'OldTileCalibHitContainers' in digitizationFlags.experimentalDigi(): ItemList += [ "CaloCalibrationHitContainer#TileCalibrationCellHitCnt", "CaloCalibrationHitContainer#TileCalibrationDMHitCnt" ] else: ItemList += [ "CaloCalibrationHitContainer#TileCalibHitActiveCell", "CaloCalibrationHitContainer#TileCalibHitInactiveCell", "CaloCalibrationHitContainer#TileCalibHitDeadMaterial" ] kwargs.setdefault('ItemList', ItemList) return CfgMgr.PileUpXingFolder(name, **kwargs)
ServiceMgr.EventSelector.CollectionType = CollType except: print("Reading from file") SkipEvents=0 ServiceMgr.EventSelector.SkipEvents = SkipEvents #-------------------------------------------------------------- # Setup Output #-------------------------------------------------------------- if hasattr(runArgs, "outputRDO_MRGFile"): outputFile = runArgs.outputRDO_MRGFile else: outputFile = "DidNotSetOutputName.root" if digitizationFlags.PileUpPremixing and 'OverlayMT' in digitizationFlags.experimentalDigi(): from OverlayCommonAlgs.OverlayFlags import overlayFlags eventInfoKey = overlayFlags.bkgPrefix() + "EventInfo" else: eventInfoKey = "EventInfo" from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream StreamRDO = AthenaPoolOutputStream( "StreamRDO", outputFile, asAlg=True, noTag=True, eventInfoKey=eventInfoKey ) StreamRDO.TakeItemsFromInput=TRUE; # The next line is an example on how to exclude clid's if they are causing a problem #StreamRDO.ExcludeList = ['6421#*'] # Look for lists of filter algorithms try: StreamRDO.AcceptAlgs = AcceptList except:
def getSCT_SurfaceChargesGenerator(name="SCT_SurfaceChargesGenerator", **kwargs): ## Set up services used by SCT_SurfaceChargesGenerator ## TODO remove all this stuff and see if PixelDigitization works without it. # Setup the DCS folders and Svc used in the sctSiliconConditionsSvc from IOVDbSvc.CondDB import conddb if not conddb.folderRequested('/SCT/DCS/CHANSTAT'): conddb.addFolder("DCS_OFL", "/SCT/DCS/CHANSTAT") if not conddb.folderRequested('/SCT/DCS/MODTEMP'): conddb.addFolder("DCS_OFL", "/SCT/DCS/MODTEMP") if not conddb.folderRequested('/SCT/DCS/HV'): conddb.addFolder("DCS_OFL", "/SCT/DCS/HV") ## SCT_DCSConditionsSvc - used by SCT_SurfaceChargesGenerator from AthenaCommon.AppMgr import ServiceMgr if not hasattr(ServiceMgr, "InDetSCT_DCSConditionsSvc"): from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_DCSConditionsSvc InDetSCT_DCSConditionsSvc = SCT_DCSConditionsSvc( name="InDetSCT_DCSConditionsSvc") ServiceMgr += InDetSCT_DCSConditionsSvc ## SCT_SiPropertiesSvc - used by SCT_SurfaceChargesGenerator if not hasattr(ServiceMgr, "SCT_SiPropertiesSvc"): # Lorentz Angle Service from SiLorentzAngleSvc.LorentzAngleSvcSetup import lorentzAngleSvc # Silicon conditions service (set up by LorentzAngleSvcSetup) sctSiliconConditionsSvc = ServiceMgr.SCT_SiliconConditionsSvc # Silicon properties service from SiPropertiesSvc.SiPropertiesSvcConf import SiPropertiesSvc sctSiPropertiesSvc = SiPropertiesSvc( name="SCT_SiPropertiesSvc", DetectorName="SCT", SiConditionsServices=sctSiliconConditionsSvc) ServiceMgr += sctSiPropertiesSvc ## Charge trapping service - used by SCT_SurfaceChargesGenerator if not hasattr(ServiceMgr, "InDetSCT_RadDamageSummarySvc"): from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_RadDamageSummarySvc InDetSCT_RadDamageSummarySvc = SCT_RadDamageSummarySvc( name="InDetSCT_RadDamageSummarySvc") ServiceMgr += InDetSCT_RadDamageSummarySvc ## END OF JUNK kwargs.setdefault("FixedTime", -999) kwargs.setdefault("SubtractTime", -999) kwargs.setdefault("SurfaceDriftTime", 10) kwargs.setdefault("NumberOfCharges", 1) kwargs.setdefault("SmallStepLength", 5) kwargs.setdefault("DepletionVoltage", 70) kwargs.setdefault("BiasVoltage", 150) from AthenaCommon.GlobalFlags import globalflags kwargs.setdefault("isOverlay", globalflags.isOverlay()) from Digitization.DigitizationFlags import digitizationFlags if 'doDetailedSurfChargesGen' in digitizationFlags.experimentalDigi(): kwargs.setdefault("ChargeDriftModel", 1) kwargs.setdefault("EFieldModel", 2) kwargs.setdefault("MagneticField", -2.0) kwargs.setdefault("SensorTemperature", 273.15) kwargs.setdefault("TransportTimeStep", 0.25) kwargs.setdefault("TransportTimeMax", 25.0) from SCT_Digitization.SCT_DigitizationConf import SCT_DetailedSurfaceChargesGenerator return SCT_DetailedSurfaceChargesGenerator(name, **kwargs) else: from SCT_Digitization.SCT_DigitizationConf import SCT_SurfaceChargesGenerator return SCT_SurfaceChargesGenerator(name, **kwargs)