CMS 3D CMS Logo

fetchall_from_DQM.py
Go to the documentation of this file.
1 #! /usr/bin/env python3
2 
11 
12 from __future__ import print_function
13 import subprocess as sub
14 import sys
15 from optparse import OptionParser
16 
17 parser = OptionParser(usage="usage: %prog cmssw_release [options]")
18 
19 
20 parser.add_option("-d","--data ",
21  action="store",
22  dest="data",
23  default=False,
24  help="Fetch data relvals")
25 
26 parser.add_option("-m","--mc ",
27  action="store",
28  dest="mc",
29  default=False,
30  help="Fetch Monte Carlo relvals")
31 
32 parser.add_option("--p1","--path1 ",
33  action="store",
34  dest="path1",
35  default="",
36  help="Additional path to match in relvals")
37 
38 parser.add_option("--p2","--path2 ",
39  action="store",
40  dest="path2",
41  default="",
42  help="Additional path to match in relvals")
43 
44 (options, args) = parser.parse_args()
45 
46 #if len(args)!=1:
47 # print "Specify one and only one release!"
48 # print args
49 # sys.exit(2)
50 
51 cmssw_release = args[0]
52 
53 # Specify the directory of data or MC
54 relvaldir="RelVal"
55 if options.data:
56  relvaldir+="Data"
57 
58 # Specify the directory of the release
59 releasedir=cmssw_release[:10]+"x"
60 
61 #fetch!
62 thepath=cmssw_release
63 if len(options.path1)>0:
64  thepath="%s.*%s"%(options.path1,thepath)
65 if len(options.path2)>0:
66  thepath="%s.*%s"%(thepath,options.path2)
67 command='relmon_rootfiles_spy.py ROOT/%s/%s/ -u -g -p %s'%(relvaldir,releasedir,thepath)
68 print(command)
69 sub.call(command.split(" "))
70 
71 # Main tree:
72 # https://cmsweb.cern.ch/dqm/relval/data/browse/ROOT/
73 
74 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47