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 vetoedFunction = set()
79 etaFound, phiFound =
False,
False
83 classList = [ ROOT.TClass.GetClass(objectName) ]
84 if verbose:
print classList
87 alreadySeenFunction.update(vetoedFunction)
88 vetoedFunction.clear()
89 oneclass = classList.pop (0)
90 print "Looking at %s" % oneclass.GetName ()
91 bases = oneclass.GetListOfBases()
92 funcs = oneclass.GetListOfMethods()
94 print "baseSize", bases.GetSize()
95 print "FunctionMemberSize", funcs.GetSize()
96 for baseIndex
in range( bases.GetSize() ) :
97 classList.append( bases.At(baseIndex).GetClassPointer() )
98 for index
in range( funcs.GetSize() ):
99 funcMember = funcs.At (index)
101 name = funcMember.GetName()
108 if name
in alreadySeenFunction:
111 returnType = funcMember.GetReturnTypeName()
112 goType = root2GOtypeDict.get (returnType,
None)
114 print " type", returnType, goType
116 vetoedTypes.add (returnType)
124 if funcMember.Property() & ROOT.kIsConstMethod
and not funcMember.GetNargs():
125 retval.append( (
"%s.%s()" % (base, name), goType))
126 alreadySeenFunction.add( name )
130 vetoedFunction.add( name )
132 print " failed IsConst() and GetNargs()"
135 dataList = oneclass.GetListOfDataMembers()
136 for index
in range( dataList.GetSize() ):
137 data = dataList.At( index );
138 name = data.GetName()
139 dataType = data.GetTypeName()
140 goType = root2GOtypeDict.get (dataType,
None)
144 print "name", name,
"dataType", dataType,
"goType", goType
145 retval.append ( (
"%s.%s" % (base, name), goType) )
147 return retval, etaFound
and phiFound
151 """Returns GenObject name and ntuple definition function"""
152 words = dotRE.split (line)[1:]
153 func =
".".join (words)
154 name =
"_".join (words)
155 name = nonAlphaRE.sub (
'', name)
160 """Does something, but I can't remembrer what... """
161 print "tuple %s alias %s label %s type %s" % (tuple, alias, label, type)
163 firstName = mylist[0][0]
164 match = alphaRE.match (firstName)
166 raise RuntimeError,
"firstName doesn't parse correctly. (%s)" \
168 genName = match.group (1)
169 genDef =
" ## GenObject %s Definition ##\n[%s]\n" % \
171 if options.index
or not etaPhiFound:
174 genDef +=
"-equiv: index,0\n";
176 genDef +=
"-equiv: eta,0.1 phi,0.1 index,100000\n";
177 tupleDef =
'[%s:%s:%s label=%s type=%s]\n' % \
178 (genName, tuple, alias, label, type)
180 for variable
in mylist:
181 name, func = genObjNameDef (variable[0])
182 typeInfo = variable[1]
183 form = defsDict[ typeInfo ]
184 genDef += form % name +
'\n'
185 tupleDef +=
"%-40s : %s\n" % (name, func)
186 return genDef, tupleDef
189 if __name__ ==
"__main__":
191 parser = optparse.OptionParser \
192 (
"usage: %prog [options] objectName\n" \
193 "Creates control file for GenObject.")
194 parser.add_option (
'--goName', dest=
'goName', type=
'string',
196 help=
'GenObject name')
197 parser.add_option (
'--index', dest=
'index', action=
'store_true',
198 help=
'use index for matching')
199 parser.add_option (
'--label', dest=
'label', type=
'string',
200 default =
'dummyLabel',
201 help=
"Tell GO to set an label")
202 parser.add_option (
'--output', dest=
'output', type=
'string',
204 help=
"Output (Default 'objectName.txt')")
205 parser.add_option (
'--precision', dest=
'precision', type=
'string',
207 help=
"precision to use for floats (default %default)")
208 parser.add_option (
'--privateMemberData', dest=
'privateMemberData',
210 help=
'include private member data (NOT for comparisons)')
211 parser.add_option (
'--tupleName', dest=
'tupleName', type=
'string',
213 help=
"Tuple name (default '%default')")
214 parser.add_option (
'--type', dest=
'type', type=
'string',
215 default =
'dummyType',
216 help=
"Tell GO to set an type")
217 parser.add_option (
'--verbose', dest=
'verbose', action=
'store_true',
218 help=
'Verbose output')
219 options, args = parser.parse_args()
220 defsDict[
'float'] += options.precision
222 options.type = GenObject.decodeNonAlphanumerics (options.type)
224 raise RuntimeError,
"Need to provide object name."
226 objectName = GenObject.decodeNonAlphanumerics (args[0])
227 goName = options.goName
or colonRE.sub (
'', objectName)
228 outputFile = options.output
or goName +
'.txt'
229 ROOT.gROOT.SetBatch()
231 ROOT.gSystem.Load(
"libFWCoreFWLite")
232 ROOT.gSystem.Load(
"libDataFormatsFWLite")
234 ROOT.FWLiteEnabler.enable()
235 mylist, etaPhiFound = getObjectList (objectName, goName, options.verbose,
236 options.privateMemberData)
238 print "There are no member functions that are useful for comparison."
239 sys.exit (GenObject.uselessReturnCode)
240 targetFile = open (outputFile,
'w')
241 genDef, tupleDef = genObjectDef (mylist,
247 targetFile.write (startString)
248 targetFile.write (genDef)
249 targetFile.write (defTemplate % {
'objs':
'reco',
'OBJS':
'RECO'})
250 targetFile.write (tupleDef)
251 print "Vetoed types:"
252 pprint.pprint ( sorted(
list(vetoedTypes) ) )
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