11 'int' :
'%-40s : form=%%%%8d type=int',
12 'float' :
'%-40s : form=%%%%7.2f prec=',
13 'str' :
'%-40s : form=%%%%20s type=string',
14 'long' :
'%-40s : form=%%%%10d type=long',
23 'unsigned int' :
'int',
26 'std::basic_string<char>' :
'str',
30 # -*- sh -*- For Font lock mode
32 ###########################
33 ## GenObject Definitions ##
34 ###########################
36 # GenObject 'event' definition
44 ## %(OBJS)s Definition ##
50 # 'reco'-tupe 'runevent' 'tofill' information
51 [runevent:%(objs)s:EventAuxiliary shortcut=eventAuxiliary()]
57 colonRE = re.compile (
r':')
58 dotRE = re.compile (
r'\.')
59 nonAlphaRE = re.compile (
r'\W')
60 alphaRE = re.compile (
r'(\w+)')
63 def getObjectList (objectName, base, verbose = False, memberData = False):
64 """Get a list of interesting things from this object"""
68 rootObjConstructor = getattr (ROOT, objectName)
69 except AttributeError
as missingAttr:
70 if str(missingAttr)
in [
'double',
'int']:
71 print "Do not need to describe doubles or ints"
76 obj = rootObjConstructor()
77 alreadySeenFunction = set()
78 etaFound, phiFound =
False,
False
82 reflexList = [ ROOT.Reflex.Type.ByName (objectName) ]
83 if verbose:
print reflexList
86 reflex = reflexList.pop (0)
87 print "Looking at %s" % reflex.Name (0xffffffff)
89 print "baseSize", reflex.BaseSize()
90 print "FunctionMemberSize", reflex.FunctionMemberSize()
91 for baseIndex
in range( reflex.BaseSize() ) :
92 reflexList.append( reflex.BaseAt(baseIndex).ToType() )
93 for index
in range( reflex.FunctionMemberSize() ):
94 funcMember = reflex.FunctionMemberAt (index)
96 name = funcMember.Name()
103 if name
in alreadySeenFunction:
106 returnType = funcMember.TypeOf().
ReturnType().Name (0xffffffff)
107 goType = root2GOtypeDict.get (returnType,
None)
109 print " type", returnType, goType
111 vetoedTypes.add (returnType)
119 if funcMember.IsConst()
and not funcMember.FunctionParameterSize():
120 retval.append( (
"%s.%s()" % (base, name), goType))
121 alreadySeenFunction.add( name )
125 print " failed IsConst() and FunctionParameterSize()"
128 for index
in range( reflex.DataMemberSize() ):
129 data = reflex.DataMemberAt( index );
131 dataType = data.MemberType().__class__.__name__
132 goType = root2GOtypeDict.get (dataType,
None)
136 print "name", name,
"dataType", dataType,
"goType", goType
137 retval.append ( (
"%s.%s" % (base, name), goType) )
139 return retval, etaFound
and phiFound
143 """Returns GenObject name and ntuple definition function"""
144 words = dotRE.split (line)[1:]
145 func =
".".join (words)
146 name =
"_".join (words)
147 name = nonAlphaRE.sub (
'', name)
152 """Does something, but I can't remembrer what... """
153 print "tuple %s alias %s label %s type %s" % (tuple, alias, label, type)
155 firstName = mylist[0][0]
156 match = alphaRE.match (firstName)
158 raise RuntimeError,
"firstName doesn't parse correctly. (%s)" \
160 genName = match.group (1)
161 genDef =
" ## GenObject %s Definition ##\n[%s]\n" % \
163 if options.index
or not etaPhiFound:
166 genDef +=
"-equiv: index,0\n";
168 genDef +=
"-equiv: eta,0.1 phi,0.1 index,100000\n";
169 tupleDef =
'[%s:%s:%s label=%s type=%s]\n' % \
170 (genName, tuple, alias, label, type)
172 for variable
in mylist:
173 name, func = genObjNameDef (variable[0])
174 typeInfo = variable[1]
175 form = defsDict[ typeInfo ]
176 genDef += form % name +
'\n'
177 tupleDef +=
"%-40s : %s\n" % (name, func)
178 return genDef, tupleDef
181 if __name__ ==
"__main__":
183 parser = optparse.OptionParser \
184 (
"usage: %prog [options] objectName\n" \
185 "Creates control file for GenObject.")
186 parser.add_option (
'--goName', dest=
'goName', type=
'string',
188 help=
'GenObject name')
189 parser.add_option (
'--index', dest=
'index', action=
'store_true',
190 help=
'use index for matching')
191 parser.add_option (
'--label', dest=
'label', type=
'string',
192 default =
'dummyLabel',
193 help=
"Tell GO to set an label")
194 parser.add_option (
'--output', dest=
'output', type=
'string',
196 help=
"Output (Default 'objectName.txt')")
197 parser.add_option (
'--precision', dest=
'precision', type=
'string',
199 help=
"precision to use for floats (default %default)")
200 parser.add_option (
'--privateMemberData', dest=
'privateMemberData',
202 help=
'include private member data (NOT for comparisons)')
203 parser.add_option (
'--tupleName', dest=
'tupleName', type=
'string',
205 help=
"Tuple name (default '%default')")
206 parser.add_option (
'--type', dest=
'type', type=
'string',
207 default =
'dummyType',
208 help=
"Tell GO to set an type")
209 parser.add_option (
'--verbose', dest=
'verbose', action=
'store_true',
210 help=
'Verbose output')
211 options, args = parser.parse_args()
212 defsDict[
'float'] += options.precision
214 options.type = GenObject.decodeNonAlphanumerics (options.type)
216 raise RuntimeError,
"Need to provide object name."
218 objectName = GenObject.decodeNonAlphanumerics (args[0])
219 goName = options.goName
or colonRE.sub (
'', objectName)
220 outputFile = options.output
or goName +
'.txt'
221 ROOT.gROOT.SetBatch()
223 ROOT.gSystem.Load(
"libFWCoreFWLite")
224 ROOT.gSystem.Load(
"libDataFormatsFWLite")
225 ROOT.gSystem.Load(
"libReflexDict")
226 ROOT.FWLiteEnabler::enable()
227 mylist, etaPhiFound = getObjectList (objectName, goName, options.verbose,
228 options.privateMemberData)
230 print "There are no member functions that are useful for comparison."
231 sys.exit (GenObject.uselessReturnCode)
232 targetFile = open (outputFile,
'w')
233 genDef, tupleDef = genObjectDef (mylist,
239 targetFile.write (startString)
240 targetFile.write (genDef)
241 targetFile.write (defTemplate % {
'objs':
'reco',
'OBJS':
'RECO'})
242 targetFile.write (tupleDef)
243 print "Vetoed types:"
244 pprint.pprint ( sorted(
list(vetoedTypes) ) )
std::map< DetId, double > ReturnType
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