CMS 3D CMS Logo

Functions | Variables
makeHGCalValidationPlots Namespace Reference

Functions

def main (opts)
 

Variables

 action
 
 allLabel
 
 choices
 
 collection_choices
 
 default
 
 description
 
 help
 
 hitCalLabel
 
 hitValLabel
 
 layerClustersLabel
 
 metavar
 
 nargs
 
 opts
 
 parser
 
 simClustersIters
 
 simLabel
 
 str
 
 trackstersLabel
 
 trackstersWithEdgesLabel
 
 type
 

Function Documentation

◆ main()

def makeHGCalValidationPlots.main (   opts)

Definition at line 28 of file makeHGCalValidationPlots.py.

References hgcalPlots.append_hgcalCaloParticlesPlots(), hgcalPlots.append_hgcalDigisPlots(), hgcalPlots.append_hgcalHitsPlots(), hgcalPlots.append_hgcalLayerClustersPlots(), hgcalPlots.append_hgcalSimClustersPlots(), hgcalPlots.append_hgcalTrackstersPlots(), hgcalPlots.create_hgcalTrackstersPlotter(), join(), print(), and TrackValidation_cff.task.

28 def main(opts):
29 
30  drawArgs={}
31  extendedFlag = False
32  if opts.no_ratio:
33  drawArgs["ratio"] = False
34  if opts.separate:
35  drawArgs["separate"] = True
36  if opts.png:
37  drawArgs["saveFormat"] = ".png"
38  if opts.extended:
39  extendedFlag = True
40  if opts.verbose:
41  plotting.verbose = True
42 
43  filenames = [(f, f.replace(".root", "")) for f in opts.files]
44  sample = SimpleSample(opts.subdirprefix[0], opts.html_sample, filenames)
45 
46  val = SimpleValidation([sample], opts.outputDir[0])
47  if opts.separate:
48  val = SeparateValidation([sample], opts.outputDir[0])
49  htmlReport = val.createHtmlReport(validationName=opts.html_validation_name[0])
50 
51  #layerClusters
52  def plot_LC():
53  hgclayclus = [hgcalPlots.hgcalLayerClustersPlotter]
54  hgcalPlots.append_hgcalLayerClustersPlots(hgcalValidator.label_layerClusterPlots._InputTag__moduleLabel, "Layer Clusters", extendedFlag)
55  val.doPlots(hgclayclus, plotterDrawArgs=drawArgs)
56 
57  #simClusters
58  def plot_SC():
59  hgcsimclus = [hgcalPlots.hgcalSimClustersPlotter]
60  for i_iter in simClustersIters:
62  val.doPlots(hgcsimclus, plotterDrawArgs=drawArgs)
63 
64  #tracksters
65  def plot_Tst():
66  hgctrackster = [hgcalPlots.hgcalTrackstersPlotter]
67  for tracksterCollection in trackstersIters :
68  hgcalPlots.append_hgcalTrackstersPlots(tracksterCollection, tracksterCollection)
69  val.doPlots(hgctrackster, plotterDrawArgs=drawArgs)
70 
71  #trackstersWithEdges
72  def plot_TstEdges():
73  plot_Tst()
74  for tracksterCollection in trackstersIters :
75  hgctracksters = [hgcalPlots.create_hgcalTrackstersPlotter(sample.files(), tracksterCollection, tracksterCollection)]
76  val.doPlots(hgctracksters, plotterDrawArgs=drawArgs)
77 
78  #caloParticles
79  def plot_CP():
80  particletypes = {"pion-":"-211", "pion+":"211", "pion0": "111",
81  "muon-": "-13", "muon+":"13",
82  "electron-": "-11", "electron+": "11", "photon": "22",
83  "kaon0L": "310", "kaon0S": "130",
84  "kaon-": "-321", "kaon+": "321"}
85  hgcaloPart = [hgcalPlots.hgcalCaloParticlesPlotter]
86  for i_part, i_partID in particletypes.items() :
87  hgcalPlots.append_hgcalCaloParticlesPlots(sample.files(), i_partID, i_part)
88  val.doPlots(hgcaloPart, plotterDrawArgs=drawArgs)
89 
90  #hitValidation
91  def plot_hitVal():
92  hgchit = [hgcalPlots.hgcalHitPlotter]
93  hgcalPlots.append_hgcalHitsPlots('HGCalSimHitsV', "Simulated Hits")
94  hgcalPlots.append_hgcalHitsPlots('HGCalRecHitsV', "Reconstruced Hits")
95  hgcalPlots.append_hgcalDigisPlots('HGCalDigisV', "Digis")
96  val.doPlots(hgchit, plotterDrawArgs=drawArgs)
97 
98  #hitCalibration
99  def plot_hitCal():
100  hgchitcalib = [hgcalPlots.hgcalHitCalibPlotter]
101  val.doPlots(hgchitcalib, plotterDrawArgs=drawArgs)
102 
103 
104  plotDict = {hitCalLabel:[plot_hitCal], hitValLabel:[plot_hitVal], layerClustersLabel:[plot_LC], trackstersLabel:[plot_Tst], trackstersWithEdgesLabel:[plot_TstEdges], simLabel:[plot_SC, plot_CP]}
105 
106  if (opts.collection != allLabel):
107  for task in plotDict[opts.collection]:
108  task()
109  else:
110  for label in plotDict:
111  if (label == trackstersLabel): continue # already run in trackstersWithEdges
112  for task in plotDict[label]:
113  task()
114 
115  if opts.no_html:
116  print("Plots created into directory '%s'." % opts.outputDir)
117  else:
118  htmlReport.write()
119 
120  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)))
121 
def append_hgcalHitsPlots(collection="HGCalSimHitsV", name_collection="Simulated Hits")
Definition: hgcalPlots.py:2718
def append_hgcalTrackstersPlots(collection='ticlTrackstersMerge', name_collection="TrackstersMerge")
Definition: hgcalPlots.py:2481
def create_hgcalTrackstersPlotter(files, collection='ticlTrackstersMerge', name_collection="TrackstersMerge")
Definition: hgcalPlots.py:2583
def append_hgcalDigisPlots(collection="HGCalDigisV", name_collection="Digis")
Definition: hgcalPlots.py:2787
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
static std::string join(char **cmd)
Definition: RemoteFile.cc:19
def append_hgcalCaloParticlesPlots(files, collection='-211', name_collection="pion-")
Definition: hgcalPlots.py:2534
def append_hgcalSimClustersPlots(collection, name_collection)
Definition: hgcalPlots.py:2416
def append_hgcalLayerClustersPlots(collection=hgcalValidator.label_layerClusterPlots._InputTag__moduleLabel, name_collection=layerClustersLabel, extended=False)
Definition: hgcalPlots.py:2278

Variable Documentation

◆ action

makeHGCalValidationPlots.action

Definition at line 131 of file makeHGCalValidationPlots.py.

◆ allLabel

makeHGCalValidationPlots.allLabel

Definition at line 23 of file makeHGCalValidationPlots.py.

◆ choices

makeHGCalValidationPlots.choices

Definition at line 143 of file makeHGCalValidationPlots.py.

◆ collection_choices

makeHGCalValidationPlots.collection_choices

Definition at line 25 of file makeHGCalValidationPlots.py.

◆ default

makeHGCalValidationPlots.default

Definition at line 125 of file makeHGCalValidationPlots.py.

◆ description

makeHGCalValidationPlots.description

Definition at line 123 of file makeHGCalValidationPlots.py.

◆ help

makeHGCalValidationPlots.help

Definition at line 126 of file makeHGCalValidationPlots.py.

◆ hitCalLabel

makeHGCalValidationPlots.hitCalLabel

Definition at line 17 of file makeHGCalValidationPlots.py.

◆ hitValLabel

makeHGCalValidationPlots.hitValLabel

Definition at line 18 of file makeHGCalValidationPlots.py.

◆ layerClustersLabel

makeHGCalValidationPlots.layerClustersLabel

Definition at line 19 of file makeHGCalValidationPlots.py.

◆ metavar

makeHGCalValidationPlots.metavar

Definition at line 124 of file makeHGCalValidationPlots.py.

◆ nargs

makeHGCalValidationPlots.nargs

Definition at line 124 of file makeHGCalValidationPlots.py.

◆ opts

makeHGCalValidationPlots.opts

Definition at line 150 of file makeHGCalValidationPlots.py.

◆ parser

makeHGCalValidationPlots.parser

Definition at line 123 of file makeHGCalValidationPlots.py.

◆ simClustersIters

makeHGCalValidationPlots.simClustersIters

Definition at line 15 of file makeHGCalValidationPlots.py.

◆ simLabel

makeHGCalValidationPlots.simLabel

Definition at line 22 of file makeHGCalValidationPlots.py.

◆ str

makeHGCalValidationPlots.str

Definition at line 124 of file makeHGCalValidationPlots.py.

◆ trackstersLabel

makeHGCalValidationPlots.trackstersLabel

Definition at line 20 of file makeHGCalValidationPlots.py.

◆ trackstersWithEdgesLabel

makeHGCalValidationPlots.trackstersWithEdgesLabel

Definition at line 21 of file makeHGCalValidationPlots.py.

◆ type

makeHGCalValidationPlots.type

Definition at line 124 of file makeHGCalValidationPlots.py.