7 for i
in range(len(copyargs)):
8 if copyargs[i] ==
"": copyargs[i] =
"\"\"" 9 if copyargs[i].
find(
" ") != -1: copyargs[i] =
"\"%s\"" % copyargs[i]
10 commandline =
" ".
join(copyargs)
16 %(prog)s [options] reportX.py reportY.py 18 Draws a scatterplot of delta corrections from reportX vs. from reportY. 21 parser = optparse.OptionParser(usage)
22 parser.add_option(
"-o",
"--output",
23 help=
"plots' file name. If not give, an automatic file name would be given as reportVsReport_label_selection.png",
27 parser.add_option(
"-l",
"--label",
28 help=
"label for an automatic filename",
32 parser.add_option(
"-s",
"--selection",
33 help=
"is one of the following: ALL, DT, CSC, CSCE1, CSCE2",
37 parser.add_option(
"-x",
"--xlabel",
38 help=
"prefix to add to plots' X axis",
42 parser.add_option(
"-y",
"--ylabel",
43 help=
"prefix to add to plots' Y axis",
47 parser.add_option(
"-w",
"--which",
48 help=
"binary mask for which variables to draw, defauls is 110011",
53 options, args = parser.parse_args(sys.argv[1:])
55 if len(args)!=2:
print usage; sys.exit()
60 def DT(dt, wheel, station, sector):
return dt ==
"DT" 62 def CSC(csc, endcap, station, ring, chamber):
63 if csc !=
"CSC":
return False 65 if station==1
and ring==4:
return False 67 if station==4
and ring==2
and ( (endcap==1
and (chamber<9
or chamber >13))
or endcap==2 ) :
return False 70 def CSCE1(csc, endcap, station, ring, chamber):
return CSC(csc, endcap, station, ring, chamber)
and endcap==1
72 def CSCE2(csc, endcap, station, ring, chamber):
return CSC(csc, endcap, station, ring, chamber)
and endcap==2
77 execfile(
"plotscripts.py")
79 ROOT.gROOT.SetBatch(1)
81 selection = options.selection
82 if selection ==
'ALL': selection =
None 89 if options.which.count(
'1')>4: c1 = ROOT.TCanvas(
"c1",
"c1",1000,800)
90 else: c1 = ROOT.TCanvas(
"c1",
"c1",760,800)
92 print "corrections2D(reportsX=rx, reportsY=ry, selection=%s, pre_title_x='%s', pre_title_y='%s', which='%s' )" % (
93 selection, options.xlabel, options.ylabel, options.which )
94 eval(
"corrections2D(reportsX=rx, reportsY=ry, selection=%s, pre_title_x='%s', pre_title_y='%s', which='%s', canvas=c1 )" % (
95 selection, options.xlabel, options.ylabel, options.which) )
98 if len(options.filename)>0: filename = options.filename
99 else: filename =
"reportVsReport_"+options.label+
"_"+options.selection+
".png" 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)