CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/Utilities/RelMon/scripts/fetchall_from_DQM.py

Go to the documentation of this file.
00001 #! /usr/bin/env python
00002 ################################################################################
00003 # RelMon: a tool for automatic Release Comparison
00004 # https://twiki.cern.ch/twiki/bin/view/CMSPublic/RelMon
00005 #
00006 # $Author: agimbuta $
00007 # $Date: 2012/07/10 14:19:02 $
00008 # $Revision: 1.2 $
00009 #
00010 #
00011 # Danilo Piparo CERN - danilo.piparo@cern.ch
00012 #
00013 ################################################################################
00014 
00015 import subprocess as sub
00016 import sys
00017 from optparse import OptionParser
00018 
00019 parser = OptionParser(usage="usage: %prog cmssw_release [options]")
00020 
00021 
00022 parser.add_option("-d","--data ",
00023                   action="store",
00024                   dest="data",
00025                   default=False,
00026                   help="Fetch data relvals")
00027 
00028 parser.add_option("-m","--mc ",
00029                   action="store",
00030                   dest="mc",
00031                   default=False,
00032                   help="Fetch Monte Carlo relvals")
00033 
00034 parser.add_option("--p1","--path1 ",
00035                   action="store",
00036                   dest="path1",
00037                   default="",
00038                   help="Additional path to match in relvals")
00039 
00040 parser.add_option("--p2","--path2 ",
00041                   action="store",
00042                   dest="path2",
00043                   default="",
00044                   help="Additional path to match in relvals")
00045 
00046 (options, args) = parser.parse_args()
00047 
00048 #if len(args)!=1:
00049 #  print "Specify one and only one release!"
00050 #  print args
00051 #  sys.exit(2)
00052 
00053 cmssw_release = args[0]
00054 
00055 # Specify the directory of data or MC
00056 relvaldir="RelVal"
00057 if options.data:
00058   relvaldir+="Data"
00059 
00060 # Specify the directory of the release
00061 releasedir=cmssw_release[:10]+"x"
00062 
00063 #fetch!
00064 thepath=cmssw_release
00065 if len(options.path1)>0:
00066   thepath="%s.*%s"%(options.path1,thepath)
00067 if len(options.path2)>0:
00068   thepath="%s.*%s"%(thepath,options.path2)  
00069 command='relmon_rootfiles_spy.py ROOT/%s/%s/ -u -g -p %s'%(relvaldir,releasedir,thepath)
00070 print command
00071 sub.call(command.split(" "))
00072 
00073 # Main tree:
00074 # https://cmsweb.cern.ch/dqm/relval/data/browse/ROOT/
00075 
00076