Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:49

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 from __future__ import print_function
0013 import subprocess as sub
0014 import sys
0015 from optparse import OptionParser
0016 
0017 parser = OptionParser(usage="usage: %prog cmssw_release [options]")
0018 
0019 
0020 parser.add_option("-d","--data ",
0021                   action="store",
0022                   dest="data",
0023                   default=False,
0024                   help="Fetch data relvals")
0025 
0026 parser.add_option("-m","--mc ",
0027                   action="store",
0028                   dest="mc",
0029                   default=False,
0030                   help="Fetch Monte Carlo relvals")
0031 
0032 parser.add_option("--p1","--path1 ",
0033                   action="store",
0034                   dest="path1",
0035                   default="",
0036                   help="Additional path to match in relvals")
0037 
0038 parser.add_option("--p2","--path2 ",
0039                   action="store",
0040                   dest="path2",
0041                   default="",
0042                   help="Additional path to match in relvals")
0043 
0044 (options, args) = parser.parse_args()
0045 
0046 #if len(args)!=1:
0047 #  print "Specify one and only one release!"
0048 #  print args
0049 #  sys.exit(2)
0050 
0051 cmssw_release = args[0]
0052 
0053 # Specify the directory of data or MC
0054 relvaldir="RelVal"
0055 if options.data:
0056   relvaldir+="Data"
0057 
0058 # Specify the directory of the release
0059 releasedir=cmssw_release[:10]+"x"
0060 
0061 #fetch!
0062 thepath=cmssw_release
0063 if len(options.path1)>0:
0064   thepath="%s.*%s"%(options.path1,thepath)
0065 if len(options.path2)>0:
0066   thepath="%s.*%s"%(thepath,options.path2)  
0067 command='relmon_rootfiles_spy.py ROOT/%s/%s/ -u -g -p %s'%(relvaldir,releasedir,thepath)
0068 print(command)
0069 sub.call(command.split(" "))
0070 
0071 # Main tree:
0072 # https://cmsweb.cern.ch/dqm/relval/data/browse/ROOT/
0073 
0074