3 from __future__
import print_function
4 from builtins
import range
9 for i
in range(len(copyargs)):
10 if copyargs[i] ==
"": copyargs[i] =
"\"\"" 11 if copyargs[i].
find(
" ") != -1: copyargs[i] =
"\"%s\"" % copyargs[i]
12 commandline =
" ".
join(copyargs)
18 %(prog)s [options] geometry0.xml geometryX.xml geometryY.xml 20 Draws a scatterplot of delta corrections: 21 X: geometryX - geometry0 22 Y: geometryY - geometry0 24 Optionally, corresponding reportX.py and reportY.py could be provided through options 25 in order to better select chambers for plotting. 28 parser = optparse.OptionParser(usage)
29 parser.add_option(
"--rx",
30 help=
"report.py that corresponds to geometryX.xml",
34 parser.add_option(
"--ry",
35 help=
"report.py that corresponds to geometryY.xml",
39 parser.add_option(
"-o",
"--output",
40 help=
"plots' file name. If not give, an automatic file name would be given as corrVsCorr_label_selection.png",
44 parser.add_option(
"-l",
"--label",
45 help=
"label for an automatic filename",
49 parser.add_option(
"-s",
"--selection",
50 help=
"is one of the following: ALL, DT, CSC, CSCE1, CSCE2",
54 parser.add_option(
"-x",
"--xlabel",
55 help=
"prefix to add to plots' X axis",
59 parser.add_option(
"-y",
"--ylabel",
60 help=
"prefix to add to plots' Y axis",
64 parser.add_option(
"-w",
"--which",
65 help=
"binary mask for which variables to draw, defauls is 110011",
70 options, args = parser.parse_args(sys.argv[1:])
72 if len(args)!=3:
print(usage); sys.exit()
77 def DT(dt, wheel, station, sector):
return dt ==
"DT" 79 def CSC(csc, endcap, station, ring, chamber):
80 if csc !=
"CSC":
return False 82 if station==1
and ring==4:
return False 84 if station==4
and ring==2
and ( (endcap==1
and (chamber<9
or chamber >13))
or endcap==2 ) :
return False 88 def CSCE1(csc, endcap, station, ring, chamber):
return CSC(csc, endcap, station, ring, chamber)
and endcap==1
90 def CSCE2(csc, endcap, station, ring, chamber):
return CSC(csc, endcap, station, ring, chamber)
and endcap==2
95 execfile(
"geometryXMLparser.py")
96 execfile(
"plotscripts.py")
98 ROOT.gROOT.SetBatch(1)
100 selection = options.selection
101 if selection ==
'ALL': selection =
None 104 if options.rx !=
"None" and options.ry !=
"None":
110 g0 = MuonGeometry(args[0])
111 gX = MuonGeometry(args[1])
112 gY = MuonGeometry(args[2])
114 if options.which.count(
'1')>4: c1 = ROOT.TCanvas(
"c1",
"c1",1000,800)
115 else: c1 = ROOT.TCanvas(
"c1",
"c1",760,800)
117 print(
"corrections2D(reportsX=rx, reportsY=ry, geometry0=g0, geometryX=gX, geometryY=gY, selection=%s, pre_title_x='%s', pre_title_y='%s', which='%s' )" % (
118 selection, options.xlabel, options.ylabel, options.which ))
119 eval(
"corrections2D(reportsX=rx, reportsY=ry, geometry0=g0, geometryX=gX, geometryY=gY, selection=%s, pre_title_x='%s', pre_title_y='%s', which='%s', canvas=c1 )" % (
120 selection, options.xlabel, options.ylabel, options.which) )
123 if len(options.filename)>0: filename = options.filename
124 else: filename =
"corrVsCorr_"+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 DT(dt, wheel, station, sector)
definitions of selectors:
static std::string join(char **cmd)
def CSCE2(csc, endcap, station, ring, chamber)
def CSC(csc, endcap, station, ring, chamber)
def CSCE1(csc, endcap, station, ring, chamber)