Пример #1
0
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
Пример #2
0
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