CMS 3D CMS Logo

Functions | Variables
makeHGCalValidationPlots Namespace Reference

Functions

def main (opts)
 

Variables

 action
 
 choices
 
 default
 
 description
 
 help
 
 metavar
 
 nargs
 
 opts
 
 parser
 
 str
 
 type
 

Function Documentation

def makeHGCalValidationPlots.main (   opts)

Definition at line 11 of file makeHGCalValidationPlots.py.

References join(), and edm.print().

11 def main(opts):
12 
13  drawArgs={}
14  if opts.no_ratio:
15  drawArgs["ratio"] = False
16  if opts.separate:
17  drawArgs["separate"] = True
18  if opts.png:
19  drawArgs["saveFormat"] = ".png"
20  if opts.verbose:
21  plotting.verbose = True
22 
23  filenames = [(f, f.replace(".root", "")) for f in opts.files]
24  sample = SimpleSample(opts.subdirprefix[0], opts.html_sample, filenames)
25 
26  val = SimpleValidation([sample], opts.outputDir[0])
27  htmlReport = val.createHtmlReport(validationName=opts.html_validation_name[0])
28 
29  if opts.collection=="hgcalLayerClusters":
30  hgclayclus = [hgcalPlots.hgcalLayerClustersPlotter]
31  val.doPlots(hgclayclus, plotterDrawArgs=drawArgs)
32  elif opts.collection in ["hgcalMultiClusters", "multiClustersFromTrackstersMIP", "multiClustersFromTrackstersTrk", "multiClustersFromTrackstersEM", "multiClustersFromTrackstersHAD"]:
33  hgcmulticlus = [hgcalPlots.hgcalMultiClustersPlotter]
34  val.doPlots(hgcmulticlus, plotterDrawArgs=drawArgs)
35  elif opts.collection=="hitValidation":
36  hgchit = [hgcalPlots.hgcalHitPlotter]
37  val.doPlots(hgchit, plotterDrawArgs=drawArgs)
38  elif opts.collection=="hitCalibration":
39  hgchitcalib = [hgcalPlots.hgcalHitCalibPlotter]
40  val.doPlots(hgchitcalib, plotterDrawArgs=drawArgs)
41  else :
42  #In case of all you have to keep a specific order in one to one
43  #correspondance between subdirprefix and collections and validation names
44  #layer clusters
45  hgclayclus = [hgcalPlots.hgcalLayerClustersPlotter]
46  val.doPlots(hgclayclus, plotterDrawArgs=drawArgs)
47  #multiclusters
48  sample = SimpleSample(opts.subdirprefix[1], opts.html_sample, filenames)
49  val = SimpleValidation([sample], opts.outputDir[1])
50  htmlReport_2 = val.createHtmlReport(validationName=opts.html_validation_name[1])
51  hgcmulticlus = [hgcalPlots.hgcalMultiClustersPlotter]
52  val.doPlots(hgcmulticlus, plotterDrawArgs=drawArgs)
53  #hits
54  sample = SimpleSample(opts.subdirprefix[2], opts.html_sample, filenames)
55  val = SimpleValidation([sample], opts.outputDir[2])
56  htmlReport_3 = val.createHtmlReport(validationName=opts.html_validation_name[2])
57  hgchit = [hgcalPlots.hgcalHitPlotter]
58  val.doPlots(hgchit, plotterDrawArgs=drawArgs)
59  #calib
60  sample = SimpleSample(opts.subdirprefix[3], opts.html_sample, filenames)
61  val = SimpleValidation([sample], opts.outputDir[3])
62  htmlReport_4 = val.createHtmlReport(validationName=opts.html_validation_name[3])
63  hgchitcalib = [hgcalPlots.hgcalHitCalibPlotter]
64  val.doPlots(hgchitcalib, plotterDrawArgs=drawArgs)
65 
66  if opts.no_html:
67  print("Plots created into directory '%s'." % opts.outputDir)
68  else:
69  htmlReport.write()
70  if(opts.collection=="all"):
71  htmlReport_2.write()
72  htmlReport_3.write()
73  htmlReport_4.write()
74 
75  print("Plots and HTML report created into directory '%s'. You can just move it to some www area and access the pages via web browser" % (','.join(opts.outputDir)))
76 
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
static std::string join(char **cmd)
Definition: RemoteFile.cc:17

Variable Documentation

makeHGCalValidationPlots.action

Definition at line 86 of file makeHGCalValidationPlots.py.

makeHGCalValidationPlots.choices

Definition at line 100 of file makeHGCalValidationPlots.py.

makeHGCalValidationPlots.default

Definition at line 80 of file makeHGCalValidationPlots.py.

makeHGCalValidationPlots.description

Definition at line 78 of file makeHGCalValidationPlots.py.

makeHGCalValidationPlots.help

Definition at line 81 of file makeHGCalValidationPlots.py.

makeHGCalValidationPlots.metavar

Definition at line 79 of file makeHGCalValidationPlots.py.

makeHGCalValidationPlots.nargs

Definition at line 79 of file makeHGCalValidationPlots.py.

makeHGCalValidationPlots.opts

Definition at line 103 of file makeHGCalValidationPlots.py.

makeHGCalValidationPlots.parser

Definition at line 78 of file makeHGCalValidationPlots.py.

makeHGCalValidationPlots.str

Definition at line 79 of file makeHGCalValidationPlots.py.

makeHGCalValidationPlots.type

Definition at line 79 of file makeHGCalValidationPlots.py.