CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
fetchall_from_DQM.py
Go to the documentation of this file.
1 #! /usr/bin/env python
2 ################################################################################
3 # RelMon: a tool for automatic Release Comparison
4 # https://twiki.cern.ch/twiki/bin/view/CMSPublic/RelMon
5 #
6 #
7 #
8 # Danilo Piparo CERN - danilo.piparo@cern.ch
9 #
10 ################################################################################
11 
12 import subprocess as sub
13 import sys
14 from optparse import OptionParser
15 
16 parser = OptionParser(usage="usage: %prog cmssw_release [options]")
17 
18 
19 parser.add_option("-d","--data ",
20  action="store",
21  dest="data",
22  default=False,
23  help="Fetch data relvals")
24 
25 parser.add_option("-m","--mc ",
26  action="store",
27  dest="mc",
28  default=False,
29  help="Fetch Monte Carlo relvals")
30 
31 parser.add_option("--p1","--path1 ",
32  action="store",
33  dest="path1",
34  default="",
35  help="Additional path to match in relvals")
36 
37 parser.add_option("--p2","--path2 ",
38  action="store",
39  dest="path2",
40  default="",
41  help="Additional path to match in relvals")
42 
43 (options, args) = parser.parse_args()
44 
45 #if len(args)!=1:
46 # print "Specify one and only one release!"
47 # print args
48 # sys.exit(2)
49 
50 cmssw_release = args[0]
51 
52 # Specify the directory of data or MC
53 relvaldir="RelVal"
54 if options.data:
55  relvaldir+="Data"
56 
57 # Specify the directory of the release
58 releasedir=cmssw_release[:10]+"x"
59 
60 #fetch!
61 thepath=cmssw_release
62 if len(options.path1)>0:
63  thepath="%s.*%s"%(options.path1,thepath)
64 if len(options.path2)>0:
65  thepath="%s.*%s"%(thepath,options.path2)
66 command='relmon_rootfiles_spy.py ROOT/%s/%s/ -u -g -p %s'%(relvaldir,releasedir,thepath)
67 print command
68 sub.call(command.split(" "))
69 
70 # Main tree:
71 # https://cmsweb.cern.ch/dqm/relval/data/browse/ROOT/
72 
73