Ejemplo n.º 1
0
## Run useReflexToDescribeForGenObject ##
#########################################
    for key, value in sorted(collection.items()):
        name = value[0].name
        prettyName = nonAlphaRE.sub('', name)
        descriptionName = prettyName + '.txt'
        if os.path.exists (descriptionName) \
               and os.path.getsize (descriptionName) \
               and not options.forceDescribe:
            if options.verbose:
                print('%s exists.  Skipping' % descriptionName)
            continue
        #print name, prettyName, key
        describeCmd = "%s %s %s useReflexToDescribeForGenObject.py %s '--type=%s'" \
                  % (fullCommand, currentDir, logPrefix + prettyName,
                     GenObject.encodeNonAlphanumerics (name),
                     #name,
                     GenObject.encodeNonAlphanumerics (key))
        if options.precision:
            describeCmd += " --precision=" + options.precision
        if options.verbose:
            print("describing %s" % name)
        if options.verboseDebug:
            print(describeCmd, '\n')
        returnCode = os.system(describeCmd)
        if returnCode:
            # return codes are shifted by 8 bits:
            if returnCode == GenObject.uselessReturnCode << 8:
                useless += 1
            else:
                print("Error trying to describe '%s'.  Continuing.\n" % \
Ejemplo n.º 2
0
                    help="precision to use for floats (default %default)")
 parser.add_option ('--privateMemberData', dest='privateMemberData',
                    action='store_true',
                    help='include private member data (NOT for comparisons)')
 parser.add_option ('--tupleName', dest='tupleName', type='string',
                    default = 'reco',
                    help="Tuple name (default '%default')")
 parser.add_option ('--type', dest='type', type='string',
                    default = 'dummyType',
                    help="Tell GO to set an type")
 parser.add_option ('--verbose', dest='verbose', action='store_true',
                    help='Verbose output')
 options, args = parser.parse_args()
 defsDict['float'] += options.precision
 from Validation.Tools.GenObject import GenObject
 options.type = GenObject.decodeNonAlphanumerics (options.type)
 if len (args) < 1:
     raise RuntimeError, "Need to provide object name."
 #
 objectName = GenObject.decodeNonAlphanumerics (args[0])
 goName     = options.goName or colonRE.sub ('', objectName)
 outputFile = options.output or goName + '.txt'
 ROOT.gROOT.SetBatch()
 # load the right libraries, etc.
 ROOT.gSystem.Load("libFWCoreFWLite")
 ROOT.gSystem.Load("libDataFormatsFWLite")
 ROOT.gSystem.Load("libReflexDict")
 ROOT.FWLiteEnabler::enable()
 mylist, etaPhiFound = getObjectList (objectName, goName, options.verbose,
                                      options.privateMemberData)
 if not len (mylist):
Ejemplo n.º 3
0
 ## Run useReflexToDescribeForGenObject ##
 #########################################
 for key, value in sorted(collection.iteritems()):
     name = value[0].name
     prettyName = nonAlphaRE.sub("", name)
     descriptionName = prettyName + ".txt"
     if os.path.exists(descriptionName) and os.path.getsize(descriptionName) and not options.forceDescribe:
         if options.verbose:
             print "%s exists.  Skipping" % descriptionName
         continue
     # print name, prettyName, key
     describeCmd = "%s %s %s useReflexToDescribeForGenObject.py %s '--type=%s'" % (
         fullCommand,
         currentDir,
         logPrefix + prettyName,
         GenObject.encodeNonAlphanumerics(name),
         # name,
         GenObject.encodeNonAlphanumerics(key),
     )
     if options.precision:
         describeCmd += " --precision=" + options.precision
     if options.verbose:
         print "describing %s" % name
     if options.verboseDebug:
         print describeCmd, "\n"
     returnCode = os.system(describeCmd)
     if returnCode:
         # return codes are shifted by 8 bits:
         if returnCode == GenObject.uselessReturnCode << 8:
             useless += 1
         else: