CMS 3D CMS Logo

Functions | Variables
makeHGCalValidationPlots Namespace Reference

Functions

def main (opts)
 

Variables

 action
 
 allLabel
 
 candidatesLabel
 
 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 29 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.

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

Variable Documentation

◆ action

makeHGCalValidationPlots.action

Definition at line 135 of file makeHGCalValidationPlots.py.

◆ allLabel

makeHGCalValidationPlots.allLabel

Definition at line 24 of file makeHGCalValidationPlots.py.

◆ candidatesLabel

makeHGCalValidationPlots.candidatesLabel

Definition at line 22 of file makeHGCalValidationPlots.py.

◆ choices

makeHGCalValidationPlots.choices

Definition at line 147 of file makeHGCalValidationPlots.py.

◆ collection_choices

makeHGCalValidationPlots.collection_choices

Definition at line 26 of file makeHGCalValidationPlots.py.

◆ default

makeHGCalValidationPlots.default

Definition at line 129 of file makeHGCalValidationPlots.py.

◆ description

makeHGCalValidationPlots.description

Definition at line 127 of file makeHGCalValidationPlots.py.

◆ help

makeHGCalValidationPlots.help

Definition at line 130 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 128 of file makeHGCalValidationPlots.py.

◆ nargs

makeHGCalValidationPlots.nargs

Definition at line 128 of file makeHGCalValidationPlots.py.

◆ opts

makeHGCalValidationPlots.opts

Definition at line 156 of file makeHGCalValidationPlots.py.

◆ parser

makeHGCalValidationPlots.parser

Definition at line 127 of file makeHGCalValidationPlots.py.

◆ simClustersIters

makeHGCalValidationPlots.simClustersIters

Definition at line 15 of file makeHGCalValidationPlots.py.

◆ simLabel

makeHGCalValidationPlots.simLabel

Definition at line 23 of file makeHGCalValidationPlots.py.

◆ str

makeHGCalValidationPlots.str

Definition at line 128 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 128 of file makeHGCalValidationPlots.py.