3 from __future__
import print_function
8 for i
in range(len(copyargs)):
9 if copyargs[i] ==
"": copyargs[i] =
"\"\"" 10 if copyargs[i].
find(
" ") != -1: copyargs[i] =
"\"%s\"" % copyargs[i]
11 commandline =
" ".
join(copyargs)
17 %(prog)s [options] reportX.py reportY.py 19 Draws a scatterplot of delta corrections from reportX vs. from reportY. 22 parser = optparse.OptionParser(usage)
23 parser.add_option(
"-o",
"--output",
24 help=
"plots' file name. If not give, an automatic file name would be given as reportVsReport_label_selection.png",
28 parser.add_option(
"-l",
"--label",
29 help=
"label for an automatic filename",
33 parser.add_option(
"-s",
"--selection",
34 help=
"is one of the following: ALL, DT, CSC, CSCE1, CSCE2",
38 parser.add_option(
"-x",
"--xlabel",
39 help=
"prefix to add to plots' X axis",
43 parser.add_option(
"-y",
"--ylabel",
44 help=
"prefix to add to plots' Y axis",
48 parser.add_option(
"-w",
"--which",
49 help=
"binary mask for which variables to draw, defauls is 110011",
54 options, args = parser.parse_args(sys.argv[1:])
56 if len(args)!=2:
print(usage); sys.exit()
61 def DT(dt, wheel, station, sector):
return dt ==
"DT" 63 def CSC(csc, endcap, station, ring, chamber):
64 if csc !=
"CSC":
return False 66 if station==1
and ring==4:
return False 68 if station==4
and ring==2
and ( (endcap==1
and (chamber<9
or chamber >13))
or endcap==2 ) :
return False 71 def CSCE1(csc, endcap, station, ring, chamber):
return CSC(csc, endcap, station, ring, chamber)
and endcap==1
73 def CSCE2(csc, endcap, station, ring, chamber):
return CSC(csc, endcap, station, ring, chamber)
and endcap==2
78 execfile(
"plotscripts.py")
80 ROOT.gROOT.SetBatch(1)
82 selection = options.selection
83 if selection ==
'ALL': selection =
None 90 if options.which.count(
'1')>4: c1 = ROOT.TCanvas(
"c1",
"c1",1000,800)
91 else: c1 = ROOT.TCanvas(
"c1",
"c1",760,800)
93 print(
"corrections2D(reportsX=rx, reportsY=ry, selection=%s, pre_title_x='%s', pre_title_y='%s', which='%s' )" % (
94 selection, options.xlabel, options.ylabel, options.which ))
95 eval(
"corrections2D(reportsX=rx, reportsY=ry, selection=%s, pre_title_x='%s', pre_title_y='%s', which='%s', canvas=c1 )" % (
96 selection, options.xlabel, options.ylabel, options.which) )
99 if len(options.filename)>0: filename = options.filename
100 else: filename =
"reportVsReport_"+options.label+
"_"+options.selection+
".png" S & print(S &os, JobReport::InputFile const &f)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
def CSCE2(csc, endcap, station, ring, chamber)
def DT(dt, wheel, station, sector)
definitions of selectors:
static std::string join(char **cmd)
def CSCE1(csc, endcap, station, ring, chamber)
def CSC(csc, endcap, station, ring, chamber)