CMS 3D CMS Logo

hgcalPlots.py
Go to the documentation of this file.
1 from __future__ import print_function
2 import os
3 import sys
4 import copy
5 import collections
6 
7 import ROOT
8 from ROOT import TFile, TString
9 from ROOT import gDirectory
10 ROOT.gROOT.SetBatch(True)
11 ROOT.PyConfig.IgnoreCommandLineOptions = True
12 
13 from Validation.RecoTrack.plotting.plotting import Plot, PlotGroup, PlotFolder, Plotter, PlotOnSideGroup
14 from Validation.RecoTrack.plotting.html import PlotPurpose
15 import Validation.RecoTrack.plotting.plotting as plotting
16 import Validation.RecoTrack.plotting.validation as validation
17 import Validation.RecoTrack.plotting.html as html
18 
19 from Validation.HGCalValidation.HGCalValidator_cff import hgcalValidator
20 from Validation.HGCalValidation.PostProcessorHGCAL_cfi import lcToCP_linking, simDict, TSbyHits_CP, TSbyLCs, TSbyLCs_CP, TSbyHits, variables
21 
22 hgcVal_dqm = "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/"
23 #The number of layers per endcap in the current default geometry scenario.
24 geometryscenario = 47
25 
26 #To be able to spot any issues both in -z and +z a layer id was introduced
27 #that spans from 0 to 103 for hgcal_v9 geometry. The mapping for hgcal_v9 is:
28 #-z: 0->51
29 #+z: 52->103
30 #while for V10 is:
31 #-z: 0->49
32 #+z: 50->99
33 '''
34 layerscheme = { 'lastLayerEEzm': 0, 'lastLayerFHzm': 0, 'maxlayerzm': 0, 'lastLayerEEzp': 0, 'lastLayerFHzp': 0, 'maxlayerzp': 0 }
35 
36 #Let's take the relevant values of layerscheme from the dqm file.
37 theDQMfile = "DQM_V0001_R000000001__Global__CMSSW_X_Y_Z__RECO.root"
38 if not os.path.isfile(theDQMfile):
39  print("Error: file", theDQMfile, "not found, exit")
40  sys.exit(0)
41 
42 
43 #Take general info from the first file is sufficient.
44 thefile = TFile( theDQMfile )
45 GeneralInfoDirectory = hgcVal_dqm + 'GeneralInfo'
46 
47 if not gDirectory.GetDirectory( GeneralInfoDirectory ):
48  print("Error: GeneralInfo directory not found in DQM file, exit")
49  sys.exit(0)
50 
51 keys = gDirectory.GetDirectory( GeneralInfoDirectory ).GetListOfKeys()
52 key = keys[0]
53 layvalue = 0
54 while key:
55  obj = key.ReadObj()
56  for laykey in layerscheme.keys():
57  if laykey in obj.GetName():
58  layvalue = obj.GetName()[len("<"+laykey+">i="):-len("</"+laykey+">")]
59  layerscheme[laykey] = layvalue
60  #print(layvalue)
61  key = keys.After(key)
62 
63 thefile.Close()
64 
65 print(layerscheme)
66 #TODO: Anticipating the fine/coarse layer information in CMSSW we overwrite values from DQM file
67 #For now values returned for
68 # 'lastLayerFHzp': '104', 'lastLayerFHzm': '52'
69 #are not the one expected. Will come back to this when there will be info in CMSSW to put in DQM file.
70 #For V9:
71 #layerscheme = { 'lastLayerEEzm': 28, 'lastLayerFHzm': 40, 'maxlayerzm': 52, 'lastLayerEEzp': 80, 'lastLayerFHzp': 92, 'maxlayerzp': 104 }
72 #For V10:
73 layerscheme = { 'lastLayerEEzm': 28, 'lastLayerFHzm': 40, 'maxlayerzm': 50, 'lastLayerEEzp': 78, 'lastLayerFHzp': 90, 'maxlayerzp': 100 }
74 #For V16
75 layerscheme = { 'lastLayerEEzm': 26, 'lastLayerFHzm': 37, 'maxlayerzm': 47, 'lastLayerEEzp': 73, 'lastLayerFHzp': 84, 'maxlayerzp': 94 }
76 '''
77 #print(layerscheme)
78 
79 layerscheme = {}
80 
81 if geometryscenario == 52:
82  layerscheme = { 'lastLayerEEzm': 28, 'lastLayerFHzm': 40, 'maxlayerzm': 52, 'lastLayerEEzp': 80, 'lastLayerFHzp': 92, 'maxlayerzp': 104 }
83 elif geometryscenario == 50:
84  layerscheme = { 'lastLayerEEzm': 28, 'lastLayerFHzm': 40, 'maxlayerzm': 50, 'lastLayerEEzp': 78, 'lastLayerFHzp': 90, 'maxlayerzp': 100 }
85 elif geometryscenario == 47:
86  layerscheme = { 'lastLayerEEzm': 26, 'lastLayerFHzm': 37, 'maxlayerzm': 47, 'lastLayerEEzp': 73, 'lastLayerFHzp': 84, 'maxlayerzp': 94 }
87 #print(layerscheme)
88 
89 lastLayerEEzm = layerscheme['lastLayerEEzm'] # last layer of EE -z
90 lastLayerFHzm = layerscheme['lastLayerFHzm'] # last layer of FH -z
91 maxlayerzm = layerscheme['maxlayerzm'] # last layer of BH -z
92 lastLayerEEzp = layerscheme['lastLayerEEzp'] # last layer of EE +z
93 lastLayerFHzp = layerscheme['lastLayerFHzp'] # last layer of FH +z
94 maxlayerzp = layerscheme['maxlayerzp'] # last layer of BH +z
95 
96 hitlayerscheme = { 'EE_min': 1,'EE_max': 28, 'HESilicon_min': 1, 'HESilicon_max': 22, 'HEScintillator_min': 9 , 'HEScintillator_max': 22 }
97 #print(hitlayerscheme)
98 
99 EE_min = hitlayerscheme['EE_min']
100 EE_max = hitlayerscheme['EE_max']
101 HESilicon_min = hitlayerscheme['HESilicon_min']
102 HESilicon_max = hitlayerscheme['HESilicon_max']
103 HEScintillator_min = hitlayerscheme['HEScintillator_min']
104 HEScintillator_max = hitlayerscheme['HEScintillator_max']
105 
106 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65 }
107 _legend_common = {"legendDx": -0.3,
108  "legendDy": -0.05,
109  "legendDw": 0.1}
110 
111 _SelectedCaloParticles = PlotGroup("SelectedCaloParticles", [
112  Plot("num_caloparticle_eta", xtitle="", **_common),
113  Plot("caloparticle_energy", xtitle="", **_common),
114  Plot("caloparticle_pt", xtitle="", **_common),
115  Plot("caloparticle_phi", xtitle="", **_common),
116  Plot("Eta vs Zorigin", xtitle="", **_common),
117  ])
118 
119 #Need to adjust the statbox to see better the plot
120 _common = {"stat": True, "drawStyle": "hist", "statx": 0.38, "staty": 0.68 }
121 _num_reco_cluster_eta = PlotGroup("num_reco_cluster_eta", [
122  Plot("num_reco_cluster_eta", xtitle="", **_common),
123 ],ncols=1)
124 #Back to normal
125 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65 }
126 
127 _mixedhitsclusters = PlotGroup("mixedhitsclusters", [
128  Plot("mixedhitscluster_zminus", xtitle="", **_common),
129  Plot("mixedhitscluster_zplus", xtitle="", **_common),
130 ],ncols=2)
131 
132 _mixedhitssimclusters = PlotGroup("mixedhitssimclusters", [
133  Plot("mixedhitssimcluster_zminus", xtitle="", **_common),
134  Plot("mixedhitssimcluster_zplus", xtitle="", **_common),
135 ],ncols=2)
136 
137 #Just to prevent the stabox covering the plot
138 _common = {"stat": True, "drawStyle": "hist", "statx": 0.45, "staty": 0.65 }
139 
140 _energyclustered = PlotGroup("energyclustered", [
141  Plot("energyclustered_zminus", xtitle="", **_common),
142  Plot("energyclustered_zplus", xtitle="", **_common),
143 ],ncols=2)
144 
145 #Coming back to the usual box definition
146 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65 }
147 
148 _longdepthbarycentre = PlotGroup("longdepthbarycentre", [
149  Plot("longdepthbarycentre_zminus", xtitle="", **_common),
150  Plot("longdepthbarycentre_zplus", xtitle="", **_common),
151 ],ncols=2)
152 
153 _common_layerperthickness = {}
154 _common_layerperthickness.update(_common)
155 _common_layerperthickness['xmin'] = 0.
156 _common_layerperthickness['xmax'] = 100
157 
158 _totclusternum_thick = PlotGroup("totclusternum_thick", [
159  Plot("totclusternum_thick_120", xtitle="", **_common_layerperthickness),
160  Plot("totclusternum_thick_200", xtitle="", **_common_layerperthickness),
161  Plot("totclusternum_thick_300", xtitle="", **_common_layerperthickness),
162  Plot("totclusternum_thick_-1", xtitle="", **_common_layerperthickness),
163  Plot("mixedhitscluster", xtitle="", **_common_layerperthickness),
164 ])
165 
166 _totsimclusternum_thick = PlotGroup("totsimclusternum_thick", [
167  Plot("totsimclusternum_thick_120", xtitle="", **_common_layerperthickness),
168  Plot("totsimclusternum_thick_200", xtitle="", **_common_layerperthickness),
169  Plot("totsimclusternum_thick_300", xtitle="", **_common_layerperthickness),
170  Plot("totsimclusternum_thick_-1", xtitle="", **_common_layerperthickness),
171  Plot("mixedhitssimcluster", xtitle="", **_common_layerperthickness),
172 ])
173 
174 #We will plot the density in logy scale.
175 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65, "ylog": True}
176 
177 _cellsenedens_thick = PlotGroup("cellsenedens_thick", [
178  Plot("cellsenedens_thick_120", xtitle="", **_common),
179  Plot("cellsenedens_thick_200", xtitle="", **_common),
180  Plot("cellsenedens_thick_300", xtitle="", **_common),
181  Plot("cellsenedens_thick_-1", xtitle="", **_common),
182 ])
183 
184 #Coming back to the usual box definition
185 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65 }
186 
187 
188 #--------------------------------------------------------------------------------------------
189 # z-
190 #--------------------------------------------------------------------------------------------
191 _totclusternum_layer_EE_zminus = PlotGroup("totclusternum_layer_EE", [
192  Plot("totclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
193 ], ncols=7)
194 
195 _totclusternum_layer_FH_zminus = PlotGroup("totclusternum_layer_FH", [
196  Plot("totclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
197 ], ncols=7)
198 
199 _totclusternum_layer_BH_zminus = PlotGroup("totclusternum_layer_BH", [
200  Plot("totclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
201 ], ncols=7)
202 
203 _totsimclusternum_layer_EE_zminus = PlotGroup("totsimclusternum_layer_EE_zminus", [
204  Plot("totsimclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
205 ], ncols=4)
206 
207 _totsimclusternum_layer_FH_zminus = PlotGroup("totsimclusternum_layer_FH_zminus", [
208  Plot("totsimclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
209 ], ncols=4)
210 
211 _totsimclusternum_layer_BH_zminus = PlotGroup("totsimclusternum_layer_BH_zminus", [
212  Plot("totsimclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
213 ], ncols=4)
214 
215 _energyclustered_perlayer_EE_zminus = PlotGroup("energyclustered_perlayer_EE", [
216  Plot("energyclustered_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
217 ], ncols=7)
218 
219 _energyclustered_perlayer_FH_zminus = PlotGroup("energyclustered_perlayer_FH", [
220  Plot("energyclustered_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
221 ], ncols=7)
222 
223 _energyclustered_perlayer_BH_zminus = PlotGroup("energyclustered_perlayer_BH", [
224  Plot("energyclustered_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
225 ], ncols=7)
226 
227 #----------------------------------------------------------------------------------------------------------------
228 #120 um
229 _common_cells = {}
230 _common_cells.update(_common)
231 _common_cells["xmin"] = 0
232 _common_cells["xmax"] = 50
233 _common_cells["ymin"] = 0.1
234 _common_cells["ymax"] = 10000
235 _common_cells["ylog"] = True
236 _cellsnum_perthick_perlayer_120_EE_zminus = PlotGroup("cellsnum_perthick_perlayer_120_EE", [
237  Plot("cellsnum_perthick_perlayer_120_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzm)
238 ], ncols=7)
239 
240 _cellsnum_perthick_perlayer_120_FH_zminus = PlotGroup("cellsnum_perthick_perlayer_120_FH", [
241  Plot("cellsnum_perthick_perlayer_120_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzm,lastLayerFHzm)
242 ], ncols=7)
243 
244 _cellsnum_perthick_perlayer_120_BH_zminus = PlotGroup("cellsnum_perthick_perlayer_120_BH", [
245  Plot("cellsnum_perthick_perlayer_120_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerFHzm,maxlayerzm)
246 ], ncols=7)
247 
248 #200 um
249 _cellsnum_perthick_perlayer_200_EE_zminus = PlotGroup("cellsnum_perthick_perlayer_200_EE", [
250  Plot("cellsnum_perthick_perlayer_200_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzm)
251 ], ncols=7)
252 
253 _cellsnum_perthick_perlayer_200_FH_zminus = PlotGroup("cellsnum_perthick_perlayer_200_FH", [
254  Plot("cellsnum_perthick_perlayer_200_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzm,lastLayerFHzm)
255 ], ncols=7)
256 
257 _cellsnum_perthick_perlayer_200_BH_zminus = PlotGroup("cellsnum_perthick_perlayer_200_BH", [
258  Plot("cellsnum_perthick_perlayer_200_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerFHzm,maxlayerzm)
259 ], ncols=7)
260 
261 #300 um
262 _cellsnum_perthick_perlayer_300_EE_zminus = PlotGroup("cellsnum_perthick_perlayer_300_EE", [
263  Plot("cellsnum_perthick_perlayer_300_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzm)
264 ], ncols=7)
265 
266 _cellsnum_perthick_perlayer_300_FH_zminus = PlotGroup("cellsnum_perthick_perlayer_300_FH", [
267  Plot("cellsnum_perthick_perlayer_300_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzm,lastLayerFHzm)
268 ], ncols=7)
269 
270 _cellsnum_perthick_perlayer_300_BH_zminus = PlotGroup("cellsnum_perthick_perlayer_300_BH", [
271  Plot("cellsnum_perthick_perlayer_300_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerFHzm,maxlayerzm)
272 ], ncols=7)
273 
274 #scint um
275 _cellsnum_perthick_perlayer_scint_EE_zminus = PlotGroup("cellsnum_perthick_perlayer_Sci_EE", [
276  Plot("cellsnum_perthick_perlayer_-1_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzm)
277 ], ncols=7)
278 
279 _cellsnum_perthick_perlayer_scint_FH_zminus = PlotGroup("cellsnum_perthick_perlayer_Sci_FH", [
280  Plot("cellsnum_perthick_perlayer_-1_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzm,lastLayerFHzm)
281 ], ncols=7)
282 
283 _cellsnum_perthick_perlayer_scint_BH_zminus = PlotGroup("cellsnum_perthick_perlayer_Sci_BH", [
284  Plot("cellsnum_perthick_perlayer_-1_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerFHzm,maxlayerzm)
285 ], ncols=7)
286 
287 #----------------------------------------------------------------------------------------------------------------
288 #120 um
289 _common_distance = {}
290 _common_distance.update(_common)
291 _common_distance.update(_legend_common)
292 _common_distance["xmax"] = 150
293 _common_distance["stat"] = False
294 _common_distance["ymin"] = 1e-3
295 _common_distance["ymax"] = 10000
296 _common_distance["ylog"] = True
297 
298 _distancetomaxcell_perthickperlayer_120_EE_zminus = PlotGroup("distancetomaxcell_perthickperlayer_120_EE", [
299  Plot("distancetomaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
300 ], ncols=7)
301 
302 _distancetomaxcell_perthickperlayer_120_FH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_120_FH", [
303  Plot("distancetomaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
304 ], ncols=7)
305 
306 _distancetomaxcell_perthickperlayer_120_BH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_120_BH", [
307  Plot("distancetomaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
308 ], ncols=7)
309 
310 #200 um
311 _distancetomaxcell_perthickperlayer_200_EE_zminus = PlotGroup("distancetomaxcell_perthickperlayer_200_EE", [
312  Plot("distancetomaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
313 ], ncols=7)
314 
315 _distancetomaxcell_perthickperlayer_200_FH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_200_FH", [
316  Plot("distancetomaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
317 ], ncols=7)
318 
319 _distancetomaxcell_perthickperlayer_200_BH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_200_BH", [
320  Plot("distancetomaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
321 ], ncols=7)
322 
323 #300 um
324 _distancetomaxcell_perthickperlayer_300_EE_zminus = PlotGroup("distancetomaxcell_perthickperlayer_300_EE", [
325  Plot("distancetomaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
326 ], ncols=7)
327 
328 _distancetomaxcell_perthickperlayer_300_FH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_300_FH", [
329  Plot("distancetomaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
330 ], ncols=7)
331 
332 _distancetomaxcell_perthickperlayer_300_BH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_300_BH", [
333  Plot("distancetomaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
334 ], ncols=7)
335 
336 #scint um
337 _distancetomaxcell_perthickperlayer_scint_EE_zminus = PlotGroup("distancetomaxcell_perthickperlayer_Sci_EE", [
338  Plot("distancetomaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
339 ], ncols=7)
340 
341 _distancetomaxcell_perthickperlayer_scint_FH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_Sci_FH", [
342  Plot("distancetomaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
343 ], ncols=7)
344 
345 _distancetomaxcell_perthickperlayer_scint_BH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_Sci_BH", [
346  Plot("distancetomaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
347 ], ncols=7)
348 
349 #----------------------------------------------------------------------------------------------------------------
350 #120 um
351 _distancebetseedandmaxcell_perthickperlayer_120_EE_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_120_EE", [
352  Plot("distancebetseedandmaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
353 ], ncols=7)
354 
355 _distancebetseedandmaxcell_perthickperlayer_120_FH_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_120_FH", [
356  Plot("distancebetseedandmaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
357 ], ncols=7)
358 
359 _distancebetseedandmaxcell_perthickperlayer_120_BH_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_120_BH", [
360  Plot("distancebetseedandmaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
361 ], ncols=7)
362 
363 #200 um
364 _distancebetseedandmaxcell_perthickperlayer_200_EE_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_200_EE", [
365  Plot("distancebetseedandmaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
366 ], ncols=7)
367 
368 _distancebetseedandmaxcell_perthickperlayer_200_FH_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_200_FH", [
369  Plot("distancebetseedandmaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
370 ], ncols=7)
371 
372 _distancebetseedandmaxcell_perthickperlayer_200_BH_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_200_BH", [
373  Plot("distancebetseedandmaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
374 ], ncols=7)
375 
376 #300 um
377 _distancebetseedandmaxcell_perthickperlayer_300_EE_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_300_EE", [
378  Plot("distancebetseedandmaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
379 ], ncols=7)
380 
381 _distancebetseedandmaxcell_perthickperlayer_300_FH_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_300_FH", [
382  Plot("distancebetseedandmaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
383 ], ncols=7)
384 
385 _distancebetseedandmaxcell_perthickperlayer_300_BH_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_300_BH", [
386  Plot("distancebetseedandmaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
387 ], ncols=7)
388 
389 #scint um
390 _distancebetseedandmaxcell_perthickperlayer_scint_EE_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_Sci_EE", [
391  Plot("distancebetseedandmaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
392 ], ncols=7)
393 
394 _distancebetseedandmaxcell_perthickperlayer_scint_FH_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_Sci_FH", [
395  Plot("distancebetseedandmaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
396 ], ncols=7)
397 
398 _distancebetseedandmaxcell_perthickperlayer_scint_BH_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_Sci_BH", [
399  Plot("distancebetseedandmaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
400 ], ncols=7)
401 
402 #----------------------------------------------------------------------------------------------------------------
403 #120 um
404 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_EE_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_EE", [
405  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
406 ], ncols=7)
407 
408 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_FH_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_FH", [
409  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
410 ], ncols=7)
411 
412 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_BH_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_BH", [
413  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
414 ], ncols=7)
415 
416 #200 um
417 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_EE_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_EE", [
418  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
419 ], ncols=7)
420 
421 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_FH_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_FH", [
422  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
423 ], ncols=7)
424 
425 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_BH_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_BH", [
426  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
427 ], ncols=7)
428 
429 #300 um
430 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_EE_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_EE", [
431  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
432 ], ncols=7)
433 
434 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_FH_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_FH", [
435  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
436 ], ncols=7)
437 
438 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_BH_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_BH", [
439  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
440 ], ncols=7)
441 
442 #scint um
443 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_EE_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_Sci_EE", [
444  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
445 ], ncols=7)
446 
447 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_FH_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_Sci_FH", [
448  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
449 ], ncols=7)
450 
451 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_BH_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_Sci_BH", [
452  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
453 ], ncols=7)
454 
455 #----------------------------------------------------------------------------------------------------------------
456 #120 um
457 _distancetoseedcell_perthickperlayer_120_EE_zminus = PlotGroup("distancetoseedcell_perthickperlayer_120_EE", [
458  Plot("distancetoseedcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
459 ], ncols=7)
460 
461 _distancetoseedcell_perthickperlayer_120_FH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_120_FH", [
462  Plot("distancetoseedcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
463 ], ncols=7)
464 
465 _distancetoseedcell_perthickperlayer_120_BH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_120_BH", [
466  Plot("distancetoseedcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
467 ], ncols=7)
468 
469 #200 um
470 _distancetoseedcell_perthickperlayer_200_EE_zminus = PlotGroup("distancetoseedcell_perthickperlayer_200_EE", [
471  Plot("distancetoseedcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
472 ], ncols=7)
473 
474 _distancetoseedcell_perthickperlayer_200_FH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_200_FH", [
475  Plot("distancetoseedcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
476 ], ncols=7)
477 
478 _distancetoseedcell_perthickperlayer_200_BH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_200_BH", [
479  Plot("distancetoseedcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
480 ], ncols=7)
481 
482 #300 um
483 _distancetoseedcell_perthickperlayer_300_EE_zminus = PlotGroup("distancetoseedcell_perthickperlayer_300_EE", [
484  Plot("distancetoseedcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
485 ], ncols=7)
486 
487 _distancetoseedcell_perthickperlayer_300_FH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_300_FH", [
488  Plot("distancetoseedcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
489 ], ncols=7)
490 
491 _distancetoseedcell_perthickperlayer_300_BH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_300_BH", [
492  Plot("distancetoseedcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
493 ], ncols=7)
494 
495 #scint um
496 _distancetoseedcell_perthickperlayer_scint_EE_zminus = PlotGroup("distancetoseedcell_perthickperlayer_Sci_EE", [
497  Plot("distancetoseedcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
498 ], ncols=7)
499 
500 _distancetoseedcell_perthickperlayer_scint_FH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_Sci_FH", [
501  Plot("distancetoseedcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
502 ], ncols=7)
503 
504 _distancetoseedcell_perthickperlayer_scint_BH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_Sci_BH", [
505  Plot("distancetoseedcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
506 ], ncols=7)
507 
508 #=====================================================================================================================
509 #----------------------------------------------------------------------------------------------------------------
510 #We need points for the weighted plots
511 _common = {"stat": True, "drawStyle": "EP", "staty": 0.65 }
512 #120 um
513 _distancetomaxcell_perthickperlayer_eneweighted_120_EE_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_120_EE", [
514  Plot("distancetomaxcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
515 ], ncols=7)
516 
517 _distancetomaxcell_perthickperlayer_eneweighted_120_FH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_120_FH", [
518  Plot("distancetomaxcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
519 ], ncols=7)
520 
521 _distancetomaxcell_perthickperlayer_eneweighted_120_BH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_120_BH", [
522  Plot("distancetomaxcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
523 ], ncols=7)
524 
525 #200 um
526 _distancetomaxcell_perthickperlayer_eneweighted_200_EE_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_200_EE", [
527  Plot("distancetomaxcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
528 ], ncols=7)
529 
530 _distancetomaxcell_perthickperlayer_eneweighted_200_FH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_200_FH", [
531  Plot("distancetomaxcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
532 ], ncols=7)
533 
534 _distancetomaxcell_perthickperlayer_eneweighted_200_BH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_200_BH", [
535  Plot("distancetomaxcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
536 ], ncols=7)
537 
538 #300 um
539 _distancetomaxcell_perthickperlayer_eneweighted_300_EE_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_300_EE", [
540  Plot("distancetomaxcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
541 ], ncols=7)
542 
543 _distancetomaxcell_perthickperlayer_eneweighted_300_FH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_300_FH", [
544  Plot("distancetomaxcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
545 ], ncols=7)
546 
547 _distancetomaxcell_perthickperlayer_eneweighted_300_BH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_300_BH", [
548  Plot("distancetomaxcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
549 ], ncols=7)
550 #scint um
551 _distancetomaxcell_perthickperlayer_eneweighted_scint_EE_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_Sci_EE", [
552  Plot("distancetomaxcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
553 ], ncols=7)
554 
555 _distancetomaxcell_perthickperlayer_eneweighted_scint_FH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_Sci_FH", [
556  Plot("distancetomaxcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
557 ], ncols=7)
558 
559 _distancetomaxcell_perthickperlayer_eneweighted_scint_BH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_Sci_BH", [
560  Plot("distancetomaxcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
561 ], ncols=7)
562 
563 
564 #----------------------------------------------------------------------------------------------------------------
565 #120 um
566 _distancetoseedcell_perthickperlayer_eneweighted_120_EE_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_120_EE", [
567  Plot("distancetoseedcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
568 ], ncols=7)
569 
570 _distancetoseedcell_perthickperlayer_eneweighted_120_FH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_120_FH", [
571  Plot("distancetoseedcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
572 ], ncols=7)
573 
574 _distancetoseedcell_perthickperlayer_eneweighted_120_BH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_120_BH", [
575  Plot("distancetoseedcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
576 ], ncols=7)
577 
578 #200 um
579 _distancetoseedcell_perthickperlayer_eneweighted_200_EE_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_200_EE", [
580  Plot("distancetoseedcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
581 ], ncols=7)
582 
583 _distancetoseedcell_perthickperlayer_eneweighted_200_FH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_200_FH", [
584  Plot("distancetoseedcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
585 ], ncols=7)
586 
587 _distancetoseedcell_perthickperlayer_eneweighted_200_BH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_200_BH", [
588  Plot("distancetoseedcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
589 ], ncols=7)
590 
591 #300 um
592 _distancetoseedcell_perthickperlayer_eneweighted_300_EE_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_300_EE", [
593  Plot("distancetoseedcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
594 ], ncols=7)
595 
596 _distancetoseedcell_perthickperlayer_eneweighted_300_FH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_300_FH", [
597  Plot("distancetoseedcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
598 ], ncols=7)
599 
600 _distancetoseedcell_perthickperlayer_eneweighted_300_BH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_300_BH", [
601  Plot("distancetoseedcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
602 ], ncols=7)
603 
604 #scint um
605 _distancetoseedcell_perthickperlayer_eneweighted_scint_EE_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_Sci_EE", [
606  Plot("distancetoseedcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
607 ], ncols=7)
608 
609 _distancetoseedcell_perthickperlayer_eneweighted_scint_FH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_Sci_FH", [
610  Plot("distancetoseedcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
611 ], ncols=7)
612 
613 _distancetoseedcell_perthickperlayer_eneweighted_scint_BH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_Sci_BH", [
614  Plot("distancetoseedcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
615 ], ncols=7)
616 
617 #Coming back to the usual definition
618 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65 }
619 
620 #--------------------------------------------------------------------------------------------
621 # z+
622 #--------------------------------------------------------------------------------------------
623 _totclusternum_layer_EE_zplus = PlotGroup("totclusternum_layer_EE", [
624  Plot("totclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
625 ], ncols=7)
626 
627 _totclusternum_layer_FH_zplus = PlotGroup("totclusternum_layer_FH", [
628  Plot("totclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
629 ], ncols=7)
630 
631 _totclusternum_layer_BH_zplus = PlotGroup("totclusternum_layer_BH", [
632  Plot("totclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
633 ], ncols=7)
634 
635 _totsimclusternum_layer_EE_zplus = PlotGroup("totsimclusternum_layer_EE_zplus", [
636  Plot("totsimclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
637 ], ncols=4)
638 
639 _totsimclusternum_layer_FH_zplus = PlotGroup("totsimclusternum_layer_FH_zplus", [
640  Plot("totsimclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
641 ], ncols=4)
642 
643 _totsimclusternum_layer_BH_zplus = PlotGroup("totsimclusternum_layer_BH_zplus", [
644  Plot("totsimclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
645 ], ncols=4)
646 
647 _energyclustered_perlayer_EE_zplus = PlotGroup("energyclustered_perlayer_EE", [
648  Plot("energyclustered_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
649 ], ncols=7)
650 
651 _energyclustered_perlayer_FH_zplus = PlotGroup("energyclustered_perlayer_FH", [
652  Plot("energyclustered_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
653 ], ncols=7)
654 
655 _energyclustered_perlayer_BH_zplus = PlotGroup("energyclustered_perlayer_BH", [
656  Plot("energyclustered_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
657 ], ncols=7)
658 
659 #----------------------------------------------------------------------------------------------------------------
660 #120 um
661 _cellsnum_perthick_perlayer_120_EE_zplus = PlotGroup("cellsnum_perthick_perlayer_120_EE", [
662  Plot("cellsnum_perthick_perlayer_120_{:02d}".format(i), xtitle="", **_common_cells) for i in range(maxlayerzm,lastLayerEEzp)
663 ], ncols=7)
664 
665 _cellsnum_perthick_perlayer_120_FH_zplus = PlotGroup("cellsnum_perthick_perlayer_120_FH", [
666  Plot("cellsnum_perthick_perlayer_120_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzp,lastLayerFHzp)
667 ], ncols=7)
668 _cellsnum_perthick_perlayer_120_BH_zplus = PlotGroup("cellsnum_perthick_perlayer_120_BH", [
669  Plot("cellsnum_perthick_perlayer_120_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerFHzp,maxlayerzp)
670 ], ncols=7)
671 
672 #200 um
673 _cellsnum_perthick_perlayer_200_EE_zplus = PlotGroup("cellsnum_perthick_perlayer_200_EE", [
674  Plot("cellsnum_perthick_perlayer_200_{:02d}".format(i), xtitle="", **_common_cells) for i in range(maxlayerzm,lastLayerEEzp)
675 ], ncols=7)
676 
677 _cellsnum_perthick_perlayer_200_FH_zplus = PlotGroup("cellsnum_perthick_perlayer_200_FH", [
678  Plot("cellsnum_perthick_perlayer_200_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzp,lastLayerFHzp)
679 ], ncols=7)
680 
681 _cellsnum_perthick_perlayer_200_BH_zplus = PlotGroup("cellsnum_perthick_perlayer_200_BH", [
682  Plot("cellsnum_perthick_perlayer_200_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerFHzp,maxlayerzp)
683 ], ncols=7)
684 #300 um
685 _cellsnum_perthick_perlayer_300_EE_zplus = PlotGroup("cellsnum_perthick_perlayer_300_EE", [
686  Plot("cellsnum_perthick_perlayer_300_{:02d}".format(i), xtitle="", **_common_cells) for i in range(maxlayerzm,lastLayerEEzp)
687 ], ncols=7)
688 
689 _cellsnum_perthick_perlayer_300_FH_zplus = PlotGroup("cellsnum_perthick_perlayer_300_FH", [
690  Plot("cellsnum_perthick_perlayer_300_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzp,lastLayerFHzp)
691 ], ncols=7)
692 _cellsnum_perthick_perlayer_300_BH_zplus = PlotGroup("cellsnum_perthick_perlayer_300_BH", [
693  Plot("cellsnum_perthick_perlayer_300_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerFHzp,maxlayerzp)
694 ], ncols=7)
695 
696 #scint um
697 _cellsnum_perthick_perlayer_scint_EE_zplus = PlotGroup("cellsnum_perthick_perlayer_Sci_EE", [
698  Plot("cellsnum_perthick_perlayer_-1_{:02d}".format(i), xtitle="", **_common_cells) for i in range(maxlayerzm,lastLayerEEzp)
699 ], ncols=7)
700 
701 _cellsnum_perthick_perlayer_scint_FH_zplus = PlotGroup("cellsnum_perthick_perlayer_Sci_FH", [
702  Plot("cellsnum_perthick_perlayer_-1_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzp,lastLayerFHzp)
703 ], ncols=7)
704 
705 _cellsnum_perthick_perlayer_scint_BH_zplus = PlotGroup("cellsnum_perthick_perlayer_Sci_BH", [
706  Plot("cellsnum_perthick_perlayer_-1_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerFHzp,maxlayerzp)
707 ], ncols=7)
708 
709 #----------------------------------------------------------------------------------------------------------------
710 #120 um
711 _common_distance = {}
712 _common_distance.update(_common)
713 _common_distance.update(_legend_common)
714 _common_distance["xmax"] = 150
715 _common_distance["stat"] = False
716 _common_distance["ymin"] = 1e-3
717 _common_distance["ymax"] = 10000
718 _common_distance["ylog"] = True
719 
720 _distancetomaxcell_perthickperlayer_120_EE_zplus = PlotGroup("distancetomaxcell_perthickperlayer_120_EE", [
721  Plot("distancetomaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
722 ], ncols=7)
723 
724 _distancetomaxcell_perthickperlayer_120_FH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_120_FH", [
725  Plot("distancetomaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
726 ], ncols=7)
727 
728 _distancetomaxcell_perthickperlayer_120_BH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_120_BH", [
729  Plot("distancetomaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
730 ], ncols=7)
731 
732 #200 um
733 _distancetomaxcell_perthickperlayer_200_EE_zplus = PlotGroup("distancetomaxcell_perthickperlayer_200_EE", [
734  Plot("distancetomaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
735 ], ncols=7)
736 
737 _distancetomaxcell_perthickperlayer_200_FH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_200_FH", [
738  Plot("distancetomaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
739 ], ncols=7)
740 
741 _distancetomaxcell_perthickperlayer_200_BH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_200_BH", [
742  Plot("distancetomaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
743 ], ncols=7)
744 
745 #300 um
746 _distancetomaxcell_perthickperlayer_300_EE_zplus = PlotGroup("distancetomaxcell_perthickperlayer_300_EE", [
747  Plot("distancetomaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
748 ], ncols=7)
749 
750 _distancetomaxcell_perthickperlayer_300_FH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_300_FH", [
751  Plot("distancetomaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
752 ], ncols=7)
753 
754 _distancetomaxcell_perthickperlayer_300_BH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_300_BH", [
755  Plot("distancetomaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
756 ], ncols=7)
757 
758 #scint um
759 _distancetomaxcell_perthickperlayer_scint_EE_zplus = PlotGroup("distancetomaxcell_perthickperlayer_Sci_EE", [
760  Plot("distancetomaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
761 ], ncols=7)
762 
763 _distancetomaxcell_perthickperlayer_scint_FH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_Sci_FH", [
764  Plot("distancetomaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
765 ], ncols=7)
766 
767 _distancetomaxcell_perthickperlayer_scint_BH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_Sci_BH", [
768  Plot("distancetomaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
769 ], ncols=7)
770 
771 #----------------------------------------------------------------------------------------------------------------
772 #120 um
773 _distancebetseedandmaxcell_perthickperlayer_120_EE_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_120_EE", [
774  Plot("distancebetseedandmaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
775 ], ncols=7)
776 
777 _distancebetseedandmaxcell_perthickperlayer_120_FH_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_120_FH", [
778  Plot("distancebetseedandmaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
779 ], ncols=7)
780 
781 _distancebetseedandmaxcell_perthickperlayer_120_BH_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_120_BH", [
782  Plot("distancebetseedandmaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
783 ], ncols=7)
784 
785 #200 um
786 _distancebetseedandmaxcell_perthickperlayer_200_EE_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_200_EE", [
787  Plot("distancebetseedandmaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
788 ], ncols=7)
789 
790 _distancebetseedandmaxcell_perthickperlayer_200_FH_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_200_FH", [
791  Plot("distancebetseedandmaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
792 ], ncols=7)
793 
794 _distancebetseedandmaxcell_perthickperlayer_200_BH_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_200_BH", [
795  Plot("distancebetseedandmaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
796 ], ncols=7)
797 
798 #300 um
799 _distancebetseedandmaxcell_perthickperlayer_300_EE_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_300_EE", [
800  Plot("distancebetseedandmaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
801 ], ncols=7)
802 
803 _distancebetseedandmaxcell_perthickperlayer_300_FH_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_300_FH", [
804  Plot("distancebetseedandmaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
805 ], ncols=7)
806 
807 _distancebetseedandmaxcell_perthickperlayer_300_BH_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_300_BH", [
808  Plot("distancebetseedandmaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
809 ], ncols=7)
810 
811 #scint um
812 _distancebetseedandmaxcell_perthickperlayer_scint_EE_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_Sci_EE", [
813  Plot("distancebetseedandmaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
814 ], ncols=7)
815 
816 _distancebetseedandmaxcell_perthickperlayer_scint_FH_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_Sci_FH", [
817  Plot("distancebetseedandmaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
818 ], ncols=7)
819 
820 _distancebetseedandmaxcell_perthickperlayer_scint_BH_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_Sci_BH", [
821  Plot("distancebetseedandmaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
822 ], ncols=7)
823 
824 #----------------------------------------------------------------------------------------------------------------
825 #120 um
826 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_EE_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_EE", [
827  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
828 ], ncols=7)
829 
830 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_FH_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_FH", [
831  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
832 ], ncols=7)
833 
834 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_BH_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_BH", [
835  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
836 ], ncols=7)
837 
838 #200 um
839 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_EE_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_EE", [
840  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
841 ], ncols=7)
842 
843 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_FH_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_FH", [
844  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
845 ], ncols=7)
846 
847 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_BH_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_BH", [
848  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
849 ], ncols=7)
850 
851 #300 um
852 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_EE_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_EE", [
853  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
854 ], ncols=7)
855 
856 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_FH_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_FH", [
857  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
858 ], ncols=7)
859 
860 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_BH_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_BH", [
861  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
862 ], ncols=7)
863 
864 #scint um
865 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_EE_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_Sci_EE", [
866  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
867 ], ncols=7)
868 
869 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_FH_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_Sci_FH", [
870  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
871 ], ncols=7)
872 
873 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_BH_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_Sci_BH", [
874  Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
875 ], ncols=7)
876 
877 
878 #----------------------------------------------------------------------------------------------------------------
879 #120 um
880 _distancetoseedcell_perthickperlayer_120_EE_zplus = PlotGroup("distancetoseedcell_perthickperlayer_120_EE", [
881  Plot("distancetoseedcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
882 ], ncols=7)
883 
884 _distancetoseedcell_perthickperlayer_120_FH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_120_FH", [
885  Plot("distancetoseedcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
886 ], ncols=7)
887 
888 _distancetoseedcell_perthickperlayer_120_BH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_120_BH", [
889  Plot("distancetoseedcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
890 ], ncols=7)
891 
892 #200 um
893 _distancetoseedcell_perthickperlayer_200_EE_zplus = PlotGroup("distancetoseedcell_perthickperlayer_200_EE", [
894  Plot("distancetoseedcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
895 ], ncols=7)
896 
897 _distancetoseedcell_perthickperlayer_200_FH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_200_FH", [
898  Plot("distancetoseedcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
899 ], ncols=7)
900 
901 _distancetoseedcell_perthickperlayer_200_BH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_200_BH", [
902  Plot("distancetoseedcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
903 ], ncols=7)
904 
905 #300 um
906 _distancetoseedcell_perthickperlayer_300_EE_zplus = PlotGroup("distancetoseedcell_perthickperlayer_300_EE", [
907  Plot("distancetoseedcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
908 ], ncols=7)
909 
910 _distancetoseedcell_perthickperlayer_300_FH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_300_FH", [
911  Plot("distancetoseedcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
912 ], ncols=7)
913 
914 _distancetoseedcell_perthickperlayer_300_BH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_300_BH", [
915  Plot("distancetoseedcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
916 ], ncols=7)
917 
918 #scint um
919 _distancetoseedcell_perthickperlayer_scint_EE_zplus = PlotGroup("distancetoseedcell_perthickperlayer_Sci_EE", [
920  Plot("distancetoseedcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
921 ], ncols=7)
922 
923 _distancetoseedcell_perthickperlayer_scint_FH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_Sci_FH", [
924  Plot("distancetoseedcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
925 ], ncols=7)
926 
927 _distancetoseedcell_perthickperlayer_scint_BH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_Sci_BH", [
928  Plot("distancetoseedcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
929 ], ncols=7)
930 
931 #=====================================================================================================================
932 #----------------------------------------------------------------------------------------------------------------
933 #We need points for the weighted plots
934 _common = {"stat": True, "drawStyle": "EP", "staty": 0.65 }
935 
936 #120 um
937 _distancetomaxcell_perthickperlayer_eneweighted_120_EE_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_120_EE", [
938  Plot("distancetomaxcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
939 ], ncols=7)
940 
941 _distancetomaxcell_perthickperlayer_eneweighted_120_FH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_120_FH", [
942  Plot("distancetomaxcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
943 ], ncols=7)
944 
945 _distancetomaxcell_perthickperlayer_eneweighted_120_BH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_120_BH", [
946  Plot("distancetomaxcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
947 ], ncols=7)
948 
949 #200 um
950 _distancetomaxcell_perthickperlayer_eneweighted_200_EE_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_200_EE", [
951  Plot("distancetomaxcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
952 ], ncols=7)
953 _distancetomaxcell_perthickperlayer_eneweighted_200_FH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_200_FH", [
954  Plot("distancetomaxcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
955 ], ncols=7)
956 
957 _distancetomaxcell_perthickperlayer_eneweighted_200_BH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_200_BH", [
958  Plot("distancetomaxcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
959 ], ncols=7)
960 
961 #300 um
962 _distancetomaxcell_perthickperlayer_eneweighted_300_EE_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_300_EE", [
963  Plot("distancetomaxcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
964 ], ncols=7)
965 
966 _distancetomaxcell_perthickperlayer_eneweighted_300_FH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_300_FH", [
967  Plot("distancetomaxcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
968 ], ncols=7)
969 
970 _distancetomaxcell_perthickperlayer_eneweighted_300_BH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_300_BH", [
971  Plot("distancetomaxcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
972 ], ncols=7)
973 
974 #scint um
975 _distancetomaxcell_perthickperlayer_eneweighted_scint_EE_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_Sci_EE", [
976  Plot("distancetomaxcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
977 ], ncols=7)
978 
979 _distancetomaxcell_perthickperlayer_eneweighted_scint_FH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_Sci_FH", [
980  Plot("distancetomaxcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
981 ], ncols=7)
982 
983 _distancetomaxcell_perthickperlayer_eneweighted_scint_BH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_Sci_BH", [
984  Plot("distancetomaxcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
985 ], ncols=7)
986 
987 #----------------------------------------------------------------------------------------------------------------
988 #120 um
989 _distancetoseedcell_perthickperlayer_eneweighted_120_EE_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_120_EE", [
990  Plot("distancetoseedcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
991 ], ncols=7)
992 
993 _distancetoseedcell_perthickperlayer_eneweighted_120_FH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_120_FH", [
994  Plot("distancetoseedcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
995 ], ncols=7)
996 
997 _distancetoseedcell_perthickperlayer_eneweighted_120_BH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_120_BH", [
998  Plot("distancetoseedcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
999 ], ncols=7)
1000 
1001 #200 um
1002 _distancetoseedcell_perthickperlayer_eneweighted_200_EE_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_200_EE", [
1003  Plot("distancetoseedcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
1004 ], ncols=7)
1005 
1006 _distancetoseedcell_perthickperlayer_eneweighted_200_FH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_200_FH", [
1007  Plot("distancetoseedcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
1008 ], ncols=7)
1009 
1010 _distancetoseedcell_perthickperlayer_eneweighted_200_BH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_200_BH", [
1011  Plot("distancetoseedcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
1012 ], ncols=7)
1013 
1014 #300 um
1015 _distancetoseedcell_perthickperlayer_eneweighted_300_EE_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_300_EE", [
1016  Plot("distancetoseedcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
1017 ], ncols=7)
1018 
1019 _distancetoseedcell_perthickperlayer_eneweighted_300_FH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_300_FH", [
1020  Plot("distancetoseedcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
1021 ], ncols=7)
1022 
1023 _distancetoseedcell_perthickperlayer_eneweighted_300_BH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_300_BH", [
1024  Plot("distancetoseedcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
1025 ], ncols=7)
1026 
1027 #scint um
1028 _distancetoseedcell_perthickperlayer_eneweighted_scint_EE_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_Sci_EE", [
1029  Plot("distancetoseedcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
1030 ], ncols=7)
1031 
1032 _distancetoseedcell_perthickperlayer_eneweighted_scint_FH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_Sci_FH", [
1033  Plot("distancetoseedcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
1034 ], ncols=7)
1035 
1036 _distancetoseedcell_perthickperlayer_eneweighted_scint_BH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_Sci_BH", [
1037  Plot("distancetoseedcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
1038 ], ncols=7)
1039 #Just in case we add some plots below to be on the safe side.
1040 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65 }
1041 
1042 #--------------------------------------------------------------------------------------------
1043 # z-
1044 #--------------------------------------------------------------------------------------------
1045 
1046 _common_score = {"title": "Score CaloParticle to LayerClusters in z-",
1047  "stat": False,
1048  "ymin": 0.1,
1049  "ymax": 1000,
1050  "xmin": 0,
1051  "xmax": 1,
1052  "drawStyle": "hist",
1053  "lineWidth": 1,
1054  "ylog": True
1055  }
1056 _common_score.update(_legend_common)
1057 _score_caloparticle_to_layerclusters_zminus = PlotGroup("score_caloparticle_to_layercluster", [
1058  Plot("Score_caloparticle2layercl_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_score) for i in range(0,maxlayerzm)
1059  ], ncols=10 )
1060 
1061 _common_score = {"title": "Score LayerCluster to CaloParticles in z-",
1062  "stat": False,
1063  "ymin": 0.1,
1064  "ymax": 1000,
1065  "xmin": 0,
1066  "xmax": 1,
1067  "drawStyle": "hist",
1068  "lineWidth": 1,
1069  "ylog": True
1070  }
1071 _common_score.update(_legend_common)
1072 _score_layercluster_to_caloparticles_zminus = PlotGroup("score_layercluster_to_caloparticle", [
1073  Plot("Score_layercl2caloparticle_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_score) for i in range(0,maxlayerzm)
1074  ], ncols=8 )
1075 
1076 _common_shared= {"title": "Shared Energy CaloParticle To Layer Cluster in z-",
1077  "stat": False,
1078  "legend": False,
1079  }
1080 _common_shared.update(_legend_common)
1081 _shared_plots_zminus = [Plot("SharedEnergy_caloparticle2layercl_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_shared) for i in range(0,maxlayerzm)]
1082 _shared_plots_zminus.extend([Plot("SharedEnergy_caloparticle2layercl_vs_eta_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_shared) for i in range(0,maxlayerzm)])
1083 _shared_plots_zminus.extend([Plot("SharedEnergy_caloparticle2layercl_vs_phi_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_shared) for i in range(0,maxlayerzm)])
1084 _sharedEnergy_caloparticle_to_layercluster_zminus = PlotGroup("sharedEnergy_caloparticle_to_layercluster", _shared_plots_zminus, ncols=8)
1085 
1086 _common_shared= {"title": "Shared Energy Layer Cluster To CaloParticle in z-",
1087  "stat": False,
1088  "legend": False,
1089  }
1090 _common_shared.update(_legend_common)
1091 _shared_plots2_zminus = [Plot("SharedEnergy_layercluster2caloparticle_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_shared) for i in range(0,maxlayerzm)]
1092 _common_shared= {"title": "Shared Energy Layer Cluster To Best CaloParticle in z-",
1093  "stat": False,
1094  "legend": False,
1095  "ymin": 0,
1096  "ymax": 1
1097  }
1098 _common_shared.update(_legend_common)
1099 _shared_plots2_zminus.extend([Plot("SharedEnergy_layercl2caloparticle_vs_eta_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_shared) for i in range(0,maxlayerzm)])
1100 _shared_plots2_zminus.extend([Plot("SharedEnergy_layercl2caloparticle_vs_phi_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_shared) for i in range(0,maxlayerzm)])
1101 _sharedEnergy_layercluster_to_caloparticle_zminus = PlotGroup("sharedEnergy_layercluster_to_caloparticle", _shared_plots2_zminus, ncols=8)
1102 
1103 
1104 _common_assoc = {#"title": "Cell Association Table in z-",
1105  "stat": False,
1106  "legend": False,
1107  "xbinlabels": ["", "TN(pur)", "FN(ineff.)", "FP(fake)", "TP(eff)"],
1108  "xbinlabeloption": "h",
1109  "drawStyle": "hist",
1110  "ymin": 0.1,
1111  "ymax": 10000,
1112  "ylog": True}
1113 _common_assoc.update(_legend_common)
1114 _cell_association_table_zminus = PlotGroup("cellAssociation_table", [
1115  Plot("cellAssociation_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_assoc) for i in range(0,maxlayerzm)
1116  ], ncols=8 )
1117 
1118 _bin_count = 0
1119 _xbinlabels = [ "{:02d}".format(i+1) for i in range(0,maxlayerzm) ]
1120 _xtitle = "Layer Numbers in z-"
1121 _common_eff = {"stat": False, "legend": False, "ymin": 0.0, "ymax": 1.1, "xbinlabeloption": "d"}
1122 _effplots_zminus_eta = [Plot("effic_eta_layer{:02d}".format(i), xtitle="", **_common_eff) for i in range(0,maxlayerzm)]
1123 _effplots_zminus_phi = [Plot("effic_phi_layer{:02d}".format(i), xtitle="", **_common_eff) for i in range(0,maxlayerzm)]
1124 _common_eff = {"stat": False, "legend": False, "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloption": "v", "ymin": 0.0, "ymax": 1.1}
1125 _common_eff["xmin"] = _bin_count
1126 _common_eff["xmax"] = maxlayerzm
1127 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1128 _effplots_zminus = [Plot("globalEfficiencies", xtitle=_xtitle, ytitle="Efficiency", **_common_eff)]
1129 _efficiencies_zminus_eta = PlotGroup("Efficiencies_vs_eta", _effplots_zminus_eta, ncols=10)
1130 _efficiencies_zminus_phi = PlotGroup("Efficiencies_vs_phi", _effplots_zminus_phi, ncols=10)
1131 _efficiencies_zminus = PlotGroup("Efficiencies_vs_layer", _effplots_zminus, ncols=1)
1132 
1133 _common_dup = {"stat": False, "legend": False, "ymin":0.0, "ymax":1.1}
1134 _dupplots_zminus_eta = [Plot("duplicate_eta_layer{:02d}".format(i), xtitle="", **_common_dup) for i in range(0,maxlayerzm)]
1135 _dupplots_zminus_phi = [Plot("duplicate_phi_layer{:02d}".format(i), xtitle="", **_common_dup) for i in range(0,maxlayerzm)]
1136 _common_dup = {"stat": False, "legend": False, "title": "Global Duplicates in z-", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloption": "v", "ymin": 0.0, "ymax": 1.1}
1137 _common_dup["xmin"] = _bin_count
1138 _common_dup["xmax"] = _common_dup["xmin"] + maxlayerzm
1139 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1140 _dupplots_zminus = [Plot("globalEfficiencies", xtitle=_xtitle, ytitle="Duplicates", **_common_dup)]
1141 _duplicates_zminus_eta = PlotGroup("Duplicates_vs_eta", _dupplots_zminus_eta, ncols=10)
1142 _duplicates_zminus_phi = PlotGroup("Duplicates_vs_phi", _dupplots_zminus_phi, ncols=10)
1143 _duplicates_zminus = PlotGroup("Duplicates_vs_layer", _dupplots_zminus, ncols=1)
1144 
1145 _common_fake = {"stat": False, "legend": False, "ymin":0.0, "ymax":1.1}
1146 _fakeplots_zminus_eta = [Plot("fake_eta_layer{:02d}".format(i), xtitle="", **_common_fake) for i in range(0,maxlayerzm)]
1147 _fakeplots_zminus_phi = [Plot("fake_phi_layer{:02d}".format(i), xtitle="", **_common_fake) for i in range(0,maxlayerzm)]
1148 _common_fake = {"stat": False, "legend": False, "title": "Global Fake Rates in z-", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloption": "v", "ymin": 0.0, "ymax": 1.1}
1149 _common_fake["xmin"] = _bin_count
1150 _common_fake["xmax"] = _common_fake["xmin"] + maxlayerzm
1151 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1152 _common_fake["xbinlabelsize"] = 10.
1153 _fakeplots_zminus = [Plot("globalEfficiencies", xtitle=_xtitle, ytitle="Fake Rate", **_common_fake)]
1154 _fakes_zminus_eta = PlotGroup("FakeRate_vs_eta", _fakeplots_zminus_eta, ncols=10)
1155 _fakes_zminus_phi = PlotGroup("FakeRate_vs_phi", _fakeplots_zminus_phi, ncols=10)
1156 _fakes_zminus = PlotGroup("FakeRate_vs_layer", _fakeplots_zminus, ncols=1)
1157 
1158 _common_merge = {"stat": False, "legend": False, "ymin":0.0, "ymax":1.1}
1159 _mergeplots_zminus_eta = [Plot("merge_eta_layer{:02d}".format(i), xtitle="", **_common_merge) for i in range(0,maxlayerzm)]
1160 _mergeplots_zminus_phi = [Plot("merge_phi_layer{:02d}".format(i), xtitle="", **_common_merge) for i in range(0,maxlayerzm)]
1161 _common_merge = {"stat": False, "legend": False, "title": "Global Merge Rates in z-", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloption": "v", "ymin": 0.0, "ymax": 1.1}
1162 _common_merge["xmin"] = _bin_count
1163 _common_merge["xmax"] = _common_merge["xmin"] + maxlayerzm
1164 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1165 _common_merge["xbinlabelsize"] = 10.
1166 _mergeplots_zminus = [Plot("globalEfficiencies", xtitle=_xtitle, ytitle="Merge Rate", **_common_merge)]
1167 _merges_zminus_eta = PlotGroup("MergeRate_vs_eta", _mergeplots_zminus_eta, ncols=10)
1168 _merges_zminus_phi = PlotGroup("MergeRate_vs_phi", _mergeplots_zminus_phi, ncols=10)
1169 _merges_zminus = PlotGroup("MergeRate_vs_layer", _mergeplots_zminus, ncols=1)
1170 
1171 
1172 _common_energy_score = dict(removeEmptyBins=False, xbinlabelsize=10,
1173  stat=True,
1174  xbinlabeloption="d",
1175  ncols=1,
1176  xmin=0.001,
1177  xmax=1.,
1178  ymin=0.01,
1179  ymax=1.)
1180 _energyscore_cp2lc_zminus = PlotGroup("Energy_vs_Score_CP2LC", [Plot("Energy_vs_Score_caloparticle2layer_perlayer{:02d}".format(i), title="Energy_vs_Score_CP2LC",
1181  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_energy_score) for i in range(0, maxlayerzm)
1182  ], ncols=10)
1183 
1184 _energyscore_cp2lc_zplus = PlotGroup("Energy_vs_Score_CP2LC", [Plot("Energy_vs_Score_caloparticle2layer_perlayer{:02d}".format(i), title="Energy_vs_Score_CP2LC",
1185  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_energy_score) for i in range(maxlayerzm,maxlayerzp)
1186  ], ncols=10)
1187 _common_energy_score["xmin"]=-0.1
1188 _energyscore_lc2cp_zminus = PlotGroup("Energy_vs_Score_LC2CP", [Plot("Energy_vs_Score_layer2caloparticle_perlayer{:02d}".format(i), title="Energy_vs_Score_LC2CP",
1189  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_energy_score) for i in range(0, maxlayerzm)
1190  ], ncols=10)
1191 _energyscore_lc2cp_zplus = PlotGroup("Energy_vs_Score_LC2CP", [Plot("Energy_vs_Score_layer2caloparticle_perlayer{:02d}".format(i), title="Energy_vs_Score_LC2CP",
1192  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_energy_score) for i in range(maxlayerzm,maxlayerzp)
1193  ], ncols=10)
1194 
1195 #--------------------------------------------------------------------------------------------
1196 # z+
1197 #--------------------------------------------------------------------------------------------
1198 _common_score = {"title": "Score CaloParticle to LayerClusters in z+",
1199  "stat": False,
1200  "ymin": 0.1,
1201  "ymax": 1000,
1202  "xmin": 0,
1203  "xmax": 1,
1204  "drawStyle": "hist",
1205  "lineWidth": 1,
1206  "ylog": True
1207  }
1208 _common_score.update(_legend_common)
1209 _score_caloparticle_to_layerclusters_zplus = PlotGroup("score_caloparticle_to_layercluster", [
1210  Plot("Score_caloparticle2layercl_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_score) for i in range(maxlayerzm,maxlayerzp)
1211  ], ncols=10 )
1212 
1213 _common_score = {"title": "Score LayerCluster to CaloParticles in z+",
1214  "stat": False,
1215  "ymin": 0.1,
1216  "ymax": 1000,
1217  "xmin": 0,
1218  "xmax": 1,
1219  "drawStyle": "hist",
1220  "lineWidth": 1,
1221  "ylog": True
1222  }
1223 _common_score.update(_legend_common)
1224 _score_layercluster_to_caloparticles_zplus = PlotGroup("score_layercluster_to_caloparticle", [
1225  Plot("Score_layercl2caloparticle_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_score) for i in range(maxlayerzm,maxlayerzp)
1226  ], ncols=8 )
1227 
1228 _common_shared= {"title": "Shared Energy CaloParticle To Layer Cluster in z+",
1229  "stat": False,
1230  "legend": False,
1231  }
1232 _common_shared.update(_legend_common)
1233 _shared_plots_zplus = [Plot("SharedEnergy_caloparticle2layercl_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_shared) for i in range(maxlayerzm,maxlayerzp)]
1234 _shared_plots_zplus.extend([Plot("SharedEnergy_caloparticle2layercl_vs_eta_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_shared) for i in range(maxlayerzm,maxlayerzp)])
1235 _shared_plots_zplus.extend([Plot("SharedEnergy_caloparticle2layercl_vs_phi_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_shared) for i in range(maxlayerzm,maxlayerzp)])
1236 _sharedEnergy_caloparticle_to_layercluster_zplus = PlotGroup("sharedEnergy_caloparticle_to_layercluster", _shared_plots_zplus, ncols=8)
1237 
1238 _common_shared= {"title": "Shared Energy Layer Cluster To CaloParticle in z+",
1239  "stat": False,
1240  "legend": False,
1241  }
1242 _common_shared.update(_legend_common)
1243 _shared_plots2_zplus = [Plot("SharedEnergy_layercluster2caloparticle_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_shared) for i in range(maxlayerzm,maxlayerzp)]
1244 _common_shared= {"title": "Shared Energy Layer Cluster To Best CaloParticle in z+",
1245  "stat": False,
1246  "legend": False,
1247  "ymin": 0,
1248  "ymax": 1,
1249  }
1250 _common_shared.update(_legend_common)
1251 _shared_plots2_zplus.extend([Plot("SharedEnergy_layercl2caloparticle_vs_eta_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_shared) for i in range(maxlayerzm,maxlayerzp)])
1252 _shared_plots2_zplus.extend([Plot("SharedEnergy_layercl2caloparticle_vs_phi_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_shared) for i in range(maxlayerzm,maxlayerzp)])
1253 _sharedEnergy_layercluster_to_caloparticle_zplus = PlotGroup("sharedEnergy_layercluster_to_caloparticle", _shared_plots2_zplus, ncols=8)
1254 
1255 
1256 _common_assoc = {#"title": "Cell Association Table in z+",
1257  "stat": False,
1258  "legend": False,
1259  "xbinlabels": ["", "TN(pur)", "FN(ineff.)", "FP(fake)", "TP(eff)"],
1260  "xbinlabeloption": "h",
1261  "drawStyle": "hist",
1262  "ymin": 0.1,
1263  "ymax": 10000,
1264  "ylog": True}
1265 _common_assoc.update(_legend_common)
1266 _cell_association_table_zplus = PlotGroup("cellAssociation_table", [
1267  Plot("cellAssociation_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_assoc) for i in range(maxlayerzm,maxlayerzp)
1268  ], ncols=8 )
1269 
1270 
1271 _bin_count = maxlayerzm
1272 _xtitle = "Layer Numbers in z+"
1273 _common_eff = {"stat": False, "legend": False, "ymin":0.0, "ymax":1.1}
1274 _effplots_zplus_eta = [Plot("effic_eta_layer{:02d}".format(i), xtitle="", **_common_eff) for i in range(maxlayerzm,maxlayerzp)]
1275 _effplots_zplus_phi = [Plot("effic_phi_layer{:02d}".format(i), xtitle="", **_common_eff) for i in range(maxlayerzm,maxlayerzp)]
1276 _common_eff = {"stat": False, "legend": False, "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloption": "v", "ymin": 0.0, "ymax": 1.1}
1277 _common_eff["xmin"] = _bin_count
1278 _common_eff["xmax"] = _common_eff["xmin"] + maxlayerzm
1279 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1280 _effplots_zplus = [Plot("globalEfficiencies", xtitle=_xtitle, ytitle="Efficiency", **_common_eff)]
1281 _efficiencies_zplus_eta = PlotGroup("Efficiencies_vs_eta", _effplots_zplus_eta, ncols=10)
1282 _efficiencies_zplus_phi = PlotGroup("Efficiencies_vs_phi", _effplots_zplus_phi, ncols=10)
1283 _efficiencies_zplus = PlotGroup("Efficiencies_vs_layer", _effplots_zplus, ncols=1)
1284 
1285 _common_dup = {"stat": False, "legend": False, "ymin": 0.0, "ymax": 1.1}
1286 _dupplots_zplus_eta = [Plot("duplicate_eta_layer{:02d}".format(i), xtitle="", **_common_dup) for i in range(maxlayerzm,maxlayerzp)]
1287 _dupplots_zplus_phi = [Plot("duplicate_phi_layer{:02d}".format(i), xtitle="", **_common_dup) for i in range(maxlayerzm,maxlayerzp)]
1288 _common_dup = {"stat": False, "legend": False, "title": "Global Duplicates in z+", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloption": "v", "ymin": 0.0, "ymax": 1.1}
1289 _common_dup["xmin"] = _bin_count
1290 _common_dup["xmax"] = _common_dup["xmin"] + maxlayerzm
1291 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1292 _dupplots_zplus = [Plot("globalEfficiencies", xtitle=_xtitle, ytitle="Duplicates", **_common_dup)]
1293 _duplicates_zplus_eta = PlotGroup("Duplicates_vs_eta", _dupplots_zplus_eta, ncols=10)
1294 _duplicates_zplus_phi = PlotGroup("Duplicates_vs_phi", _dupplots_zplus_phi, ncols=10)
1295 _duplicates_zplus = PlotGroup("Duplicates_vs_layer", _dupplots_zplus, ncols=1)
1296 
1297 _common_fake = {"stat": False, "legend": False, "ymin": 0.0, "ymax": 1.1}
1298 _fakeplots_zplus_eta = [Plot("fake_eta_layer{:02d}".format(i), xtitle="", **_common_fake) for i in range(maxlayerzm,maxlayerzp)]
1299 _fakeplots_zplus_phi = [Plot("fake_phi_layer{:02d}".format(i), xtitle="", **_common_fake) for i in range(maxlayerzm,maxlayerzp)]
1300 _common_fake = {"stat": False, "legend": False, "title": "Global Fake Rates in z+", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloption": "v", "ymin": 0.0, "ymax": 1.1}
1301 _common_fake["xmin"] = _bin_count
1302 _common_fake["xmax"] = _common_fake["xmin"] + maxlayerzm
1303 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1304 _fakeplots_zplus = [Plot("globalEfficiencies", xtitle=_xtitle, ytitle="Fake Rate", **_common_fake)]
1305 _fakes_zplus_eta = PlotGroup("FakeRate_vs_eta", _fakeplots_zplus_eta, ncols=10)
1306 _fakes_zplus_phi = PlotGroup("FakeRate_vs_phi", _fakeplots_zplus_phi, ncols=10)
1307 _fakes_zplus = PlotGroup("FakeRate_vs_layer", _fakeplots_zplus, ncols=1)
1308 
1309 _common_merge = {"stat": False, "legend": False, "ymin": 0.0, "ymax": 1.1}
1310 _mergeplots_zplus_eta = [Plot("merge_eta_layer{:02d}".format(i), xtitle="", **_common_merge) for i in range(maxlayerzm,maxlayerzp)]
1311 _mergeplots_zplus_phi = [Plot("merge_phi_layer{:02d}".format(i), xtitle="", **_common_merge) for i in range(maxlayerzm,maxlayerzp)]
1312 _common_merge = {"stat": False, "legend": False, "title": "Global Merge Rates in z+", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloption": "v", "ymin": 0.0, "ymax": 1.1}
1313 _common_merge["xmin"] = _bin_count
1314 _common_merge["xmax"] = _common_merge["xmin"] + maxlayerzm
1315 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1316 _mergeplots_zplus = [Plot("globalEfficiencies", xtitle=_xtitle, ytitle="Merge Rate", **_common_merge)]
1317 _merges_zplus_eta = PlotGroup("MergeRate_vs_eta", _mergeplots_zplus_eta, ncols=10)
1318 _merges_zplus_phi = PlotGroup("MergeRate_vs_phi", _mergeplots_zplus_phi, ncols=10)
1319 _merges_zplus = PlotGroup("MergeRate_vs_layer", _mergeplots_zplus, ncols=1)
1320 
1321 #--------------------------------------------------------------------------------------------
1322 # SimClusters
1323 #--------------------------------------------------------------------------------------------
1324 
1325 _common_sc_score = {"title": "Score SimCluster to LayerClusters in z-",
1326  "stat": False,
1327  "ymin": 0.1,
1328  "ymax": 10**6,
1329  "xmin": 0,
1330  "xmax": 1,
1331  "drawStyle": "hist",
1332  "lineWidth": 1,
1333  "ylog": True
1334  }
1335 _common_sc_score.update(_legend_common)
1336 _score_simcluster_to_layerclusters_zminus = PlotGroup("score_simcluster_to_layercluster_zminus", [
1337  Plot("Score_simcluster2layercl_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_sc_score) for i in range(0,maxlayerzm)
1338  ], ncols=10 )
1339 
1340 _common_sc_score = {"title": "Score LayerCluster to SimClusters in z-",
1341  "stat": False,
1342  "ymin": 0.1,
1343  "ymax": 10**6,
1344  "xmin": 0,
1345  "xmax": 1,
1346  "drawStyle": "hist",
1347  "lineWidth": 1,
1348  "ylog": True
1349  }
1350 _common_sc_score.update(_legend_common)
1351 _score_layercluster_to_simclusters_zminus = PlotGroup("score_layercluster_to_simcluster_zminus", [
1352  Plot("Score_layercl2simcluster_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_sc_score) for i in range(0,maxlayerzm)
1353  ], ncols=8 )
1354 
1355 _common_sc_shared= {"title": "Shared Energy SimCluster To Layer Cluster in z-",
1356  "stat": False,
1357  "legend": False,
1358  }
1359 _common_sc_shared.update(_legend_common)
1360 _shared_sc_plots_zminus = [Plot("SharedEnergy_simcluster2layercl_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_sc_shared) for i in range(0,maxlayerzm)]
1361 _shared_sc_plots_zminus.extend([Plot("SharedEnergy_simcluster2layercl_vs_eta_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_sc_shared) for i in range(0,maxlayerzm)])
1362 _shared_sc_plots_zminus.extend([Plot("SharedEnergy_simcluster2layercl_vs_phi_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_sc_shared) for i in range(0,maxlayerzm)])
1363 _sharedEnergy_simcluster_to_layercluster_zminus = PlotGroup("sharedEnergy_simcluster_to_layercluster_zminus", _shared_sc_plots_zminus, ncols=8)
1364 
1365 _common_sc_shared= {"title": "Shared Energy Layer Cluster To SimCluster in z-",
1366  "stat": False,
1367  "legend": False,
1368  }
1369 _common_sc_shared.update(_legend_common)
1370 _shared_plots2_sc_zminus = [Plot("SharedEnergy_layercluster2simcluster_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_sc_shared) for i in range(0,maxlayerzm)]
1371 _common_sc_shared= {"title": "Shared Energy Layer Cluster To Best SimCluster in z-",
1372  "stat": False,
1373  "legend": False,
1374  "ymin": 0,
1375  "ymax": 1
1376  }
1377 _common_sc_shared.update(_legend_common)
1378 _shared_plots2_sc_zminus.extend([Plot("SharedEnergy_layercl2simcluster_vs_eta_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_sc_shared) for i in range(0,maxlayerzm)])
1379 _shared_plots2_sc_zminus.extend([Plot("SharedEnergy_layercl2simcluster_vs_phi_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_sc_shared) for i in range(0,maxlayerzm)])
1380 _sharedEnergy_layercluster_to_simcluster_zminus = PlotGroup("sharedEnergy_layercluster_to_simcluster_zminus", _shared_plots2_sc_zminus, ncols=8)
1381 
1382 _bin_count = 0
1383 _xbinlabels = [ "L{:02d}".format(i+1) for i in range(0,maxlayerzm) ]
1384 _common_eff = {"stat": False, "legend": False}
1385 _effplots_sc_zminus_eta = [Plot("effic_eta_layer{:02d}".format(i), xtitle="", **_common_eff) for i in range(0,maxlayerzm)]
1386 _effplots_sc_zminus_phi = [Plot("effic_phi_layer{:02d}".format(i), xtitle="", **_common_eff) for i in range(0,maxlayerzm)]
1387 _common_eff = {"stat": False, "legend": False, "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloptions": "v"}
1388 _common_eff["xmin"] = _bin_count
1389 _common_eff["xmax"] = maxlayerzm
1390 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1391 _effplots_sc_zminus = [Plot("globalEfficiencies_zminus", xtitle="Global Efficiencies in z-", **_common_eff)]
1392 _efficiencies_sc_zminus_eta = PlotGroup("Efficiencies_vs_eta_zminus", _effplots_sc_zminus_eta, ncols=10)
1393 _efficiencies_sc_zminus_phi = PlotGroup("Efficiencies_vs_phi_zminus", _effplots_sc_zminus_phi, ncols=10)
1394 _efficiencies_sc_zminus = PlotGroup("Eff_Dup_Fake_Merge_Global_zminus", _effplots_sc_zminus, ncols=4)
1395 
1396 _common_dup = {"stat": False, "legend": False}
1397 _dupplots_sc_zminus_eta = [Plot("duplicate_eta_layer{:02d}".format(i), xtitle="", **_common_dup) for i in range(0,maxlayerzm)]
1398 _dupplots_sc_zminus_phi = [Plot("duplicate_phi_layer{:02d}".format(i), xtitle="", **_common_dup) for i in range(0,maxlayerzm)]
1399 _common_dup = {"stat": False, "legend": False, "title": "Global Duplicates in z-", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloptions": "v"}
1400 _common_dup["xmin"] = _bin_count
1401 _common_dup["xmax"] = _common_dup["xmin"] + maxlayerzm
1402 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1403 _dupplots_sc_zminus = [Plot("globalDublicates_zminus", xtitle="Global Duplicates in z-", **_common_dup)]
1404 _duplicates_sc_zminus_eta = PlotGroup("Duplicates_vs_eta_zminus", _dupplots_sc_zminus_eta, ncols=10)
1405 _duplicates_sc_zminus_phi = PlotGroup("Duplicates_vs_phi_zminus", _dupplots_sc_zminus_phi, ncols=10)
1406 _duplicates_sc_zminus = PlotGroup("Eff_Dup_Fake_Merge_Global_zminus", _dupplots_sc_zminus, ncols=4)
1407 
1408 _common_fake = {"stat": False, "legend": False}
1409 _fakeplots_sc_zminus_eta = [Plot("fake_eta_layer{:02d}".format(i), xtitle="", **_common_fake) for i in range(0,maxlayerzm)]
1410 _fakeplots_sc_zminus_phi = [Plot("fake_phi_layer{:02d}".format(i), xtitle="", **_common_fake) for i in range(0,maxlayerzm)]
1411 _common_fake = {"stat": False, "legend": False, "title": "Global Fake Rates in z-", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloptions": "v"}
1412 _common_fake["xmin"] = _bin_count
1413 _common_fake["xmax"] = _common_fake["xmin"] + maxlayerzm
1414 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1415 _common_fake["xbinlabels"] = [ "L{:02d}".format(i+1) for i in range(0,maxlayerzm) ]
1416 _common_fake["xbinlabelsize"] = 10.
1417 _fakeplots_sc_zminus = [Plot("globalFakes_zminus", xtitle="Global Fake Rate in z-", **_common_fake)]
1418 _fakes_sc_zminus_eta = PlotGroup("FakeRate_vs_eta_zminus", _fakeplots_sc_zminus_eta, ncols=10)
1419 _fakes_sc_zminus_phi = PlotGroup("FakeRate_vs_phi_zminus", _fakeplots_sc_zminus_phi, ncols=10)
1420 _fakes_sc_zminus = PlotGroup("Eff_Dup_Fake_Merge_Global_zminus", _fakeplots_sc_zminus, ncols=4)
1421 
1422 _common_merge = {"stat": False, "legend": False}
1423 _mergeplots_sc_zminus_eta = [Plot("merge_eta_layer{:02d}".format(i), xtitle="", **_common_merge) for i in range(0,maxlayerzm)]
1424 _mergeplots_sc_zminus_phi = [Plot("merge_phi_layer{:02d}".format(i), xtitle="", **_common_merge) for i in range(0,maxlayerzm)]
1425 _common_merge = {"stat": False, "legend": False, "title": "Global Merge Rates in z-", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloptions": "v"}
1426 _common_merge["xmin"] = _bin_count
1427 _common_merge["xmax"] = _common_merge["xmin"] + maxlayerzm
1428 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1429 _common_merge["xbinlabels"] = [ "L{:02d}".format(i+1) for i in range(0,maxlayerzm) ]
1430 _common_merge["xbinlabelsize"] = 10.
1431 _mergeplots_sc_zminus = [Plot("globalMergeRate_zminus", xtitle="Global merge Rate in z-", **_common_merge)]
1432 _merges_sc_zminus_eta = PlotGroup("MergeRate_vs_eta_zminus", _mergeplots_sc_zminus_eta, ncols=10)
1433 _merges_sc_zminus_phi = PlotGroup("MergeRate_vs_phi_zminus", _mergeplots_sc_zminus_phi, ncols=10)
1434 _merges_sc_zminus = PlotGroup("Eff_Dup_Fake_Merge_Global_zminus", _mergeplots_sc_zminus, ncols=4)
1435 
1436 _common_energy_score = dict(removeEmptyBins=False, xbinlabelsize=10,
1437  stat=True,
1438  xbinlabeloption="d",
1439  ncols=1,
1440  ylog=True,
1441  xlog=True,
1442  xmin=0.001,
1443  xmax=1.,
1444  ymin=0.01,
1445  ymax=1.)
1446 _energyscore_sc2lc_zminus = PlotGroup("Energy_vs_Score_SC2LC_zminus", [Plot("Energy_vs_Score_simcluster2layer_perlayer{:02d}".format(i), title="Energy_vs_Score_SC2LC",
1447  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_energy_score) for i in range(0, maxlayerzm)
1448  ], ncols=10)
1449 
1450 _energyscore_sc2lc_zplus = PlotGroup("Energy_vs_Score_SC2LC_zplus", [Plot("Energy_vs_Score_simcluster2layer_perlayer{:02d}".format(i), title="Energy_vs_Score_SC2LC",
1451  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_energy_score) for i in range(maxlayerzm,maxlayerzp)
1452  ], ncols=10)
1453 
1454 _common_energy_score["xlog"]=False
1455 _common_energy_score["ylog"]=False
1456 _common_energy_score["xmin"]=-0.1
1457 _energyscore_lc2sc_zminus = PlotGroup("Energy_vs_Score_LC2SC_zminus", [Plot("Energy_vs_Score_layer2simcluster_perlayer{:02d}".format(i), title="Energy_vs_Score_LC2SC",
1458  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_energy_score) for i in range(0, maxlayerzm)
1459  ], ncols=10)
1460 _energyscore_lc2sc_zplus = PlotGroup("Energy_vs_Score_LC2SC_zplus", [Plot("Energy_vs_Score_layer2simcluster_perlayer{:02d}".format(i), title="Energy_vs_Score_LC2SC",
1461  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_energy_score) for i in range(maxlayerzm,maxlayerzp)
1462  ], ncols=10)
1463 
1464 #--------------------------------------------------------------------------------------------
1465 # z+
1466 #--------------------------------------------------------------------------------------------
1467 _common_sc_score = {"title": "Score SimCluster to LayerClusters in z+",
1468  "stat": False,
1469  "ymin": 0.1,
1470  "ymax": 1000,
1471  "xmin": 0,
1472  "xmax": 1,
1473  "drawStyle": "hist",
1474  "lineWidth": 1,
1475  "ylog": True
1476  }
1477 _common_sc_score.update(_legend_common)
1478 _score_simcluster_to_layerclusters_zplus = PlotGroup("score_simcluster_to_layercluster_zplus", [
1479  Plot("Score_simcluster2layercl_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_sc_score) for i in range(maxlayerzm,maxlayerzp)
1480  ], ncols=10 )
1481 
1482 _common_sc_score = {"title": "Score LayerCluster to SimClusters in z+",
1483  "stat": False,
1484  "ymin": 0.1,
1485  "ymax": 1000,
1486  "xmin": 0,
1487  "xmax": 1,
1488  "drawStyle": "hist",
1489  "lineWidth": 1,
1490  "ylog": True
1491  }
1492 _common_sc_score.update(_legend_common)
1493 _score_layercluster_to_simclusters_zplus = PlotGroup("score_layercluster_to_simcluster_zplus", [
1494  Plot("Score_layercl2simcluster_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_sc_score) for i in range(maxlayerzm,maxlayerzp)
1495  ], ncols=8 )
1496 
1497 _common_sc_shared= {"title": "Shared Energy SimCluster To Layer Cluster in z+",
1498  "stat": False,
1499  "legend": False,
1500  }
1501 _common_sc_shared.update(_legend_common)
1502 _shared_sc_plots_zplus = [Plot("SharedEnergy_simcluster2layercl_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_sc_shared) for i in range(maxlayerzm,maxlayerzp)]
1503 _shared_sc_plots_zplus.extend([Plot("SharedEnergy_simcluster2layercl_vs_eta_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_sc_shared) for i in range(maxlayerzm,maxlayerzp)])
1504 _shared_sc_plots_zplus.extend([Plot("SharedEnergy_simcluster2layercl_vs_phi_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_sc_shared) for i in range(maxlayerzm,maxlayerzp)])
1505 _sharedEnergy_simcluster_to_layercluster_zplus = PlotGroup("sharedEnergy_simcluster_to_layercluster_zplus", _shared_sc_plots_zplus, ncols=8)
1506 
1507 _common_sc_shared= {"title": "Shared Energy Layer Cluster To SimCluster in z+",
1508  "stat": False,
1509  "legend": False,
1510  }
1511 _common_sc_shared.update(_legend_common)
1512 _shared_plots2_sc_zplus = [Plot("SharedEnergy_layercluster2simcluster_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_sc_shared) for i in range(maxlayerzm,maxlayerzp)]
1513 _common_sc_shared= {"title": "Shared Energy Layer Cluster To Best SimCluster in z+",
1514  "stat": False,
1515  "legend": False,
1516  "ymin": 0,
1517  "ymax": 1,
1518  }
1519 _common_sc_shared.update(_legend_common)
1520 _shared_plots2_sc_zplus.extend([Plot("SharedEnergy_layercl2simcluster_vs_eta_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_sc_shared) for i in range(maxlayerzm,maxlayerzp)])
1521 _shared_plots2_sc_zplus.extend([Plot("SharedEnergy_layercl2simcluster_vs_phi_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_sc_shared) for i in range(maxlayerzm,maxlayerzp)])
1522 _sharedEnergy_layercluster_to_simcluster_zplus = PlotGroup("sharedEnergy_layercluster_to_simcluster_zplus", _shared_plots2_sc_zplus, ncols=8)
1523 
1524 
1525 _bin_count = maxlayerzm
1526 _common_eff = {"stat": False, "legend": False}
1527 _effplots_sc_zplus_eta = [Plot("effic_eta_layer{:02d}".format(i), xtitle="", **_common_eff) for i in range(maxlayerzm,maxlayerzp)]
1528 _effplots_sc_zplus_phi = [Plot("effic_phi_layer{:02d}".format(i), xtitle="", **_common_eff) for i in range(maxlayerzm,maxlayerzp)]
1529 _common_eff = {"stat": False, "legend": False, "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloptions": "v"}
1530 _common_eff["xmin"] = _bin_count
1531 _common_eff["xmax"] = _common_eff["xmin"] + maxlayerzm
1532 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1533 _effplots_sc_zplus = [Plot("globalEfficiencies_zplus", xtitle="Global Efficiencies in z+", **_common_eff)]
1534 _efficiencies_sc_zplus_eta = PlotGroup("Efficiencies_vs_eta_zplus", _effplots_sc_zplus_eta, ncols=10)
1535 _efficiencies_sc_zplus_phi = PlotGroup("Efficiencies_vs_phi_zplus", _effplots_sc_zplus_phi, ncols=10)
1536 _efficiencies_sc_zplus = PlotGroup("Eff_Dup_Fake_Merge_Global_zplus", _effplots_sc_zplus, ncols=4)
1537 
1538 _common_dup = {"stat": False, "legend": False}
1539 _dupplots_sc_zplus_eta = [Plot("duplicate_eta_layer{:02d}".format(i), xtitle="", **_common_dup) for i in range(maxlayerzm,maxlayerzp)]
1540 _dupplots_sc_zplus_phi = [Plot("duplicate_phi_layer{:02d}".format(i), xtitle="", **_common_dup) for i in range(maxlayerzm,maxlayerzp)]
1541 _common_dup = {"stat": False, "legend": False, "title": "Global Duplicates in z+", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloptions": "v"}
1542 _common_dup["xmin"] = _bin_count
1543 _common_dup["xmax"] = _common_dup["xmin"] + maxlayerzm
1544 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1545 _dupplots_sc_zplus = [Plot("globalDuplicates_zplus", xtitle="Global Duplicates in z+", **_common_dup)]
1546 _duplicates_sc_zplus_eta = PlotGroup("Duplicates_vs_eta_zplus", _dupplots_sc_zplus_eta, ncols=10)
1547 _duplicates_sc_zplus_phi = PlotGroup("Duplicates_vs_phi_zplus", _dupplots_sc_zplus_phi, ncols=10)
1548 _duplicates_sc_zplus = PlotGroup("Eff_Dup_Fake_Merge_Global_zplus", _dupplots_sc_zplus, ncols=4)
1549 
1550 _common_fake = {"stat": False, "legend": False}
1551 _fakeplots_sc_zplus_eta = [Plot("fake_eta_layer{:02d}".format(i), xtitle="", **_common_fake) for i in range(maxlayerzm,maxlayerzp)]
1552 _fakeplots_sc_zplus_phi = [Plot("fake_phi_layer{:02d}".format(i), xtitle="", **_common_fake) for i in range(maxlayerzm,maxlayerzp)]
1553 _common_fake = {"stat": False, "legend": False, "title": "Global Fake Rates in z+", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloptions": "v"}
1554 _common_fake["xmin"] = _bin_count
1555 _common_fake["xmax"] = _common_fake["xmin"] + maxlayerzm
1556 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1557 _fakeplots_sc_zplus = [Plot("globalFakeRate_zplus", xtitle="Global Fake Rate in z+", **_common_fake)]
1558 _fakes_sc_zplus_eta = PlotGroup("FakeRate_vs_eta_zplus", _fakeplots_sc_zplus_eta, ncols=10)
1559 _fakes_sc_zplus_phi = PlotGroup("FakeRate_vs_phi_zplus", _fakeplots_sc_zplus_phi, ncols=10)
1560 _fakes_sc_zplus = PlotGroup("Eff_Dup_Fake_Merge_Global_zplus", _fakeplots_sc_zplus, ncols=4)
1561 
1562 _common_merge = {"stat": False, "legend": False}
1563 _mergeplots_sc_zplus_eta = [Plot("merge_eta_layer{:02d}".format(i), xtitle="", **_common_merge) for i in range(maxlayerzm,maxlayerzp)]
1564 _mergeplots_sc_zplus_phi = [Plot("merge_phi_layer{:02d}".format(i), xtitle="", **_common_merge) for i in range(maxlayerzm,maxlayerzp)]
1565 _common_merge = {"stat": False, "legend": False, "title": "Global Merge Rates in z+", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloptions": "v"}
1566 _common_merge["xmin"] = _bin_count
1567 _common_merge["xmax"] = _common_merge["xmin"] + maxlayerzm
1568 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1569 _mergeplots_sc_zplus = [Plot("globalMergeRate_zplus", xtitle="Global merge Rate in z+", **_common_merge)]
1570 _merges_sc_zplus_eta = PlotGroup("MergeRate_vs_eta_zplus", _mergeplots_sc_zplus_eta, ncols=10)
1571 _merges_sc_zplus_phi = PlotGroup("MergeRate_vs_phi_zplus", _mergeplots_sc_zplus_phi, ncols=10)
1572 _merges_sc_zplus = PlotGroup("Eff_Dup_Fake_Merge_Global_zplus", _mergeplots_sc_zplus, ncols=4)
1573 
1574 #Just in case we add some plots below to be on the safe side.
1575 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65 }
1576 
1577 #--------------------------------------------------------------------------------------------
1578 # TRACKSTERS
1579 #--------------------------------------------------------------------------------------------
1580 _common_score = {"stat": False, "legend": False
1581  ,"ymin": 0.1
1582  ,"ymax": 100000
1583  ,"xmin": 0
1584  #,"xmax": 1.0
1585  ,"drawStyle": "hist"
1586  ,"lineWidth": 1
1587  ,"ylog": True
1588  ,"xlog": True
1589  ,"xtitle": "Default"
1590  }
1591 _common_score.update(_legend_common)
1592 
1593 score_to_trackster = ["","Pur","Dupl"]
1594 _score_caloparticle_to_tracksters = PlotGroup("ScoreCaloParticlesToTracksters", [], ncols=len(score_to_trackster))
1595 _score_simtrackster_to_tracksters = PlotGroup("ScoreSimTrackstersToTracksters", [], ncols=len(score_to_trackster))
1596 for score in score_to_trackster:
1597  _score_caloparticle_to_tracksters.append(Plot("Score"+score+"_caloparticle2trackster", **_common_score))
1598  _score_simtrackster_to_tracksters.append(Plot("Score"+score+"_simtrackster2trackster", **_common_score))
1599 
1600 score_trackster_to = ["","Fake","Merge"]
1601 _score_trackster_to_caloparticles = PlotGroup("ScoreTrackstersToCaloParticles", [], ncols=len(score_trackster_to))
1602 _score_trackster_to_simtracksters = PlotGroup("ScoreTrackstersToSimTracksters", [], ncols=len(score_trackster_to))
1603 for score in score_trackster_to:
1604  _score_trackster_to_caloparticles.append(Plot("Score"+score+"_trackster2caloparticle", **_common_score))
1605  _score_trackster_to_simtracksters.append(Plot("Score"+score+"_trackster2simtrackster", **_common_score))
1606 
1607 
1608 _common_shared = {"stat": False, "legend": False, "xtitle": 'Default', "ytitle": 'Default'}
1609 _common_shared.update(_legend_common)
1610 _common_energy_score = dict(removeEmptyBins=True, xbinlabelsize=10, xbinlabeloption="d", drawStyle="COLZ", adjustMarginRight=0.1, legend=False, xtitle='Default', ytitle='Default')
1611 #_common_energy_score["ymax"] = 1.
1612 #_common_energy_score["xmax"] = 1.0
1613 
1614 _sharedEnergy_to_trackster = []
1615 _sharedEnergy_trackster_to = []
1616 versions = ["", "_assoc", "_assoc_vs_eta", "_assoc_vs_phi"]
1617 
1618 _energyscore_to_trackster = []
1619 _energyscore_trackster_to = []
1620 en_vs_score = ["","best","secBest"]
1621 for val in simDict:
1622  _sharedEnergy_to_trackster.append(PlotGroup("SharedEnergy_"+val+"ToTrackster", [], ncols=2))
1623  print("appending plot group", "SharedEnergy_"+val+"ToTrackster")
1624  _sharedEnergy_trackster_to.append(PlotGroup("SharedEnergy_TracksterTo"+val, [], ncols=2))
1625  print("appending plot group", "SharedEnergy_TracksterTo"+val)
1626  for ver in versions:
1627  _sharedEnergy_to_trackster[-1].append(Plot("SharedEnergy_"+val+"2trackster"+ver, **_common_shared))
1628  print("appending plot ", "SharedEnergy_"+val+"2trackster"+ver)
1629  _sharedEnergy_trackster_to[-1].append(Plot("SharedEnergy_trackster2"+val+ver, **_common_shared))
1630  print("appending plot ", "SharedEnergy_trackster2"+val+ver)
1631 
1632  _energyscore_to_trackster.append(PlotGroup("Energy_vs_Score_"+val+"ToTracksters", [], ncols=len(en_vs_score)))
1633  _energyscore_trackster_to.append(PlotGroup("Energy_vs_Score_TrackstersTo"+val, [], ncols=len(en_vs_score)))
1634  for ver in en_vs_score:
1635  _energyscore_to_trackster[-1].append(Plot("Energy_vs_Score_"+val+"2"+ver+"Trackster", **_common_energy_score))
1636  print("appending plot ", "Energy_vs_Score_"+val+"2"+ver+"Trackster")
1637  _energyscore_trackster_to[-1].append(Plot("Energy_vs_Score_trackster2"+ver+val, **_common_energy_score))
1638  print("appending plot ", "Energy_vs_Score_trackster2"+ver+val)
1639 _common_assoc = {#"title": "Cell Association Table",
1640  "stat": False,
1641  "legend": False,
1642  "xbinlabels": ["", "TN(pur)", "FN(ineff.)", "FP(fake)", "TP(eff)"],
1643  "xbinlabeloption": "h",
1644  "drawStyle": "hist",
1645  "ymin": 0.1,
1646  "ymax": 10000000,
1647  "ylog": True}
1648 _common_assoc.update(_legend_common)
1649 _cell_association_table = PlotGroup("cellAssociation_table", [
1650  Plot("cellAssociation_perlayer{:02d}".format(i), xtitle="Layer {:02d} in z-".format(i%maxlayerzm+1) if (i<maxlayerzm) else "Layer {:02d} in z+".format(i%maxlayerzm+1), **_common_assoc) for i in range(0,maxlayerzm)
1651  ], ncols=8 )
1652 
1653 # Trackster plots
1654 _common_metric = {"stat": False, "legend": False, "xbinlabelsize": 14, "xbinlabeloption": "d", "ymin": 0.0, "ymax": 1.1}
1655 _common_metric_logx = _common_metric.copy()
1656 _common_metric_logx["xlog"] = True
1657 
1658 _efficiencies = []
1659 _purities = []
1660 _duplicates = []
1661 _fakes = []
1662 _merges = []
1663 for val in simDict:
1664  _effplots = [Plot("globalEfficiencies", xtitle="", **_common_metric)]
1665  _purityplots = [Plot("globalEfficiencies", xtitle="", **_common_metric)]
1666  _dupplots = [Plot("globalEfficiencies", xtitle="", **_common_metric)]
1667  _fakeplots = [Plot("globalEfficiencies", xtitle="", **_common_metric)]
1668  _mergeplots = [Plot("globalEfficiencies", xtitle="", **_common_metric)]
1669 
1670  for v in variables:
1671  kwargs = _common_metric_logx if v in ["energy","pt"] else _common_metric
1672  _effplots.extend([Plot("effic_"+v+simDict[val], xtitle = variables[v][0]+variables[v][1], **kwargs)])
1673  print("appending plot", "effic_"+v+simDict[val])
1674  _purityplots.extend([Plot("purity_"+v+simDict[val], xtitle = variables[v][0]+variables[v][1], **kwargs)])
1675  print("appending plot", "purity_"+v+simDict[val])
1676  _dupplots.extend([Plot("duplicate_"+v+simDict[val], xtitle = variables[v][0]+variables[v][1], **kwargs)])
1677  print("appending plot", "duplicate_"+v+simDict[val])
1678  _fakeplots.extend([Plot("fake_"+v+simDict[val], xtitle = variables[v][0]+variables[v][1], **kwargs)])
1679  print("appending plot", "fake_"+v+simDict[val])
1680  _mergeplots.extend([Plot("merge_"+v+simDict[val], xtitle = variables[v][0]+variables[v][1], **kwargs)])
1681  print("appending plot", "merge_"+v+simDict[val])
1682 
1683  _efficiencies.append(PlotGroup("Efficiencies"+simDict[val], _effplots, ncols=3))
1684  print("appending plot group", "Efficiencies"+simDict[val])
1685  _purities.append(PlotGroup("Purities"+simDict[val], _purityplots, ncols=3))
1686  print("appending plot group", "Purities"+simDict[val])
1687  _duplicates.append(PlotGroup("Duplicates"+simDict[val], _dupplots, ncols=3))
1688  _fakes.append(PlotGroup("FakeRate"+simDict[val], _fakeplots, ncols=3))
1689  _merges.append(PlotGroup("MergeRate"+simDict[val], _mergeplots, ncols=3))
1690 
1691 
1692 #Coming back to the usual box definition
1693 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65, "xtitle": "Default"}
1694 
1695 _tottracksternum = PlotGroup("TotalNumberofTracksters", [
1696  Plot("tottracksternum", **_common)
1697 ],ncols=1)
1698 
1699 _trackster_layernum_plots = [Plot("trackster_firstlayer", **_common)]
1700 _trackster_layernum_plots.extend([Plot("trackster_lastlayer", **_common)])
1701 _trackster_layernum_plots.extend([Plot("trackster_layersnum", **_common)])
1702 _trackster_layernum = PlotGroup("LayerNumbersOfTrackster", _trackster_layernum_plots, ncols=3)
1703 
1704 _common["xmax"] = 150
1705 _clusternum_in_trackster = PlotGroup("NumberofLayerClustersinTrackster",[
1706  Plot("clusternum_in_trackster", **_common)
1707 ],ncols=1)
1708 
1709 _common = {"stat": True, "drawStyle": "pcolz", "staty": 0.65, "xtitle": "Default", "ytitle": "Default"}
1710 
1711 _clusternum_in_trackster_vs_layer = PlotGroup("NumberofLayerClustersinTracksterPerLayer",[
1712  Plot("clusternum_in_trackster_vs_layer", **_common)
1713 ],ncols=1)
1714 
1715 _common["scale"] = 100.
1716 #, ztitle = "% of clusters" normalizeToUnitArea=True
1717 _multiplicity_numberOfEventsHistogram = hgcVal_dqm + "ticlTrackstersMerge/multiplicity_numberOfEventsHistogram"
1718 _multiplicity_zminus_numberOfEventsHistogram = hgcVal_dqm + "ticlTrackstersMerge/multiplicity_zminus_numberOfEventsHistogram"
1719 _multiplicity_zplus_numberOfEventsHistogram = hgcVal_dqm + "ticlTrackstersMerge/multiplicity_zplus_numberOfEventsHistogram"
1720 
1721 _multiplicityOfLCinTST_plots = [Plot("multiplicityOfLCinTST",
1722  drawCommand = "colz text45", normalizeToNumberOfEvents = True, **_common)]
1723 _multiplicityOfLCinTST_plots.extend([Plot("multiplicityOfLCinTST_vs_layerclusterenergy",
1724  drawCommand = "colz text45", normalizeToNumberOfEvents = True, **_common)])
1725 _multiplicityOfLCinTST_plots.extend([Plot("multiplicityOfLCinTST_vs_layercluster_zplus",
1726  drawCommand = "colz text45", normalizeToNumberOfEvents = True, **_common)])
1727 _multiplicityOfLCinTST_plots.extend([Plot("multiplicityOfLCinTST_vs_layercluster_zminus",
1728  drawCommand = "colz text45", normalizeToNumberOfEvents = True, **_common)])
1729 _multiplicityOfLCinTST = PlotGroup("MultiplicityofLCinTST", _multiplicityOfLCinTST_plots, ncols=2)
1730 
1731 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65}
1732 #--------------------------------------------------------------------------------------------
1733 # z-
1734 #--------------------------------------------------------------------------------------------
1735 _clusternum_in_trackster_perlayer_zminus_EE = PlotGroup("NumberofLayerClustersinTracksterPerLayer_zminus_EE", [
1736  Plot("clusternum_in_trackster_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
1737 ], ncols=7)
1738 
1739 _clusternum_in_trackster_perlayer_zminus_FH = PlotGroup("NumberofLayerClustersinTracksterPerLayer_zminus_FH", [
1740  Plot("clusternum_in_trackster_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
1741 ], ncols=7)
1742 
1743 _clusternum_in_trackster_perlayer_zminus_BH = PlotGroup("NumberofLayerClustersinTracksterPerLayer_zminus_BH", [
1744  Plot("clusternum_in_trackster_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
1745 ], ncols=7)
1746 
1747 #--------------------------------------------------------------------------------------------
1748 # z+
1749 #--------------------------------------------------------------------------------------------
1750 _clusternum_in_trackster_perlayer_zplus_EE = PlotGroup("NumberofLayerClustersinTracksterPerLayer_zplus_EE", [
1751  Plot("clusternum_in_trackster_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
1752 ], ncols=7)
1753 
1754 _clusternum_in_trackster_perlayer_zplus_FH = PlotGroup("NumberofLayerClustersinTracksterPerLayer_zplus_FH", [
1755  Plot("clusternum_in_trackster_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
1756 ], ncols=7)
1757 
1758 _clusternum_in_trackster_perlayer_zplus_BH = PlotGroup("NumberofLayerClustersinTracksterPerLayer_zplus_BH", [
1759  Plot("clusternum_in_trackster_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
1760 ], ncols=7)
1761 
1762 # Coming back to the usual box definition
1763 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65, "xtitle": "Default"}
1764 
1765 # Some tracksters quantities
1766 _trackster_eppe_plots = [Plot("trackster_eta", **_common)]
1767 _trackster_eppe_plots.extend([Plot("trackster_phi", **_common)])
1768 _trackster_eppe_plots.extend([Plot("trackster_pt", **_common)])
1769 _trackster_eppe_plots.extend([Plot("trackster_energy", **_common)])
1770 _trackster_eppe = PlotGroup("EtaPhiPtEnergy", _trackster_eppe_plots, ncols=2)
1771 
1772 _trackster_xyz_plots = [Plot("trackster_x", **_common)]
1773 _trackster_xyz_plots.extend([Plot("trackster_y", **_common)])
1774 _trackster_xyz_plots.extend([Plot("trackster_z", **_common)])
1775 _trackster_xyz = PlotGroup("XYZ", _trackster_xyz_plots, ncols=3)
1776 
1777 #--------------------------------------------------------------------------------------------
1778 # CANDIDATES
1779 #--------------------------------------------------------------------------------------------
1780 
1781 # all candidates
1782 cand_plots_names = ["N of tracksters in candidate", "Candidates PDG Id", "Candidates charge", "Candidates type"]
1783 _candidate_nts_plots = []
1784 for name in cand_plots_names:
1785  _candidate_nts_plots.extend([Plot(name, **_common)])
1786 _candidatesPlots1 = PlotGroup("General_plots_pid_type", _candidate_nts_plots, ncols=2)
1787 
1788 cand_plots_names = ["Candidates pT", "Candidates raw energy", "Candidates regressed energy"]
1789 _candidate_nts_plots = []
1790 for name in cand_plots_names:
1791  _candidate_nts_plots.extend([Plot(name, **_common)])
1792 _candidatesPlots2 = PlotGroup("General_plots_pt_energy", _candidate_nts_plots, ncols=3)
1793 
1794 _candidatesPlots = [_candidatesPlots1, _candidatesPlots2]
1795 
1796 # divided by candidate's type
1797 cand_type = ["charged_hadrons", "electrons", "muons", "neutral_hadrons", "neutral_pions", "photons"]
1798 cand_plots_names = [" candidates PDG Id", " candidates charge", " candidates type"]
1799 cand_plots_names_den = ["den_fake_cand_vs_energy_", "den_fake_cand_vs_eta_", "den_fake_cand_vs_phi_", "den_fake_cand_vs_pt_"]
1800 
1801 _all_cand_type_plots = []
1802 for ct in cand_type:
1803  cand_type_plots = [Plot("N of tracksters in candidate for "+ct, title="N of tracksters in candidate for "+ct.replace("_", " "), **_common)]
1804  for name in cand_plots_names:
1805  cand_type_plots.extend([Plot(ct+name, title=ct.replace("_", " ")+name, **_common)])
1806  _all_cand_type_plots.append(cand_type_plots)
1807 
1808 _all_cand_ene_plots = []
1809 for ct in cand_type:
1810  name = "candidates regressed energy"
1811  cand_type_plots = [Plot(ct+name, title=ct.replace("_", " ")+" "+name, **_common)]
1812  for name in cand_plots_names_den:
1813  cand_type_plots.extend([Plot(name+ct, title=ct.replace("_", " ")+" candidates "+name.replace("den_fake_cand_vs_", "").replace("_", ""), **_common)])
1814  _all_cand_ene_plots.append(cand_type_plots)
1815 
1816 #efficiency and fake
1817 _common_eff_fake = {"stat": False, "legend": False, "xbinlabelsize": 14, "xtitle": "Default", "xbinlabeloption": "d", "ymin": 0.0, "ymax": 1.1}
1818 _all_cand_eff_plots = []
1819 for ct in cand_type:
1820  cand_eff_plots = []
1821  for var in ["pt", "energy", "eta", "phi"]:
1822  for cut in ["track", "pid", "energy"]:
1823  cand_eff_plots.extend([Plot("eff_"+ct+"_"+cut+"_"+var, title=cut + " efficiency for "+ct.replace("_", " ")+" vs "+var, ytitle="Efficiency", **_common_eff_fake)])
1824  _all_cand_eff_plots.append(cand_eff_plots)
1825 
1826 _all_cand_fake_plots = []
1827 for ct in cand_type:
1828  cand_fake_plots = []
1829  for var in ["pt", "energy", "eta", "phi"]:
1830  for cut in ["track", "pid", "energy"]:
1831  cand_fake_plots.extend([Plot("fake_"+ct+"_"+cut+"_"+var, title=cut + " fake rate for "+ct.replace("_", " ")+" vs "+var, ytitle="Fake rate", **_common_eff_fake)])
1832  _all_cand_fake_plots.append(cand_fake_plots)
1833 
1834 _allCandidatesPlots = [[],[],[],[],[],[]]
1835 for i in range(6):
1836  _allCandidatesPlots[i].extend([PlotGroup(cand_type[i]+"_type", _all_cand_type_plots[i], ncols=2), PlotGroup(cand_type[i]+"_kin", _all_cand_ene_plots[i], ncols=3), PlotGroup(cand_type[i]+"_eff", _all_cand_eff_plots[i], ncols=3), PlotGroup(cand_type[i]+"_fake", _all_cand_fake_plots[i], ncols=3)])
1837 
1838 #--------------------------------------------------------------------------------------------
1839 # SIMHITS, DIGIS, RECHITS
1840 #--------------------------------------------------------------------------------------------
1841 
1842 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65, "ymin": 0.1, "ylog": True}
1843 
1844 _HitValidation = PlotGroup("HitValidation", [
1845  Plot("heeEnSim", title="SimHits_EE_Energy", **_common),
1846  Plot("hebEnSim", title="SimHits_HE_Silicon_Energy", **_common),
1847  Plot("hefEnSim", title="SimHits_HE_Scintillator_Energy", **_common),
1848  ])
1849 
1850 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65}
1851 
1852 _Occupancy_EE_zplus = PlotGroup("Occupancy_EE_zplus", [Plot("HitOccupancy_Plus_layer_{:02d}".format(i), title="Occupancy_EE_zplus",
1853  xtitle="Layer {}".format(i), **_common) for i in range(EE_min,EE_max+1)
1854  ], ncols=7)
1855 
1856 _Occupancy_HE_Silicon_zplus = PlotGroup("Occupancy_HE_Silicon_zplus", [Plot("HitOccupancy_Plus_layer_{:02d}".format(i), title="Occupancy_HE_zplus",
1857  xtitle="Layer {}".format(i), **_common) for i in range(HESilicon_min,HESilicon_max+1)
1858  ], ncols=7)
1859 
1860 _Occupancy_HE_Scintillator_zplus = PlotGroup("Occupancy_HE_Scintillator_zplus", [Plot("HitOccupancy_Plus_layer_{:02d}".format(i), title="Occupancy_HE_Scintillator_zplus",
1861  xtitle="Layer {}".format(i), **_common) for i in range(HEScintillator_min,HEScintillator_max+1)
1862  ], ncols=7)
1863 
1864 _Occupancy_EE_zminus = PlotGroup("Occupancy_EE_zminus", [Plot("HitOccupancy_Minus_layer_{:02d}".format(i), title="Occupancy_EE_zminus",
1865  xtitle="Layer {}".format(i), **_common) for i in range(EE_min,EE_max+1)
1866  ], ncols=7)
1867 
1868 _Occupancy_HE_Silicon_zminus = PlotGroup("Occupancy_HE_Silicon_zminus", [Plot("HitOccupancy_Minus_layer_{:02d}".format(i), title="Occupancy_HE_Silicon_zminus",
1869  xtitle="Layer {}".format(i), **_common) for i in range(HESilicon_min,HESilicon_max+1)
1870  ], ncols=7)
1871 
1872 _Occupancy_HE_Scintillator_zminus = PlotGroup("Occupancy_HE_Scintillator_zminus", [Plot("HitOccupancy_Minus_layer_{:02d}".format(i), title="Occupancy_HE_Scintillator_zminus",
1873  xtitle="Layer {}".format(i), **_common) for i in range(HEScintillator_min,HEScintillator_max+1)
1874  ], ncols=7)
1875 
1876 _common_etaphi = dict(removeEmptyBins=False, xbinlabelsize=10, xbinlabeloption="d", ymin=None)
1877 
1878 _EtaPhi_EE_zplus = PlotGroup("EtaPhi_EE_zplus", [Plot("EtaPhi_Plus_layer_{:02d}".format(i), title="EtaPhi_EE_zplus",
1879  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_etaphi) for i in range(EE_min,EE_max+1)
1880  ], ncols=7)
1881 
1882 _EtaPhi_HE_Silicon_zplus = PlotGroup("EtaPhi_HE_Silicon_zplus", [Plot("EtaPhi_Plus_layer_{:02d}".format(i), title="EtaPhi_HE_Silicon_zplus",
1883  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_etaphi) for i in range(HESilicon_min,HESilicon_max+1)
1884  ], ncols=7)
1885 
1886 _EtaPhi_HE_Scintillator_zplus = PlotGroup("EtaPhi_HE_Scintillator_zplus", [Plot("EtaPhi_Plus_layer_{:02d}".format(i), title="EtaPhi_HE_Scintillator_zplus",
1887  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_etaphi) for i in range(HEScintillator_min,HEScintillator_max+1)
1888  ], ncols=7)
1889 
1890 _EtaPhi_EE_zminus = PlotGroup("EtaPhi_EE_zminus", [Plot("EtaPhi_Minus_layer_{:02d}".format(i), title="EtaPhi_EE_zminus",
1891  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_etaphi) for i in range(EE_min,EE_max+1)
1892  ], ncols=7)
1893 
1894 _EtaPhi_HE_Silicon_zminus = PlotGroup("EtaPhi_HE_Silicon_zminus", [Plot("EtaPhi_Minus_layer_{:02d}".format(i), title="EtaPhi_HE_Silicon_zminus",
1895  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_etaphi) for i in range(HESilicon_min,HESilicon_max+1)
1896  ], ncols=7)
1897 
1898 _EtaPhi_HE_Scintillator_zminus = PlotGroup("EtaPhi_HE_Scintillator_zminus", [Plot("EtaPhi_Minus_layer_{:02d}".format(i), title="EtaPhi_HE_Scintillator_zminus",
1899  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_etaphi) for i in range(HEScintillator_min,HEScintillator_max+1)
1900  ], ncols=7)
1901 
1902 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65, "ymin": 0.1, "ylog": True}
1903 
1904 _Energy_EE_0 = PlotGroup("Energy_Time_0_EE", [Plot("energy_time_0_layer_{:02d}".format(i), title="Energy_Time_0_EE",
1905  xtitle="Layer {}".format(i), **_common) for i in range(EE_min,EE_max+1)
1906  ], ncols=7)
1907 
1908 _Energy_HE_Silicon_0 = PlotGroup("Energy_Time_0_HE_Silicon", [Plot("energy_time_0_layer_{:02d}".format(i), title="Energy_Time_0_HE_Silicon",
1909  xtitle="Layer {}".format(i), **_common) for i in range(HESilicon_min,HESilicon_max+1)
1910  ], ncols=7)
1911 
1912 _Energy_HE_Scintillator_0 = PlotGroup("Energy_Time_0_HE_Scintillator", [Plot("energy_time_0_layer_{:02d}".format(i), title="Energy_Time_0_HE_Scintillator",
1913  xtitle="Layer {}".format(i), **_common) for i in range(HEScintillator_min,HEScintillator_max+1)
1914  ], ncols=7)
1915 
1916 _Energy_EE_1 = PlotGroup("Energy_Time_1_EE", [Plot("energy_time_1_layer_{:02d}".format(i), title="Energy_Time_1_EE",
1917  xtitle="Layer {}".format(i), **_common) for i in range(EE_min,EE_max+1)
1918  ], ncols=7)
1919 
1920 _Energy_HE_Silicon_1 = PlotGroup("Energy_Time_1_HE_Silicon", [Plot("energy_time_1_layer_{:02d}".format(i), title="Energy_Time_1_HE_Silicon",
1921  xtitle="Layer {}".format(i), **_common) for i in range(HESilicon_min,HESilicon_max+1)
1922  ], ncols=7)
1923 
1924 _Energy_HE_Scintillator_1 = PlotGroup("Energy_Time_1_HE_Scintillator", [Plot("energy_time_1_layer_{:02d}".format(i), title="Energy_Time_1_HE_Scintillator",
1925  xtitle="Layer {}".format(i), **_common) for i in range(HEScintillator_min,HEScintillator_max+1)
1926  ], ncols=7)
1927 
1928 _Energy_EE = PlotGroup("Energy_EE", [Plot("energy_layer_{:02d}".format(i), title="Energy_EE",
1929  xtitle="Layer {}".format(i), **_common) for i in range(EE_min,EE_max+1)
1930  ], ncols=7)
1931 
1932 _Energy_HE_Silicon = PlotGroup("Energy_HE_Silicon", [Plot("energy_layer_{:02d}".format(i), title="Energy_HE_Silicon",
1933  xtitle="Layer {}".format(i), **_common) for i in range(HESilicon_min,HESilicon_max+1)
1934  ], ncols=7)
1935 
1936 _Energy_HE_Scintillator = PlotGroup("Energy_HE_Scintillator", [Plot("energy_layer_{:02d}".format(i), title="Energy_HE_Scintillator",
1937  xtitle="Layer {}".format(i), **_common) for i in range(HEScintillator_min,HEScintillator_max+1)
1938  ], ncols=7)
1939 
1940 _DigiHits_ADC_EE = PlotGroup("ADC_EE", [Plot("ADC_layer_{:02d}".format(i), title="DigiHits_ADC_EE",
1941  xtitle="Layer {}".format(i), **_common) for i in range(EE_min,EE_max+1)
1942  ], ncols=7)
1943 
1944 _DigiHits_ADC_HE_Silicon = PlotGroup("ADC_HE_Silicon", [Plot("ADC_layer_{:02d}".format(i), title="DigiHits_ADC_HE_Silicon",
1945  xtitle="Layer {}".format(i), **_common) for i in range(HESilicon_min,HESilicon_max+1)
1946  ], ncols=7)
1947 
1948 _DigiHits_ADC_HE_Scintillator = PlotGroup("ADC_HE_Scintillator", [Plot("ADC_layer_{:02d}".format(i), title="DigiHits_ADC_HE_Scintillator",
1949  xtitle="Layer {}".format(i), **_common) for i in range(HEScintillator_min,HEScintillator_max+1)
1950  ], ncols=7)
1951 
1952 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65}
1953 
1954 _DigiHits_Occupancy_EE_zplus = PlotGroup("Occupancy_EE_zplus", [Plot("DigiOccupancy_Plus_layer_{:02d}".format(i), title="DigiHits_Occupancy_EE_zplus",
1955  xtitle="Layer {}".format(i), **_common) for i in range(EE_min,EE_max+1)
1956  ], ncols=7)
1957 
1958 _DigiHits_Occupancy_HE_Silicon_zplus = PlotGroup("Occupancy_HE_Silicon_zplus", [Plot("DigiOccupancy_Plus_layer_{:02d}".format(i), title="DigiHits_Occupancy_HE_Silicon_zplus",
1959  xtitle="Layer {}".format(i), **_common) for i in range(HESilicon_min,HESilicon_max+1)
1960  ], ncols=7)
1961 
1962 _DigiHits_Occupancy_HE_Scintillator_zplus = PlotGroup("Occupancy_HE_Scintillator_zplus", [Plot("DigiOccupancy_Plus_layer_{:02d}".format(i), title="DigiHits_Occupancy_HE_Scintillator_zplus",
1963  xtitle="Layer {}".format(i), **_common) for i in range(HEScintillator_min,HEScintillator_max+1)
1964  ], ncols=7)
1965 
1966 _DigiHits_Occupancy_EE_zminus = PlotGroup("Occupancy_EE_zminus", [Plot("DigiOccupancy_Minus_layer_{:02d}".format(i), title="DigiHits_Occupancy_EE_zminus",
1967  xtitle="Layer {}".format(i), **_common) for i in range(EE_min,EE_max+1)
1968  ], ncols=7)
1969 
1970 _DigiHits_Occupancy_HE_Silicon_zminus = PlotGroup("Occupancy_HE_Silicon_zminus", [Plot("DigiOccupancy_Minus_layer_{:02d}".format(i), title="DigiHits_Occupancy_HE_Silicon_zminus",
1971  xtitle="Layer {}".format(i), **_common) for i in range(HESilicon_min,HESilicon_max+1)
1972  ], ncols=7)
1973 
1974 _DigiHits_Occupancy_HE_Scintillator_zminus = PlotGroup("Occupancy_HE_Scintillator_zminus", [Plot("DigiOccupancy_Minus_layer_{:02d}".format(i), title="DigiHits_Occupancy_HE_Scintillator_zminus",
1975  xtitle="Layer {}".format(i), **_common) for i in range(HEScintillator_min,HEScintillator_max+1)
1976  ], ncols=7)
1977 
1978 _common_XY = dict(removeEmptyBins=True, xbinlabelsize=10, xbinlabeloption="d", ymin=None)
1979 
1980 _DigiHits_Occupancy_XY_EE = PlotGroup("Occupancy_XY_EE", [Plot("DigiOccupancy_XY_layer_{:02d}".format(i), title="DigiHits_Occupancy_XY_EE",
1981  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_XY) for i in range(EE_min,EE_max+1)
1982  ], ncols=7)
1983 
1984 _DigiHits_Occupancy_XY_HE_Silicon = PlotGroup("Occupancy_XY_HE_Silicon", [Plot("DigiOccupancy_XY_layer_{:02d}".format(i), title="DigiHits_Occupancy_XY_HE_Silicon",
1985  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_XY) for i in range(HESilicon_min,HESilicon_max+1)
1986  ], ncols=7)
1987 
1988 _DigiHits_Occupancy_XY_HE_Scintillator = PlotGroup("Occupancy_XY_HE_Scintillator", [Plot("DigiOccupancy_XY_layer_{:02d}".format(i), title="DigiHits_Occupancy_XY_HE_Scintillator",
1989  xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_XY) for i in range(HEScintillator_min,HEScintillator_max+1)
1990  ], ncols=7)
1991 
1992 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65, "ymin": 0.1, "ylog": True}
1993 
1994 _DigiHits_TOA_EE = PlotGroup("TOA_EE", [
1995  Plot("TOA_layer_{:02d}".format(i), title="TOA_EE", xtitle="Layer {}".format(i), **_common) for i in range(EE_min,EE_max+1)
1996  ], ncols=7)
1997 
1998 _DigiHits_TOA_HE_Silicon = PlotGroup("TOA_HE_Silicon", [
1999  Plot("TOA_layer_{:02d}".format(i), title="TOA_HE_Silicon", xtitle="Layer {}".format(i), **_common) for i in range(HESilicon_min,HESilicon_max+1)
2000  ], ncols=7)
2001 
2002 _DigiHits_TOA_HE_Scintillator = PlotGroup("TOA_HE_Scintillator", [
2003  Plot("TOA_layer_{:02d}".format(i), title="TOA_HE_Scintillator", xtitle="Layer {}".format(i), **_common) for i in range(HEScintillator_min,HEScintillator_max+1)
2004  ], ncols=7)
2005 
2006 _DigiHits_TOT_EE = PlotGroup("TOT_EE", [
2007  Plot("TOT_layer_{:02d}".format(i), title="TOT_EE", xtitle="Layer {}".format(i), **_common) for i in range(EE_min,EE_max+1)
2008  ], ncols=7)
2009 
2010 _DigiHits_TOT_HE_Silicon = PlotGroup("TOT_HE_Silicon", [
2011  Plot("TOT_layer_{:02d}".format(i), title="TOT_HE_Silicon", xtitle="Layer {}".format(i), **_common) for i in range(HESilicon_min,HESilicon_max+1)
2012  ], ncols=7)
2013 
2014 _DigiHits_TOT_HE_Scintillator = PlotGroup("TOT_HE_Scintillator", [
2015  Plot("TOT_layer_{:02d}".format(i), title="TOT_HE_Scintillator", xtitle="Layer {}".format(i), **_common) for i in range(HEScintillator_min,HEScintillator_max+1)
2016  ], ncols=7)
2017 
2018 #===================================================================================================================
2019 #Plot definition for HitCalibration
2020 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65, "ymin": 0.1, "ylog": False}
2021 
2022 _LayerOccupancy = PlotGroup("LayerOccupancy", [
2023  Plot("LayerOccupancy", title="LayerOccupancy", **_common)], ncols=1)
2024 
2025 _ReconstructableEnergyOverCPenergy = PlotGroup("ReconstructableEnergyOverCPenergy", [
2026  Plot("h_EoP_CPene_100_calib_fraction", title="EoP_CPene_100_calib_fraction", **_common),
2027  Plot("h_EoP_CPene_200_calib_fraction", title="EoP_CPene_200_calib_fraction", **_common),
2028  Plot("h_EoP_CPene_300_calib_fraction", title="EoP_CPene_300_calib_fraction", **_common),
2029  Plot("h_EoP_CPene_scint_calib_fraction", title="EoP_CPene_scint_calib_fraction", **_common),
2030 ])
2031 
2032 _ParticleFlowClusterHGCalFromTrackster_Closest_EoverCPenergy = PlotGroup("ParticleFlowClusterHGCalFromTrackster", [
2033  Plot("hgcal_EoP_CPene_100_calib_fraction", title="hgcal_EoP_CPene_100_calib_fraction", **_common),
2034  Plot("hgcal_EoP_CPene_200_calib_fraction", title="hgcal_EoP_CPene_200_calib_fraction", **_common),
2035  Plot("hgcal_EoP_CPene_300_calib_fraction", title="hgcal_EoP_CPene_300_calib_fraction", **_common),
2036  Plot("hgcal_EoP_CPene_scint_calib_fraction", title="hgcal_EoP_CPene_scint_calib_fraction", **_common),
2037 ])
2038 
2039 _EcalDrivenGsfElectronsFromTrackster_Closest_EoverCPenergy = PlotGroup("EcalDrivenGsfElectronsFromTrackster", [
2040  Plot("hgcal_ele_EoP_CPene_100_calib_fraction", title="hgcal_ele_EoP_CPene_100_calib_fraction", **_common),
2041  Plot("hgcal_ele_EoP_CPene_200_calib_fraction", title="hgcal_ele_EoP_CPene_200_calib_fraction", **_common),
2042  Plot("hgcal_ele_EoP_CPene_300_calib_fraction", title="hgcal_ele_EoP_CPene_300_calib_fraction", **_common),
2043  Plot("hgcal_ele_EoP_CPene_scint_calib_fraction", title="hgcal_ele_EoP_CPene_scint_calib_fraction", **_common),
2044 ])
2045 
2046 _PhotonsFromTrackster_Closest_EoverCPenergy = PlotGroup("PhotonsFromTrackster", [
2047  Plot("hgcal_photon_EoP_CPene_100_calib_fraction", title="hgcal_photon_EoP_CPene_100_calib_fraction", **_common),
2048  Plot("hgcal_photon_EoP_CPene_200_calib_fraction", title="hgcal_photon_EoP_CPene_200_calib_fraction", **_common),
2049  Plot("hgcal_photon_EoP_CPene_300_calib_fraction", title="hgcal_photon_EoP_CPene_300_calib_fraction", **_common),
2050  Plot("hgcal_photon_EoP_CPene_scint_calib_fraction", title="hgcal_photon_EoP_CPene_scint_calib_fraction", **_common),
2051 ])
2052 
2053 #=================================================================================================
2054 hgcalLayerClustersPlotter = Plotter()
2055 layerClustersLabel = 'Layer Clusters'
2056 
2057 lc_general_clusterlevel = [
2058  # number of layer clusters per event in a) 120um, b) 200um, c) 300um, d) scint
2059  # (one entry per event in each of the four histos)
2060  _totclusternum_thick,
2061  # Miscellaneous plots:
2062  # longdepthbarycentre: The longitudinal depth barycentre. One entry per event.
2063  # mixedhitscluster: Number of clusters per event with hits in different thicknesses.
2064  # num_reco_cluster_eta: Number of reco clusters vs eta
2065  _num_reco_cluster_eta,
2066  _energyclustered,
2067  _mixedhitsclusters,
2068  _longdepthbarycentre,
2069  # calculated "energy density" for cells in a) 120um, b) 200um, c) 300um, d) scint
2070  # (one entry per rechit, in the appropriate histo)
2071  _cellsenedens_thick
2072 ]
2073 
2074 lc_clusterlevel_zminus = [
2075  # number of layer clusters per layer (one entry per event in each histo)
2076  _totclusternum_layer_EE_zminus,
2077  _totclusternum_layer_FH_zminus,
2078  _totclusternum_layer_BH_zminus,
2079  # Looking at the fraction of true energy that has been clustered; by layer and overall
2080  _energyclustered_perlayer_EE_zminus,
2081  _energyclustered_perlayer_FH_zminus,
2082  _energyclustered_perlayer_BH_zminus
2083 ]
2084 
2085 lc_cellevel_zminus = [
2086  # For each layer cluster:
2087  # number of cells in layer cluster, by layer - separate histos in each layer for 120um Si, 200/300um Si, Scint
2088  # NB: not all combinations exist; e.g. no 120um Si in layers with scint.
2089  # (One entry in the appropriate histo per layer cluster).
2090  _cellsnum_perthick_perlayer_120_EE_zminus,
2091  _cellsnum_perthick_perlayer_120_FH_zminus,
2092  _cellsnum_perthick_perlayer_120_BH_zminus,
2093  _cellsnum_perthick_perlayer_200_EE_zminus,
2094  _cellsnum_perthick_perlayer_200_FH_zminus,
2095  _cellsnum_perthick_perlayer_200_BH_zminus,
2096  _cellsnum_perthick_perlayer_300_EE_zminus,
2097  _cellsnum_perthick_perlayer_300_FH_zminus,
2098  _cellsnum_perthick_perlayer_300_BH_zminus,
2099  _cellsnum_perthick_perlayer_scint_EE_zminus,
2100  _cellsnum_perthick_perlayer_scint_FH_zminus,
2101  _cellsnum_perthick_perlayer_scint_BH_zminus,
2102  # Cell Association per Layer
2103  _cell_association_table_zminus
2104 ]
2105 
2106 lc_cp_association_zminus = [
2107  # Efficiency Plots
2108  _efficiencies_zminus,
2109  _efficiencies_zminus_eta,
2110  _efficiencies_zminus_phi,
2111  # Duplicate Plots
2112  _duplicates_zminus,
2113  _duplicates_zminus_eta,
2114  _duplicates_zminus_phi,
2115  # Fake Rate Plots
2116  _fakes_zminus,
2117  _fakes_zminus_eta,
2118  _fakes_zminus_phi,
2119  # Merge Rate Plots
2120  _merges_zminus,
2121  _merges_zminus_eta,
2122  _merges_zminus_phi,
2123  # Score of CaloParticles wrt Layer Clusters
2124  _score_caloparticle_to_layerclusters_zminus,
2125  # Score of LayerClusters wrt CaloParticles
2126  _score_layercluster_to_caloparticles_zminus,
2127  # Shared Energy between CaloParticle and LayerClusters
2128  _sharedEnergy_caloparticle_to_layercluster_zminus,
2129  # Shared Energy between LayerClusters and CaloParticle
2130  _sharedEnergy_layercluster_to_caloparticle_zminus,
2131  # Energy vs Score 2D plots CP to LC
2132  _energyscore_cp2lc_zminus,
2133  # Energy vs Score 2D plots LC to CP
2134  _energyscore_lc2cp_zminus
2135 ]
2136 
2137 lc_zminus_extended = [
2138  # For each layer cluster:
2139  # distance of cells from a) seed cell, b) max cell; and c), d): same with entries weighted by cell energy
2140  # separate histos in each layer for 120um Si, 200/300um Si, Scint
2141  # NB: not all combinations exist; e.g. no 120um Si in layers with scint.
2142  # (One entry in each of the four appropriate histos per cell in a layer cluster)
2143  _distancetomaxcell_perthickperlayer_120_EE_zminus,
2144  _distancetomaxcell_perthickperlayer_120_FH_zminus,
2145  _distancetomaxcell_perthickperlayer_120_BH_zminus,
2146  _distancetomaxcell_perthickperlayer_200_EE_zminus,
2147  _distancetomaxcell_perthickperlayer_200_FH_zminus,
2148  _distancetomaxcell_perthickperlayer_200_BH_zminus,
2149  _distancetomaxcell_perthickperlayer_300_EE_zminus,
2150  _distancetomaxcell_perthickperlayer_300_FH_zminus,
2151  _distancetomaxcell_perthickperlayer_300_BH_zminus,
2152  _distancetomaxcell_perthickperlayer_scint_EE_zminus,
2153  _distancetomaxcell_perthickperlayer_scint_FH_zminus,
2154  _distancetomaxcell_perthickperlayer_scint_BH_zminus,
2155  _distancetoseedcell_perthickperlayer_120_EE_zminus,
2156  _distancetoseedcell_perthickperlayer_120_FH_zminus,
2157  _distancetoseedcell_perthickperlayer_120_BH_zminus,
2158  _distancetoseedcell_perthickperlayer_200_EE_zminus,
2159  _distancetoseedcell_perthickperlayer_200_FH_zminus,
2160  _distancetoseedcell_perthickperlayer_200_BH_zminus,
2161  _distancetoseedcell_perthickperlayer_300_EE_zminus,
2162  _distancetoseedcell_perthickperlayer_300_FH_zminus,
2163  _distancetoseedcell_perthickperlayer_300_BH_zminus,
2164  _distancetoseedcell_perthickperlayer_scint_EE_zminus,
2165  _distancetoseedcell_perthickperlayer_scint_FH_zminus,
2166  _distancetoseedcell_perthickperlayer_scint_BH_zminus,
2167  _distancetomaxcell_perthickperlayer_eneweighted_120_EE_zminus,
2168  _distancetomaxcell_perthickperlayer_eneweighted_120_FH_zminus,
2169  _distancetomaxcell_perthickperlayer_eneweighted_120_BH_zminus,
2170  _distancetomaxcell_perthickperlayer_eneweighted_200_EE_zminus,
2171  _distancetomaxcell_perthickperlayer_eneweighted_200_FH_zminus,
2172  _distancetomaxcell_perthickperlayer_eneweighted_200_BH_zminus,
2173  _distancetomaxcell_perthickperlayer_eneweighted_300_EE_zminus,
2174  _distancetomaxcell_perthickperlayer_eneweighted_300_FH_zminus,
2175  _distancetomaxcell_perthickperlayer_eneweighted_300_BH_zminus,
2176  _distancetomaxcell_perthickperlayer_eneweighted_scint_EE_zminus,
2177  _distancetomaxcell_perthickperlayer_eneweighted_scint_FH_zminus,
2178  _distancetomaxcell_perthickperlayer_eneweighted_scint_BH_zminus,
2179  _distancetoseedcell_perthickperlayer_eneweighted_120_EE_zminus,
2180  _distancetoseedcell_perthickperlayer_eneweighted_120_FH_zminus,
2181  _distancetoseedcell_perthickperlayer_eneweighted_120_BH_zminus,
2182  _distancetoseedcell_perthickperlayer_eneweighted_200_EE_zminus,
2183  _distancetoseedcell_perthickperlayer_eneweighted_200_FH_zminus,
2184  _distancetoseedcell_perthickperlayer_eneweighted_200_BH_zminus,
2185  _distancetoseedcell_perthickperlayer_eneweighted_300_EE_zminus,
2186  _distancetoseedcell_perthickperlayer_eneweighted_300_FH_zminus,
2187  _distancetoseedcell_perthickperlayer_eneweighted_300_BH_zminus,
2188  _distancetoseedcell_perthickperlayer_eneweighted_scint_EE_zminus,
2189  _distancetoseedcell_perthickperlayer_eneweighted_scint_FH_zminus,
2190  _distancetoseedcell_perthickperlayer_eneweighted_scint_BH_zminus,
2191  _distancebetseedandmaxcell_perthickperlayer_120_EE_zminus,
2192  _distancebetseedandmaxcell_perthickperlayer_120_FH_zminus,
2193  _distancebetseedandmaxcell_perthickperlayer_120_BH_zminus,
2194  _distancebetseedandmaxcell_perthickperlayer_200_EE_zminus,
2195  _distancebetseedandmaxcell_perthickperlayer_200_FH_zminus,
2196  _distancebetseedandmaxcell_perthickperlayer_200_BH_zminus,
2197  _distancebetseedandmaxcell_perthickperlayer_300_EE_zminus,
2198  _distancebetseedandmaxcell_perthickperlayer_300_FH_zminus,
2199  _distancebetseedandmaxcell_perthickperlayer_300_BH_zminus,
2200  _distancebetseedandmaxcell_perthickperlayer_scint_EE_zminus,
2201  _distancebetseedandmaxcell_perthickperlayer_scint_FH_zminus,
2202  _distancebetseedandmaxcell_perthickperlayer_scint_BH_zminus,
2203  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_EE_zminus,
2204  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_FH_zminus,
2205  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_BH_zminus,
2206  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_EE_zminus,
2207  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_FH_zminus,
2208  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_BH_zminus,
2209  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_EE_zminus,
2210  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_FH_zminus,
2211  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_BH_zminus,
2212  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_EE_zminus,
2213  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_FH_zminus,
2214  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_BH_zminus
2215 ]
2216 
2217 lc_clusterlevel_zplus = [
2218  # number of layer clusters per layer (one entry per event in each histo)
2219  _totclusternum_layer_EE_zplus,
2220  _totclusternum_layer_FH_zplus,
2221  _totclusternum_layer_BH_zplus,
2222  # Looking at the fraction of true energy that has been clustered; by layer and overall
2223  _energyclustered_perlayer_EE_zplus,
2224  _energyclustered_perlayer_FH_zplus,
2225  _energyclustered_perlayer_BH_zplus
2226 ]
2227 
2228 lc_cellevel_zplus = [
2229  # number of cells in layer cluster, by layer - separate histos in each layer for 120um Si, 200/300um Si, Scint
2230  _cellsnum_perthick_perlayer_120_EE_zplus,
2231  _cellsnum_perthick_perlayer_120_FH_zplus,
2232  _cellsnum_perthick_perlayer_120_BH_zplus,
2233  _cellsnum_perthick_perlayer_200_EE_zplus,
2234  _cellsnum_perthick_perlayer_200_FH_zplus,
2235  _cellsnum_perthick_perlayer_200_BH_zplus,
2236  _cellsnum_perthick_perlayer_300_EE_zplus,
2237  _cellsnum_perthick_perlayer_300_FH_zplus,
2238  _cellsnum_perthick_perlayer_300_BH_zplus,
2239  _cellsnum_perthick_perlayer_scint_EE_zplus,
2240  _cellsnum_perthick_perlayer_scint_FH_zplus,
2241  _cellsnum_perthick_perlayer_scint_BH_zplus,
2242  # Cell Association per Layer
2243  _cell_association_table_zplus
2244 ]
2245 
2246 lc_cp_association_zplus = [
2247  # Efficiency Plots
2248  _efficiencies_zplus,
2249  _efficiencies_zplus_eta,
2250  _efficiencies_zplus_phi,
2251  # Duplicate Plots
2252  _duplicates_zplus,
2253  _duplicates_zplus_eta,
2254  _duplicates_zplus_phi,
2255  # Fake Rate Plots
2256  _fakes_zplus,
2257  _fakes_zplus_eta,
2258  _fakes_zplus_phi,
2259  # Merge Rate Plots
2260  _merges_zplus,
2261  _merges_zplus_eta,
2262  _merges_zplus_phi,
2263  # Score of CaloParticles wrt Layer Clusters
2264  _score_caloparticle_to_layerclusters_zplus,
2265  # Score of LayerClusters wrt CaloParticles
2266  _score_layercluster_to_caloparticles_zplus,
2267  # Shared Energy between CaloParticle and LayerClusters
2268  _sharedEnergy_caloparticle_to_layercluster_zplus,
2269  # Shared Energy between LayerClusters and CaloParticle
2270  _sharedEnergy_layercluster_to_caloparticle_zplus,
2271  _energyscore_cp2lc_zplus,
2272  _energyscore_lc2cp_zplus
2273 ]
2274 
2275 lc_zplus_extended = [
2276  # distance of cells from a) seed cell, b) max cell; and c), d): same with entries weighted by cell energy
2277  _distancetomaxcell_perthickperlayer_120_EE_zplus,
2278  _distancetomaxcell_perthickperlayer_120_FH_zplus,
2279  _distancetomaxcell_perthickperlayer_120_BH_zplus,
2280  _distancetomaxcell_perthickperlayer_200_EE_zplus,
2281  _distancetomaxcell_perthickperlayer_200_FH_zplus,
2282  _distancetomaxcell_perthickperlayer_200_BH_zplus,
2283  _distancetomaxcell_perthickperlayer_300_EE_zplus,
2284  _distancetomaxcell_perthickperlayer_300_FH_zplus,
2285  _distancetomaxcell_perthickperlayer_300_BH_zplus,
2286  _distancetomaxcell_perthickperlayer_scint_EE_zplus,
2287  _distancetomaxcell_perthickperlayer_scint_FH_zplus,
2288  _distancetomaxcell_perthickperlayer_scint_BH_zplus,
2289  _distancetoseedcell_perthickperlayer_120_EE_zplus,
2290  _distancetoseedcell_perthickperlayer_120_FH_zplus,
2291  _distancetoseedcell_perthickperlayer_120_BH_zplus,
2292  _distancetoseedcell_perthickperlayer_200_EE_zplus,
2293  _distancetoseedcell_perthickperlayer_200_FH_zplus,
2294  _distancetoseedcell_perthickperlayer_200_BH_zplus,
2295  _distancetoseedcell_perthickperlayer_300_EE_zplus,
2296  _distancetoseedcell_perthickperlayer_300_FH_zplus,
2297  _distancetoseedcell_perthickperlayer_300_BH_zplus,
2298  _distancetoseedcell_perthickperlayer_scint_EE_zplus,
2299  _distancetoseedcell_perthickperlayer_scint_FH_zplus,
2300  _distancetoseedcell_perthickperlayer_scint_BH_zplus,
2301  _distancetomaxcell_perthickperlayer_eneweighted_120_EE_zplus,
2302  _distancetomaxcell_perthickperlayer_eneweighted_120_FH_zplus,
2303  _distancetomaxcell_perthickperlayer_eneweighted_120_BH_zplus,
2304  _distancetomaxcell_perthickperlayer_eneweighted_200_EE_zplus,
2305  _distancetomaxcell_perthickperlayer_eneweighted_200_FH_zplus,
2306  _distancetomaxcell_perthickperlayer_eneweighted_200_BH_zplus,
2307  _distancetomaxcell_perthickperlayer_eneweighted_300_EE_zplus,
2308  _distancetomaxcell_perthickperlayer_eneweighted_300_FH_zplus,
2309  _distancetomaxcell_perthickperlayer_eneweighted_300_BH_zplus,
2310  _distancetomaxcell_perthickperlayer_eneweighted_scint_EE_zplus,
2311  _distancetomaxcell_perthickperlayer_eneweighted_scint_FH_zplus,
2312  _distancetomaxcell_perthickperlayer_eneweighted_scint_BH_zplus,
2313  _distancetoseedcell_perthickperlayer_eneweighted_120_EE_zplus,
2314  _distancetoseedcell_perthickperlayer_eneweighted_120_FH_zplus,
2315  _distancetoseedcell_perthickperlayer_eneweighted_120_BH_zplus,
2316  _distancetoseedcell_perthickperlayer_eneweighted_200_EE_zplus,
2317  _distancetoseedcell_perthickperlayer_eneweighted_200_FH_zplus,
2318  _distancetoseedcell_perthickperlayer_eneweighted_200_BH_zplus,
2319  _distancetoseedcell_perthickperlayer_eneweighted_300_EE_zplus,
2320  _distancetoseedcell_perthickperlayer_eneweighted_300_FH_zplus,
2321  _distancetoseedcell_perthickperlayer_eneweighted_300_BH_zplus,
2322  _distancetoseedcell_perthickperlayer_eneweighted_scint_EE_zplus,
2323  _distancetoseedcell_perthickperlayer_eneweighted_scint_FH_zplus,
2324  _distancetoseedcell_perthickperlayer_eneweighted_scint_BH_zplus,
2325  _distancebetseedandmaxcell_perthickperlayer_120_EE_zplus,
2326  _distancebetseedandmaxcell_perthickperlayer_120_FH_zplus,
2327  _distancebetseedandmaxcell_perthickperlayer_120_BH_zplus,
2328  _distancebetseedandmaxcell_perthickperlayer_200_EE_zplus,
2329  _distancebetseedandmaxcell_perthickperlayer_200_FH_zplus,
2330  _distancebetseedandmaxcell_perthickperlayer_200_BH_zplus,
2331  _distancebetseedandmaxcell_perthickperlayer_300_EE_zplus,
2332  _distancebetseedandmaxcell_perthickperlayer_300_FH_zplus,
2333  _distancebetseedandmaxcell_perthickperlayer_300_BH_zplus,
2334  _distancebetseedandmaxcell_perthickperlayer_scint_EE_zplus,
2335  _distancebetseedandmaxcell_perthickperlayer_scint_FH_zplus,
2336  _distancebetseedandmaxcell_perthickperlayer_scint_BH_zplus,
2337  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_EE_zplus,
2338  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_FH_zplus,
2339  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_BH_zplus,
2340  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_EE_zplus,
2341  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_FH_zplus,
2342  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_BH_zplus,
2343  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_EE_zplus,
2344  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_FH_zplus,
2345  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_BH_zplus,
2346  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_EE_zplus,
2347  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_FH_zplus,
2348  _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_BH_zplus
2349 ]
2350 
2351 def append_hgcalLayerClustersPlots(collection = hgcalValidator.label_layerClusterPlots._InputTag__moduleLabel, name_collection = layerClustersLabel, extended = False):
2352  print('extended : ',extended)
2353  regions_ClusterLevel = ["General: Cluster Level", "Z-minus: Cluster Level", "Z-plus: Cluster Level"]
2354  regions_CellLevel = ["Z-minus: Cell Level", "Z-plus: Cell Level"]
2355  regions_LCtoCP_association = ["Z-minus: LC_CP association", "Z-plus: LC_CP association"]
2356 
2357  plots_lc_general_clusterlevel = lc_general_clusterlevel
2358  plots_lc_clusterlevel_zminus = lc_clusterlevel_zminus
2359  plots_lc_cellevel_zminus = lc_cellevel_zminus
2360  plots_lc_clusterlevel_zplus = lc_clusterlevel_zplus
2361  plots_lc_cellevel_zplus = lc_cellevel_zplus
2362  plots_lc_cp_association_zminus = lc_cp_association_zminus
2363  plots_lc_cp_association_zplus = lc_cp_association_zplus
2364 
2365  if extended :
2366  #plots_lc_clusterlevel_zminus = lc_clusterlevel_zminus
2367  #plots_lc_clusterlevel_zplus = lc_clusterlevel_zplus
2368  plots_lc_cellevel_zminus = lc_cellevel_zminus + lc_zminus_extended
2369  plots_lc_cellevel_zplus = lc_cellevel_zplus + lc_zplus_extended
2370  #plots_lc_cp_association_zminus = lc_cp_association_zminus
2371  #plots_lc_cp_association_zplus = lc_cp_association_zplus
2372 
2373  setPlots_ClusterLevel = [plots_lc_general_clusterlevel, plots_lc_clusterlevel_zminus, plots_lc_clusterlevel_zplus]
2374  setPlots_CellLevel = [plots_lc_cellevel_zminus, plots_lc_cellevel_zplus]
2375  setPlots_LCtoCP_association = [plots_lc_cp_association_zminus, plots_lc_cp_association_zplus]
2376  for reg, setPlot in zip(regions_ClusterLevel, setPlots_ClusterLevel):
2377  hgcalLayerClustersPlotter.append(collection+"_"+reg, [
2378  _hgcalFolders(collection + "/ClusterLevel")
2379  ], PlotFolder(
2380  *setPlot,
2381  loopSubFolders=False,
2382  purpose=PlotPurpose.Timing, page=layerClustersLabel, section=reg))
2383  for reg, setPlot in zip(regions_CellLevel, setPlots_CellLevel):
2384  hgcalLayerClustersPlotter.append(collection+"_"+reg, [
2385  _hgcalFolders(collection + "/CellLevel")
2386  ], PlotFolder(
2387  *setPlot,
2388  loopSubFolders=False,
2389  purpose=PlotPurpose.Timing, page=layerClustersLabel, section=reg))
2390  for reg, setPlot in zip(regions_LCtoCP_association, setPlots_LCtoCP_association):
2391  hgcalLayerClustersPlotter.append(collection+"_"+reg, [
2392  _hgcalFolders(collection + "/" + lcToCP_linking)
2393  ], PlotFolder(
2394  *setPlot,
2395  loopSubFolders=False,
2396  purpose=PlotPurpose.Timing, page=layerClustersLabel, section=reg))
2397 
2398 #=================================================================================================
2399 
2400 sc_clusterlevel = [
2401  # number of layer clusters per event in a) 120um, b) 200um, c) 300um, d) scint
2402  # (one entry per event in each of the four histos) ([B] above)
2403  _totsimclusternum_thick,
2404  # number of simclusters per layer (one entry per event in each histo) ([C] above)
2405  # z-
2406  _totsimclusternum_layer_EE_zminus,
2407  _totsimclusternum_layer_FH_zminus,
2408  _totsimclusternum_layer_BH_zminus,
2409  # z+
2410  _totsimclusternum_layer_EE_zplus,
2411  _totsimclusternum_layer_FH_zplus,
2412  _totsimclusternum_layer_BH_zplus,
2413  # Miscellaneous plots ([G] above):
2414  # mixedhitscluster: Number of clusters per event with hits in different thicknesses.
2415  _mixedhitssimclusters,
2416 ]
2417 
2418 sc_ticltracksters = [
2419  # Score of SimClusters wrt Layer Clusters
2420  # z-
2421  _score_simcluster_to_layerclusters_zminus,
2422  # z+
2423  _score_simcluster_to_layerclusters_zplus,
2424  # Score of LayerClusters wrt SimClusters
2425  # z-
2426  _score_layercluster_to_simclusters_zminus,
2427  # z+
2428  _score_layercluster_to_simclusters_zplus,
2429  # Shared Energy between SimCluster and LayerClusters
2430  # z-
2431  _sharedEnergy_simcluster_to_layercluster_zminus,
2432  # z+
2433  _sharedEnergy_simcluster_to_layercluster_zplus,
2434  # Shared Energy between LayerClusters and SimCluster
2435  # z-
2436  _sharedEnergy_layercluster_to_simcluster_zminus,
2437  # z+
2438  _sharedEnergy_layercluster_to_simcluster_zplus,
2439  # Efficiency Plots
2440  # z-
2441  _efficiencies_sc_zminus,
2442  _duplicates_sc_zminus,
2443  _fakes_sc_zminus,
2444  _merges_sc_zminus,
2445  _efficiencies_sc_zminus_eta,
2446  _efficiencies_sc_zminus_phi,
2447  # z+
2448  _efficiencies_sc_zplus,
2449  _duplicates_sc_zplus,
2450  _fakes_sc_zplus,
2451  _merges_sc_zplus,
2452  _efficiencies_sc_zplus_eta,
2453  _efficiencies_sc_zplus_phi,
2454  # Duplicate Plots
2455  # z-
2456  _duplicates_sc_zminus_eta,
2457  _duplicates_sc_zminus_phi,
2458  # z+
2459  _duplicates_sc_zplus_eta,
2460  _duplicates_sc_zplus_phi,
2461  # Fake Rate Plots
2462  # z-
2463  _fakes_sc_zminus_eta,
2464  _fakes_sc_zminus_phi,
2465  # z+
2466  _fakes_sc_zplus_eta,
2467  _fakes_sc_zplus_phi,
2468  # Merge Rate Plots
2469  # z-
2470  _merges_sc_zminus_eta,
2471  _merges_sc_zminus_phi,
2472  # z+
2473  _merges_sc_zplus_eta,
2474  _merges_sc_zplus_phi,
2475  # Energy vs Score 2D plots SC to LC
2476  # z-
2477  _energyscore_sc2lc_zminus,
2478  # z+
2479  _energyscore_sc2lc_zplus,
2480  # Energy vs Score 2D plots LC to SC
2481  # z-
2482  _energyscore_lc2sc_zminus,
2483  # z+
2484  _energyscore_lc2sc_zplus
2485 ]
2486 
2487 hgcalSimClustersPlotter = Plotter()
2488 
2489 def append_hgcalSimClustersPlots(collection, name_collection):
2490  if collection == hgcalValidator.label_SimClustersLevel._InputTag__moduleLabel:
2491  hgcalSimClustersPlotter.append(collection, [
2492  _hgcalFolders(hgcalValidator.label_SimClusters._InputTag__moduleLabel +"/"+ collection)
2493  ], PlotFolder(
2494  *sc_clusterlevel,
2495  loopSubFolders=False,
2496  purpose=PlotPurpose.Timing, page="SimClusters", section=name_collection))
2497  else:
2498  hgcalSimClustersPlotter.append(collection, [
2499  _hgcalFolders(hgcalValidator.label_SimClusters._InputTag__moduleLabel +"/"+collection)
2500  ], PlotFolder(
2501  *sc_ticltracksters,
2502  loopSubFolders=False,
2503  purpose=PlotPurpose.Timing, page="SimClusters", section=name_collection))
2504 
2505 
2506 #=================================================================================================
2507 def _hgcalFolders(lastDirName="hgcalLayerClusters"):
2508  return hgcVal_dqm + lastDirName
2509 
2510 _trackstersPlots = [
2511  _trackster_eppe,
2512  _trackster_xyz,
2513  _tottracksternum,
2514  _clusternum_in_trackster,
2515  _clusternum_in_trackster_vs_layer,
2516  _clusternum_in_trackster_perlayer_zminus_EE,
2517  _clusternum_in_trackster_perlayer_zminus_FH,
2518  _clusternum_in_trackster_perlayer_zminus_BH,
2519  _clusternum_in_trackster_perlayer_zplus_EE,
2520  _clusternum_in_trackster_perlayer_zplus_FH,
2521  _clusternum_in_trackster_perlayer_zplus_BH,
2522  _trackster_layernum,
2523  _multiplicityOfLCinTST,
2524 ]
2525 
2526 _trackstersToSimTracksterFromCPByHitsPlots = [
2527  _efficiencies[0],
2528  _purities[0],
2529  _duplicates[0],
2530  _fakes[0],
2531  _merges[0],
2532  _score_caloparticle_to_tracksters,
2533  _score_trackster_to_caloparticles,
2534  _sharedEnergy_to_trackster[0],
2535  _sharedEnergy_trackster_to[0],
2536  _energyscore_to_trackster[0],
2537  _energyscore_trackster_to[0],
2538 ]
2539 
2540 _trackstersToSimTracksterByLCsPlots = [
2541  _efficiencies[1],
2542  _purities[1],
2543  _duplicates[1],
2544  _fakes[1],
2545  _merges[1],
2546  _score_simtrackster_to_tracksters,
2547  _score_trackster_to_simtracksters,
2548  _sharedEnergy_to_trackster[1],
2549  _sharedEnergy_trackster_to[1],
2550  _energyscore_to_trackster[1],
2551  _energyscore_trackster_to[1],
2552 ]
2553 
2554 _trackstersToSimTracksterFromCPByLCsPlots = [
2555  _efficiencies[2],
2556  _purities[2],
2557  _duplicates[2],
2558  _fakes[2],
2559  _merges[2],
2560  _score_simtrackster_to_tracksters,
2561  _score_trackster_to_simtracksters,
2562  _sharedEnergy_to_trackster[2],
2563  _sharedEnergy_trackster_to[2],
2564  _energyscore_to_trackster[2],
2565  _energyscore_trackster_to[2],
2566 ]
2567 
2568 _trackstersToSimTracksterByHitsPlots = [
2569  _efficiencies[3],
2570  _purities[3],
2571  _duplicates[3],
2572  _fakes[3],
2573  _merges[3],
2574  _score_simtrackster_to_tracksters,
2575  _score_trackster_to_simtracksters,
2576  _sharedEnergy_to_trackster[3],
2577  _sharedEnergy_trackster_to[3],
2578  _energyscore_to_trackster[3],
2579  _energyscore_trackster_to[3],
2580 ]
2581 
2582 hgcalTrackstersPlotter = Plotter()
2583 def append_hgcalTrackstersPlots(collection = 'ticlTrackstersMerge', name_collection = "TrackstersMerge"):
2584  # Appending generic plots for Tracksters
2585  hgcalTrackstersPlotter.append(collection, [
2586  _hgcalFolders(collection+ "/" + hgcalValidator.label_TS.value())
2587  ], PlotFolder(
2588  *_trackstersPlots,
2589  loopSubFolders=False,
2590  purpose=PlotPurpose.Timing, page="Tracksters", section=name_collection))
2591 
2592 
2593  # Appending plots for Tracksters TSbyHits_CP, TSbyLCs, TSbyLCs_CP, TSbyHits
2594  hgcalTrackstersPlotter.append(collection, [
2595  _hgcalFolders(collection + "/" + TSbyHits_CP)
2596  ], PlotFolder(
2597  *_trackstersToSimTracksterFromCPByHitsPlots,
2598  loopSubFolders=False,
2599  purpose=PlotPurpose.Timing
2600  ,page="Trackster to SimTracksters from CP Associated by Hits"
2601  ,section=name_collection)
2602  )
2603 
2604  hgcalTrackstersPlotter.append(collection, [
2605  _hgcalFolders(collection + "/" + TSbyLCs)
2606  ], PlotFolder(
2607  *_trackstersToSimTracksterByLCsPlots,
2608  loopSubFolders=False,
2609  purpose=PlotPurpose.Timing
2610  ,page="Trackster to SimTracksters Associated by LCs"
2611  ,section=name_collection)
2612  )
2613 
2614  hgcalTrackstersPlotter.append(collection, [
2615  _hgcalFolders(collection + "/" + TSbyLCs_CP)
2616  ], PlotFolder(
2617  *_trackstersToSimTracksterFromCPByLCsPlots,
2618  loopSubFolders=False,
2619  purpose=PlotPurpose.Timing
2620  ,page="Trackster to SimTracksters from CP Associated by LCs"
2621  ,section=name_collection)
2622  )
2623 
2624  hgcalTrackstersPlotter.append(collection, [
2625  _hgcalFolders(collection + "/" + TSbyHits)
2626  ], PlotFolder(
2627  *_trackstersToSimTracksterByHitsPlots,
2628  loopSubFolders=False,
2629  purpose=PlotPurpose.Timing
2630  ,page="Trackster to SimTracksters Associated by Hits"
2631  ,section=name_collection)
2632  )
2633 
2634 
2635 
2636 #=================================================================================================
2637 _common_Calo = {"stat": False, "drawStyle": "hist", "staty": 0.65, "ymin": 0.0, "ylog": False, "xtitle": "Default", "ytitle": "Default"}
2638 
2639 hgcalCaloParticlesPlotter = Plotter()
2640 def append_hgcalCaloParticlesPlots(files, collection = '-211', name_collection = "pion-"):
2641 
2642  list_2D_histos = ["Energy of Rec-matched Hits vs layer",
2643  "Energy of Rec-matched Hits vs layer (1SC)",
2644  "Rec-matched Hits Sum Energy vs layer"]
2645 
2646  dqmfolder = hgcVal_dqm + "SelectedCaloParticles/" + collection
2647  templateFile = ROOT.TFile.Open(files[0]) # assuming all files have same structure
2648  if not gDirectory.GetDirectory(dqmfolder):
2649  print("Error: GeneralInfo directory %s not found in DQM file, exit"%dqmfolder)
2650  return hgcalTrackstersPlotter
2651 
2652  keys = gDirectory.GetDirectory(dqmfolder,True).GetListOfKeys()
2653  key = keys[0]
2654  while key:
2655  obj = key.ReadObj()
2656  name = obj.GetName()
2657  fileName = TString(name)
2658  fileName.ReplaceAll(" ","_")
2659  pg = PlotGroup(fileName.Data(),[
2660  Plot(name,
2661  drawCommand = "",
2662  normalizeToNumberOfEvents = True, **_common_Calo)
2663  ],
2664  ncols=1)
2665 
2666  if name in list_2D_histos :
2667  pg = PlotOnSideGroup(plotName.Data(),
2668  Plot(name,
2669  drawCommand = "COLZ",
2670  normalizeToNumberOfEvents = True, **_common_Calo)
2671  ,
2672  ncols=1)
2673 
2674  hgcalCaloParticlesPlotter.append("CaloParticles_"+name_collection, [
2675  dqmfolder
2676  ], PlotFolder(
2677  pg,
2678  loopSubFolders=False,
2679  purpose=PlotPurpose.Timing, page="CaloParticles", section=name_collection)
2680  )
2681 
2682  key = keys.After(key)
2683 
2684  templateFile.Close()
2685 
2686  return hgcalCaloParticlesPlotter
2687 
2688 #=================================================================================================
2689 def create_hgcalTrackstersPlotter(files, collection = 'ticlTrackstersMerge', name_collection = "TrackstersMerge"):
2690  grouped = {"cosAngle Beta": PlotGroup("cosAngle_Beta_per_layer",[],ncols=10), "cosAngle Beta Weighted": PlotGroup("cosAngle_Beta_Weighted_per_layer",[],ncols=10)}
2691  groupingFlag = " on Layer "
2692 
2693  hgcalTrackstersPlotter = Plotter()
2694  dqmfolder = hgcVal_dqm + collection
2695  #_multiplicity_tracksters_numberOfEventsHistogram = dqmfolder+"/Number of Trackster per Event"
2696 
2697  _common["ymin"] = 0.0
2698  _common["staty"] = 0.85
2699  templateFile = ROOT.TFile.Open(files[0]) # assuming all files have same structure
2700  if not gDirectory.GetDirectory(dqmfolder):
2701  print("Error: GeneralInfo directory %s not found in DQM file, exit"%dqmfolder)
2702  return hgcalTrackstersPlotter
2703 
2704  keys = gDirectory.GetDirectory(dqmfolder,True).GetListOfKeys()
2705  key = keys[0]
2706  while key:
2707  obj = key.ReadObj()
2708  name = obj.GetName()
2709  plotName = TString(name)
2710  plotName.ReplaceAll(" ","_")
2711 
2712  if groupingFlag in name:
2713  for group in grouped:
2714  if group+groupingFlag in name:
2715  grouped[group].append(Plot(name,
2716  xtitle="Default", ytitle="Default",
2717  **_common)
2718  )
2719  print("Adding %s to %s"%(name,group))
2720  else:
2721  pg = None
2722  if obj.InheritsFrom("TH2"):
2723  pg = PlotOnSideGroup(plotName.Data(),
2724  Plot(name,
2725  xtitle="Default", ytitle="Default",
2726  drawCommand = "COLZ",
2727  **_common),
2728  ncols=1)
2729  elif obj.InheritsFrom("TH1"):
2730  pg = PlotGroup(plotName.Data(),
2731  [Plot(name,
2732  xtitle="Default", ytitle="Default",
2733  drawCommand = "COLZ", # ineffective for TH1
2734  **_common)
2735  ],
2736  ncols=1, legendDh=-0.03 * len(files))
2737 
2738  if (pg is not None):
2739  hgcalTrackstersPlotter.append(name_collection+"_TICLDebugger",
2740  [dqmfolder], PlotFolder(pg,
2741  loopSubFolders=False,
2742  purpose=PlotPurpose.Timing, page="Tracksters", section=name_collection)
2743  #numberOfEventsHistogram=_multiplicity_tracksters_numberOfEventsHistogram)
2744  )
2745 
2746  key = keys.After(key)
2747 
2748  for group in grouped:
2749  hgcalTrackstersPlotter.append(name_collection+"_TICLDebugger",
2750  [dqmfolder], PlotFolder(grouped[group],
2751  loopSubFolders=False,
2752  purpose=PlotPurpose.Timing, page="Tracksters", section=name_collection)
2753  #numberOfEventsHistogram=_multiplicity_tracksters_numberOfEventsHistogram)
2754  )
2755 
2756  templateFile.Close()
2757 
2758  return hgcalTrackstersPlotter
2759 
2760 #=================================================================================================
2761 _common_Calo = {"stat": False, "drawStyle": "hist", "staty": 0.65, "ymin": 0.0, "ylog": False, "xtitle": "Default", "ytitle": "Default"}
2762 
2763 hgcalCaloParticlesPlotter = Plotter()
2764 
2765 def append_hgcalCaloParticlesPlots(files, collection = '-211', name_collection = "pion-"):
2766  dqmfolder = hgcVal_dqm + "SelectedCaloParticles/" + collection
2767  print(dqmfolder)
2768 # _common["ymin"] = 0.0
2769  templateFile = ROOT.TFile.Open(files[0]) # assuming all files have same structure
2770  keys = gDirectory.GetDirectory(dqmfolder,True).GetListOfKeys()
2771  key = keys[0]
2772  while key:
2773  obj = key.ReadObj()
2774  name = obj.GetName()
2775  plotName = TString(name)
2776  plotName.ReplaceAll(" ","_")
2777 
2778  pg = None
2779  if obj.InheritsFrom("TH2"):
2780  pg = PlotOnSideGroup(plotName.Data(),
2781  Plot(name,
2782  drawCommand = "COLZ",
2783  normalizeToNumberOfEvents = True, **_common_Calo),
2784  ncols=1)
2785  elif obj.InheritsFrom("TH1"):
2786  pg = PlotGroup(plotName.Data(),[
2787  Plot(name,
2788  drawCommand = "", # may want to customize for TH2 (colz, etc.)
2789  normalizeToNumberOfEvents = True, **_common_Calo)
2790  ],
2791  ncols=1)
2792 
2793  if (pg is not None):
2794  hgcalCaloParticlesPlotter.append("CaloParticles_"+name_collection, [
2795  dqmfolder
2796  ], PlotFolder(
2797  pg,
2798  loopSubFolders=False,
2799  purpose=PlotPurpose.Timing, page="CaloParticles", section=name_collection)
2800  )
2801 
2802  key = keys.After(key)
2803 
2804  templateFile.Close()
2805 
2806  return hgcalCaloParticlesPlotter
2807 
2808 #=================================================================================================
2809 # hitValidation
2810 def _hgcalHitFolders(dirName="HGCalSimHitsV/HGCalEESensitive"):
2811  return "DQMData/Run 1/HGCAL/Run summary/"+dirName
2812 
2813 hgcalHitPlotter = Plotter()
2814 hitsLabel = 'Hits'
2815 simHitsLabel = 'Simulated Hits'
2816 
2817 hgcalHitPlotter.append("SimHits_Validation", [
2818  "DQMData/Run 1/HGCAL/Run summary/HGCalSimHitsV/HitValidation",
2819  ], PlotFolder(
2820  _HitValidation,
2821  loopSubFolders=False,
2822  purpose=PlotPurpose.Timing, page=hitsLabel, section=simHitsLabel
2823  ))
2824 
2825 def append_hgcalHitsPlots(collection = "HGCalSimHitsV", name_collection = "Simulated Hits"):
2826  _hitsCommonPlots_EE = [
2827  _Occupancy_EE_zplus,
2828  _Occupancy_EE_zminus,
2829  _EtaPhi_EE_zminus,
2830  _EtaPhi_EE_zplus
2831  ]
2832  _hitsCommonPlots_HE_Sil = [
2833  _Occupancy_HE_Silicon_zplus,
2834  _Occupancy_HE_Silicon_zminus,
2835  _EtaPhi_HE_Silicon_zminus,
2836  _EtaPhi_HE_Silicon_zplus
2837  ]
2838  _hitsCommonPlots_HE_Sci = [
2839  _Occupancy_HE_Scintillator_zplus,
2840  _Occupancy_HE_Scintillator_zminus,
2841  _EtaPhi_HE_Scintillator_zminus,
2842  _EtaPhi_HE_Scintillator_zplus
2843  ]
2844 
2845  regions = ["HGCalEESensitive", "HGCalHESiliconSensitive", "HGCalHEScintillatorSensitive"]
2846  setPlots = [_hitsCommonPlots_EE, _hitsCommonPlots_HE_Sil, _hitsCommonPlots_HE_Sci]
2847  if "SimHits" in collection :
2848  _hitsCommonPlots_EE.append(_Energy_EE_0)
2849  _hitsCommonPlots_EE.append(_Energy_EE_1)
2850  _hitsCommonPlots_HE_Sil.append(_Energy_HE_Silicon_0)
2851  _hitsCommonPlots_HE_Sil.append( _Energy_HE_Silicon_1)
2852  _hitsCommonPlots_HE_Sil.append(_Energy_HE_Scintillator_0)
2853  _hitsCommonPlots_HE_Sil.append(_Energy_HE_Scintillator_1)
2854  if "RecHits" in collection :
2855  _hitsCommonPlots_EE.append(_Energy_EE)
2856  _hitsCommonPlots_HE_Sil.append(_Energy_HE_Silicon)
2857  _hitsCommonPlots_HE_Sil.append(_Energy_HE_Scintillator)
2858 
2859  for reg, setPlot in zip(regions, setPlots):
2860  dirName = collection+"/"+reg
2861  print(dirName)
2862  hgcalHitPlotter.append(collection, [
2863  _hgcalHitFolders(dirName)
2864  ], PlotFolder(
2865  *setPlot,
2866  loopSubFolders=False,
2867  purpose=PlotPurpose.Timing, page=hitsLabel, section=name_collection))
2868 
2869 _digisCommonPlots_EE = [
2870  _DigiHits_Occupancy_EE_zplus,
2871  _DigiHits_Occupancy_EE_zminus,
2872  _DigiHits_Occupancy_XY_EE,
2873  _DigiHits_ADC_EE,
2874  _DigiHits_TOA_EE,
2875  _DigiHits_TOT_EE,
2876 ]
2877 _digisCommonPlots_HE_Sil = [
2878  _DigiHits_Occupancy_HE_Silicon_zplus,
2879  _DigiHits_Occupancy_HE_Silicon_zminus,
2880  _DigiHits_Occupancy_XY_HE_Silicon,
2881  _DigiHits_ADC_HE_Silicon,
2882  _DigiHits_TOA_HE_Silicon,
2883  _DigiHits_TOT_HE_Silicon,
2884 ]
2885 _digisCommonPlots_HE_Sci = [
2886  _DigiHits_Occupancy_HE_Scintillator_zplus,
2887  _DigiHits_Occupancy_HE_Scintillator_zminus,
2888  _DigiHits_Occupancy_XY_HE_Scintillator,
2889  _DigiHits_ADC_HE_Scintillator,
2890  _DigiHits_TOA_HE_Scintillator,
2891  _DigiHits_TOT_HE_Scintillator,
2892 ]
2893 
2894 def append_hgcalDigisPlots(collection = "HGCalDigisV", name_collection = "Digis"):
2895  regions = ["HGCalEESensitive", "HGCalHESiliconSensitive", "HGCalHEScintillatorSensitive"]
2896  setPlots = [_digisCommonPlots_EE, _digisCommonPlots_HE_Sil, _digisCommonPlots_HE_Sci]
2897  for reg, setPlot in zip(regions, setPlots):
2898  dirName = collection+"/"+reg
2899  print(dirName)
2900  hgcalHitPlotter.append(name_collection, [
2901  _hgcalHitFolders(dirName)
2902  ], PlotFolder(
2903  *setPlot,
2904  loopSubFolders=False,
2905  purpose=PlotPurpose.Timing, page=hitsLabel, section=name_collection))
2906 
2907 #=================================================================================================
2908 # hitCalibration
2909 hgcalHitCalibPlotter = Plotter()
2910 hitCalibrationLabel = 'Calibrated RecHits'
2911 
2912 hgcalHitCalibPlotter.append("Layer_Occupancy", [
2913  "DQMData/Run 1/HGCalHitCalibration/Run summary",
2914  ], PlotFolder(
2915  _LayerOccupancy,
2916  loopSubFolders=False,
2917  purpose=PlotPurpose.Timing, page=hitCalibrationLabel, section=hitCalibrationLabel
2918  ))
2919 hgcalHitCalibPlotter.append("ReconstructableEnergyOverCPenergy", [
2920  "DQMData/Run 1/HGCalHitCalibration/Run summary",
2921  ], PlotFolder(
2922  _ReconstructableEnergyOverCPenergy,
2923  loopSubFolders=False,
2924  purpose=PlotPurpose.Timing, page=hitCalibrationLabel, section=hitCalibrationLabel
2925  ))
2926 
2927 hgcalHitCalibPlotter.append("ParticleFlowClusterHGCalFromTrackster_Closest_EoverCPenergy", [
2928  "DQMData/Run 1/HGCalHitCalibration/Run summary",
2929  ], PlotFolder(
2930  _ParticleFlowClusterHGCalFromTrackster_Closest_EoverCPenergy,
2931  loopSubFolders=False,
2932  purpose=PlotPurpose.Timing, page=hitCalibrationLabel, section=hitCalibrationLabel
2933  ))
2934 
2935 hgcalHitCalibPlotter.append("PhotonsFromTrackster_Closest_EoverCPenergy", [
2936  "DQMData/Run 1/HGCalHitCalibration/Run summary",
2937  ], PlotFolder(
2938  _PhotonsFromTrackster_Closest_EoverCPenergy,
2939  loopSubFolders=False,
2940  purpose=PlotPurpose.Timing, page=hitCalibrationLabel, section=hitCalibrationLabel
2941  ))
2942 
2943 hgcalHitCalibPlotter.append("EcalDrivenGsfElectronsFromTrackster_Closest_EoverCPenergy", [
2944  "DQMData/Run 1/HGCalHitCalibration/Run summary",
2945  ], PlotFolder(
2946  _EcalDrivenGsfElectronsFromTrackster_Closest_EoverCPenergy,
2947  loopSubFolders=False,
2948  purpose=PlotPurpose.Timing, page=hitCalibrationLabel, section=hitCalibrationLabel
2949  ))
2950 
2951 hgcalTICLCandPlotter = Plotter()
2952 
2953 hgcalTICLCandPlotter.append('ticlCandidates', [
2954  "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/"+hgcalValidator.ticlCandidates.value(),
2955  ], PlotFolder(
2956  *_candidatesPlots,
2957  loopSubFolders=False,
2958  purpose=PlotPurpose.Timing, page="General", section="Candidates"))
2959 
2960 for i in range(6):
2961  hgcalTICLCandPlotter.append('ticlCandidates', [
2962  "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/"+hgcalValidator.ticlCandidates.value()+"/"+cand_type[i],
2963  ], PlotFolder(
2964  *_allCandidatesPlots[i],
2965  loopSubFolders=False,
2966  purpose=PlotPurpose.Timing, page=cand_type[i], section="Candidates"))
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
ALPAKA_FN_HOST_ACC ALPAKA_FN_INLINE constexpr float zip(ConstView const &tracks, int32_t i)
Definition: TracksSoA.h:90
def replace(string, replacements)
def append_hgcalDigisPlots(collection="HGCalDigisV", name_collection="Digis")
Definition: hgcalPlots.py:2894
def _hgcalFolders(lastDirName="hgcalLayerClusters")
Definition: hgcalPlots.py:2507
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def append_hgcalCaloParticlesPlots(files, collection='-211', name_collection="pion-")
Definition: hgcalPlots.py:2640
def _hgcalHitFolders(dirName="HGCalSimHitsV/HGCalEESensitive")
Definition: hgcalPlots.py:2810
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