def MuonCaloTagToolCfg(flags, name='MuonCaloTagTool', **kwargs ): result = ComponentAccumulator() kwargs.setdefault("CaloMuonTagLoose", CompFactory.CaloMuonTag(name = "CaloMuonTagLoose", TagMode="Loose") ) kwargs.setdefault("CaloMuonTagTight", CompFactory.CaloMuonTag() ) result.addPublicTool(kwargs['CaloMuonTagLoose']) result.addPublicTool(kwargs['CaloMuonTagTight']) acc = CaloMuonLikelihoodToolCfg(flags) kwargs.setdefault("CaloMuonLikelihoodTool", acc.popPrivateTools() ) result.addPublicTool(kwargs['CaloMuonLikelihoodTool']) result.merge(acc) acc = CaloMuonScoreToolCfg(flags) kwargs.setdefault("CaloMuonScoreTool", acc.popPrivateTools() ) result.addPublicTool(kwargs['CaloMuonScoreTool']) result.merge(acc) acc = TrackDepositInCaloToolCfg(flags) trackDepositInCaloTool = acc.popPrivateTools() result.addPublicTool(trackDepositInCaloTool) kwargs.setdefault("TrackDepositInCaloTool", trackDepositInCaloTool ) result.merge(acc) acc = CaloTrkMuIdAlgTrackSelectorToolCfg(flags) calotrkmuidalgtrackselectortool = acc.popPrivateTools() result.addPublicTool(calotrkmuidalgtrackselectortool) kwargs.setdefault("TrackSelectorTool", calotrkmuidalgtrackselectortool ) result.merge(acc) kwargs.setdefault("doCaloLR", True) tool = CompFactory.MuonCombined.MuonCaloTagTool(name, **kwargs ) result.setPrivateTools(tool) return result
def getJetGroomAlg(jetname,groomdef,pjsin,modlist,monTool=None): jetlog.debug("Configuring JetAlgorithm \"jetalg_{0}\"".format(jetname)) from . import JetRecConfig builder = JetRecConfig.getJetBuilder() groomer = getJetGroomer(groomdef,pjsin) groomer.JetBuilder = builder from . import JetModConfig mods = [] # Dependency resolution should be done externally for moddef,modspec in modlist: mod = JetModConfig.getModifier(groomdef,moddef,modspec) mods.append(mod) rectool = CompFactory.JetRecTool(jetname, JetGroomer=groomer, InputContainer=groomdef.ungroomedname, OutputContainer=jetname, JetPseudojetRetriever=CompFactory.JetPseudojetRetriever("jpjretriever"), JetModifiers=mods) if monTool: rectool.MonTool = monTool jetalg = CompFactory.JetAlgorithm("jetalg_"+jetname) jetalg.Tools = [rectool] return jetalg
def BadLBFilterToolCfg(inputFlags,name, defects, alwaysReturnTrue=False, ignoreRecoverable=False, origDbTag=None): """ Configure an instance of the bad LB filter tool. If called twice with the same options, will return the same instance. Arguments: - name: name of *algorithm* instance to create - defects: the defects to use for LB rejection. Tool will return false if any of these defects is present. These may be virtual defects. NOTE: the value you pass must be a 'hashable' type. The best choice is to pass a tuple; you can create a tuple from any iterable object with tuple(obj). - alwaysReturnTrue (optional; default=False): if True, the tool will never reject any LBs. - ignoreRecoverable (optional; default=False): if True, the tool will ignore defects that are marked as recoverable - origDbTag (optional): if set, will override automatic configuration of database tag (only for testing) """ log = logging.getLogger('BadLBFilterToolCfg') result=ComponentAccumulator() if inputFlags.Common.isOnline or inputFlags.Input.isMC: # if online or MC, we don't want to do any filtering, or even access log.info('Disabling bad LB filter tool due to inappropriate environment; returning dummy') result.setPrivateTools(CompFactory.DQDummyFilterTool(name)) return result sgkey = 'DQBadLBFilterAlgResult_%s' % name #Schedule required cond-algo result.merge(BadLBFilterAlgCfg(inputFlags,name,defects,sgkey,ignoreRecoverable, origDbTag)) monFilterTool=CompFactory.DQBadLBFilterTool(name,alwaysReturnTrue=alwaysReturnTrue, ReadKey= sgkey) result.setPrivateTools(monFilterTool) return result
def __init__(self, name='L1Decoder', *args, **kwargs): super(L1Decoder, self).__init__(name, *args, **kwargs) from TriggerJobOpts.TriggerFlags import TriggerFlags # CTP unpacker ctpUnpacker = CompFactory.CTPUnpackingTool() self.ctpUnpacker = ctpUnpacker from TrigEDMConfig.TriggerEDMRun3 import recordable self.roiUnpackers += [ CompFactory.FSRoIsUnpackingTool("FSRoIsUnpackingTool", Decisions=mapThresholdToL1DecisionCollection("FSNOSEED"), OutputTrigRoIs = recordable(mapThresholdToL1RoICollection("FSNOSEED") )) ] # EM unpacker if TriggerFlags.doID() or TriggerFlags.doCalo(): unpackers, rerunUnpackers = createCaloRoIUnpackers() self.roiUnpackers += unpackers self.rerunRoiUnpackers += rerunUnpackers # MU unpacker if TriggerFlags.doMuon(): unpackers, rerunUnpackers = createMuonRoIUnpackers() self.roiUnpackers += unpackers self.rerunRoiUnpackers += rerunUnpackers self.prescaler = createPrescalingTool() from AthenaConfiguration.AllConfigFlags import ConfigFlags as flags self.DoCostMonitoring = flags.Trigger.CostMonitoring.doCostMonitoring self.CostMonitoringChain = flags.Trigger.CostMonitoring.chain self.L1DecoderSummaryKey = "L1DecoderSummary"
def SCT_MonitorConditionsToolCfg(flags, name="InDetSCT_MonitorConditionsTool", cond_kwargs={}, **kwargs): cond_kwargs.setdefault("Folder", "/SCT/Derived/Monitoring") cond_kwargs.setdefault("dbInstance", "SCT_OFL") cond_kwargs.setdefault("MonitorCondAlgName", "SCT_MonitorCondAlg") result = ComponentAccumulator() if "FolderDb" not in cond_kwargs: cond_kwargs["FolderDb"] = cond_kwargs["Folder"] result.merge( addFolders(flags, cond_kwargs["FolderDb"], cond_kwargs["dbInstance"], className="CondAttrListCollection")) result.addCondAlgo( CompFactory.SCT_MonitorCondAlg(name=cond_kwargs["MonitorCondAlgName"], ReadKey=cond_kwargs["Folder"])) tool = CompFactory.SCT_MonitorConditionsTool(name, **kwargs) result.setPrivateTools(tool) return result
def createCaloRoIUnpackers(): #from L1Decoder.L1DecoderConf import EMRoIsUnpackingTool, METRoIsUnpackingTool, JRoIsUnpackingTool, RerunRoIsUnpackingTool, TAURoIsUnpackingTool from L1Decoder.L1DecoderMonitoring import RoIsUnpackingMonitoring from TrigEDMConfig.TriggerEDMRun3 import recordable emUnpacker = CompFactory.EMRoIsUnpackingTool(Decisions = mapThresholdToL1DecisionCollection("EM"), OutputTrigRoIs = recordable(mapThresholdToL1RoICollection("EM")), MonTool = RoIsUnpackingMonitoring( prefix="EM", maxCount=30 )) # emUnpacker.MonTool = RoIsUnpackingMonitoring( prefix="EM", maxCount=30 ) emRerunUnpacker = CompFactory.RerunRoIsUnpackingTool("EMRerunRoIsUnpackingTool", SourceDecisions=mapThresholdToL1DecisionCollection("EM"), Decisions="HLTNav_RerunL1EM" ) metUnpacker = CompFactory.METRoIsUnpackingTool(Decisions = mapThresholdToL1DecisionCollection("XE")) tauUnpacker = CompFactory.TAURoIsUnpackingTool(Decisions = mapThresholdToL1DecisionCollection("TAU"), OutputTrigRoIs = recordable("HLT_TAURoI")) tauUnpacker.MonTool = RoIsUnpackingMonitoring( prefix="TAU", maxCount=30 ) jUnpacker = CompFactory.JRoIsUnpackingTool(Decisions = mapThresholdToL1DecisionCollection("J"), OutputTrigRoIs = recordable(mapThresholdToL1RoICollection("J")) ) jUnpacker.MonTool = RoIsUnpackingMonitoring( prefix="J", maxCount=30 ) return [emUnpacker, metUnpacker, tauUnpacker, jUnpacker ],[emRerunUnpacker]
def JetGroomAlgCfg(ConfigFlags, buildjetsname, groomjetsname): groomcfg = ComponentAccumulator() # Create a sequence that holds a set of algorithms # -- mainly for understanding how chunks of the job # relate to each other sequencename = "JetGroomSeq" groomcfg.addSequence(CompFactory.AthSequencer(sequencename)) # Create the JetGroomer, provide it with a JetTrimmer jtrim = CompFactory.JetTrimming("trimSmallR2Frac5", RClus=0.2, PtFrac=0.05) jtrim.UngroomedJets = buildjetsname jtrim.ParentPseudoJets = "PseudoJetMerged_" + buildjetsname # Create the JetRecAlg, configure it to use the builder # using constructor syntax instead # (equivalent to setting properties with "=") jra = CompFactory.JetRecAlg( "JRA_trim", Provider=jtrim, # Single ToolHandle Modifiers=[], # ToolHandleArray OutputContainer=groomjetsname) # Add the alg to the ComponentAccumulator in the named sequence groomcfg.addEventAlgo(jra, sequencename) return groomcfg
def JetCopyAlgCfg(ConfigFlags, buildjetsname, copyjetsname): copycfg = ComponentAccumulator() # Create a sequence that holds a set of algorithms # -- mainly for understanding how chunks of the job # relate to each other sequencename = "JetCopySeq" copycfg.addSequence(CompFactory.AthSequencer(sequencename)) # Create the JetCopier, set some standard options jcopy = CompFactory.JetCopier("copier") jcopy.InputJets = buildjetsname # Add a simple jet modifier to the JetRecAlg jclsmoms = CompFactory.JetClusterMomentsTool("clsmoms", JetContainer=copyjetsname) # Create the JetRecAlg, configure it to use the copier # using constructor syntax instead # (equivalent to setting properties with "=") jra = CompFactory.JetRecAlg( "JRA_copy", Provider=jcopy, # Single ToolHandle Modifiers=[jclsmoms], # ToolHandleArray OutputContainer=copyjetsname) # Add the alg to the ComponentAccumulator in the named sequence copycfg.addEventAlgo(jra, sequencename) return copycfg
def MetaDataSvcCfg(flags, toolNames=[]): # should cover most use cases (POOL, RAW) when called with appropriate toolNames argument from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory from six import string_types result = ComponentAccumulator() result.addService(CompFactory.StoreGateSvc("MetaDataStore")) result.addService(CompFactory.StoreGateSvc("InputMetaDataStore")) svc = CompFactory.MetaDataSvc("MetaDataSvc") svc.MetaDataContainer = "MetaDataHdr" result.addService(svc) result.addService( CompFactory.ProxyProviderSvc(ProviderNames=["MetaDataSvc"])) for name in toolNames: if not isinstance(name, string_types): from AthenaCommon.Logging import logging log = logging.getLogger("MetaDataSvcConfig") log.error( 'Attempted to pass a non-string argument as a metadata tool name' ) continue thistool = CompFactory.getComps(name)[0]() result.addPublicTool(thistool) svc.MetaDataTools += [thistool] return result
def TileDSP_ThresholdCondAlgCfg(flags, **kwargs): """Return component accumulator with configured Tile DSP threshold conditions algorithm Arguments: flags -- Athena configuration flags (ConfigFlags) Keyword arguments: Source -- source of Tile auto correlation conditions (COOL, FILE). Defaults to COOL. TileDSP_Threshold -- name of Tile auto correlation conditions object. Defaults to TileDSP_Threshold. """ acc = ComponentAccumulator() source = kwargs.get('Source', 'COOL') dspThreshold = kwargs.get('TileDSP_Threshold', 'TileDSP_Threshold') name = dspThreshold + 'CondAlg' if source == 'COOL': # Connect COOL Tile conditions proxies to the algorithm (default) from TileConditions.TileFolders import TileFolders folders = TileFolders(isMC=flags.Input.isMC, isOnline=flags.Common.isOnline) if flags.IOVDb.DatabaseInstance == 'CONDBR2': dspThresholdFolder = folders.addSplitOnline( '/TILE/ONL01/DSP/THRESHOLD', '/TILE/OFL02/DSP/THRESHOLD') else: raise (Exception("No Tile DSP threshold folder in %s" % flags.IOVDb.DatabaseInstancea)) TileCondProxyCoolFlt = CompFactory.getComp( "TileCondProxyCool<TileCalibDrawerFlt>") dspThresholdProxy = TileCondProxyCoolFlt( 'TileCondProxyCool_DspThreshold', Source=dspThresholdFolder) from IOVDbSvc.IOVDbSvcConfig import addFolderList acc.merge(addFolderList(flags, folders.get())) elif source == 'FILE': # Connect FILE Tile conditions proxies to the algorithm TileCondProxyFileFlt = CompFactory.getComp( "TileCondProxyFile<TileCalibDrawerFlt>") dspThresholdProxy = TileCondProxyFileFlt( 'TileCondProxyFile_DspThreshold', Source='TileDefault.dspThreshold') else: raise (Exception("Invalid source: %s" % source)) TileCalibFltCondAlg = CompFactory.getComp( "TileCalibCondAlg<TileCalibDrawerFlt>") dspThresholdCondAlg = TileCalibFltCondAlg( name=name, ConditionsProxy=dspThresholdProxy, TileCalibData=dspThreshold) acc.addCondAlgo(dspThresholdCondAlg) return acc
def CaloMuonScoreToolCfg(flags, name='CaloMuonScoreTool', **kwargs ): from TrackToCalo.TrackToCaloConfig import ParticleCaloCellAssociationToolCfg result = ParticleCaloCellAssociationToolCfg(flags) kwargs.setdefault("ParticleCaloCellAssociationTool", result.popPrivateTools()) caloMuonScoreSvc = CompFactory.CaloMuonScoreONNXRuntimeSvc(name="CaloMuonScoreONNXRuntimeSvc") result.addService(caloMuonScoreSvc) tool = CompFactory.CaloMuonScoreTool(name, **kwargs ) result.setPrivateTools(tool) return result
def clusterFSInputMaker(): """Creates the inputMaker for FS in menu""" RoIs = 'HLT_FSJETRoI' from AthenaConfiguration.ComponentFactory import CompFactory InputMakerAlg = CompFactory.InputMakerForRoI("IMclusterFS", RoIsLink="initialRoI") InputMakerAlg.RoITool = CompFactory.ViewCreatorInitialROITool() InputMakerAlg.RoIs = RoIs return InputMakerAlg
def fastCaloEVCreator(): InViewRoIs = "EMCaloRoIs" fastCaloViewsMaker = CompFactory.EventViewCreatorAlgorithm("IMfastCalo") fastCaloViewsMaker.ViewFallThrough = True fastCaloViewsMaker.RoIsLink = "initialRoI" fastCaloViewsMaker.RoITool = CompFactory.ViewCreatorInitialROITool() fastCaloViewsMaker.InViewRoIs = InViewRoIs fastCaloViewsMaker.Views = "EMCaloViews" fastCaloViewsMaker.ViewNodeName = "fastCaloInViewSequence" return (fastCaloViewsMaker, InViewRoIs)
def JetTrackingSequence(dummyFlags, trkopt, RoIs): jetTrkSeq = parOR("JetTrackingSeq_" + trkopt, []) tracksname = "" verticesname = "" if trkopt == "ftf": from TrigInDetConfig.InDetSetup import makeInDetAlgsNoView # Guess FS rather than making it jet-specific? viewAlgs = makeInDetAlgsNoView("JetFS", "FS", rois=recordable(RoIs)) jetTrkSeq += viewAlgs tracksname = recordable("HLT_IDTrack_FS_FTF") verticesname = recordable("HLT_IDVertex_FS") from TrigInDetConfig.TrigInDetPriVtxConfig import makeVertices vtxAlgs = makeVertices("jet", tracksname, verticesname) prmVtx = vtxAlgs[-1] jetTrkSeq += prmVtx tvaname = "JetTrackVtxAssoc_" + trkopt trkcolls = { "Tracks": tracksname, "Vertices": verticesname, "TVA": tvaname, } from JetRecTools.JetRecToolsConfig import trackcollectionmap if trkopt not in trackcollectionmap.keys(): trackcollectionmap[trkopt] = trkcolls # Jet track selection jettrackselloose = getTrackSelTool(trkopt, doWriteTracks=True) jettracksname = jettrackselloose.OutputContainer jettvassoc = getTrackVertexAssocTool(trkopt) trackcollectionmap[trkopt]["JetTracks"] = jettracksname trackcollectionmap[trkopt]["TVA"] = tvaname jettrkprepalg = CompFactory.JetAlgorithm("jetalg_TrackPrep") jettrkprepalg.Tools = [jettrackselloose, jettvassoc] jetTrkSeq += conf2toConfigurable(jettrkprepalg) label = "GhostTrack_{}".format(trkopt) ghosttracksname = "PseudoJet{}".format(label) trackcollectionmap[trkopt]["GhostTracks"] = ghosttracksname trackcollectionmap[trkopt]["GhostTracksLabel"] = label pjgalg = CompFactory.PseudoJetAlgorithm("pjgalg_" + label, InputContainer=tracksname, OutputContainer=ghosttracksname, Label=label, SkipNegativeEnergy=True) jetTrkSeq += conf2toConfigurable(pjgalg) return jetTrkSeq, trkcolls
def AtlasReadyFilterCfg(flags): result=ComponentAccumulator() if flags.Common.isOnline or flags.Input.isMC or flags.Beam.Type != 'collisions' or flags.DQ.disableAtlasReadyFilter: result.setPrivateTools(CompFactory.DQDummyFilterTool()) else: from IOVDbSvc.IOVDbSvcConfig import addFolders result.merge(addFolders(flags,'/TDAQ/RunCtrl/DataTakingMode','TDAQ',className='AthenaAttributeList')) result.setPrivateTools(CompFactory.DQAtlasReadyFilterTool()) return result
def TileMuIDCondAlgCfg(flags, **kwargs): """Return component accumulator with configured Tile MuID conditions algorithm Arguments: flags -- Athena configuration flags (ConfigFlags) Keyword arguments: Source -- source of Tile MuID conditions (COOL, FILE). Defaults to COOL. TileMuID -- name of Tile MuID conditions object. Defaults to TileMuID. """ acc = ComponentAccumulator() source = kwargs.get('Source', 'COOL') muID = kwargs.get('TileMuID', 'TileMuID') name = muID + 'CondAlg' if source == 'COOL': # Connect COOL Tile conditions proxies to the algorithm (default) from TileConditions.TileFolders import TileFolders folders = TileFolders(isMC=flags.Input.isMC, isOnline=flags.Common.isOnline) muIDFolder = folders.addSplitMC('/TILE/ONL01/MUID', '/TILE/ONL01/MUID') TileCondProxyCoolFlt = CompFactory.getComp( "TileCondProxyCool<TileCalibDrawerFlt>") muIDProxy = TileCondProxyCoolFlt('TileCondProxyCool_MuID', Source=muIDFolder) from IOVDbSvc.IOVDbSvcConfig import addFolderList acc.merge(addFolderList(flags, folders.get())) elif source == 'FILE': # Connect FILE Tile conditions proxies to the algorithm TileCondProxyFileFlt = CompFactory.getComp( "TileCondProxyFile<TileCalibDrawerFlt>") muIDProxy = TileCondProxyFileFlt('TileCondProxyFile_MuID', Source='TileDefault.muid') else: raise (Exception("Invalid source: %s" % source)) TileCalibFltCondAlg = CompFactory.getComp( "TileCalibCondAlg<TileCalibDrawerFlt>") muIDCondAlg = TileCalibFltCondAlg(name=name, ConditionsProxy=muIDProxy, TileCalibData=muID) acc.addCondAlgo(muIDCondAlg) return acc
def createMuonRoIUnpackers(): #from L1Decoder.L1DecoderConf import MURoIsUnpackingTool, RerunRoIsUnpackingTool from L1Decoder.L1DecoderMonitoring import RoIsUnpackingMonitoring from TrigEDMConfig.TriggerEDMRun3 import recordable muUnpacker = CompFactory.MURoIsUnpackingTool(Decisions = mapThresholdToL1DecisionCollection("MU"), OutputTrigRoIs = recordable(mapThresholdToL1RoICollection("MU"))) muUnpacker.MonTool = RoIsUnpackingMonitoring( prefix="MU", maxCount=20 ) muRerunUnpacker = CompFactory.RerunRoIsUnpackingTool("MURerunRoIsUnpackingTool", SourceDecisions=mapThresholdToL1DecisionCollection("MU"), Decisions="HLTNav_RerunL1MU" ) return [muUnpacker],[muRerunUnpacker]
def getEventShapeAlg(constit, constitpjkey, evsprefix=""): rhokey = evsprefix + "Kt4" + constit.label + "EventShape" rhotoolname = "EventDensity_{}Kt4{}".format(evsprefix, constit.label) rhotool = CompFactory.EventDensityTool(rhotoolname) rhotool.InputContainer = constitpjkey rhotool.OutputContainer = rhokey eventshapealg = CompFactory.EventDensityAthAlg("{0}{1}Alg".format( evsprefix, rhotoolname)) eventshapealg.EventDensityTool = rhotool return eventshapealg
def TileIntegratorCondAlgCfg(flags, **kwargs): """Return component accumulator with configured Tile integrator conditions algorithm Arguments: flags -- Athena configuration flags (ConfigFlags) Keyword arguments: Source -- source of Tile integrator conditions (COOL, FILE). Defaults to COOL. TileIntegrator -- name of Tile integrator conditions object. Defaults to TileIntegrator. """ acc = ComponentAccumulator() source = kwargs.get('Source', 'COOL') integrator = kwargs.get('TileIntegrator', 'TileIntegrator') name = integrator + 'CondAlg' if source == 'COOL': # Connect COOL Tile conditions proxies to the algorithm (default) from TileConditions.TileFolders import TileFolders folders = TileFolders(isMC = flags.Input.isMC, isOnline = flags.Common.isOnline) if flags.IOVDb.DatabaseInstance == 'CONDBR2': integratorFolder = folders.addSplitOnline('/TILE/ONL01/INTEGRATOR', '/TILE/OFL02/INTEGRATOR') else: integratorFolder = folders.addSplitOnline('/TILE/OFL01/INTEGRATOR', '/TILE/OFL02/INTEGRATOR') TileCondProxyCoolFlt=CompFactory.getComp("TileCondProxyCool<TileCalibDrawerFlt>") integratorProxy = TileCondProxyCoolFlt('TileCondProxyCool_Integrator', Source = integratorFolder) from IOVDbSvc.IOVDbSvcConfig import addFolderList acc.merge( addFolderList(flags, folders.get()) ) elif source == 'FILE': # Connect FILE Tile conditions proxies to the algorithm TileCondProxyFileFlt=CompFactory.getComp("TileCondProxyFile<TileCalibDrawerFlt>") integratorProxy = TileCondProxyFileFlt('TileCondProxyFile_Integrator', Source = 'TileDefault.int') else: raise(Exception("Invalid source: %s" % source)) TileCalibFltCondAlg=CompFactory.getComp("TileCalibCondAlg<TileCalibDrawerFlt>") integratorCondAlg = TileCalibFltCondAlg( name = name, ConditionsProxy = integratorProxy, TileCalibData = integrator) acc.addCondAlgo(integratorCondAlg) return acc
def LArNoisyROSummaryCfg(configFlags): result = ComponentAccumulator() result.merge(LArKnownBadFebCfg(configFlags)) result.merge(LArKnownMNBFebCfg(configFlags)) # now configure the algorithm try: LArNoisyROAlg, LArNoisyROTool = CompFactory.getComps( "LArNoisyROAlg", "LArNoisyROTool") except Exception: import traceback print(traceback.format_exc()) return result theLArNoisyROTool = LArNoisyROTool( CellQualityCut=larNoisyROFlags.CellQualityCut(), BadChanPerFEB=larNoisyROFlags.BadChanPerFEB(), BadFEBCut=larNoisyROFlags.BadFEBCut(), MNBLooseCut=larNoisyROFlags.MNBLooseCut(), MNBTightCut=larNoisyROFlags.MNBTightCut(), MNBTight_PsVetoCut=larNoisyROFlags.MNBTight_PsVetoCut()) result.setPrivateTools(theLArNoisyROTool) theLArNoisyROAlg = LArNoisyROAlg() theLArNoisyROAlg.Tool = result.popPrivateTools() result.addEventAlgo(theLArNoisyROAlg) return result
def RenameHLTaggerCfg(JetCollection, Tagger, suffix): acc = ComponentAccumulator() AddressRemappingSvc, ProxyProviderSvc = CompFactory.getComps( "AddressRemappingSvc", "ProxyProviderSvc", ) AddressRemappingSvc = AddressRemappingSvc("AddressRemappingSvc") AddressRemappingSvc.TypeKeyRenameMaps += [ 'xAOD::BTaggingAuxContainer#BTagging_' + JetCollection + '.' + Tagger + '_pu->BTagging_' + JetCollection + '.' + Tagger + '_pu' + suffix ] AddressRemappingSvc.TypeKeyRenameMaps += [ 'xAOD::BTaggingAuxContainer#BTagging_' + JetCollection + '.' + Tagger + '_pc->BTagging_' + JetCollection + '.' + Tagger + '_pc' + suffix ] AddressRemappingSvc.TypeKeyRenameMaps += [ 'xAOD::BTaggingAuxContainer#BTagging_' + JetCollection + '.' + Tagger + '_pb->BTagging_' + JetCollection + '.' + Tagger + '_pb' + suffix ] AddressRemappingSvc.TypeKeyRenameMaps += [ 'xAOD::BTaggingAuxContainer#BTagging_' + JetCollection + '.' + Tagger + '_ptau->BTagging_' + JetCollection + '.' + Tagger + '_ptau' + suffix ] acc.addService(AddressRemappingSvc) acc.addService(ProxyProviderSvc(ProviderNames=["AddressRemappingSvc"])) return acc
def RoIBResultToxAODCfg(flags, seqName=''): if flags.Trigger.enableL1Phase1 and not flags.Trigger.enableL1CaloLegacy: # No Run-2 L1 RoIs -> nothing to covert to xAOD -> don't add RoIBResultToxAOD return ComponentAccumulator() acc = ComponentAccumulator(sequenceName=seqName) alg = CompFactory.RoIBResultToxAOD('RoIBResultToxAOD') alg.DoMuon = not flags.Trigger.enableL1Phase1 alg.DoCalo = flags.Trigger.enableL1CaloLegacy acc.addEventAlgo(alg, sequenceName=seqName) if flags.Input.Format == 'BS': from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg typeNames = [ 'xAOD::JetElementContainer/JetElements', 'xAOD::JetElementAuxContainer/JetElementsAux.', 'xAOD::CPMTowerContainer/CPMTowers', 'xAOD::CPMTowerAuxContainer/CPMTowersAux.' ] acc.merge(ByteStreamReadCfg(flags, typeNames)) # Create output list to return for use by the caller outputList = [] if alg.DoMuon: outputList += [("xAOD::MuonRoIContainer", alg.xAODKeyMuon)] if alg.DoCalo: outputList += [("xAOD::EmTauRoIContainer", alg.xAODKeyEmTau), ("xAOD::EnergySumRoI", alg.xAODKeyEsum), ("xAOD::JetEtRoI", alg.xAODKeyJetEt), ("xAOD::JetRoIContainer", alg.xAODKeyJet)] return acc, outputList
def getJetBuilder(doArea=True): # Do we have any reasons for not using the area one? # Maybe CPU reduction if we don't need areas for calibration builder = CompFactory.JetFromPseudojet("jetbuild") if doArea: builder.Attributes = ["ActiveArea", "ActiveAreaFourVector"] return builder
def BCM_ZeroSuppressionCfg(flags, **kwargs): acc = ComponentAccumulator() kwargs.setdefault("BcmContainerName", "BCM_RDOs") algo = CompFactory.BCM_ZeroSuppression("InDetBCM_ZeroSuppression", **kwargs) acc.addEventAlgo(algo, primary=True) return acc
def L1TriggerByteStreamDecoderCfg(flags): from AthenaCommon.Configurable import Configurable cb = Configurable.configurableRun3Behavior Configurable.configurableRun3Behavior += 1 decoderTools = [] if flags.Trigger.enableL1CaloLegacy or not flags.Trigger.enableL1Phase1: roibResultTool = RoIBResultByteStreamToolCfg( name="RoIBResultBSDecoderTool", writeBS=False) decoderTools += [roibResultTool] if flags.Trigger.enableL1Phase1: # Placeholder for real decoder tools - now it's just an example exampleTool = ExampleL1TriggerByteStreamToolCfg( name="L1MuonBSDecoderTool", writeBS=False) decoderTools += [exampleTool] decoderAlg = CompFactory.L1TriggerByteStreamDecoderAlg( name="L1TriggerByteStreamDecoder", DecoderTools=decoderTools) acc = ComponentAccumulator() acc.addEventAlgo(decoderAlg, primary=True) Configurable.configurableRun3Behavior = cb return acc
def SCT_CablingToolCfg(flags): from SCT_Cabling.SCT_CablingConfig import SCT_CablingCondAlgCfg result = SCT_CablingCondAlgCfg(flags) tool = CompFactory.SCT_CablingTool() result.setPrivateTools(tool) return result
def SCT_SurfaceChargesGeneratorCfg(flags, name="SCT_SurfaceChargesGenerator", **kwargs): """Return ComponentAccumulator with configured surface charges tool""" acc = ComponentAccumulator() 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("isOverlay", flags.Detector.Overlay) # kwargs.setdefault("doTrapping", True) # ATL-INDET-INT-2016-019 # experimental SCT_DetailedSurfaceChargesGenerator config dropped here SCT_SurfaceChargesGenerator, SCT_RadDamageSummaryTool = CompFactory.getComps( "SCT_SurfaceChargesGenerator", "SCT_RadDamageSummaryTool", ) tool = SCT_SurfaceChargesGenerator(name, **kwargs) tool.RadDamageSummaryTool = SCT_RadDamageSummaryTool() DCSCondTool = acc.popToolsAndMerge(SCT_DCSConditionsCfg(flags)) SiliCondTool = SCT_SiliconConditionsToolCfg(flags) SiliCondAcc = SCT_SiliconConditionsCfg(flags, DCSConditionsTool=DCSCondTool) SiliPropsAcc = SCT_SiPropertiesCfg(flags, SiConditionsTool=SiliCondTool) acc.merge(SiliCondAcc) tool.SiConditionsTool = SiliCondTool tool.SiPropertiesTool = acc.popToolsAndMerge(SiliPropsAcc) tool.LorentzAngleTool = acc.popToolsAndMerge(SCT_LorentzAngleCfg(flags)) acc.setPrivateTools(tool) return acc
def SCT_FlaggedConditionToolCfg(flags, name="SCT_FlaggedConditionTool", **kwargs): tool = CompFactory.SCT_FlaggedConditionTool(name, **kwargs) result = ComponentAccumulator() result.setPrivateTools(tool) return result
def LArCollisionTimeMonConfig(inputFlags): '''Function to configures some algorithms in the monitoring system.''' # The following class will make a sequence, configure algorithms, and link them to GenericMonitoringTools from AthenaMonitoring.AthMonitorCfgHelper import AthMonitorCfgHelper helper = AthMonitorCfgHelper(inputFlags, 'LArCollisionTimeMonAlgCfg') from LArCellRec.LArCollisionTimeConfig import LArCollisionTimeCfg cfg = LArCollisionTimeCfg(inputFlags) larColTime_hist_path = 'LArCollisionTimeNewAlg' from AthenaConfiguration.ComponentFactory import CompFactory LArCollisionTimeMonConfigCore(helper, CompFactory.LArCollisionTimeMonAlg, inputFlags, larColTime_hist_path) larClusColTime_hist_path = 'LArClusterCollisionTimeNewAlg' LArCollisionTimeMonConfigCore( helper, CompFactory.LArCollisionTimeMonAlg('LArClusterCollisionTimeMonAlg'), inputFlags, larClusColTime_hist_path) for algo in helper.monSeq.Members: if algo.name == 'LArClusterCollisionTimeMonAlg': algo.Key = "ClusterCollTime" algo.nCells = 0 cfg.merge(helper.result()) return cfg
def FastShowerCellBuilderToolBaseCfg(flags, name, **kwargs): acc = RNG(flags.Random.Engine) acc.merge( addFolders(flags, "/GLOBAL/AtlfastII/FastCaloSimParam", "GLOBAL_OFL", tag="FastCaloSim_v2")) localFileNameList = AdditionalParticleParametrizationFileNames() localFileNameList.insert(0, "L1_L2_egamma_corr.config20.root") kwargs.setdefault("AdditionalParticleParametrizationFileNames", localFileNameList) kwargs.setdefault("RandomService", acc.getService("AthRNGSvc")) kwargs.setdefault("RandomStreamName", "AthRNGSvc") kwargs.setdefault("DoSimulWithInnerDetectorTruthOnly", True) kwargs.setdefault("ID_cut_off_r", [1150]) kwargs.setdefault("ID_cut_off_z", [3490]) kwargs.setdefault("DoSimulWithInnerDetectorV14TruthCuts", True) kwargs.setdefault("DoNewEnergyEtaSelection", True) kwargs.setdefault("DoEnergyInterpolation", True) kwargs.setdefault("use_Ekin_for_depositions", True) kwargs.setdefault("McLocation", flags.Sim.FastShower.InputCollection) kwargs.setdefault("ParticleParametrizationFileName", "") kwargs.setdefault("Extrapolator", NITimedExtrapolatorCfg(flags)) # New kwarg from old FastCaloSimFactory kwargs.setdefault("CaloEntrance", TrkDetFlags.InDetContainerName()) ####################################################################################################### #theFastShowerCellBuilderTool.Invisibles=[12, 14, 16, 1000022] ######################################################################################################### acc.setPrivateTools(CompFactory.FastShowerCellBuilderTool(name, **kwargs)) return acc