3 import sys, imp, re, itertools
4 from HLTrigger.Configuration.Tools.frozendict
import frozendict
16 'hltPreEventDisplaySmart',
20 return module.label
in whitelist_labels
or module.type
in whitelist_types
26 elif '__iter__' in dir(arg):
27 return tuple(
freeze(v)
for v
in arg )
32 if type(arg) == frozendict:
33 return dict((k,
unfreeze(v))
for (k, v)
in arg.iteritems())
34 elif '__iter__' in dir(arg):
40 if 'parameters_' in dir(arg):
41 arg = arg.parameters_()
43 if 'value' in dir(arg):
48 elif '__iter__' in dir(arg):
74 return type(value)
is str
and bool(group.match(value))
76 def __sub(self, value, group, label):
77 if type(value)
is str:
78 return group.sub(
r'%s\2' % label, value)
85 for label, (group, check)
in groups.iteritems():
86 for k, p
in newparams.iteritems():
87 if '__iter__' in dir(p):
89 newparams[k] = tuple(self.
__sub(v, check, label)
for v
in p)
93 newparams[k] = self.
__sub(p, check, label)
109 self.modules.append(m)
112 for module
in modules:
117 if '__iter__' in dir(arg):
123 self.modules.sort(key = Module.key)
129 for v, g
in itertools.groupby(self.
modules, Module.key):
133 g = [ m.label
for m
in group ]
136 r = re.compile(
r'^(%s)($|:)' %
r'|'.
join(g))
142 module.apply_rename(groups)
146 print "%s = (%s) {" % (m.label, m.type)
147 for k, v
in m.params.iteritems():
148 print "\t%s = %s" % (k, v)
156 process._Process__analyzers.itervalues(),
157 process._Process__producers.itervalues(),
158 process._Process__filters.itervalues()
162 groups = modules.group()
163 dups = sum(len(g[0])
for g
in groups.itervalues()) - len(groups)
166 while(dups != oldups):
168 dump = open(
'step%d.sed' % index,
'w')
169 for target, (group, regexp)
in groups.iteritems():
170 dump.write(
's#\\<\\(%s\\)\\>#%s#\n' % (
'\\|'.
join(group), target))
172 print "found %d duplicates" % dups
174 modules.apply_rename(groups)
175 groups = modules.group()
176 dups = sum(len(g[0])
for g
in groups.itervalues()) - len(groups)
179 dump = open(
'groups.sed',
'w')
180 for target, (group, regexp)
in groups.iteritems():
181 dump.write(
's#\\<\\(%s\\)\\>#%s#\n' % (
'\\|'.
join(group), target))
184 dump = open(
'groups.txt',
'w')
185 for target, (group, regexp)
in groups.iteritems():
186 dump.write(
'#%s\n%s\n\n' % ( target,
'\n'.
join(group)))
193 hlt = imp.new_module(
'hlt')
195 configname = sys.argv[1]
199 config = open(configname)
200 exec config
in globals(), hlt.__dict__
205 if __name__ ==
"__main__":
static std::string join(char **cmd)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run