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
 
 ticlVersion
 
 ticlVersions
 
 tracksters
 
 trackstersLabel
 
 trackstersWithEdgesLabel
 
 type
 

Function Documentation

◆ main()

def makeHGCalValidationPlots.main (   opts)

Definition at line 31 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.

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

Variable Documentation

◆ action

makeHGCalValidationPlots.action

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

◆ collection_choices

makeHGCalValidationPlots.collection_choices

Definition at line 27 of file makeHGCalValidationPlots.py.

◆ default

makeHGCalValidationPlots.default

Definition at line 142 of file makeHGCalValidationPlots.py.

◆ description

makeHGCalValidationPlots.description

Definition at line 140 of file makeHGCalValidationPlots.py.

◆ help

makeHGCalValidationPlots.help

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

◆ nargs

makeHGCalValidationPlots.nargs

Definition at line 141 of file makeHGCalValidationPlots.py.

◆ opts

makeHGCalValidationPlots.opts

Definition at line 171 of file makeHGCalValidationPlots.py.

◆ parser

makeHGCalValidationPlots.parser

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

◆ ticlVersion

makeHGCalValidationPlots.ticlVersion

Definition at line 26 of file makeHGCalValidationPlots.py.

◆ ticlVersions

makeHGCalValidationPlots.ticlVersions

Definition at line 25 of file makeHGCalValidationPlots.py.

◆ tracksters

makeHGCalValidationPlots.tracksters

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