Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-26 02:34:35

0001 #! /usr/bin/env python3
0002 ################################################################################
0003 # RelMon: a tool for automatic Release Comparison
0004 # https://twiki.cern.ch/twiki/bin/view/CMSPublic/RelMon
0005 #
0006 #
0007 #
0008 # Danilo Piparo CERN - danilo.piparo@cern.ch
0009 #
0010 ################################################################################
0011 
0012 import subprocess as sub
0013 import sys
0014 from optparse import OptionParser
0015 
0016 parser = OptionParser(usage="usage: %prog cmssw_release [options]")
0017 
0018 
0019 parser.add_option("-d","--data ",
0020                   action="store",
0021                   dest="data",
0022                   default=False,
0023                   help="Fetch data relvals")
0024 
0025 parser.add_option("-m","--mc ",
0026                   action="store",
0027                   dest="mc",
0028                   default=False,
0029                   help="Fetch Monte Carlo relvals")
0030 
0031 parser.add_option("--p1","--path1 ",
0032                   action="store",
0033                   dest="path1",
0034                   default="",
0035                   help="Additional path to match in relvals")
0036 
0037 parser.add_option("--p2","--path2 ",
0038                   action="store",
0039                   dest="path2",
0040                   default="",
0041                   help="Additional path to match in relvals")
0042 
0043 (options, args) = parser.parse_args()
0044 
0045 #if len(args)!=1:
0046 #  print "Specify one and only one release!"
0047 #  print args
0048 #  sys.exit(2)
0049 
0050 cmssw_release = args[0]
0051 
0052 # Specify the directory of data or MC
0053 relvaldir="RelVal"
0054 if options.data:
0055   relvaldir+="Data"
0056 
0057 # Specify the directory of the release
0058 releasedir=cmssw_release[:10]+"x"
0059 
0060 #fetch!
0061 thepath=cmssw_release
0062 if len(options.path1)>0:
0063   thepath="%s.*%s"%(options.path1,thepath)
0064 if len(options.path2)>0:
0065   thepath="%s.*%s"%(thepath,options.path2)  
0066 command='relmon_rootfiles_spy.py ROOT/%s/%s/ -u -g -p %s'%(relvaldir,releasedir,thepath)
0067 print(command)
0068 sub.call(command.split(" "))
0069 
0070 # Main tree:
0071 # https://cmsweb.cern.ch/dqm/relval/data/browse/ROOT/
0072 
0073