Exemplo n.º 1
0
def TrigLiveFractionCondAlgCfg(configFlags):
    name = 'TrigLiveFractionCondAlg'
    result = ComponentAccumulator()

    kwargs = {}
    if configFlags.IOVDb.DatabaseInstance == 'COMP200':
        folder = '/TRIGGER/LUMI/PerBcidDeadtime'

        # Mistakenly created as multi-version folder, must specify HEAD
        result.merge(
            addFolders(configFlags,
                       folder,
                       'TRIGGER',
                       tag='HEAD',
                       className='AthenaAttributeList'))

        kwargs['DeadtimeFolderInputKey'] = folder
        kwargs['LuminosityInputKey'] = 'LuminosityCondData'

        from LumiBlockComps.LuminosityCondAlgConfig import LuminosityCondAlgCfg
        result.merge(LuminosityCondAlgCfg(configFlags))

    else:
        kwargs['DeadtimeFolderInputKey'] = ''
        kwargs['LuminosityInputKey'] = ''

    TrigLiveFractionCondAlg = CompFactory.TrigLiveFractionCondAlg
    alg = TrigLiveFractionCondAlg(
        name, TrigLiveFractionOutputKey='TrigLiveFractionCondData', **kwargs)
    result.addCondAlgo(alg)
    return result
Exemplo n.º 2
0
def LArCellMonConfig(inputFlags):
    from AthenaCommon.Logging import logging
    mlog = logging.getLogger( 'LArCellMonConfig' )

    from AthenaMonitoring.AthMonitorCfgHelper import AthMonitorCfgHelper
    helper = AthMonitorCfgHelper(inputFlags,'LArCellMonAlgCfg')

    if not inputFlags.DQ.enableLumiAccess:
       mlog.warning('This algo needs Lumi access, returning empty config')
       from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
       cfg=ComponentAccumulator()
       cfg.merge(helper.result())
       return cfg

    from LArGeoAlgsNV.LArGMConfig import LArGMCfg
    cfg = LArGMCfg(inputFlags)
    from TileGeoModel.TileGMConfig import TileGMCfg
    cfg.merge(TileGMCfg(inputFlags))

    from DetDescrCnvSvc.DetDescrCnvSvcConfig import DetDescrCnvSvcCfg
    cfg.merge(DetDescrCnvSvcCfg(inputFlags))

    from LArCellRec.LArCollisionTimeConfig import LArCollisionTimeCfg
    cfg.merge(LArCollisionTimeCfg(inputFlags))

    from CaloTools.CaloNoiseCondAlgConfig import CaloNoiseCondAlgCfg
    cfg.merge(CaloNoiseCondAlgCfg(inputFlags))

    if inputFlags.Input.isMC is False:
      from LumiBlockComps.LuminosityCondAlgConfig import  LuminosityCondAlgCfg
      cfg.merge(LuminosityCondAlgCfg(inputFlags))
      from LumiBlockComps.LBDurationCondAlgConfig import  LBDurationCondAlgCfg
      cfg.merge(LBDurationCondAlgCfg(inputFlags))

    from AthenaConfiguration.ComponentFactory import CompFactory
    lArCellMonAlg=CompFactory.LArCellMonAlg

    algname='LArCellMonAlg'
    if inputFlags.Beam.Type == 'cosmics':
        algname=algname+'Cosmics'

    isCosmics = ( inputFlags.Beam.Type == 'cosmics' )
    LArCellMonConfigCore(helper, lArCellMonAlg,inputFlags, isCosmics, inputFlags.Input.isMC, algname)

    acc=helper.result()

    from AthenaMonitoring.AtlasReadyFilterConfig import AtlasReadyFilterCfg
    acc.getEventAlgo(algname).ReadyFilterTool = cfg.popToolsAndMerge(AtlasReadyFilterCfg(inputFlags))

    if not inputFlags.Input.isMC:
       from AthenaMonitoring.BadLBFilterToolConfig import LArBadLBFilterToolCfg
       acc.getEventAlgo(algname).BadLBTool=cfg.popToolsAndMerge(LArBadLBFilterToolCfg(inputFlags))

    cfg.merge(acc)

    return cfg
Exemplo n.º 3
0
def LumiBlockMuWriterCfg(configFlags, name='LumiBlockMuWriter'):
    result = ComponentAccumulator()

    if configFlags.Beam.Type == 'cosmics':
        condkey = ''
    else:
        from LumiBlockComps.LuminosityCondAlgConfig import LuminosityCondAlgCfg
        result.merge(LuminosityCondAlgCfg(configFlags))
        condkey = result.getCondAlgo('LuminosityCondAlg').LuminosityOutputKey

    LumiBlockMuWriter = CompFactory.LumiBlockMuWriter  # LumiBlockComps
    alg = LumiBlockMuWriter(name, LumiDataKey=condkey)
    result.addCondAlgo(alg)
    return result
Exemplo n.º 4
0
    def addAlgorithm(self, algClassOrObj, name=None, *args, **kwargs):
        '''
        Instantiate/add a monitoring algorithm

        Arguments:
        algClassOrObj -- the Configurable class object of the algorithm to create, or an instance
                         of the algorithm Configurable. The former is recommended.  In the former case,
                         the name argument is required.
        name -- the name of the algorithm to create. Required when passing a Configurable class object
                as algClassOrObj.  No effect if a Configurable instance is passed.
        *args, **kwargs -- additional arguments will be forwarded to the Configurable constructor if
                           a Configurable class object is passed. No effect if a Configurable instance
                           is passed.

        Returns:
        algObj -- an algorithm Configurable object
        '''
        from inspect import isclass
        if isclass(algClassOrObj):
            if name is None:
                raise TypeError(
                    'addAlgorithm with a class argument requires a name for the algorithm'
                )
            algObj = algClassOrObj(name, *args, **kwargs)
        else:
            algObj = algClassOrObj

        # configure these properties; users really should have no reason to override them
        algObj.Environment = self.inputFlags.DQ.Environment
        algObj.DataType = self.inputFlags.DQ.DataType
        if self.inputFlags.DQ.useTrigger:
            algObj.TrigDecisionTool = self.resobj.getPublicTool(
                "TrigDecisionTool")
            algObj.TriggerTranslatorTool = self.resobj.popToolsAndMerge(
                getTriggerTranslatorToolSimple(self.inputFlags))

        if not self.inputFlags.Input.isMC and self.inputFlags.DQ.enableLumiAccess:
            algObj.EnableLumi = True
            from LumiBlockComps.LuminosityCondAlgConfig import LuminosityCondAlgCfg
            from LumiBlockComps.LBDurationCondAlgConfig import LBDurationCondAlgCfg
            from LumiBlockComps.TrigLiveFractionCondAlgConfig import TrigLiveFractionCondAlgCfg
            self.resobj.merge(LuminosityCondAlgCfg(self.inputFlags))
            self.resobj.merge(LBDurationCondAlgCfg(self.inputFlags))
            self.resobj.merge(TrigLiveFractionCondAlgCfg(self.inputFlags))
        else:
            algObj.EnableLumi = False

        self.monSeq.Members.append(algObj)
        return algObj
Exemplo n.º 5
0
def CaloBCIDLumiCondAlgCfg(flags):
    result = ComponentAccumulator()

    from CaloRec.CaloBCIDCoeffsCondAlgConfig import CaloBCIDCoeffsCondAlgCfg
    result.merge(CaloBCIDCoeffsCondAlgCfg(flags))

    if flags.Input.isMC is False:
        from LumiBlockComps.LuminosityCondAlgConfig import LuminosityCondAlgCfg
        result.merge(LuminosityCondAlgCfg(flags))

    else:
        from LumiBlockComps.BunchCrossingCondAlgConfig import BunchCrossingCondAlgCfg
        result.merge(BunchCrossingCondAlgCfg(flags))

    CaloBCIDLumiCondAlg = CompFactory.CaloBCIDLumiCondAlg  # CaloRec
    alg = CaloBCIDLumiCondAlg('CaloBCIDLumiCondAlg',
                              CoeffsKey='CaloBCIDCoeffs',
                              BunchCrossingCondDataKey='BunchCrossingData',
                              LuminosityCondDataKey='LuminosityCondData',
                              isMC=flags.Input.isMC,
                              OutputLumiKey='CaloBCIDLumi')
    result.addCondAlgo(alg)

    return result
Exemplo n.º 6
0
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
from AthenaCommon import Logging
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaConfiguration.ComponentFactory import CompFactory

if __name__=="__main__":
    # Setting needed for the ComponentAccumulator to do its thing
    from AthenaCommon.Configurable import Configurable
    Configurable.configurableRun3Behavior=True
    
    # Set message levels
    from AthenaCommon import Constants
    msgLvl = "WARNING"
    from AthenaCommon.Logging import log
    log.setLevel(msgLvl)
    
    # Config flags steer the job at various levels
    from AthenaConfiguration.AllConfigFlags import ConfigFlags
    ConfigFlags.Input.isMC  = True
    ConfigFlags.Input.Files = ["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/ASG/mc16_13TeV.410501.PowhegPythia8EvtGen_A14_ttbar_hdamp258p75_nonallhad.merge.AOD.e5458_s3126_r9364_r9315/AOD.11182705._000001.pool.root.1"]
    
    # Flags relating to multithreaded execution
    nthreads=0
    ConfigFlags.Concurrency.NumThreads =nthreads
    if nthreads>0:
    	ConfigFlags.Concurrency.NumThreads = 1
    	ConfigFlags.Concurrency.NumConcurrentEvents = 1
    ConfigFlags.MET.UseTracks = True
    ConfigFlags.MET.DoPFlow = True
    if ConfigFlags.Beam.Type == 'cosmics' or ConfigFlags.Beam.Type == 'singlebeam':# used to have " or not rec.doInDet()" on the end
Exemplo n.º 7
0
    # Prevent the flags from being modified
    ConfigFlags.lock()

    # Get a ComponentAccumulator setting up the fundamental Athena job
    from AthenaConfiguration.MainServicesConfig import MainServicesCfg
    cfg = MainServicesCfg(ConfigFlags)

    # Add the components for reading in pool files
    from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
    cfg.merge(PoolReadCfg(ConfigFlags))

    # Nowadays the jet calibration tool requires the EventInfo
    # to be decorated with lumi info, which is not in Run 2 AODs
    from LumiBlockComps.LuminosityCondAlgConfig import LuminosityCondAlgCfg
    cfg.merge(LuminosityCondAlgCfg(ConfigFlags))

    from AthenaConfiguration.ComponentFactory import CompFactory
    muWriter = CompFactory.LumiBlockMuWriter("LumiBlockMuWriter",
                                             LumiDataKey="LuminosityCondData")
    cfg.addEventAlgo(muWriter, "AthAlgSeq")

    ########################################################################
    # Define flags steering the jet reco config
    jetdefs = DefineJetCollections(ConfigFlags)

    # Add the components from our jet reconstruction job
    cfg.merge(JetRecTestCfg(jetdefs, ConfigFlags, args))

    # Write what we produced to AOD
    # First define the output list