Definition at line 10 of file ItemListSemantics.py.
◆ __init__()
def python.ItemListSemantics.OutputStreamItemListSemantics.__init__ |
( |
|
self, |
|
|
|
cpp_type |
|
) |
| |
Definition at line 15 of file ItemListSemantics.py.
16 valueSem = getSemanticsFor(
"std::string")
if cpp_type
in self.__handled_types__
else None
17 super(OutputStreamItemListSemantics, self).
__init__(cpp_type, valueSem=valueSem)
◆ checkAuxAttributes()
def python.ItemListSemantics.OutputStreamItemListSemantics.checkAuxAttributes |
( |
|
self, |
|
|
|
itemList |
|
) |
| |
Checks dynamic Aux attribute selection in the ItemList for duplicates and conflicts
From Event/xAOD/xAODCore/Root/AuxSelection.cxx
The formalism for attribute selection is the following:
- An empty set, or a set containing "*" will select all the dynamic
attributes passed to the object.
- A single "-" attribute will not select any of the dynamic attributes.
- A set of variables (without "-" as the first character of the
variable names) will select just the variables listed.
- A set of variable names, each prefixed by "-", will select all
variables but the ones listed.
Definition at line 28 of file ItemListSemantics.py.
28 def checkAuxAttributes(self, itemList):
30 Checks dynamic Aux attribute selection in the ItemList for duplicates and conflicts
32 From Event/xAOD/xAODCore/Root/AuxSelection.cxx
33 The formalism for attribute selection is the following:
34 - An empty set, or a set containing "*" will select all the dynamic
35 attributes passed to the object.
36 - A single "-" attribute will not select any of the dynamic attributes.
37 - A set of variables (without "-" as the first character of the
38 variable names) will select just the variables listed.
39 - A set of variable names, each prefixed by "-", will select all
40 variables but the ones listed.
43 auxitems = defaultdict(set)
45 auxpos = item.find(self.__AUX_ext__)
48 itemname = item[ : auxpos+self.__AUX_len__]
49 selection = item[auxpos+self.__AUX_len__ : ]
52 auxitems[itemname].
add( selection )
54 newitemlist.append(item)
57 for k,sel
in auxitems.items():
61 if ".." in line
or line.startswith(
".")
or line.endswith(
'.'):
62 raise ValueError(f
"ItemList AuxAttribute selection syntax error for {k} - extra dot in '{line}'")
63 newsel =
set(line.split(
'.'))
64 newneg = {s
for s
in newsel
if s[:1]==
'-'}
71 raise ValueError(f
"Multiple (different) negative selection are not supported: for {k} : {str(sel)}")
72 allsel.update( newsel )
73 if negsel
and len(negsel) != len(allsel):
74 raise ValueError(f
"Mixing up negative and positive Aux selections is not supported: {k} : {str(sel)}")
77 newauxlist.append( k +
next(iter(sel)) )
80 if '' in sel
or '*' in allsel:
82 msg.info(f
"Multiple Aux attribute selections for {k} - will write all attributes." +
83 f
" Original selection was: {str(sel)}")
84 newauxlist.append( k +
'*')
88 newauxlist.append(newitem)
89 msg.info(f
"Multiple attribute selections for {k} - will write combined selection. Found {len(sel)} selections: {str(sel)}")
90 msg.info(f
" New selection: {newitem}")
92 return newitemlist + newauxlist
◆ merge()
def python.ItemListSemantics.OutputStreamItemListSemantics.merge |
( |
|
self, |
|
|
|
bb, |
|
|
|
aa |
|
) |
| |
◆ __AUX_ext__
string python.ItemListSemantics.OutputStreamItemListSemantics.__AUX_ext__ = "Aux." |
|
staticprivate |
◆ __AUX_len__
python.ItemListSemantics.OutputStreamItemListSemantics.__AUX_len__ = len(__AUX_ext__) |
|
staticprivate |
◆ __handled_types__
tuple python.ItemListSemantics.OutputStreamItemListSemantics.__handled_types__ = ( "OutputStreamItemList", ) |
|
staticprivate |
The documentation for this class was generated from the following file:
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.