CMS 3D CMS Logo

Functions | Variables
makeHGCalValidationPlots Namespace Reference

Functions

def main (opts)
 

Variables

 action
 
 allLabel
 
 caloParticlesLabel
 
 choices
 
 collection_choices
 
 default
 
 description
 
 help
 
 hitCalibrationLabel
 
 hitValidationLabel
 
 layerClustersGeneralLabel
 
 metavar
 
 multiclustersGeneralLabel
 
 nargs
 
 opts
 
 parser
 
 simClustersGeneralLabel
 
 simClustersIters
 
 str
 
 trackstersGeneralLabel
 
 trackstersIters
 
 type
 

Function Documentation

◆ main()

def makeHGCalValidationPlots.main (   opts)

Definition at line 31 of file makeHGCalValidationPlots.py.

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 
46  filenames = [(f, f.replace(".root", "")) for f in opts.files]
47  sample = SimpleSample(opts.subdirprefix[0], opts.html_sample, filenames)
48 
49  val = SimpleValidation([sample], opts.outputDir[0])
50  if opts.separate:
51  val = SeparateValidation([sample], opts.outputDir[0])
52  htmlReport = val.createHtmlReport(validationName=opts.html_validation_name[0])
53 
54  #layerClusters
55  if (opts.collection == layerClustersGeneralLabel):
56  hgclayclus = [hgcalPlots.hgcalLayerClustersPlotter]
57  hgcalPlots.append_hgcalLayerClustersPlots("hgcalLayerClusters", "Layer Clusters", extendedFlag)
58  val.doPlots(hgclayclus, plotterDrawArgs=drawArgs)
59  #simClusters
60  elif (opts.collection == simClustersGeneralLabel):
61  hgcsimclus = [hgcalPlots.hgcalSimClustersPlotter]
62  for i_iter in simClustersIters:
64  val.doPlots(hgcsimclus, plotterDrawArgs=drawArgs)
65  #multiClusters
66  elif (opts.collection == multiclustersGeneralLabel):
67  hgcmulticlus = [hgcalPlots.hgcalMultiClustersPlotter]
68  hgcalPlots.append_hgcalMultiClustersPlots(multiclustersGeneralLabel, "MultiClusters")
69  val.doPlots(hgcmulticlus, plotterDrawArgs=drawArgs)
70  #ticlTracksters
71  elif (opts.collection == trackstersGeneralLabel):
72  hgcmulticlus = [hgcalPlots.hgcalMultiClustersPlotter]
73  for i_iter in trackstersIters :
74  tracksterCollection = i_iter.replace("ticlMultiClustersFromTracksters","ticlTracksters")
75  hgcalPlots.append_hgcalMultiClustersPlots(i_iter, tracksterCollection)
76  val.doPlots(hgcmulticlus, plotterDrawArgs=drawArgs)
77  # TICLTrackstersEdges plots
78  for i_iter in trackstersIters :
79  tracksterCollection = i_iter.replace("ticlMultiClustersFromTracksters","ticlTracksters")
80  hgctracksters = [hgcalPlots.create_hgcalTrackstersPlotter(sample.files(), tracksterCollection, tracksterCollection)]
81  val.doPlots(hgctracksters, plotterDrawArgs=drawArgs)
82  elif (opts.collection == caloParticlesLabel):
83  particletypes = {"pion-":"-211", "pion+":"211", "pion0": "111",
84  "muon-": "-13", "muon+":"13",
85  "electron-": "-11", "electron+": "11", "photon": "22",
86  "kaon0L": "310", "kaon0S": "130",
87  "kaon-": "-321", "kaon+": "321"}
88  hgcaloPart = [hgcalPlots.hgcalCaloParticlesPlotter]
89  for i_part, i_partID in particletypes.iteritems() :
90  hgcalPlots.append_hgcalCaloParticlesPlots(sample.files(), i_partID, i_part)
91  val.doPlots(hgcaloPart, plotterDrawArgs=drawArgs)
92  #hitValidation
93  elif (opts.collection == hitValidationLabel):
94  hgchit = [hgcalPlots.hgcalHitPlotter]
95  hgcalPlots.append_hgcalHitsPlots('HGCalSimHitsV', "Simulated Hits")
96  hgcalPlots.append_hgcalHitsPlots('HGCalRecHitsV', "Reconstruced Hits")
97  hgcalPlots.append_hgcalDigisPlots('HGCalDigisV', "Digis")
98  val.doPlots(hgchit, plotterDrawArgs=drawArgs)
99  #hitCalibration
100  elif (opts.collection == hitCalibrationLabel):
101  hgchitcalib = [hgcalPlots.hgcalHitCalibPlotter]
102  val.doPlots(hgchitcalib, plotterDrawArgs=drawArgs)
103  elif (opts.collection == allLabel):
104  #caloparticles
105  particletypes = {"pion-":"-211", "pion+":"211", "pion0": "111",
106  "muon-": "-13", "muon+":"13",
107  "electron-": "-11", "electron+": "11", "photon": "22",
108  "kaon0L": "310", "kaon0S": "130",
109  "kaon-": "-321", "kaon+": "321"}
110  hgcaloPart = [hgcalPlots.hgcalCaloParticlesPlotter]
111  for i_part, i_partID in particletypes.iteritems() :
112  hgcalPlots.append_hgcalCaloParticlesPlots(sample.files(), i_partID, i_part)
113  val.doPlots(hgcaloPart, plotterDrawArgs=drawArgs)
114 
115  #hits
116  hgchit = [hgcalPlots.hgcalHitPlotter]
117  hgcalPlots.append_hgcalHitsPlots('HGCalSimHitsV', "Simulated Hits")
118  hgcalPlots.append_hgcalHitsPlots('HGCalRecHitsV', "Reconstruced Hits")
119  hgcalPlots.append_hgcalDigisPlots('HGCalDigisV', "Digis")
120  val.doPlots(hgchit, plotterDrawArgs=drawArgs)
121 
122  #calib
123  hgchitcalib = [hgcalPlots.hgcalHitCalibPlotter]
124  val.doPlots(hgchitcalib, plotterDrawArgs=drawArgs)
125 
126  #simClusters
127  hgcsimclus = [hgcalPlots.hgcalSimClustersPlotter]
128  for i_iter in simClustersIters :
130  val.doPlots(hgcsimclus, plotterDrawArgs=drawArgs)
131 
132  #layer clusters
133  hgclayclus = [hgcalPlots.hgcalLayerClustersPlotter]
134  hgcalPlots.append_hgcalLayerClustersPlots("hgcalLayerClusters", "Layer Clusters", extendedFlag)
135  val.doPlots(hgclayclus, plotterDrawArgs=drawArgs)
136 
137  #multiclusters
138  hgcmulticlus = [hgcalPlots.hgcalMultiClustersPlotter]
139  for i_iter in trackstersIters :
140  tracksterCollection = i_iter.replace("ticlMultiClustersFromTracksters","ticlTracksters")
141  hgcalPlots.append_hgcalMultiClustersPlots(i_iter, tracksterCollection)
142  val.doPlots(hgcmulticlus, plotterDrawArgs=drawArgs)
143  #TICLTrackstersEdges plots
144  for i_iter in trackstersIters :
145  tracksterCollection = i_iter.replace("ticlMultiClustersFromTracksters","ticlTracksters")
146  hgctracksters = [hgcalPlots.create_hgcalTrackstersPlotter(sample.files(), tracksterCollection, tracksterCollection)]
147  val.doPlots(hgctracksters, plotterDrawArgs=drawArgs)
148 
149 
150  if opts.no_html:
151  print("Plots created into directory '%s'." % opts.outputDir)
152  else:
153  htmlReport.write()
154 
155  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)))
156 

References hgcalPlots.append_hgcalCaloParticlesPlots(), hgcalPlots.append_hgcalDigisPlots(), hgcalPlots.append_hgcalHitsPlots(), hgcalPlots.append_hgcalLayerClustersPlots(), hgcalPlots.append_hgcalMultiClustersPlots(), hgcalPlots.append_hgcalSimClustersPlots(), hgcalPlots.create_hgcalTrackstersPlotter(), join(), and print().

Variable Documentation

◆ action

makeHGCalValidationPlots.action

Definition at line 166 of file makeHGCalValidationPlots.py.

◆ allLabel

makeHGCalValidationPlots.allLabel

Definition at line 26 of file makeHGCalValidationPlots.py.

◆ caloParticlesLabel

makeHGCalValidationPlots.caloParticlesLabel

Definition at line 25 of file makeHGCalValidationPlots.py.

◆ choices

makeHGCalValidationPlots.choices

Definition at line 178 of file makeHGCalValidationPlots.py.

◆ collection_choices

makeHGCalValidationPlots.collection_choices

Definition at line 28 of file makeHGCalValidationPlots.py.

◆ default

makeHGCalValidationPlots.default

Definition at line 160 of file makeHGCalValidationPlots.py.

◆ description

makeHGCalValidationPlots.description

Definition at line 158 of file makeHGCalValidationPlots.py.

◆ help

makeHGCalValidationPlots.help

Definition at line 161 of file makeHGCalValidationPlots.py.

◆ hitCalibrationLabel

makeHGCalValidationPlots.hitCalibrationLabel

Definition at line 24 of file makeHGCalValidationPlots.py.

◆ hitValidationLabel

makeHGCalValidationPlots.hitValidationLabel

Definition at line 23 of file makeHGCalValidationPlots.py.

◆ layerClustersGeneralLabel

makeHGCalValidationPlots.layerClustersGeneralLabel

Definition at line 20 of file makeHGCalValidationPlots.py.

◆ metavar

makeHGCalValidationPlots.metavar

Definition at line 159 of file makeHGCalValidationPlots.py.

◆ multiclustersGeneralLabel

makeHGCalValidationPlots.multiclustersGeneralLabel

Definition at line 21 of file makeHGCalValidationPlots.py.

◆ nargs

makeHGCalValidationPlots.nargs

Definition at line 159 of file makeHGCalValidationPlots.py.

◆ opts

makeHGCalValidationPlots.opts

Definition at line 185 of file makeHGCalValidationPlots.py.

◆ parser

makeHGCalValidationPlots.parser

Definition at line 158 of file makeHGCalValidationPlots.py.

◆ simClustersGeneralLabel

makeHGCalValidationPlots.simClustersGeneralLabel

Definition at line 19 of file makeHGCalValidationPlots.py.

◆ simClustersIters

makeHGCalValidationPlots.simClustersIters

Definition at line 12 of file makeHGCalValidationPlots.py.

◆ str

makeHGCalValidationPlots.str

Definition at line 159 of file makeHGCalValidationPlots.py.

◆ trackstersGeneralLabel

makeHGCalValidationPlots.trackstersGeneralLabel

Definition at line 22 of file makeHGCalValidationPlots.py.

◆ trackstersIters

makeHGCalValidationPlots.trackstersIters

Definition at line 14 of file makeHGCalValidationPlots.py.

◆ type

makeHGCalValidationPlots.type

Definition at line 159 of file makeHGCalValidationPlots.py.

hgcalPlots.append_hgcalCaloParticlesPlots
def append_hgcalCaloParticlesPlots(files, collection='-211', name_collection="pion-")
Definition: hgcalPlots.py:2489
hgcalPlots.append_hgcalDigisPlots
def append_hgcalDigisPlots(collection="HGCalDigisV", name_collection="Digis")
Definition: hgcalPlots.py:2742
join
static std::string join(char **cmd)
Definition: RemoteFile.cc:17
hgcalPlots.append_hgcalMultiClustersPlots
def append_hgcalMultiClustersPlots(collection='ticlMultiClustersFromTrackstersMerge', name_collection="MultiClustersMerge")
Definition: hgcalPlots.py:2456
hgcalPlots.append_hgcalSimClustersPlots
def append_hgcalSimClustersPlots(collection, name_collection)
Definition: hgcalPlots.py:2407
makeHGCalValidationPlots.main
def main(opts)
Definition: makeHGCalValidationPlots.py:31
print
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:46
hgcalPlots.append_hgcalHitsPlots
def append_hgcalHitsPlots(collection="HGCalSimHitsV", name_collection="Simulated Hits")
Definition: hgcalPlots.py:2673
hgcalPlots.create_hgcalTrackstersPlotter
def create_hgcalTrackstersPlotter(files, collection='ticlTrackstersMerge', name_collection="MultiClustersMerge")
Definition: hgcalPlots.py:2540
hgcalPlots.append_hgcalLayerClustersPlots
def append_hgcalLayerClustersPlots(collection="hgcalLayerClusters", name_collection=layerClustersLabel, extended=False)
Definition: hgcalPlots.py:2267