![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
|
def | BadLBFilterAlgCfg (inputFlags, name, defects, writekey, ignoreRecoverable=False, origDbTag=None) |
|
def | BadLBFilterToolCfg (inputFlags, name, defects, alwaysReturnTrue=False, ignoreRecoverable=False, origDbTag=None) |
|
def | LArDefectList (inputFlags, origDbTag=None) |
|
def | LArBadLBFilterToolCfg (inputFlags, origDbTag=None) |
|
◆ BadLBFilterAlgCfg()
def python.BadLBFilterToolConfig.BadLBFilterAlgCfg |
( |
|
inputFlags, |
|
|
|
name, |
|
|
|
defects, |
|
|
|
writekey, |
|
|
|
ignoreRecoverable = False , |
|
|
|
origDbTag = None |
|
) |
| |
Definition at line 11 of file BadLBFilterToolConfig.py.
11 def BadLBFilterAlgCfg(inputFlags,name, defects, writekey, ignoreRecoverable=False, origDbTag=None):
12 log = logging.getLogger(
'BadLBFilterAlgCfg')
15 from DQDefects
import DefectsDB
16 ddb = DefectsDB(
'COOLOFL_GLOBAL/' + inputFlags.IOVDb.DatabaseInstance,
17 tag=origDbTag
or inputFlags.IOVDb.GlobalTag)
19 primary_defects =
set()
20 for defect
in defects:
21 if defect
in ddb.defect_names:
22 primary_defects.add(defect)
23 elif defect
in ddb.virtual_defect_names:
24 primary_defects |= ddb.virtual_defect_logics(defect).primary_defects
26 raise ValueError(
'%s is not a known defect' % defect)
28 log.debug (
"Algorithm %s configured with intolerable defects %s" % (name,
list(primary_defects)))
30 primary_defect_ids = [ddb.defect_id_map[id]
for id
in primary_defects]
32 monFilterAlg =CompFactory.DQBadLBFilterAlg(name)
33 monFilterAlg.defectList =
sorted(primary_defect_ids)
34 monFilterAlg.ignoreRecoverable = ignoreRecoverable
35 monFilterAlg.WriteKey = writekey
37 from IOVDbSvc.IOVDbSvcConfig
import addFolders
39 if not inputFlags.Input.isMC:
40 result.merge(
addFolders(inputFlags,
'/GLOBAL/DETSTATUS/DEFECTS',detDb=
'GLOBAL_OFL',className=
'CondAttrListCollection'))
42 result.addCondAlgo(monFilterAlg)
◆ BadLBFilterToolCfg()
def python.BadLBFilterToolConfig.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)
Definition at line 48 of file BadLBFilterToolConfig.py.
48 def BadLBFilterToolCfg(inputFlags,name, defects, alwaysReturnTrue=False, ignoreRecoverable=False, origDbTag=None):
50 Configure an instance of the bad LB filter tool. If called twice with the same options, will return the same instance.
52 - name: name of *algorithm* instance to create
53 - 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).
54 - alwaysReturnTrue (optional; default=False): if True, the tool will never reject any LBs.
55 - ignoreRecoverable (optional; default=False): if True, the tool will ignore defects that are marked as recoverable
56 - origDbTag (optional): if set, will override automatic configuration of database tag (only for testing)
58 log = logging.getLogger(
'BadLBFilterToolCfg')
61 if inputFlags.Common.isOnline
or inputFlags.Input.isMC:
63 log.info(
'Disabling bad LB filter tool due to inappropriate environment; returning dummy')
64 result.setPrivateTools(CompFactory.DQDummyFilterTool(name))
67 sgkey =
'DQBadLBFilterAlgResult_%s' % name
69 result.merge(
BadLBFilterAlgCfg(inputFlags,name+
'_Alg',tuple(
sorted(defects)),sgkey,ignoreRecoverable, origDbTag))
71 monFilterTool=CompFactory.DQBadLBFilterTool(name,alwaysReturnTrue=alwaysReturnTrue,
73 result.setPrivateTools(monFilterTool)
◆ LArBadLBFilterToolCfg()
def python.BadLBFilterToolConfig.LArBadLBFilterToolCfg |
( |
|
inputFlags, |
|
|
|
origDbTag = None |
|
) |
| |
Configure a LAr defect-specific instance of the bad LB filter tool. If called twice with the same options, will return the same instance.
Arguments:
- origDbTag (optional): if set, will override automatic configuration of database tag (only for testing)
Definition at line 100 of file BadLBFilterToolConfig.py.
102 Configure a LAr defect-specific instance of the bad LB filter tool. If called twice with the same options, will return the same instance.
104 - origDbTag (optional): if set, will override automatic configuration of database tag (only for testing)
106 from AthenaCommon.Logging
import logging
107 log = logging.getLogger(
'BadLBFilterTool/LAr')
109 if inputFlags.Common.isOnline
or inputFlags.Input.isMC:
110 log.info(
'Disabling LAr bad LB filter tool due to inappropriate environment')
◆ LArDefectList()
def python.BadLBFilterToolConfig.LArDefectList |
( |
|
inputFlags, |
|
|
|
origDbTag = None |
|
) |
| |
Get the defects to configure for LAr - cache results to avoid lots of DB lookups
Arguments:
- origDbTag (optional): if set, will override automatic configuration of database tag (only for testing)
Definition at line 78 of file BadLBFilterToolConfig.py.
80 Get the defects to configure for LAr - cache results to avoid lots of DB lookups
82 - origDbTag (optional): if set, will override automatic configuration of database tag (only for testing)
85 from DQDefects
import DefectsDB
86 ddb = DefectsDB(
'COOLOFL_GLOBAL/' + inputFlags.IOVDb.DatabaseInstance,
87 tag=origDbTag
or inputFlags.IOVDb.GlobalTag)
89 lar_defects =
reduce(operator.or_, [
set(ddb.virtual_defect_logics[z].clauses)
for z
in \
90 (
'EMBA',
'EMBC',
'EMECA',
'EMECC',
91 'HECA',
'HECC',
'FCALA',
92 'FCALC')])-
set([
'LAR_UNCHECKED',
'LAR_GENERAL',
'DISABLED',
'NONGREEN'])
93 lar_defects =
set(defect
for defect
in lar_defects
94 if (
'LAR' in defect
and
95 ((
'HVTRIP' in defect)
or (
'SEV' in defect)
or
96 (
'CORRUPT' in defect))))
void reduce(HepMC::GenEvent *ge, std::vector< HepMC::GenParticlePtr > toremove)
Remove unwanted particles from the event, collapsing the graph structure consistently.
def addFolders(flags, folderStrings, detDb=None, className=None, extensible=False, tag=None, db=None, modifiers='')
std::vector< typename T::value_type > sorted(T begin, T end)
Helper function to create a sorted vector from an unsorted one.
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.