Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-26 02:34:36

0001 import os
0002 import sys
0003 import copy
0004 import collections
0005 
0006 import ROOT
0007 from ROOT import TFile, TString
0008 from ROOT import gDirectory
0009 ROOT.gROOT.SetBatch(True)
0010 ROOT.PyConfig.IgnoreCommandLineOptions = True
0011 
0012 from Validation.RecoTrack.plotting.plotting import Plot, PlotGroup, PlotFolder, Plotter, PlotOnSideGroup
0013 from Validation.RecoTrack.plotting.html import PlotPurpose
0014 import Validation.RecoTrack.plotting.plotting as plotting
0015 import Validation.RecoTrack.plotting.validation as validation
0016 import Validation.RecoTrack.plotting.html as html
0017 
0018 from Validation.HGCalValidation.HGCalValidator_cff import hgcalValidator
0019 from Validation.HGCalValidation.PostProcessorHGCAL_cfi import lcToCP_linking, simDict, TSbyHits_CP, TSbyLCs, TSbyLCs_CP, TSbyHits, variables
0020 
0021 hgcVal_dqm = "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/"
0022 #The number of layers per endcap in the current default geometry scenario.
0023 geometryscenario = 47
0024 
0025 #To be able to spot any issues both in -z and +z a layer id was introduced
0026 #that spans from 0 to 103 for hgcal_v9 geometry. The mapping for hgcal_v9 is:
0027 #-z: 0->51
0028 #+z: 52->103
0029 #while for V10 is:
0030 #-z: 0->49
0031 #+z: 50->99
0032 '''
0033 layerscheme = { 'lastLayerEEzm': 0, 'lastLayerFHzm': 0, 'maxlayerzm': 0, 'lastLayerEEzp': 0, 'lastLayerFHzp': 0, 'maxlayerzp': 0 }
0034 
0035 #Let's take the relevant values of layerscheme from the dqm file.
0036 theDQMfile =  "DQM_V0001_R000000001__Global__CMSSW_X_Y_Z__RECO.root"
0037 if not os.path.isfile(theDQMfile):
0038     print("Error: file", theDQMfile, "not found, exit")
0039     sys.exit(0)
0040 
0041 
0042 #Take general info from the first file is sufficient.
0043 thefile = TFile( theDQMfile )
0044 GeneralInfoDirectory = hgcVal_dqm + 'GeneralInfo'
0045 
0046 if not gDirectory.GetDirectory( GeneralInfoDirectory ):
0047   print("Error: GeneralInfo directory not found in DQM file, exit")
0048   sys.exit(0)
0049 
0050 keys = gDirectory.GetDirectory( GeneralInfoDirectory ).GetListOfKeys()
0051 key = keys[0]
0052 layvalue = 0
0053 while key:
0054     obj = key.ReadObj()
0055     for laykey in layerscheme.keys():
0056       if laykey in obj.GetName():
0057         layvalue = obj.GetName()[len("<"+laykey+">i="):-len("</"+laykey+">")]
0058         layerscheme[laykey] = layvalue
0059         #print(layvalue)
0060     key = keys.After(key)
0061 
0062 thefile.Close()
0063 
0064 print(layerscheme)
0065 #TODO: Anticipating the fine/coarse layer information in CMSSW we overwrite values from DQM file
0066 #For now values returned for
0067 # 'lastLayerFHzp': '104', 'lastLayerFHzm': '52'
0068 #are not the one expected. Will come back to this when there will be info in CMSSW to put in DQM file.
0069 #For V9:
0070 #layerscheme = { 'lastLayerEEzm': 28, 'lastLayerFHzm': 40, 'maxlayerzm': 52, 'lastLayerEEzp': 80, 'lastLayerFHzp': 92, 'maxlayerzp': 104 }
0071 #For V10:
0072 layerscheme = { 'lastLayerEEzm': 28, 'lastLayerFHzm': 40, 'maxlayerzm': 50, 'lastLayerEEzp': 78, 'lastLayerFHzp': 90, 'maxlayerzp': 100 }
0073 #For V16
0074 layerscheme = { 'lastLayerEEzm': 26, 'lastLayerFHzm': 37, 'maxlayerzm': 47, 'lastLayerEEzp': 73, 'lastLayerFHzp': 84, 'maxlayerzp': 94 }
0075 '''
0076 #print(layerscheme)
0077 
0078 layerscheme = {}
0079 
0080 if geometryscenario == 52:
0081    layerscheme = { 'lastLayerEEzm': 28, 'lastLayerFHzm': 40, 'maxlayerzm': 52, 'lastLayerEEzp': 80, 'lastLayerFHzp': 92, 'maxlayerzp': 104 }
0082 elif geometryscenario == 50:
0083    layerscheme = { 'lastLayerEEzm': 28, 'lastLayerFHzm': 40, 'maxlayerzm': 50, 'lastLayerEEzp': 78, 'lastLayerFHzp': 90, 'maxlayerzp': 100 }
0084 elif geometryscenario == 47:
0085    layerscheme = { 'lastLayerEEzm': 26, 'lastLayerFHzm': 37, 'maxlayerzm': 47, 'lastLayerEEzp': 73, 'lastLayerFHzp': 84, 'maxlayerzp': 94 }
0086 #print(layerscheme)
0087 
0088 lastLayerEEzm = layerscheme['lastLayerEEzm']  # last layer of EE -z
0089 lastLayerFHzm = layerscheme['lastLayerFHzm']  # last layer of FH -z
0090 maxlayerzm = layerscheme['maxlayerzm'] # last layer of BH -z
0091 lastLayerEEzp = layerscheme['lastLayerEEzp']  # last layer of EE +z
0092 lastLayerFHzp = layerscheme['lastLayerFHzp']  # last layer of FH +z
0093 maxlayerzp = layerscheme['maxlayerzp'] # last layer of BH +z
0094 
0095 hitlayerscheme = { 'EE_min': 1,'EE_max': 28, 'HESilicon_min': 1, 'HESilicon_max': 22, 'HEScintillator_min': 9 , 'HEScintillator_max': 22 }
0096 #print(hitlayerscheme)
0097 
0098 EE_min = hitlayerscheme['EE_min']
0099 EE_max = hitlayerscheme['EE_max']
0100 HESilicon_min = hitlayerscheme['HESilicon_min']
0101 HESilicon_max = hitlayerscheme['HESilicon_max']
0102 HEScintillator_min = hitlayerscheme['HEScintillator_min']
0103 HEScintillator_max = hitlayerscheme['HEScintillator_max']
0104 
0105 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65 }
0106 _legend_common = {"legendDx": -0.3,
0107                   "legendDy": -0.05,
0108                   "legendDw": 0.1}
0109 
0110 _SelectedCaloParticles = PlotGroup("SelectedCaloParticles", [
0111         Plot("num_caloparticle_eta", xtitle="", **_common),
0112         Plot("caloparticle_energy", xtitle="", **_common),
0113         Plot("caloparticle_pt", xtitle="", **_common),
0114         Plot("caloparticle_phi", xtitle="", **_common),
0115         Plot("Eta vs Zorigin", xtitle="", **_common),
0116        ])
0117 
0118 #Need to adjust the statbox to see better the plot
0119 _common = {"stat": True, "drawStyle": "hist", "statx": 0.38, "staty": 0.68 }
0120 _num_reco_cluster_eta = PlotGroup("num_reco_cluster_eta", [
0121   Plot("num_reco_cluster_eta", xtitle="", **_common),
0122 ],ncols=1)
0123 #Back to normal
0124 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65 }
0125 
0126 _mixedhitsclusters = PlotGroup("mixedhitsclusters", [
0127   Plot("mixedhitscluster_zminus", xtitle="", **_common),
0128   Plot("mixedhitscluster_zplus", xtitle="", **_common),
0129 ],ncols=2)
0130 
0131 _mixedhitssimclusters = PlotGroup("mixedhitssimclusters", [
0132   Plot("mixedhitssimcluster_zminus", xtitle="", **_common),
0133   Plot("mixedhitssimcluster_zplus", xtitle="", **_common),
0134 ],ncols=2)
0135 
0136 #Just to prevent the stabox covering the plot
0137 _common = {"stat": True, "drawStyle": "hist", "statx": 0.45, "staty": 0.65 }
0138 
0139 _energyclustered = PlotGroup("energyclustered", [
0140   Plot("energyclustered_zminus", xtitle="", **_common),
0141   Plot("energyclustered_zplus", xtitle="", **_common),
0142 ],ncols=2)
0143 
0144 #Coming back to the usual box definition
0145 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65 }
0146 
0147 _longdepthbarycentre = PlotGroup("longdepthbarycentre", [
0148   Plot("longdepthbarycentre_zminus", xtitle="", **_common),
0149   Plot("longdepthbarycentre_zplus", xtitle="", **_common),
0150 ],ncols=2)
0151 
0152 _common_layerperthickness = {}
0153 _common_layerperthickness.update(_common)
0154 _common_layerperthickness['xmin'] = 0.
0155 _common_layerperthickness['xmax'] = 100
0156 
0157 _totclusternum_thick = PlotGroup("totclusternum_thick", [
0158   Plot("totclusternum_thick_120", xtitle="", **_common_layerperthickness),
0159   Plot("totclusternum_thick_200", xtitle="", **_common_layerperthickness),
0160   Plot("totclusternum_thick_300", xtitle="", **_common_layerperthickness),
0161   Plot("totclusternum_thick_-1", xtitle="", **_common_layerperthickness),
0162   Plot("mixedhitscluster", xtitle="", **_common_layerperthickness),
0163 ])
0164 
0165 _totsimclusternum_thick = PlotGroup("totsimclusternum_thick", [
0166   Plot("totsimclusternum_thick_120", xtitle="", **_common_layerperthickness),
0167   Plot("totsimclusternum_thick_200", xtitle="", **_common_layerperthickness),
0168   Plot("totsimclusternum_thick_300", xtitle="", **_common_layerperthickness),
0169   Plot("totsimclusternum_thick_-1", xtitle="", **_common_layerperthickness),
0170   Plot("mixedhitssimcluster", xtitle="", **_common_layerperthickness),
0171 ])
0172 
0173 #We will plot the density in logy scale.
0174 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65, "ylog": True}
0175 
0176 _cellsenedens_thick =  PlotGroup("cellsenedens_thick", [
0177   Plot("cellsenedens_thick_120", xtitle="", **_common),
0178   Plot("cellsenedens_thick_200", xtitle="", **_common),
0179   Plot("cellsenedens_thick_300", xtitle="", **_common),
0180   Plot("cellsenedens_thick_-1", xtitle="", **_common),
0181 ])
0182 
0183 #Coming back to the usual box definition
0184 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65 }
0185 
0186 
0187 #--------------------------------------------------------------------------------------------
0188 # z-
0189 #--------------------------------------------------------------------------------------------
0190 _totclusternum_layer_EE_zminus = PlotGroup("totclusternum_layer_EE", [
0191   Plot("totclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
0192 ], ncols=7)
0193 
0194 _totclusternum_layer_FH_zminus = PlotGroup("totclusternum_layer_FH", [
0195   Plot("totclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
0196 ], ncols=7)
0197 
0198 _totclusternum_layer_BH_zminus = PlotGroup("totclusternum_layer_BH", [
0199   Plot("totclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
0200 ], ncols=7)
0201 
0202 _totsimclusternum_layer_EE_zminus = PlotGroup("totsimclusternum_layer_EE_zminus", [
0203   Plot("totsimclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
0204 ], ncols=4)
0205 
0206 _totsimclusternum_layer_FH_zminus = PlotGroup("totsimclusternum_layer_FH_zminus", [
0207   Plot("totsimclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
0208 ], ncols=4)
0209 
0210 _totsimclusternum_layer_BH_zminus = PlotGroup("totsimclusternum_layer_BH_zminus", [
0211   Plot("totsimclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
0212 ], ncols=4)
0213 
0214 _energyclustered_perlayer_EE_zminus = PlotGroup("energyclustered_perlayer_EE", [
0215   Plot("energyclustered_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
0216 ], ncols=7)
0217 
0218 _energyclustered_perlayer_FH_zminus = PlotGroup("energyclustered_perlayer_FH", [
0219   Plot("energyclustered_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
0220 ], ncols=7)
0221 
0222 _energyclustered_perlayer_BH_zminus = PlotGroup("energyclustered_perlayer_BH", [
0223   Plot("energyclustered_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
0224 ], ncols=7)
0225 
0226 #----------------------------------------------------------------------------------------------------------------
0227 #120 um
0228 _common_cells = {}
0229 _common_cells.update(_common)
0230 _common_cells["xmin"] = 0
0231 _common_cells["xmax"] = 50
0232 _common_cells["ymin"] = 0.1
0233 _common_cells["ymax"] = 10000
0234 _common_cells["ylog"] = True
0235 _cellsnum_perthick_perlayer_120_EE_zminus = PlotGroup("cellsnum_perthick_perlayer_120_EE", [
0236   Plot("cellsnum_perthick_perlayer_120_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzm)
0237 ], ncols=7)
0238 
0239 _cellsnum_perthick_perlayer_120_FH_zminus = PlotGroup("cellsnum_perthick_perlayer_120_FH", [
0240   Plot("cellsnum_perthick_perlayer_120_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzm,lastLayerFHzm)
0241 ], ncols=7)
0242 
0243 _cellsnum_perthick_perlayer_120_BH_zminus = PlotGroup("cellsnum_perthick_perlayer_120_BH", [
0244   Plot("cellsnum_perthick_perlayer_120_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerFHzm,maxlayerzm)
0245 ], ncols=7)
0246 
0247 #200 um
0248 _cellsnum_perthick_perlayer_200_EE_zminus = PlotGroup("cellsnum_perthick_perlayer_200_EE", [
0249   Plot("cellsnum_perthick_perlayer_200_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzm)
0250 ], ncols=7)
0251 
0252 _cellsnum_perthick_perlayer_200_FH_zminus = PlotGroup("cellsnum_perthick_perlayer_200_FH", [
0253   Plot("cellsnum_perthick_perlayer_200_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzm,lastLayerFHzm)
0254 ], ncols=7)
0255 
0256 _cellsnum_perthick_perlayer_200_BH_zminus = PlotGroup("cellsnum_perthick_perlayer_200_BH", [
0257   Plot("cellsnum_perthick_perlayer_200_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerFHzm,maxlayerzm)
0258 ], ncols=7)
0259 
0260 #300 um
0261 _cellsnum_perthick_perlayer_300_EE_zminus = PlotGroup("cellsnum_perthick_perlayer_300_EE", [
0262   Plot("cellsnum_perthick_perlayer_300_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzm)
0263 ], ncols=7)
0264 
0265 _cellsnum_perthick_perlayer_300_FH_zminus = PlotGroup("cellsnum_perthick_perlayer_300_FH", [
0266   Plot("cellsnum_perthick_perlayer_300_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzm,lastLayerFHzm)
0267 ], ncols=7)
0268 
0269 _cellsnum_perthick_perlayer_300_BH_zminus = PlotGroup("cellsnum_perthick_perlayer_300_BH", [
0270   Plot("cellsnum_perthick_perlayer_300_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerFHzm,maxlayerzm)
0271 ], ncols=7)
0272 
0273 #scint um
0274 _cellsnum_perthick_perlayer_scint_EE_zminus = PlotGroup("cellsnum_perthick_perlayer_Sci_EE", [
0275   Plot("cellsnum_perthick_perlayer_-1_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzm)
0276 ], ncols=7)
0277 
0278 _cellsnum_perthick_perlayer_scint_FH_zminus = PlotGroup("cellsnum_perthick_perlayer_Sci_FH", [
0279   Plot("cellsnum_perthick_perlayer_-1_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzm,lastLayerFHzm)
0280 ], ncols=7)
0281 
0282 _cellsnum_perthick_perlayer_scint_BH_zminus = PlotGroup("cellsnum_perthick_perlayer_Sci_BH", [
0283   Plot("cellsnum_perthick_perlayer_-1_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerFHzm,maxlayerzm)
0284 ], ncols=7)
0285 
0286 #----------------------------------------------------------------------------------------------------------------
0287 #120 um
0288 _common_distance = {}
0289 _common_distance.update(_common)
0290 _common_distance.update(_legend_common)
0291 _common_distance["xmax"] = 150
0292 _common_distance["stat"] = False
0293 _common_distance["ymin"] = 1e-3
0294 _common_distance["ymax"] = 10000
0295 _common_distance["ylog"] = True
0296 
0297 _distancetomaxcell_perthickperlayer_120_EE_zminus = PlotGroup("distancetomaxcell_perthickperlayer_120_EE", [
0298   Plot("distancetomaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
0299 ], ncols=7)
0300 
0301 _distancetomaxcell_perthickperlayer_120_FH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_120_FH", [
0302   Plot("distancetomaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
0303 ], ncols=7)
0304 
0305 _distancetomaxcell_perthickperlayer_120_BH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_120_BH", [
0306   Plot("distancetomaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
0307 ], ncols=7)
0308 
0309 #200 um
0310 _distancetomaxcell_perthickperlayer_200_EE_zminus = PlotGroup("distancetomaxcell_perthickperlayer_200_EE", [
0311   Plot("distancetomaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
0312 ], ncols=7)
0313 
0314 _distancetomaxcell_perthickperlayer_200_FH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_200_FH", [
0315   Plot("distancetomaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
0316 ], ncols=7)
0317 
0318 _distancetomaxcell_perthickperlayer_200_BH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_200_BH", [
0319   Plot("distancetomaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
0320 ], ncols=7)
0321 
0322 #300 um
0323 _distancetomaxcell_perthickperlayer_300_EE_zminus = PlotGroup("distancetomaxcell_perthickperlayer_300_EE", [
0324   Plot("distancetomaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
0325 ], ncols=7)
0326 
0327 _distancetomaxcell_perthickperlayer_300_FH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_300_FH", [
0328   Plot("distancetomaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
0329 ], ncols=7)
0330 
0331 _distancetomaxcell_perthickperlayer_300_BH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_300_BH", [
0332   Plot("distancetomaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
0333 ], ncols=7)
0334 
0335 #scint um
0336 _distancetomaxcell_perthickperlayer_scint_EE_zminus = PlotGroup("distancetomaxcell_perthickperlayer_Sci_EE", [
0337   Plot("distancetomaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
0338 ], ncols=7)
0339 
0340 _distancetomaxcell_perthickperlayer_scint_FH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_Sci_FH", [
0341   Plot("distancetomaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
0342 ], ncols=7)
0343 
0344 _distancetomaxcell_perthickperlayer_scint_BH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_Sci_BH", [
0345   Plot("distancetomaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
0346 ], ncols=7)
0347 
0348 #----------------------------------------------------------------------------------------------------------------
0349 #120 um
0350 _distancebetseedandmaxcell_perthickperlayer_120_EE_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_120_EE", [
0351   Plot("distancebetseedandmaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
0352 ], ncols=7)
0353 
0354 _distancebetseedandmaxcell_perthickperlayer_120_FH_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_120_FH", [
0355   Plot("distancebetseedandmaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
0356 ], ncols=7)
0357 
0358 _distancebetseedandmaxcell_perthickperlayer_120_BH_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_120_BH", [
0359   Plot("distancebetseedandmaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
0360 ], ncols=7)
0361 
0362 #200 um
0363 _distancebetseedandmaxcell_perthickperlayer_200_EE_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_200_EE", [
0364   Plot("distancebetseedandmaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
0365 ], ncols=7)
0366 
0367 _distancebetseedandmaxcell_perthickperlayer_200_FH_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_200_FH", [
0368   Plot("distancebetseedandmaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
0369 ], ncols=7)
0370 
0371 _distancebetseedandmaxcell_perthickperlayer_200_BH_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_200_BH", [
0372   Plot("distancebetseedandmaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
0373 ], ncols=7)
0374 
0375 #300 um
0376 _distancebetseedandmaxcell_perthickperlayer_300_EE_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_300_EE", [
0377   Plot("distancebetseedandmaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
0378 ], ncols=7)
0379 
0380 _distancebetseedandmaxcell_perthickperlayer_300_FH_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_300_FH", [
0381   Plot("distancebetseedandmaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
0382 ], ncols=7)
0383 
0384 _distancebetseedandmaxcell_perthickperlayer_300_BH_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_300_BH", [
0385   Plot("distancebetseedandmaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
0386 ], ncols=7)
0387 
0388 #scint um
0389 _distancebetseedandmaxcell_perthickperlayer_scint_EE_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_Sci_EE", [
0390   Plot("distancebetseedandmaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
0391 ], ncols=7)
0392 
0393 _distancebetseedandmaxcell_perthickperlayer_scint_FH_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_Sci_FH", [
0394   Plot("distancebetseedandmaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
0395 ], ncols=7)
0396 
0397 _distancebetseedandmaxcell_perthickperlayer_scint_BH_zminus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_Sci_BH", [
0398   Plot("distancebetseedandmaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
0399 ], ncols=7)
0400 
0401 #----------------------------------------------------------------------------------------------------------------
0402 #120 um
0403 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_EE_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_EE", [
0404   Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
0405 ], ncols=7)
0406 
0407 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_FH_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_FH", [
0408   Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
0409 ], ncols=7)
0410 
0411 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_BH_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_BH", [
0412   Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
0413 ], ncols=7)
0414 
0415 #200 um
0416 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_EE_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_EE", [
0417   Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
0418 ], ncols=7)
0419 
0420 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_FH_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_FH", [
0421   Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
0422 ], ncols=7)
0423 
0424 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_BH_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_BH", [
0425   Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
0426 ], ncols=7)
0427 
0428 #300 um
0429 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_EE_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_EE", [
0430   Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
0431 ], ncols=7)
0432 
0433 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_FH_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_FH", [
0434   Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
0435 ], ncols=7)
0436 
0437 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_BH_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_BH", [
0438   Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
0439 ], ncols=7)
0440 
0441 #scint um
0442 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_EE_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_Sci_EE", [
0443   Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
0444 ], ncols=7)
0445 
0446 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_FH_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_Sci_FH", [
0447   Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
0448 ], ncols=7)
0449 
0450 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_BH_zminus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_Sci_BH", [
0451   Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
0452 ], ncols=7)
0453 
0454 #----------------------------------------------------------------------------------------------------------------
0455 #120 um
0456 _distancetoseedcell_perthickperlayer_120_EE_zminus = PlotGroup("distancetoseedcell_perthickperlayer_120_EE", [
0457   Plot("distancetoseedcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
0458 ], ncols=7)
0459 
0460 _distancetoseedcell_perthickperlayer_120_FH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_120_FH", [
0461   Plot("distancetoseedcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
0462 ], ncols=7)
0463 
0464 _distancetoseedcell_perthickperlayer_120_BH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_120_BH", [
0465   Plot("distancetoseedcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
0466 ], ncols=7)
0467 
0468 #200 um
0469 _distancetoseedcell_perthickperlayer_200_EE_zminus = PlotGroup("distancetoseedcell_perthickperlayer_200_EE", [
0470   Plot("distancetoseedcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
0471 ], ncols=7)
0472 
0473 _distancetoseedcell_perthickperlayer_200_FH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_200_FH", [
0474   Plot("distancetoseedcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
0475 ], ncols=7)
0476 
0477 _distancetoseedcell_perthickperlayer_200_BH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_200_BH", [
0478   Plot("distancetoseedcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
0479 ], ncols=7)
0480 
0481 #300 um
0482 _distancetoseedcell_perthickperlayer_300_EE_zminus = PlotGroup("distancetoseedcell_perthickperlayer_300_EE", [
0483   Plot("distancetoseedcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
0484 ], ncols=7)
0485 
0486 _distancetoseedcell_perthickperlayer_300_FH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_300_FH", [
0487   Plot("distancetoseedcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
0488 ], ncols=7)
0489 
0490 _distancetoseedcell_perthickperlayer_300_BH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_300_BH", [
0491   Plot("distancetoseedcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
0492 ], ncols=7)
0493 
0494 #scint um
0495 _distancetoseedcell_perthickperlayer_scint_EE_zminus = PlotGroup("distancetoseedcell_perthickperlayer_Sci_EE", [
0496   Plot("distancetoseedcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
0497 ], ncols=7)
0498 
0499 _distancetoseedcell_perthickperlayer_scint_FH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_Sci_FH", [
0500   Plot("distancetoseedcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
0501 ], ncols=7)
0502 
0503 _distancetoseedcell_perthickperlayer_scint_BH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_Sci_BH", [
0504   Plot("distancetoseedcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
0505 ], ncols=7)
0506 
0507 #=====================================================================================================================
0508 #----------------------------------------------------------------------------------------------------------------
0509 #We need points for the weighted plots
0510 _common = {"stat": True, "drawStyle": "EP", "staty": 0.65 }
0511 #120 um
0512 _distancetomaxcell_perthickperlayer_eneweighted_120_EE_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_120_EE", [
0513   Plot("distancetomaxcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
0514 ], ncols=7)
0515 
0516 _distancetomaxcell_perthickperlayer_eneweighted_120_FH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_120_FH", [
0517   Plot("distancetomaxcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
0518 ], ncols=7)
0519 
0520 _distancetomaxcell_perthickperlayer_eneweighted_120_BH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_120_BH", [
0521   Plot("distancetomaxcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
0522 ], ncols=7)
0523 
0524 #200 um
0525 _distancetomaxcell_perthickperlayer_eneweighted_200_EE_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_200_EE", [
0526   Plot("distancetomaxcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
0527 ], ncols=7)
0528 
0529 _distancetomaxcell_perthickperlayer_eneweighted_200_FH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_200_FH", [
0530   Plot("distancetomaxcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
0531 ], ncols=7)
0532 
0533 _distancetomaxcell_perthickperlayer_eneweighted_200_BH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_200_BH", [
0534   Plot("distancetomaxcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
0535 ], ncols=7)
0536 
0537 #300 um
0538 _distancetomaxcell_perthickperlayer_eneweighted_300_EE_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_300_EE", [
0539   Plot("distancetomaxcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
0540 ], ncols=7)
0541 
0542 _distancetomaxcell_perthickperlayer_eneweighted_300_FH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_300_FH", [
0543   Plot("distancetomaxcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
0544 ], ncols=7)
0545 
0546 _distancetomaxcell_perthickperlayer_eneweighted_300_BH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_300_BH", [
0547   Plot("distancetomaxcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
0548 ], ncols=7)
0549 #scint um
0550 _distancetomaxcell_perthickperlayer_eneweighted_scint_EE_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_Sci_EE", [
0551   Plot("distancetomaxcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
0552 ], ncols=7)
0553 
0554 _distancetomaxcell_perthickperlayer_eneweighted_scint_FH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_Sci_FH", [
0555   Plot("distancetomaxcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
0556 ], ncols=7)
0557 
0558 _distancetomaxcell_perthickperlayer_eneweighted_scint_BH_zminus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_Sci_BH", [
0559   Plot("distancetomaxcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
0560 ], ncols=7)
0561 
0562 
0563 #----------------------------------------------------------------------------------------------------------------
0564 #120 um
0565 _distancetoseedcell_perthickperlayer_eneweighted_120_EE_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_120_EE", [
0566   Plot("distancetoseedcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
0567 ], ncols=7)
0568 
0569 _distancetoseedcell_perthickperlayer_eneweighted_120_FH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_120_FH", [
0570   Plot("distancetoseedcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
0571 ], ncols=7)
0572 
0573 _distancetoseedcell_perthickperlayer_eneweighted_120_BH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_120_BH", [
0574   Plot("distancetoseedcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
0575 ], ncols=7)
0576 
0577 #200 um
0578 _distancetoseedcell_perthickperlayer_eneweighted_200_EE_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_200_EE", [
0579   Plot("distancetoseedcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
0580 ], ncols=7)
0581 
0582 _distancetoseedcell_perthickperlayer_eneweighted_200_FH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_200_FH", [
0583   Plot("distancetoseedcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
0584 ], ncols=7)
0585 
0586 _distancetoseedcell_perthickperlayer_eneweighted_200_BH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_200_BH", [
0587   Plot("distancetoseedcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
0588 ], ncols=7)
0589 
0590 #300 um
0591 _distancetoseedcell_perthickperlayer_eneweighted_300_EE_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_300_EE", [
0592   Plot("distancetoseedcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
0593 ], ncols=7)
0594 
0595 _distancetoseedcell_perthickperlayer_eneweighted_300_FH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_300_FH", [
0596   Plot("distancetoseedcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
0597 ], ncols=7)
0598 
0599 _distancetoseedcell_perthickperlayer_eneweighted_300_BH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_300_BH", [
0600   Plot("distancetoseedcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
0601 ], ncols=7)
0602 
0603 #scint um
0604 _distancetoseedcell_perthickperlayer_eneweighted_scint_EE_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_Sci_EE", [
0605   Plot("distancetoseedcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
0606 ], ncols=7)
0607 
0608 _distancetoseedcell_perthickperlayer_eneweighted_scint_FH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_Sci_FH", [
0609   Plot("distancetoseedcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
0610 ], ncols=7)
0611 
0612 _distancetoseedcell_perthickperlayer_eneweighted_scint_BH_zminus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_Sci_BH", [
0613   Plot("distancetoseedcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
0614 ], ncols=7)
0615 
0616 #Coming back to the usual definition
0617 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65 }
0618 
0619 #--------------------------------------------------------------------------------------------
0620 # z+
0621 #--------------------------------------------------------------------------------------------
0622 _totclusternum_layer_EE_zplus = PlotGroup("totclusternum_layer_EE", [
0623   Plot("totclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
0624 ], ncols=7)
0625 
0626 _totclusternum_layer_FH_zplus = PlotGroup("totclusternum_layer_FH", [
0627   Plot("totclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
0628 ], ncols=7)
0629 
0630 _totclusternum_layer_BH_zplus = PlotGroup("totclusternum_layer_BH", [
0631   Plot("totclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
0632 ], ncols=7)
0633 
0634 _totsimclusternum_layer_EE_zplus = PlotGroup("totsimclusternum_layer_EE_zplus", [
0635   Plot("totsimclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
0636 ], ncols=4)
0637 
0638 _totsimclusternum_layer_FH_zplus = PlotGroup("totsimclusternum_layer_FH_zplus", [
0639   Plot("totsimclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
0640 ], ncols=4)
0641 
0642 _totsimclusternum_layer_BH_zplus = PlotGroup("totsimclusternum_layer_BH_zplus", [
0643   Plot("totsimclusternum_layer_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
0644 ], ncols=4)
0645 
0646 _energyclustered_perlayer_EE_zplus = PlotGroup("energyclustered_perlayer_EE", [
0647   Plot("energyclustered_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
0648 ], ncols=7)
0649 
0650 _energyclustered_perlayer_FH_zplus = PlotGroup("energyclustered_perlayer_FH", [
0651   Plot("energyclustered_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
0652 ], ncols=7)
0653 
0654 _energyclustered_perlayer_BH_zplus = PlotGroup("energyclustered_perlayer_BH", [
0655   Plot("energyclustered_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
0656 ], ncols=7)
0657 
0658 #----------------------------------------------------------------------------------------------------------------
0659 #120 um
0660 _cellsnum_perthick_perlayer_120_EE_zplus = PlotGroup("cellsnum_perthick_perlayer_120_EE", [
0661   Plot("cellsnum_perthick_perlayer_120_{:02d}".format(i), xtitle="", **_common_cells) for i in range(maxlayerzm,lastLayerEEzp)
0662 ], ncols=7)
0663 
0664 _cellsnum_perthick_perlayer_120_FH_zplus = PlotGroup("cellsnum_perthick_perlayer_120_FH", [
0665   Plot("cellsnum_perthick_perlayer_120_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzp,lastLayerFHzp)
0666 ], ncols=7)
0667 _cellsnum_perthick_perlayer_120_BH_zplus = PlotGroup("cellsnum_perthick_perlayer_120_BH", [
0668   Plot("cellsnum_perthick_perlayer_120_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerFHzp,maxlayerzp)
0669 ], ncols=7)
0670 
0671 #200 um
0672 _cellsnum_perthick_perlayer_200_EE_zplus = PlotGroup("cellsnum_perthick_perlayer_200_EE", [
0673   Plot("cellsnum_perthick_perlayer_200_{:02d}".format(i), xtitle="", **_common_cells) for i in range(maxlayerzm,lastLayerEEzp)
0674 ], ncols=7)
0675 
0676 _cellsnum_perthick_perlayer_200_FH_zplus = PlotGroup("cellsnum_perthick_perlayer_200_FH", [
0677   Plot("cellsnum_perthick_perlayer_200_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzp,lastLayerFHzp)
0678 ], ncols=7)
0679 
0680 _cellsnum_perthick_perlayer_200_BH_zplus = PlotGroup("cellsnum_perthick_perlayer_200_BH", [
0681   Plot("cellsnum_perthick_perlayer_200_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerFHzp,maxlayerzp)
0682 ], ncols=7)
0683 #300 um
0684 _cellsnum_perthick_perlayer_300_EE_zplus = PlotGroup("cellsnum_perthick_perlayer_300_EE", [
0685   Plot("cellsnum_perthick_perlayer_300_{:02d}".format(i), xtitle="", **_common_cells) for i in range(maxlayerzm,lastLayerEEzp)
0686 ], ncols=7)
0687 
0688 _cellsnum_perthick_perlayer_300_FH_zplus = PlotGroup("cellsnum_perthick_perlayer_300_FH", [
0689   Plot("cellsnum_perthick_perlayer_300_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzp,lastLayerFHzp)
0690 ], ncols=7)
0691 _cellsnum_perthick_perlayer_300_BH_zplus = PlotGroup("cellsnum_perthick_perlayer_300_BH", [
0692   Plot("cellsnum_perthick_perlayer_300_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerFHzp,maxlayerzp)
0693 ], ncols=7)
0694 
0695 #scint um
0696 _cellsnum_perthick_perlayer_scint_EE_zplus = PlotGroup("cellsnum_perthick_perlayer_Sci_EE", [
0697   Plot("cellsnum_perthick_perlayer_-1_{:02d}".format(i), xtitle="", **_common_cells) for i in range(maxlayerzm,lastLayerEEzp)
0698 ], ncols=7)
0699 
0700 _cellsnum_perthick_perlayer_scint_FH_zplus = PlotGroup("cellsnum_perthick_perlayer_Sci_FH", [
0701   Plot("cellsnum_perthick_perlayer_-1_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerEEzp,lastLayerFHzp)
0702 ], ncols=7)
0703 
0704 _cellsnum_perthick_perlayer_scint_BH_zplus = PlotGroup("cellsnum_perthick_perlayer_Sci_BH", [
0705   Plot("cellsnum_perthick_perlayer_-1_{:02d}".format(i), xtitle="", **_common_cells) for i in range(lastLayerFHzp,maxlayerzp)
0706 ], ncols=7)
0707 
0708 #----------------------------------------------------------------------------------------------------------------
0709 #120 um
0710 _common_distance = {}
0711 _common_distance.update(_common)
0712 _common_distance.update(_legend_common)
0713 _common_distance["xmax"] = 150
0714 _common_distance["stat"] = False
0715 _common_distance["ymin"] = 1e-3
0716 _common_distance["ymax"] = 10000
0717 _common_distance["ylog"] = True
0718 
0719 _distancetomaxcell_perthickperlayer_120_EE_zplus = PlotGroup("distancetomaxcell_perthickperlayer_120_EE", [
0720   Plot("distancetomaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
0721 ], ncols=7)
0722 
0723 _distancetomaxcell_perthickperlayer_120_FH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_120_FH", [
0724   Plot("distancetomaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
0725 ], ncols=7)
0726 
0727 _distancetomaxcell_perthickperlayer_120_BH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_120_BH", [
0728   Plot("distancetomaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
0729 ], ncols=7)
0730 
0731 #200 um
0732 _distancetomaxcell_perthickperlayer_200_EE_zplus = PlotGroup("distancetomaxcell_perthickperlayer_200_EE", [
0733   Plot("distancetomaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
0734 ], ncols=7)
0735 
0736 _distancetomaxcell_perthickperlayer_200_FH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_200_FH", [
0737   Plot("distancetomaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
0738 ], ncols=7)
0739 
0740 _distancetomaxcell_perthickperlayer_200_BH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_200_BH", [
0741   Plot("distancetomaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
0742 ], ncols=7)
0743 
0744 #300 um
0745 _distancetomaxcell_perthickperlayer_300_EE_zplus = PlotGroup("distancetomaxcell_perthickperlayer_300_EE", [
0746   Plot("distancetomaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
0747 ], ncols=7)
0748 
0749 _distancetomaxcell_perthickperlayer_300_FH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_300_FH", [
0750   Plot("distancetomaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
0751 ], ncols=7)
0752 
0753 _distancetomaxcell_perthickperlayer_300_BH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_300_BH", [
0754   Plot("distancetomaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
0755 ], ncols=7)
0756 
0757 #scint um
0758 _distancetomaxcell_perthickperlayer_scint_EE_zplus = PlotGroup("distancetomaxcell_perthickperlayer_Sci_EE", [
0759   Plot("distancetomaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
0760 ], ncols=7)
0761 
0762 _distancetomaxcell_perthickperlayer_scint_FH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_Sci_FH", [
0763   Plot("distancetomaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
0764 ], ncols=7)
0765 
0766 _distancetomaxcell_perthickperlayer_scint_BH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_Sci_BH", [
0767   Plot("distancetomaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
0768 ], ncols=7)
0769 
0770 #----------------------------------------------------------------------------------------------------------------
0771 #120 um
0772 _distancebetseedandmaxcell_perthickperlayer_120_EE_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_120_EE", [
0773   Plot("distancebetseedandmaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
0774 ], ncols=7)
0775 
0776 _distancebetseedandmaxcell_perthickperlayer_120_FH_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_120_FH", [
0777   Plot("distancebetseedandmaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
0778 ], ncols=7)
0779 
0780 _distancebetseedandmaxcell_perthickperlayer_120_BH_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_120_BH", [
0781   Plot("distancebetseedandmaxcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
0782 ], ncols=7)
0783 
0784 #200 um
0785 _distancebetseedandmaxcell_perthickperlayer_200_EE_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_200_EE", [
0786   Plot("distancebetseedandmaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
0787 ], ncols=7)
0788 
0789 _distancebetseedandmaxcell_perthickperlayer_200_FH_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_200_FH", [
0790   Plot("distancebetseedandmaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
0791 ], ncols=7)
0792 
0793 _distancebetseedandmaxcell_perthickperlayer_200_BH_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_200_BH", [
0794   Plot("distancebetseedandmaxcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
0795 ], ncols=7)
0796 
0797 #300 um
0798 _distancebetseedandmaxcell_perthickperlayer_300_EE_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_300_EE", [
0799   Plot("distancebetseedandmaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
0800 ], ncols=7)
0801 
0802 _distancebetseedandmaxcell_perthickperlayer_300_FH_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_300_FH", [
0803   Plot("distancebetseedandmaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
0804 ], ncols=7)
0805 
0806 _distancebetseedandmaxcell_perthickperlayer_300_BH_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_300_BH", [
0807   Plot("distancebetseedandmaxcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
0808 ], ncols=7)
0809 
0810 #scint um
0811 _distancebetseedandmaxcell_perthickperlayer_scint_EE_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_Sci_EE", [
0812   Plot("distancebetseedandmaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
0813 ], ncols=7)
0814 
0815 _distancebetseedandmaxcell_perthickperlayer_scint_FH_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_Sci_FH", [
0816   Plot("distancebetseedandmaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
0817 ], ncols=7)
0818 
0819 _distancebetseedandmaxcell_perthickperlayer_scint_BH_zplus = PlotGroup("distancebetseedandmaxcell_perthickperlayer_Sci_BH", [
0820   Plot("distancebetseedandmaxcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
0821 ], ncols=7)
0822 
0823 #----------------------------------------------------------------------------------------------------------------
0824 #120 um
0825 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_EE_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_EE", [
0826   Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
0827 ], ncols=7)
0828 
0829 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_FH_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_FH", [
0830   Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
0831 ], ncols=7)
0832 
0833 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_BH_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_BH", [
0834   Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
0835 ], ncols=7)
0836 
0837 #200 um
0838 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_EE_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_EE", [
0839   Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
0840 ], ncols=7)
0841 
0842 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_FH_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_FH", [
0843   Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
0844 ], ncols=7)
0845 
0846 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_BH_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_BH", [
0847   Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
0848 ], ncols=7)
0849 
0850 #300 um
0851 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_EE_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_EE", [
0852   Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
0853 ], ncols=7)
0854 
0855 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_FH_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_FH", [
0856   Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
0857 ], ncols=7)
0858 
0859 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_BH_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_BH", [
0860   Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
0861 ], ncols=7)
0862 
0863 #scint um
0864 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_EE_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_Sci_EE", [
0865   Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
0866 ], ncols=7)
0867 
0868 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_FH_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_Sci_FH", [
0869   Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
0870 ], ncols=7)
0871 
0872 _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_BH_zplus = PlotGroup("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_Sci_BH", [
0873   Plot("distancebetseedandmaxcellvsclusterenergy_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
0874 ], ncols=7)
0875 
0876 
0877 #----------------------------------------------------------------------------------------------------------------
0878 #120 um
0879 _distancetoseedcell_perthickperlayer_120_EE_zplus = PlotGroup("distancetoseedcell_perthickperlayer_120_EE", [
0880   Plot("distancetoseedcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
0881 ], ncols=7)
0882 
0883 _distancetoseedcell_perthickperlayer_120_FH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_120_FH", [
0884   Plot("distancetoseedcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
0885 ], ncols=7)
0886 
0887 _distancetoseedcell_perthickperlayer_120_BH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_120_BH", [
0888   Plot("distancetoseedcell_perthickperlayer_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
0889 ], ncols=7)
0890 
0891 #200 um
0892 _distancetoseedcell_perthickperlayer_200_EE_zplus = PlotGroup("distancetoseedcell_perthickperlayer_200_EE", [
0893   Plot("distancetoseedcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
0894 ], ncols=7)
0895 
0896 _distancetoseedcell_perthickperlayer_200_FH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_200_FH", [
0897   Plot("distancetoseedcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
0898 ], ncols=7)
0899 
0900 _distancetoseedcell_perthickperlayer_200_BH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_200_BH", [
0901   Plot("distancetoseedcell_perthickperlayer_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
0902 ], ncols=7)
0903 
0904 #300 um
0905 _distancetoseedcell_perthickperlayer_300_EE_zplus = PlotGroup("distancetoseedcell_perthickperlayer_300_EE", [
0906   Plot("distancetoseedcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
0907 ], ncols=7)
0908 
0909 _distancetoseedcell_perthickperlayer_300_FH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_300_FH", [
0910   Plot("distancetoseedcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
0911 ], ncols=7)
0912 
0913 _distancetoseedcell_perthickperlayer_300_BH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_300_BH", [
0914   Plot("distancetoseedcell_perthickperlayer_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
0915 ], ncols=7)
0916 
0917 #scint um
0918 _distancetoseedcell_perthickperlayer_scint_EE_zplus = PlotGroup("distancetoseedcell_perthickperlayer_Sci_EE", [
0919   Plot("distancetoseedcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
0920 ], ncols=7)
0921 
0922 _distancetoseedcell_perthickperlayer_scint_FH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_Sci_FH", [
0923   Plot("distancetoseedcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
0924 ], ncols=7)
0925 
0926 _distancetoseedcell_perthickperlayer_scint_BH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_Sci_BH", [
0927   Plot("distancetoseedcell_perthickperlayer_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
0928 ], ncols=7)
0929 
0930 #=====================================================================================================================
0931 #----------------------------------------------------------------------------------------------------------------
0932 #We need points for the weighted plots
0933 _common = {"stat": True, "drawStyle": "EP", "staty": 0.65 }
0934 
0935 #120 um
0936 _distancetomaxcell_perthickperlayer_eneweighted_120_EE_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_120_EE", [
0937   Plot("distancetomaxcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
0938 ], ncols=7)
0939 
0940 _distancetomaxcell_perthickperlayer_eneweighted_120_FH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_120_FH", [
0941   Plot("distancetomaxcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
0942 ], ncols=7)
0943 
0944 _distancetomaxcell_perthickperlayer_eneweighted_120_BH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_120_BH", [
0945   Plot("distancetomaxcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
0946 ], ncols=7)
0947 
0948 #200 um
0949 _distancetomaxcell_perthickperlayer_eneweighted_200_EE_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_200_EE", [
0950   Plot("distancetomaxcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
0951 ], ncols=7)
0952 _distancetomaxcell_perthickperlayer_eneweighted_200_FH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_200_FH", [
0953   Plot("distancetomaxcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
0954 ], ncols=7)
0955 
0956 _distancetomaxcell_perthickperlayer_eneweighted_200_BH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_200_BH", [
0957   Plot("distancetomaxcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
0958 ], ncols=7)
0959 
0960 #300 um
0961 _distancetomaxcell_perthickperlayer_eneweighted_300_EE_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_300_EE", [
0962   Plot("distancetomaxcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
0963 ], ncols=7)
0964 
0965 _distancetomaxcell_perthickperlayer_eneweighted_300_FH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_300_FH", [
0966   Plot("distancetomaxcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
0967 ], ncols=7)
0968 
0969 _distancetomaxcell_perthickperlayer_eneweighted_300_BH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_300_BH", [
0970   Plot("distancetomaxcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
0971 ], ncols=7)
0972 
0973 #scint um
0974 _distancetomaxcell_perthickperlayer_eneweighted_scint_EE_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_Sci_EE", [
0975   Plot("distancetomaxcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
0976 ], ncols=7)
0977 
0978 _distancetomaxcell_perthickperlayer_eneweighted_scint_FH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_Sci_FH", [
0979   Plot("distancetomaxcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
0980 ], ncols=7)
0981 
0982 _distancetomaxcell_perthickperlayer_eneweighted_scint_BH_zplus = PlotGroup("distancetomaxcell_perthickperlayer_eneweighted_Sci_BH", [
0983   Plot("distancetomaxcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
0984 ], ncols=7)
0985 
0986 #----------------------------------------------------------------------------------------------------------------
0987 #120 um
0988 _distancetoseedcell_perthickperlayer_eneweighted_120_EE_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_120_EE", [
0989   Plot("distancetoseedcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
0990 ], ncols=7)
0991 
0992 _distancetoseedcell_perthickperlayer_eneweighted_120_FH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_120_FH", [
0993   Plot("distancetoseedcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
0994 ], ncols=7)
0995 
0996 _distancetoseedcell_perthickperlayer_eneweighted_120_BH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_120_BH", [
0997   Plot("distancetoseedcell_perthickperlayer_eneweighted_120_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
0998 ], ncols=7)
0999 
1000 #200 um
1001 _distancetoseedcell_perthickperlayer_eneweighted_200_EE_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_200_EE", [
1002   Plot("distancetoseedcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
1003 ], ncols=7)
1004 
1005 _distancetoseedcell_perthickperlayer_eneweighted_200_FH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_200_FH", [
1006   Plot("distancetoseedcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
1007 ], ncols=7)
1008 
1009 _distancetoseedcell_perthickperlayer_eneweighted_200_BH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_200_BH", [
1010   Plot("distancetoseedcell_perthickperlayer_eneweighted_200_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
1011 ], ncols=7)
1012 
1013 #300 um
1014 _distancetoseedcell_perthickperlayer_eneweighted_300_EE_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_300_EE", [
1015   Plot("distancetoseedcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
1016 ], ncols=7)
1017 
1018 _distancetoseedcell_perthickperlayer_eneweighted_300_FH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_300_FH", [
1019   Plot("distancetoseedcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
1020 ], ncols=7)
1021 
1022 _distancetoseedcell_perthickperlayer_eneweighted_300_BH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_300_BH", [
1023   Plot("distancetoseedcell_perthickperlayer_eneweighted_300_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
1024 ], ncols=7)
1025 
1026 #scint um
1027 _distancetoseedcell_perthickperlayer_eneweighted_scint_EE_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_Sci_EE", [
1028   Plot("distancetoseedcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
1029 ], ncols=7)
1030 
1031 _distancetoseedcell_perthickperlayer_eneweighted_scint_FH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_Sci_FH", [
1032   Plot("distancetoseedcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
1033 ], ncols=7)
1034 
1035 _distancetoseedcell_perthickperlayer_eneweighted_scint_BH_zplus = PlotGroup("distancetoseedcell_perthickperlayer_eneweighted_Sci_BH", [
1036   Plot("distancetoseedcell_perthickperlayer_eneweighted_-1_{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
1037 ], ncols=7)
1038 #Just in case we add some plots below to be on the safe side.
1039 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65 }
1040 
1041 #--------------------------------------------------------------------------------------------
1042 # z-
1043 #--------------------------------------------------------------------------------------------
1044 
1045 _common_score = {"title": "Score CaloParticle to LayerClusters in z-",
1046                  "stat": False,
1047                  "ymin": 0.1,
1048                  "ymax": 1000,
1049                  "xmin": 0,
1050                  "xmax": 1,
1051                  "drawStyle": "hist",
1052                  "lineWidth": 1,
1053                  "ylog": True
1054                 }
1055 _common_score.update(_legend_common)
1056 _score_caloparticle_to_layerclusters_zminus = PlotGroup("score_caloparticle_to_layercluster", [
1057         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)
1058         ], ncols=10 )
1059 
1060 _common_score = {"title": "Score LayerCluster to CaloParticles in z-",
1061                  "stat": False,
1062                  "ymin": 0.1,
1063                  "ymax": 1000,
1064                  "xmin": 0,
1065                  "xmax": 1,
1066                  "drawStyle": "hist",
1067                  "lineWidth": 1,
1068                  "ylog": True
1069                 }
1070 _common_score.update(_legend_common)
1071 _score_layercluster_to_caloparticles_zminus = PlotGroup("score_layercluster_to_caloparticle", [
1072         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)
1073         ], ncols=8 )
1074 
1075 _common_shared= {"title": "Shared Energy CaloParticle To Layer Cluster in z-",
1076                  "stat": False,
1077                  "legend": False,
1078                 }
1079 _common_shared.update(_legend_common)
1080 _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)]
1081 _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)])
1082 _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)])
1083 _sharedEnergy_caloparticle_to_layercluster_zminus = PlotGroup("sharedEnergy_caloparticle_to_layercluster", _shared_plots_zminus, ncols=8)
1084 
1085 _common_shared= {"title": "Shared Energy Layer Cluster To CaloParticle in z-",
1086                  "stat": False,
1087                  "legend": False,
1088                 }
1089 _common_shared.update(_legend_common)
1090 _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)]
1091 _common_shared= {"title": "Shared Energy Layer Cluster To Best CaloParticle in z-",
1092                  "stat": False,
1093                  "legend": False,
1094                  "ymin": 0,
1095                  "ymax": 1
1096                 }
1097 _common_shared.update(_legend_common)
1098 _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)])
1099 _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)])
1100 _sharedEnergy_layercluster_to_caloparticle_zminus = PlotGroup("sharedEnergy_layercluster_to_caloparticle", _shared_plots2_zminus, ncols=8)
1101 
1102 
1103 _common_assoc = {#"title": "Cell Association Table in z-",
1104                  "stat": False,
1105                  "legend": False,
1106                  "xbinlabels": ["", "TN(pur)", "FN(ineff.)", "FP(fake)", "TP(eff)"],
1107                  "xbinlabeloption": "h",
1108                  "drawStyle": "hist",
1109                  "ymin": 0.1,
1110                  "ymax": 10000,
1111                  "ylog": True}
1112 _common_assoc.update(_legend_common)
1113 _cell_association_table_zminus = PlotGroup("cellAssociation_table", [
1114         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)
1115         ], ncols=8 )
1116 
1117 _bin_count = 0
1118 _xbinlabels = [ "{:02d}".format(i+1) for i in range(0,maxlayerzm) ]
1119 _xtitle = "Layer Numbers in z-"
1120 _common_eff = {"stat": False, "legend": False, "ymin": 0.0, "ymax": 1.1, "xbinlabeloption": "d"}
1121 _effplots_zminus_eta = [Plot("effic_eta_layer{:02d}".format(i), xtitle="", **_common_eff) for i in range(0,maxlayerzm)]
1122 _effplots_zminus_phi = [Plot("effic_phi_layer{:02d}".format(i), xtitle="", **_common_eff) for i in range(0,maxlayerzm)]
1123 _common_eff = {"stat": False, "legend": False, "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloption": "v", "ymin": 0.0, "ymax": 1.1}
1124 _common_eff["xmin"] = _bin_count
1125 _common_eff["xmax"] = maxlayerzm
1126 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1127 _effplots_zminus = [Plot("globalEfficiencies", xtitle=_xtitle, ytitle="Efficiency", **_common_eff)]
1128 _efficiencies_zminus_eta = PlotGroup("Efficiencies_vs_eta", _effplots_zminus_eta, ncols=10)
1129 _efficiencies_zminus_phi = PlotGroup("Efficiencies_vs_phi", _effplots_zminus_phi, ncols=10)
1130 _efficiencies_zminus     = PlotGroup("Efficiencies_vs_layer", _effplots_zminus, ncols=1)
1131 
1132 _common_dup = {"stat": False, "legend": False, "ymin":0.0, "ymax":1.1}
1133 _dupplots_zminus_eta = [Plot("duplicate_eta_layer{:02d}".format(i), xtitle="", **_common_dup) for i in range(0,maxlayerzm)]
1134 _dupplots_zminus_phi = [Plot("duplicate_phi_layer{:02d}".format(i), xtitle="", **_common_dup) for i in range(0,maxlayerzm)]
1135 _common_dup = {"stat": False, "legend": False, "title": "Global Duplicates in z-", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloption": "v", "ymin": 0.0, "ymax": 1.1}
1136 _common_dup["xmin"] = _bin_count
1137 _common_dup["xmax"] = _common_dup["xmin"] + maxlayerzm
1138 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1139 _dupplots_zminus = [Plot("globalEfficiencies", xtitle=_xtitle, ytitle="Duplicates", **_common_dup)]
1140 _duplicates_zminus_eta = PlotGroup("Duplicates_vs_eta", _dupplots_zminus_eta, ncols=10)
1141 _duplicates_zminus_phi = PlotGroup("Duplicates_vs_phi", _dupplots_zminus_phi, ncols=10)
1142 _duplicates_zminus     = PlotGroup("Duplicates_vs_layer", _dupplots_zminus, ncols=1)
1143 
1144 _common_fake = {"stat": False, "legend": False, "ymin":0.0, "ymax":1.1}
1145 _fakeplots_zminus_eta = [Plot("fake_eta_layer{:02d}".format(i), xtitle="", **_common_fake) for i in range(0,maxlayerzm)]
1146 _fakeplots_zminus_phi = [Plot("fake_phi_layer{:02d}".format(i), xtitle="", **_common_fake) for i in range(0,maxlayerzm)]
1147 _common_fake = {"stat": False, "legend": False, "title": "Global Fake Rates in z-", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloption": "v", "ymin": 0.0, "ymax": 1.1}
1148 _common_fake["xmin"] = _bin_count
1149 _common_fake["xmax"] = _common_fake["xmin"] + maxlayerzm
1150 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1151 _common_fake["xbinlabelsize"] = 10.
1152 _fakeplots_zminus = [Plot("globalEfficiencies", xtitle=_xtitle, ytitle="Fake Rate", **_common_fake)]
1153 _fakes_zminus_eta = PlotGroup("FakeRate_vs_eta", _fakeplots_zminus_eta, ncols=10)
1154 _fakes_zminus_phi = PlotGroup("FakeRate_vs_phi", _fakeplots_zminus_phi, ncols=10)
1155 _fakes_zminus     = PlotGroup("FakeRate_vs_layer", _fakeplots_zminus, ncols=1)
1156 
1157 _common_merge = {"stat": False, "legend": False, "ymin":0.0, "ymax":1.1}
1158 _mergeplots_zminus_eta = [Plot("merge_eta_layer{:02d}".format(i), xtitle="", **_common_merge) for i in range(0,maxlayerzm)]
1159 _mergeplots_zminus_phi = [Plot("merge_phi_layer{:02d}".format(i), xtitle="", **_common_merge) for i in range(0,maxlayerzm)]
1160 _common_merge = {"stat": False, "legend": False, "title": "Global Merge Rates in z-", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloption": "v", "ymin": 0.0, "ymax": 1.1}
1161 _common_merge["xmin"] = _bin_count
1162 _common_merge["xmax"] = _common_merge["xmin"] + maxlayerzm
1163 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1164 _common_merge["xbinlabelsize"] = 10.
1165 _mergeplots_zminus = [Plot("globalEfficiencies", xtitle=_xtitle, ytitle="Merge Rate", **_common_merge)]
1166 _merges_zminus_eta = PlotGroup("MergeRate_vs_eta", _mergeplots_zminus_eta, ncols=10)
1167 _merges_zminus_phi = PlotGroup("MergeRate_vs_phi", _mergeplots_zminus_phi, ncols=10)
1168 _merges_zminus     = PlotGroup("MergeRate_vs_layer", _mergeplots_zminus, ncols=1)
1169 
1170 
1171 _common_energy_score = dict(removeEmptyBins=False, xbinlabelsize=10,
1172     stat=True,
1173     xbinlabeloption="d",
1174     ncols=1,
1175     xmin=0.001,
1176     xmax=1.,
1177     ymin=0.01,
1178     ymax=1.)
1179 _energyscore_cp2lc_zminus = PlotGroup("Energy_vs_Score_CP2LC", [Plot("Energy_vs_Score_caloparticle2layer_perlayer{:02d}".format(i), title="Energy_vs_Score_CP2LC",
1180                                                      xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_energy_score) for i in range(0, maxlayerzm)
1181                                                      ], ncols=10)
1182 
1183 _energyscore_cp2lc_zplus = PlotGroup("Energy_vs_Score_CP2LC", [Plot("Energy_vs_Score_caloparticle2layer_perlayer{:02d}".format(i), title="Energy_vs_Score_CP2LC",
1184                                                      xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_energy_score) for i in range(maxlayerzm,maxlayerzp)
1185                                                      ], ncols=10)
1186 _common_energy_score["xmin"]=-0.1
1187 _energyscore_lc2cp_zminus = PlotGroup("Energy_vs_Score_LC2CP", [Plot("Energy_vs_Score_layer2caloparticle_perlayer{:02d}".format(i), title="Energy_vs_Score_LC2CP",
1188                                                      xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_energy_score) for i in range(0, maxlayerzm)
1189                                                      ], ncols=10)
1190 _energyscore_lc2cp_zplus = PlotGroup("Energy_vs_Score_LC2CP", [Plot("Energy_vs_Score_layer2caloparticle_perlayer{:02d}".format(i), title="Energy_vs_Score_LC2CP",
1191                                                      xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_energy_score) for i in range(maxlayerzm,maxlayerzp)
1192                                                      ], ncols=10)
1193 
1194 #--------------------------------------------------------------------------------------------
1195 # z+
1196 #--------------------------------------------------------------------------------------------
1197 _common_score = {"title": "Score CaloParticle to LayerClusters in z+",
1198                  "stat": False,
1199                  "ymin": 0.1,
1200                  "ymax": 1000,
1201                  "xmin": 0,
1202                  "xmax": 1,
1203                  "drawStyle": "hist",
1204                  "lineWidth": 1,
1205                  "ylog": True
1206                 }
1207 _common_score.update(_legend_common)
1208 _score_caloparticle_to_layerclusters_zplus = PlotGroup("score_caloparticle_to_layercluster", [
1209         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)
1210         ], ncols=10 )
1211 
1212 _common_score = {"title": "Score LayerCluster to CaloParticles in z+",
1213                  "stat": False,
1214                  "ymin": 0.1,
1215                  "ymax": 1000,
1216                  "xmin": 0,
1217                  "xmax": 1,
1218                  "drawStyle": "hist",
1219                  "lineWidth": 1,
1220                  "ylog": True
1221                 }
1222 _common_score.update(_legend_common)
1223 _score_layercluster_to_caloparticles_zplus = PlotGroup("score_layercluster_to_caloparticle", [
1224         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)
1225         ], ncols=8 )
1226 
1227 _common_shared= {"title": "Shared Energy CaloParticle To Layer Cluster in z+",
1228                  "stat": False,
1229                  "legend": False,
1230                 }
1231 _common_shared.update(_legend_common)
1232 _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)]
1233 _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)])
1234 _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)])
1235 _sharedEnergy_caloparticle_to_layercluster_zplus = PlotGroup("sharedEnergy_caloparticle_to_layercluster", _shared_plots_zplus, ncols=8)
1236 
1237 _common_shared= {"title": "Shared Energy Layer Cluster To CaloParticle in z+",
1238                  "stat": False,
1239                  "legend": False,
1240                 }
1241 _common_shared.update(_legend_common)
1242 _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)]
1243 _common_shared= {"title": "Shared Energy Layer Cluster To Best CaloParticle in z+",
1244                  "stat": False,
1245                  "legend": False,
1246                  "ymin": 0,
1247                  "ymax": 1,
1248                 }
1249 _common_shared.update(_legend_common)
1250 _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)])
1251 _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)])
1252 _sharedEnergy_layercluster_to_caloparticle_zplus = PlotGroup("sharedEnergy_layercluster_to_caloparticle", _shared_plots2_zplus, ncols=8)
1253 
1254 
1255 _common_assoc = {#"title": "Cell Association Table in z+",
1256                  "stat": False,
1257                  "legend": False,
1258                  "xbinlabels": ["", "TN(pur)", "FN(ineff.)", "FP(fake)", "TP(eff)"],
1259                  "xbinlabeloption": "h",
1260                  "drawStyle": "hist",
1261                  "ymin": 0.1,
1262                  "ymax": 10000,
1263                  "ylog": True}
1264 _common_assoc.update(_legend_common)
1265 _cell_association_table_zplus = PlotGroup("cellAssociation_table", [
1266         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)
1267         ], ncols=8 )
1268 
1269 
1270 _bin_count = maxlayerzm
1271 _xtitle = "Layer Numbers in z+"
1272 _common_eff = {"stat": False, "legend": False, "ymin":0.0, "ymax":1.1}
1273 _effplots_zplus_eta = [Plot("effic_eta_layer{:02d}".format(i), xtitle="", **_common_eff) for i in range(maxlayerzm,maxlayerzp)]
1274 _effplots_zplus_phi = [Plot("effic_phi_layer{:02d}".format(i), xtitle="", **_common_eff) for i in range(maxlayerzm,maxlayerzp)]
1275 _common_eff = {"stat": False, "legend": False, "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloption": "v", "ymin": 0.0, "ymax": 1.1}
1276 _common_eff["xmin"] = _bin_count
1277 _common_eff["xmax"] = _common_eff["xmin"] + maxlayerzm
1278 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1279 _effplots_zplus = [Plot("globalEfficiencies", xtitle=_xtitle, ytitle="Efficiency", **_common_eff)]
1280 _efficiencies_zplus_eta = PlotGroup("Efficiencies_vs_eta", _effplots_zplus_eta, ncols=10)
1281 _efficiencies_zplus_phi = PlotGroup("Efficiencies_vs_phi", _effplots_zplus_phi, ncols=10)
1282 _efficiencies_zplus = PlotGroup("Efficiencies_vs_layer", _effplots_zplus, ncols=1)
1283 
1284 _common_dup = {"stat": False, "legend": False, "ymin": 0.0, "ymax": 1.1}
1285 _dupplots_zplus_eta = [Plot("duplicate_eta_layer{:02d}".format(i), xtitle="", **_common_dup) for i in range(maxlayerzm,maxlayerzp)]
1286 _dupplots_zplus_phi = [Plot("duplicate_phi_layer{:02d}".format(i), xtitle="", **_common_dup) for i in range(maxlayerzm,maxlayerzp)]
1287 _common_dup = {"stat": False, "legend": False, "title": "Global Duplicates in z+", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloption": "v", "ymin": 0.0, "ymax": 1.1}
1288 _common_dup["xmin"] = _bin_count
1289 _common_dup["xmax"] = _common_dup["xmin"] + maxlayerzm
1290 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1291 _dupplots_zplus = [Plot("globalEfficiencies", xtitle=_xtitle, ytitle="Duplicates", **_common_dup)]
1292 _duplicates_zplus_eta = PlotGroup("Duplicates_vs_eta", _dupplots_zplus_eta, ncols=10)
1293 _duplicates_zplus_phi = PlotGroup("Duplicates_vs_phi", _dupplots_zplus_phi, ncols=10)
1294 _duplicates_zplus = PlotGroup("Duplicates_vs_layer", _dupplots_zplus, ncols=1)
1295 
1296 _common_fake = {"stat": False, "legend": False, "ymin": 0.0, "ymax": 1.1}
1297 _fakeplots_zplus_eta = [Plot("fake_eta_layer{:02d}".format(i), xtitle="", **_common_fake) for i in range(maxlayerzm,maxlayerzp)]
1298 _fakeplots_zplus_phi = [Plot("fake_phi_layer{:02d}".format(i), xtitle="", **_common_fake) for i in range(maxlayerzm,maxlayerzp)]
1299 _common_fake = {"stat": False, "legend": False, "title": "Global Fake Rates in z+", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloption": "v", "ymin": 0.0, "ymax": 1.1}
1300 _common_fake["xmin"] = _bin_count
1301 _common_fake["xmax"] = _common_fake["xmin"] + maxlayerzm
1302 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1303 _fakeplots_zplus = [Plot("globalEfficiencies", xtitle=_xtitle, ytitle="Fake Rate", **_common_fake)]
1304 _fakes_zplus_eta = PlotGroup("FakeRate_vs_eta", _fakeplots_zplus_eta, ncols=10)
1305 _fakes_zplus_phi = PlotGroup("FakeRate_vs_phi", _fakeplots_zplus_phi, ncols=10)
1306 _fakes_zplus = PlotGroup("FakeRate_vs_layer", _fakeplots_zplus, ncols=1)
1307 
1308 _common_merge = {"stat": False, "legend": False, "ymin": 0.0, "ymax": 1.1}
1309 _mergeplots_zplus_eta = [Plot("merge_eta_layer{:02d}".format(i), xtitle="", **_common_merge) for i in range(maxlayerzm,maxlayerzp)]
1310 _mergeplots_zplus_phi = [Plot("merge_phi_layer{:02d}".format(i), xtitle="", **_common_merge) for i in range(maxlayerzm,maxlayerzp)]
1311 _common_merge = {"stat": False, "legend": False, "title": "Global Merge Rates in z+", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloption": "v", "ymin": 0.0, "ymax": 1.1}
1312 _common_merge["xmin"] = _bin_count
1313 _common_merge["xmax"] = _common_merge["xmin"] + maxlayerzm
1314 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1315 _mergeplots_zplus = [Plot("globalEfficiencies", xtitle=_xtitle, ytitle="Merge Rate", **_common_merge)]
1316 _merges_zplus_eta = PlotGroup("MergeRate_vs_eta", _mergeplots_zplus_eta, ncols=10)
1317 _merges_zplus_phi = PlotGroup("MergeRate_vs_phi", _mergeplots_zplus_phi, ncols=10)
1318 _merges_zplus = PlotGroup("MergeRate_vs_layer", _mergeplots_zplus, ncols=1)
1319 
1320 #--------------------------------------------------------------------------------------------
1321 # SimClusters
1322 #--------------------------------------------------------------------------------------------
1323 
1324 _common_sc_score = {"title": "Score SimCluster to LayerClusters in z-",
1325                  "stat": False,
1326                  "ymin": 0.1,
1327                  "ymax": 10**6,
1328                  "xmin": 0,
1329                  "xmax": 1,
1330                  "drawStyle": "hist",
1331                  "lineWidth": 1,
1332                  "ylog": True
1333                 }
1334 _common_sc_score.update(_legend_common)
1335 _score_simcluster_to_layerclusters_zminus = PlotGroup("score_simcluster_to_layercluster_zminus", [
1336         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)
1337         ], ncols=10 )
1338 
1339 _common_sc_score = {"title": "Score LayerCluster to SimClusters in z-",
1340                  "stat": False,
1341                  "ymin": 0.1,
1342                  "ymax": 10**6,
1343                  "xmin": 0,
1344                  "xmax": 1,
1345                  "drawStyle": "hist",
1346                  "lineWidth": 1,
1347                  "ylog": True
1348                 }
1349 _common_sc_score.update(_legend_common)
1350 _score_layercluster_to_simclusters_zminus = PlotGroup("score_layercluster_to_simcluster_zminus", [
1351         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)
1352         ], ncols=8 )
1353 
1354 _common_sc_shared= {"title": "Shared Energy SimCluster To Layer Cluster in z-",
1355                  "stat": False,
1356                  "legend": False,
1357                 }
1358 _common_sc_shared.update(_legend_common)
1359 _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)]
1360 _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)])
1361 _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)])
1362 _sharedEnergy_simcluster_to_layercluster_zminus = PlotGroup("sharedEnergy_simcluster_to_layercluster_zminus", _shared_sc_plots_zminus, ncols=8)
1363 
1364 _common_sc_shared= {"title": "Shared Energy Layer Cluster To SimCluster in z-",
1365                  "stat": False,
1366                  "legend": False,
1367                 }
1368 _common_sc_shared.update(_legend_common)
1369 _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)]
1370 _common_sc_shared= {"title": "Shared Energy Layer Cluster To Best SimCluster in z-",
1371                  "stat": False,
1372                  "legend": False,
1373                  "ymin": 0,
1374                  "ymax": 1
1375                 }
1376 _common_sc_shared.update(_legend_common)
1377 _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)])
1378 _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)])
1379 _sharedEnergy_layercluster_to_simcluster_zminus = PlotGroup("sharedEnergy_layercluster_to_simcluster_zminus", _shared_plots2_sc_zminus, ncols=8)
1380 
1381 _bin_count = 0
1382 _xbinlabels = [ "L{:02d}".format(i+1) for i in range(0,maxlayerzm) ]
1383 _common_eff = {"stat": False, "legend": False}
1384 _effplots_sc_zminus_eta = [Plot("effic_eta_layer{:02d}".format(i), xtitle="", **_common_eff) for i in range(0,maxlayerzm)]
1385 _effplots_sc_zminus_phi = [Plot("effic_phi_layer{:02d}".format(i), xtitle="", **_common_eff) for i in range(0,maxlayerzm)]
1386 _common_eff = {"stat": False, "legend": False, "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloptions": "v"}
1387 _common_eff["xmin"] = _bin_count
1388 _common_eff["xmax"] = maxlayerzm
1389 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1390 _effplots_sc_zminus = [Plot("globalEfficiencies_zminus", xtitle="Global Efficiencies in z-", **_common_eff)]
1391 _efficiencies_sc_zminus_eta = PlotGroup("Efficiencies_vs_eta_zminus", _effplots_sc_zminus_eta, ncols=10)
1392 _efficiencies_sc_zminus_phi = PlotGroup("Efficiencies_vs_phi_zminus", _effplots_sc_zminus_phi, ncols=10)
1393 _efficiencies_sc_zminus     = PlotGroup("Eff_Dup_Fake_Merge_Global_zminus", _effplots_sc_zminus, ncols=4)
1394 
1395 _common_dup = {"stat": False, "legend": False}
1396 _dupplots_sc_zminus_eta = [Plot("duplicate_eta_layer{:02d}".format(i), xtitle="", **_common_dup) for i in range(0,maxlayerzm)]
1397 _dupplots_sc_zminus_phi = [Plot("duplicate_phi_layer{:02d}".format(i), xtitle="", **_common_dup) for i in range(0,maxlayerzm)]
1398 _common_dup = {"stat": False, "legend": False, "title": "Global Duplicates in z-", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloptions": "v"}
1399 _common_dup["xmin"] = _bin_count
1400 _common_dup["xmax"] = _common_dup["xmin"] + maxlayerzm
1401 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1402 _dupplots_sc_zminus = [Plot("globalDublicates_zminus", xtitle="Global Duplicates in z-", **_common_dup)]
1403 _duplicates_sc_zminus_eta = PlotGroup("Duplicates_vs_eta_zminus", _dupplots_sc_zminus_eta, ncols=10)
1404 _duplicates_sc_zminus_phi = PlotGroup("Duplicates_vs_phi_zminus", _dupplots_sc_zminus_phi, ncols=10)
1405 _duplicates_sc_zminus     = PlotGroup("Eff_Dup_Fake_Merge_Global_zminus", _dupplots_sc_zminus, ncols=4)
1406 
1407 _common_fake = {"stat": False, "legend": False}
1408 _fakeplots_sc_zminus_eta = [Plot("fake_eta_layer{:02d}".format(i), xtitle="", **_common_fake) for i in range(0,maxlayerzm)]
1409 _fakeplots_sc_zminus_phi = [Plot("fake_phi_layer{:02d}".format(i), xtitle="", **_common_fake) for i in range(0,maxlayerzm)]
1410 _common_fake = {"stat": False, "legend": False, "title": "Global Fake Rates in z-", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloptions": "v"}
1411 _common_fake["xmin"] = _bin_count
1412 _common_fake["xmax"] = _common_fake["xmin"] + maxlayerzm
1413 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1414 _common_fake["xbinlabels"] = [ "L{:02d}".format(i+1) for i in range(0,maxlayerzm) ]
1415 _common_fake["xbinlabelsize"] = 10.
1416 _fakeplots_sc_zminus = [Plot("globalFakes_zminus", xtitle="Global Fake Rate in z-", **_common_fake)]
1417 _fakes_sc_zminus_eta = PlotGroup("FakeRate_vs_eta_zminus", _fakeplots_sc_zminus_eta, ncols=10)
1418 _fakes_sc_zminus_phi = PlotGroup("FakeRate_vs_phi_zminus", _fakeplots_sc_zminus_phi, ncols=10)
1419 _fakes_sc_zminus     = PlotGroup("Eff_Dup_Fake_Merge_Global_zminus", _fakeplots_sc_zminus, ncols=4)
1420 
1421 _common_merge = {"stat": False, "legend": False}
1422 _mergeplots_sc_zminus_eta = [Plot("merge_eta_layer{:02d}".format(i), xtitle="", **_common_merge) for i in range(0,maxlayerzm)]
1423 _mergeplots_sc_zminus_phi = [Plot("merge_phi_layer{:02d}".format(i), xtitle="", **_common_merge) for i in range(0,maxlayerzm)]
1424 _common_merge = {"stat": False, "legend": False, "title": "Global Merge Rates in z-", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloptions": "v"}
1425 _common_merge["xmin"] = _bin_count
1426 _common_merge["xmax"] = _common_merge["xmin"] + maxlayerzm
1427 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1428 _common_merge["xbinlabels"] = [ "L{:02d}".format(i+1) for i in range(0,maxlayerzm) ]
1429 _common_merge["xbinlabelsize"] = 10.
1430 _mergeplots_sc_zminus = [Plot("globalMergeRate_zminus", xtitle="Global merge Rate in z-", **_common_merge)]
1431 _merges_sc_zminus_eta = PlotGroup("MergeRate_vs_eta_zminus", _mergeplots_sc_zminus_eta, ncols=10)
1432 _merges_sc_zminus_phi = PlotGroup("MergeRate_vs_phi_zminus", _mergeplots_sc_zminus_phi, ncols=10)
1433 _merges_sc_zminus     = PlotGroup("Eff_Dup_Fake_Merge_Global_zminus", _mergeplots_sc_zminus, ncols=4)
1434 
1435 _common_energy_score = dict(removeEmptyBins=False, xbinlabelsize=10,
1436     stat=True,
1437     xbinlabeloption="d",
1438     ncols=1,
1439     ylog=True,
1440     xlog=True,
1441     xmin=0.001,
1442     xmax=1.,
1443     ymin=0.01,
1444     ymax=1.)
1445 _energyscore_sc2lc_zminus = PlotGroup("Energy_vs_Score_SC2LC_zminus", [Plot("Energy_vs_Score_simcluster2layer_perlayer{:02d}".format(i), title="Energy_vs_Score_SC2LC",
1446                                                      xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_energy_score) for i in range(0, maxlayerzm)
1447                                                      ], ncols=10)
1448 
1449 _energyscore_sc2lc_zplus = PlotGroup("Energy_vs_Score_SC2LC_zplus", [Plot("Energy_vs_Score_simcluster2layer_perlayer{:02d}".format(i), title="Energy_vs_Score_SC2LC",
1450                                                      xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_energy_score) for i in range(maxlayerzm,maxlayerzp)
1451                                                      ], ncols=10)
1452 
1453 _common_energy_score["xlog"]=False
1454 _common_energy_score["ylog"]=False
1455 _common_energy_score["xmin"]=-0.1
1456 _energyscore_lc2sc_zminus = PlotGroup("Energy_vs_Score_LC2SC_zminus", [Plot("Energy_vs_Score_layer2simcluster_perlayer{:02d}".format(i), title="Energy_vs_Score_LC2SC",
1457                                                      xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_energy_score) for i in range(0, maxlayerzm)
1458                                                      ], ncols=10)
1459 _energyscore_lc2sc_zplus = PlotGroup("Energy_vs_Score_LC2SC_zplus", [Plot("Energy_vs_Score_layer2simcluster_perlayer{:02d}".format(i), title="Energy_vs_Score_LC2SC",
1460                                                      xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_energy_score) for i in range(maxlayerzm,maxlayerzp)
1461                                                      ], ncols=10)
1462 
1463 #--------------------------------------------------------------------------------------------
1464 # z+
1465 #--------------------------------------------------------------------------------------------
1466 _common_sc_score = {"title": "Score SimCluster to LayerClusters in z+",
1467                  "stat": False,
1468                  "ymin": 0.1,
1469                  "ymax": 1000,
1470                  "xmin": 0,
1471                  "xmax": 1,
1472                  "drawStyle": "hist",
1473                  "lineWidth": 1,
1474                  "ylog": True
1475                 }
1476 _common_sc_score.update(_legend_common)
1477 _score_simcluster_to_layerclusters_zplus = PlotGroup("score_simcluster_to_layercluster_zplus", [
1478         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)
1479         ], ncols=10 )
1480 
1481 _common_sc_score = {"title": "Score LayerCluster to SimClusters in z+",
1482                  "stat": False,
1483                  "ymin": 0.1,
1484                  "ymax": 1000,
1485                  "xmin": 0,
1486                  "xmax": 1,
1487                  "drawStyle": "hist",
1488                  "lineWidth": 1,
1489                  "ylog": True
1490                 }
1491 _common_sc_score.update(_legend_common)
1492 _score_layercluster_to_simclusters_zplus = PlotGroup("score_layercluster_to_simcluster_zplus", [
1493         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)
1494         ], ncols=8 )
1495 
1496 _common_sc_shared= {"title": "Shared Energy SimCluster To Layer Cluster in z+",
1497                  "stat": False,
1498                  "legend": False,
1499                 }
1500 _common_sc_shared.update(_legend_common)
1501 _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)]
1502 _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)])
1503 _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)])
1504 _sharedEnergy_simcluster_to_layercluster_zplus = PlotGroup("sharedEnergy_simcluster_to_layercluster_zplus", _shared_sc_plots_zplus, ncols=8)
1505 
1506 _common_sc_shared= {"title": "Shared Energy Layer Cluster To SimCluster in z+",
1507                  "stat": False,
1508                  "legend": False,
1509                 }
1510 _common_sc_shared.update(_legend_common)
1511 _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)]
1512 _common_sc_shared= {"title": "Shared Energy Layer Cluster To Best SimCluster in z+",
1513                  "stat": False,
1514                  "legend": False,
1515                  "ymin": 0,
1516                  "ymax": 1,
1517                 }
1518 _common_sc_shared.update(_legend_common)
1519 _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)])
1520 _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)])
1521 _sharedEnergy_layercluster_to_simcluster_zplus = PlotGroup("sharedEnergy_layercluster_to_simcluster_zplus", _shared_plots2_sc_zplus, ncols=8)
1522 
1523 
1524 _bin_count = maxlayerzm
1525 _common_eff = {"stat": False, "legend": False}
1526 _effplots_sc_zplus_eta = [Plot("effic_eta_layer{:02d}".format(i), xtitle="", **_common_eff) for i in range(maxlayerzm,maxlayerzp)]
1527 _effplots_sc_zplus_phi = [Plot("effic_phi_layer{:02d}".format(i), xtitle="", **_common_eff) for i in range(maxlayerzm,maxlayerzp)]
1528 _common_eff = {"stat": False, "legend": False, "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloptions": "v"}
1529 _common_eff["xmin"] = _bin_count
1530 _common_eff["xmax"] = _common_eff["xmin"] + maxlayerzm
1531 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1532 _effplots_sc_zplus = [Plot("globalEfficiencies_zplus", xtitle="Global Efficiencies in z+", **_common_eff)]
1533 _efficiencies_sc_zplus_eta = PlotGroup("Efficiencies_vs_eta_zplus", _effplots_sc_zplus_eta, ncols=10)
1534 _efficiencies_sc_zplus_phi = PlotGroup("Efficiencies_vs_phi_zplus", _effplots_sc_zplus_phi, ncols=10)
1535 _efficiencies_sc_zplus = PlotGroup("Eff_Dup_Fake_Merge_Global_zplus", _effplots_sc_zplus, ncols=4)
1536 
1537 _common_dup = {"stat": False, "legend": False}
1538 _dupplots_sc_zplus_eta = [Plot("duplicate_eta_layer{:02d}".format(i), xtitle="", **_common_dup) for i in range(maxlayerzm,maxlayerzp)]
1539 _dupplots_sc_zplus_phi = [Plot("duplicate_phi_layer{:02d}".format(i), xtitle="", **_common_dup) for i in range(maxlayerzm,maxlayerzp)]
1540 _common_dup = {"stat": False, "legend": False, "title": "Global Duplicates in z+", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloptions": "v"}
1541 _common_dup["xmin"] = _bin_count
1542 _common_dup["xmax"] = _common_dup["xmin"] + maxlayerzm
1543 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1544 _dupplots_sc_zplus = [Plot("globalDuplicates_zplus", xtitle="Global Duplicates in z+", **_common_dup)]
1545 _duplicates_sc_zplus_eta = PlotGroup("Duplicates_vs_eta_zplus", _dupplots_sc_zplus_eta, ncols=10)
1546 _duplicates_sc_zplus_phi = PlotGroup("Duplicates_vs_phi_zplus", _dupplots_sc_zplus_phi, ncols=10)
1547 _duplicates_sc_zplus = PlotGroup("Eff_Dup_Fake_Merge_Global_zplus", _dupplots_sc_zplus, ncols=4)
1548 
1549 _common_fake = {"stat": False, "legend": False}
1550 _fakeplots_sc_zplus_eta = [Plot("fake_eta_layer{:02d}".format(i), xtitle="", **_common_fake) for i in range(maxlayerzm,maxlayerzp)]
1551 _fakeplots_sc_zplus_phi = [Plot("fake_phi_layer{:02d}".format(i), xtitle="", **_common_fake) for i in range(maxlayerzm,maxlayerzp)]
1552 _common_fake = {"stat": False, "legend": False, "title": "Global Fake Rates in z+", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloptions": "v"}
1553 _common_fake["xmin"] = _bin_count
1554 _common_fake["xmax"] = _common_fake["xmin"] + maxlayerzm
1555 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1556 _fakeplots_sc_zplus = [Plot("globalFakeRate_zplus", xtitle="Global Fake Rate in z+", **_common_fake)]
1557 _fakes_sc_zplus_eta = PlotGroup("FakeRate_vs_eta_zplus", _fakeplots_sc_zplus_eta, ncols=10)
1558 _fakes_sc_zplus_phi = PlotGroup("FakeRate_vs_phi_zplus", _fakeplots_sc_zplus_phi, ncols=10)
1559 _fakes_sc_zplus = PlotGroup("Eff_Dup_Fake_Merge_Global_zplus", _fakeplots_sc_zplus, ncols=4)
1560 
1561 _common_merge = {"stat": False, "legend": False}
1562 _mergeplots_sc_zplus_eta = [Plot("merge_eta_layer{:02d}".format(i), xtitle="", **_common_merge) for i in range(maxlayerzm,maxlayerzp)]
1563 _mergeplots_sc_zplus_phi = [Plot("merge_phi_layer{:02d}".format(i), xtitle="", **_common_merge) for i in range(maxlayerzm,maxlayerzp)]
1564 _common_merge = {"stat": False, "legend": False, "title": "Global Merge Rates in z+", "xbinlabels": _xbinlabels, "xbinlabelsize": 12, "xbinlabeloptions": "v"}
1565 _common_merge["xmin"] = _bin_count
1566 _common_merge["xmax"] = _common_merge["xmin"] + maxlayerzm
1567 _bin_count += 4*maxlayerzm # 2 for the eta{-,+} and 2 for phi{+,-}
1568 _mergeplots_sc_zplus = [Plot("globalMergeRate_zplus", xtitle="Global merge Rate in z+", **_common_merge)]
1569 _merges_sc_zplus_eta = PlotGroup("MergeRate_vs_eta_zplus", _mergeplots_sc_zplus_eta, ncols=10)
1570 _merges_sc_zplus_phi = PlotGroup("MergeRate_vs_phi_zplus", _mergeplots_sc_zplus_phi, ncols=10)
1571 _merges_sc_zplus = PlotGroup("Eff_Dup_Fake_Merge_Global_zplus", _mergeplots_sc_zplus, ncols=4)
1572 
1573 #Just in case we add some plots below to be on the safe side.
1574 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65 }
1575 
1576 #--------------------------------------------------------------------------------------------
1577 # TRACKSTERS
1578 #--------------------------------------------------------------------------------------------
1579 _common_score = {"stat": False, "legend": False
1580                  ,"ymin": 0.1
1581                  ,"ymax": 100000
1582                  ,"xmin": 0
1583                  #,"xmax": 1.0
1584                  ,"drawStyle": "hist"
1585                  ,"lineWidth": 1
1586                  ,"ylog": True
1587                  ,"xlog": True
1588                  ,"xtitle": "Default"
1589                 }
1590 _common_score.update(_legend_common)
1591 
1592 score_to_trackster = ["","Pur","Dupl"]
1593 _score_caloparticle_to_tracksters = PlotGroup("ScoreCaloParticlesToTracksters", [], ncols=len(score_to_trackster))
1594 _score_simtrackster_to_tracksters = PlotGroup("ScoreSimTrackstersToTracksters", [], ncols=len(score_to_trackster))
1595 for score in score_to_trackster:
1596     _score_caloparticle_to_tracksters.append(Plot("Score"+score+"_caloparticle2trackster", **_common_score))
1597     _score_simtrackster_to_tracksters.append(Plot("Score"+score+"_simtrackster2trackster", **_common_score))
1598 
1599 score_trackster_to = ["","Fake","Merge"]
1600 _score_trackster_to_caloparticles = PlotGroup("ScoreTrackstersToCaloParticles", [], ncols=len(score_trackster_to))
1601 _score_trackster_to_simtracksters = PlotGroup("ScoreTrackstersToSimTracksters", [], ncols=len(score_trackster_to))
1602 for score in score_trackster_to:
1603     _score_trackster_to_caloparticles.append(Plot("Score"+score+"_trackster2caloparticle", **_common_score))
1604     _score_trackster_to_simtracksters.append(Plot("Score"+score+"_trackster2simtrackster", **_common_score))
1605 
1606 
1607 _common_shared = {"stat": False, "legend": False, "xtitle": 'Default', "ytitle": 'Default'}
1608 _common_shared.update(_legend_common)
1609 _common_energy_score = dict(removeEmptyBins=True, xbinlabelsize=10, xbinlabeloption="d", drawStyle="COLZ", adjustMarginRight=0.1, legend=False, xtitle='Default', ytitle='Default')
1610 #_common_energy_score["ymax"] = 1.
1611 #_common_energy_score["xmax"] = 1.0
1612 
1613 _sharedEnergy_to_trackster = []
1614 _sharedEnergy_trackster_to = []
1615 versions = ["", "_assoc", "_assoc_vs_eta", "_assoc_vs_phi"]
1616 
1617 _energyscore_to_trackster = []
1618 _energyscore_trackster_to = []
1619 en_vs_score = ["","best","secBest"]
1620 for val in simDict:
1621     _sharedEnergy_to_trackster.append(PlotGroup("SharedEnergy_"+val+"ToTrackster", [], ncols=2))
1622     print("appending plot group", "SharedEnergy_"+val+"ToTrackster")
1623     _sharedEnergy_trackster_to.append(PlotGroup("SharedEnergy_TracksterTo"+val, [], ncols=2))
1624     print("appending plot group", "SharedEnergy_TracksterTo"+val)
1625     for ver in versions:
1626         _sharedEnergy_to_trackster[-1].append(Plot("SharedEnergy_"+val+"2trackster"+ver, **_common_shared))
1627         print("appending plot ", "SharedEnergy_"+val+"2trackster"+ver)
1628         _sharedEnergy_trackster_to[-1].append(Plot("SharedEnergy_trackster2"+val+ver, **_common_shared))
1629         print("appending plot ", "SharedEnergy_trackster2"+val+ver)
1630 
1631     _energyscore_to_trackster.append(PlotGroup("Energy_vs_Score_"+val+"ToTracksters", [], ncols=len(en_vs_score)))
1632     _energyscore_trackster_to.append(PlotGroup("Energy_vs_Score_TrackstersTo"+val, [], ncols=len(en_vs_score)))
1633     for ver in en_vs_score:
1634         _energyscore_to_trackster[-1].append(Plot("Energy_vs_Score_"+val+"2"+ver+"Trackster", **_common_energy_score))
1635         print("appending plot ", "Energy_vs_Score_"+val+"2"+ver+"Trackster")
1636         _energyscore_trackster_to[-1].append(Plot("Energy_vs_Score_trackster2"+ver+val, **_common_energy_score))
1637         print("appending plot ", "Energy_vs_Score_trackster2"+ver+val)
1638 _common_assoc = {#"title": "Cell Association Table",
1639                  "stat": False,
1640                  "legend": False,
1641                  "xbinlabels": ["", "TN(pur)", "FN(ineff.)", "FP(fake)", "TP(eff)"],
1642                  "xbinlabeloption": "h",
1643                  "drawStyle": "hist",
1644                  "ymin": 0.1,
1645                  "ymax": 10000000,
1646                  "ylog": True}
1647 _common_assoc.update(_legend_common)
1648 _cell_association_table = PlotGroup("cellAssociation_table", [
1649         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)
1650         ], ncols=8 )
1651 
1652 # Trackster plots
1653 _common_metric = {"stat": False, "legend": False, "xbinlabelsize": 14, "xbinlabeloption": "d", "ymin": 0.0, "ymax": 1.1}
1654 _common_metric_logx = _common_metric.copy()
1655 _common_metric_logx["xlog"] = True
1656 
1657 _efficiencies = []
1658 _purities = []
1659 _duplicates = []
1660 _fakes = []
1661 _merges = []
1662 for val in simDict:
1663     _effplots = [Plot("globalEfficiencies", xtitle="", **_common_metric)]
1664     _purityplots = [Plot("globalEfficiencies", xtitle="", **_common_metric)]
1665     _dupplots = [Plot("globalEfficiencies", xtitle="", **_common_metric)]
1666     _fakeplots = [Plot("globalEfficiencies", xtitle="", **_common_metric)]
1667     _mergeplots = [Plot("globalEfficiencies", xtitle="", **_common_metric)]
1668 
1669     for v in variables:
1670         kwargs = _common_metric_logx if v in ["energy","pt"] else _common_metric
1671         _effplots.extend([Plot("effic_"+v+simDict[val], xtitle = variables[v][0]+variables[v][1], **kwargs)])
1672         print("appending plot", "effic_"+v+simDict[val])
1673         _purityplots.extend([Plot("purity_"+v+simDict[val], xtitle = variables[v][0]+variables[v][1], **kwargs)])
1674         print("appending plot", "purity_"+v+simDict[val])
1675         _dupplots.extend([Plot("duplicate_"+v+simDict[val], xtitle = variables[v][0]+variables[v][1], **kwargs)])
1676         print("appending plot", "duplicate_"+v+simDict[val])
1677         _fakeplots.extend([Plot("fake_"+v+simDict[val], xtitle = variables[v][0]+variables[v][1], **kwargs)])
1678         print("appending plot", "fake_"+v+simDict[val])
1679         _mergeplots.extend([Plot("merge_"+v+simDict[val], xtitle = variables[v][0]+variables[v][1], **kwargs)])
1680         print("appending plot", "merge_"+v+simDict[val])
1681 
1682     _efficiencies.append(PlotGroup("Efficiencies"+simDict[val], _effplots, ncols=3))
1683     print("appending plot group", "Efficiencies"+simDict[val])
1684     _purities.append(PlotGroup("Purities"+simDict[val], _purityplots, ncols=3))
1685     print("appending plot group", "Purities"+simDict[val])
1686     _duplicates.append(PlotGroup("Duplicates"+simDict[val], _dupplots, ncols=3))
1687     _fakes.append(PlotGroup("FakeRate"+simDict[val], _fakeplots, ncols=3))
1688     _merges.append(PlotGroup("MergeRate"+simDict[val], _mergeplots, ncols=3))
1689 
1690 
1691 #Coming back to the usual box definition
1692 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65, "xtitle": "Default"}
1693 
1694 _tottracksternum = PlotGroup("TotalNumberofTracksters", [
1695   Plot("tottracksternum", **_common)
1696 ],ncols=1)
1697 
1698 _trackster_layernum_plots = [Plot("trackster_firstlayer", **_common)]
1699 _trackster_layernum_plots.extend([Plot("trackster_lastlayer", **_common)])
1700 _trackster_layernum_plots.extend([Plot("trackster_layersnum", **_common)])
1701 _trackster_layernum = PlotGroup("LayerNumbersOfTrackster", _trackster_layernum_plots, ncols=3)
1702 
1703 _common["xmax"] = 150
1704 _clusternum_in_trackster = PlotGroup("NumberofLayerClustersinTrackster",[
1705   Plot("clusternum_in_trackster", **_common)
1706 ],ncols=1)
1707 
1708 _common = {"stat": True, "drawStyle": "pcolz", "staty": 0.65, "xtitle": "Default", "ytitle": "Default"}
1709 
1710 _clusternum_in_trackster_vs_layer = PlotGroup("NumberofLayerClustersinTracksterPerLayer",[
1711   Plot("clusternum_in_trackster_vs_layer", **_common)
1712 ],ncols=1)
1713 
1714 _common["scale"] = 100.
1715 #, ztitle = "% of clusters" normalizeToUnitArea=True
1716 _multiplicity_numberOfEventsHistogram = hgcVal_dqm + "ticlTrackstersMerge/multiplicity_numberOfEventsHistogram"
1717 _multiplicity_zminus_numberOfEventsHistogram = hgcVal_dqm + "ticlTrackstersMerge/multiplicity_zminus_numberOfEventsHistogram"
1718 _multiplicity_zplus_numberOfEventsHistogram = hgcVal_dqm + "ticlTrackstersMerge/multiplicity_zplus_numberOfEventsHistogram"
1719 
1720 _multiplicityOfLCinTST_plots = [Plot("multiplicityOfLCinTST",
1721                                 drawCommand = "colz text45", normalizeToNumberOfEvents = True, **_common)]
1722 _multiplicityOfLCinTST_plots.extend([Plot("multiplicityOfLCinTST_vs_layerclusterenergy",
1723                                 drawCommand = "colz text45", normalizeToNumberOfEvents = True, **_common)])
1724 _multiplicityOfLCinTST_plots.extend([Plot("multiplicityOfLCinTST_vs_layercluster_zplus",
1725                                 drawCommand = "colz text45", normalizeToNumberOfEvents = True, **_common)])
1726 _multiplicityOfLCinTST_plots.extend([Plot("multiplicityOfLCinTST_vs_layercluster_zminus",
1727                                 drawCommand = "colz text45", normalizeToNumberOfEvents = True, **_common)])
1728 _multiplicityOfLCinTST = PlotGroup("MultiplicityofLCinTST", _multiplicityOfLCinTST_plots, ncols=2)
1729 
1730 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65}
1731 #--------------------------------------------------------------------------------------------
1732 # z-
1733 #--------------------------------------------------------------------------------------------
1734 _clusternum_in_trackster_perlayer_zminus_EE = PlotGroup("NumberofLayerClustersinTracksterPerLayer_zminus_EE", [
1735   Plot("clusternum_in_trackster_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm)
1736 ], ncols=7)
1737 
1738 _clusternum_in_trackster_perlayer_zminus_FH = PlotGroup("NumberofLayerClustersinTracksterPerLayer_zminus_FH", [
1739   Plot("clusternum_in_trackster_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzm,lastLayerFHzm)
1740 ], ncols=7)
1741 
1742 _clusternum_in_trackster_perlayer_zminus_BH = PlotGroup("NumberofLayerClustersinTracksterPerLayer_zminus_BH", [
1743   Plot("clusternum_in_trackster_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzm,maxlayerzm)
1744 ], ncols=7)
1745 
1746 #--------------------------------------------------------------------------------------------
1747 # z+
1748 #--------------------------------------------------------------------------------------------
1749 _clusternum_in_trackster_perlayer_zplus_EE = PlotGroup("NumberofLayerClustersinTracksterPerLayer_zplus_EE", [
1750   Plot("clusternum_in_trackster_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(maxlayerzm,lastLayerEEzp)
1751 ], ncols=7)
1752 
1753 _clusternum_in_trackster_perlayer_zplus_FH = PlotGroup("NumberofLayerClustersinTracksterPerLayer_zplus_FH", [
1754   Plot("clusternum_in_trackster_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerEEzp,lastLayerFHzp)
1755 ], ncols=7)
1756 
1757 _clusternum_in_trackster_perlayer_zplus_BH = PlotGroup("NumberofLayerClustersinTracksterPerLayer_zplus_BH", [
1758   Plot("clusternum_in_trackster_perlayer{:02d}".format(i), xtitle="", **_common) for i in range(lastLayerFHzp,maxlayerzp)
1759 ], ncols=7)
1760 
1761 # Coming back to the usual box definition
1762 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65, "xtitle": "Default"}
1763 
1764 # Some tracksters quantities
1765 _trackster_eppe_plots = [Plot("trackster_eta", **_common)]
1766 _trackster_eppe_plots.extend([Plot("trackster_phi", **_common)])
1767 _trackster_eppe_plots.extend([Plot("trackster_pt", **_common)])
1768 _trackster_eppe_plots.extend([Plot("trackster_energy", **_common)])
1769 _trackster_eppe = PlotGroup("EtaPhiPtEnergy", _trackster_eppe_plots, ncols=2)
1770 
1771 _trackster_xyz_plots = [Plot("trackster_x", **_common)]
1772 _trackster_xyz_plots.extend([Plot("trackster_y", **_common)])
1773 _trackster_xyz_plots.extend([Plot("trackster_z", **_common)])
1774 _trackster_xyz = PlotGroup("XYZ", _trackster_xyz_plots, ncols=3)
1775 
1776 #--------------------------------------------------------------------------------------------
1777 # CANDIDATES
1778 #--------------------------------------------------------------------------------------------
1779 
1780 # all candidates
1781 cand_plots_names = ["N of tracksters in candidate", "Candidates PDG Id", "Candidates charge", "Candidates type"]
1782 _candidate_nts_plots = []
1783 for name in cand_plots_names:
1784     _candidate_nts_plots.extend([Plot(name, **_common)])
1785 _candidatesPlots1 = PlotGroup("General_plots_pid_type", _candidate_nts_plots, ncols=2)
1786 
1787 cand_plots_names = ["Candidates pT", "Candidates raw energy", "Candidates regressed energy"]
1788 _candidate_nts_plots = []
1789 for name in cand_plots_names:
1790     _candidate_nts_plots.extend([Plot(name, **_common)])
1791 _candidatesPlots2 = PlotGroup("General_plots_pt_energy", _candidate_nts_plots, ncols=3)
1792 
1793 _candidatesPlots = [_candidatesPlots1, _candidatesPlots2]
1794 
1795 # divided by candidate's type
1796 cand_type = ["charged_hadrons", "electrons", "muons", "neutral_hadrons", "neutral_pions", "photons"]
1797 cand_plots_names = [" candidates PDG Id", " candidates charge", " candidates type"]
1798 cand_plots_names_den = ["den_fake_cand_vs_energy_", "den_fake_cand_vs_eta_", "den_fake_cand_vs_phi_", "den_fake_cand_vs_pt_"]
1799 
1800 _all_cand_type_plots = []
1801 for ct in cand_type:
1802     cand_type_plots = [Plot("N of tracksters in candidate for "+ct, title="N of tracksters in candidate for "+ct.replace("_", " "), **_common)]
1803     for name in cand_plots_names:
1804         cand_type_plots.extend([Plot(ct+name, title=ct.replace("_", " ")+name, **_common)])
1805     _all_cand_type_plots.append(cand_type_plots)
1806 
1807 _all_cand_ene_plots = []
1808 for ct in cand_type:
1809     name = "candidates regressed energy"
1810     cand_type_plots = [Plot(ct+name, title=ct.replace("_", " ")+" "+name, **_common)]
1811     for name in cand_plots_names_den:
1812         cand_type_plots.extend([Plot(name+ct, title=ct.replace("_", " ")+" candidates "+name.replace("den_fake_cand_vs_", "").replace("_", ""), **_common)])
1813     _all_cand_ene_plots.append(cand_type_plots)
1814 
1815 #efficiency and fake
1816 _common_eff_fake = {"stat": False, "legend": False, "xbinlabelsize": 14, "xtitle": "Default", "xbinlabeloption": "d", "ymin": 0.0, "ymax": 1.1}
1817 _all_cand_eff_plots = []
1818 for ct in cand_type:
1819     cand_eff_plots = []
1820     for var in ["pt", "energy", "eta", "phi"]:
1821         for cut in ["track", "pid", "energy"]:
1822             cand_eff_plots.extend([Plot("eff_"+ct+"_"+cut+"_"+var, title=cut + " efficiency for "+ct.replace("_", " ")+" vs "+var, ytitle="Efficiency", **_common_eff_fake)])
1823     _all_cand_eff_plots.append(cand_eff_plots)
1824 
1825 _all_cand_fake_plots = []
1826 for ct in cand_type:
1827     cand_fake_plots = []
1828     for var in ["pt", "energy", "eta", "phi"]:
1829         for cut in ["track", "pid", "energy"]:
1830             cand_fake_plots.extend([Plot("fake_"+ct+"_"+cut+"_"+var, title=cut + " fake rate for "+ct.replace("_", " ")+" vs "+var, ytitle="Fake rate", **_common_eff_fake)])
1831     _all_cand_fake_plots.append(cand_fake_plots)
1832 
1833 _allCandidatesPlots = [[],[],[],[],[],[]]
1834 for i in range(6):
1835     _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)])
1836 
1837 #--------------------------------------------------------------------------------------------
1838 # SIMHITS, DIGIS, RECHITS
1839 #--------------------------------------------------------------------------------------------
1840 
1841 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65, "ymin": 0.1, "ylog": True}
1842 
1843 _HitValidation = PlotGroup("HitValidation", [
1844                                              Plot("heeEnSim", title="SimHits_EE_Energy", **_common),
1845                                              Plot("hebEnSim", title="SimHits_HE_Silicon_Energy", **_common),
1846                                              Plot("hefEnSim", title="SimHits_HE_Scintillator_Energy", **_common),
1847                                              ])
1848 
1849 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65}
1850 
1851 _Occupancy_EE_zplus = PlotGroup("Occupancy_EE_zplus", [Plot("HitOccupancy_Plus_layer_{:02d}".format(i), title="Occupancy_EE_zplus",
1852                                                         xtitle="Layer {}".format(i), **_common) for i in range(EE_min,EE_max+1)
1853                                                         ], ncols=7)
1854 
1855 _Occupancy_HE_Silicon_zplus = PlotGroup("Occupancy_HE_Silicon_zplus", [Plot("HitOccupancy_Plus_layer_{:02d}".format(i), title="Occupancy_HE_zplus",
1856                                                                        xtitle="Layer {}".format(i), **_common) for i in range(HESilicon_min,HESilicon_max+1)
1857                                                                        ], ncols=7)
1858 
1859 _Occupancy_HE_Scintillator_zplus = PlotGroup("Occupancy_HE_Scintillator_zplus", [Plot("HitOccupancy_Plus_layer_{:02d}".format(i), title="Occupancy_HE_Scintillator_zplus",
1860                                                                                          xtitle="Layer {}".format(i), **_common) for i in range(HEScintillator_min,HEScintillator_max+1)
1861                                                                                          ], ncols=7)
1862 
1863 _Occupancy_EE_zminus = PlotGroup("Occupancy_EE_zminus", [Plot("HitOccupancy_Minus_layer_{:02d}".format(i), title="Occupancy_EE_zminus",
1864                                                          xtitle="Layer {}".format(i), **_common) for i in range(EE_min,EE_max+1)
1865                                                          ], ncols=7)
1866 
1867 _Occupancy_HE_Silicon_zminus = PlotGroup("Occupancy_HE_Silicon_zminus", [Plot("HitOccupancy_Minus_layer_{:02d}".format(i), title="Occupancy_HE_Silicon_zminus",
1868                                                                          xtitle="Layer {}".format(i), **_common) for i in range(HESilicon_min,HESilicon_max+1)
1869                                                                          ], ncols=7)
1870 
1871 _Occupancy_HE_Scintillator_zminus = PlotGroup("Occupancy_HE_Scintillator_zminus", [Plot("HitOccupancy_Minus_layer_{:02d}".format(i), title="Occupancy_HE_Scintillator_zminus",
1872                                                                                    xtitle="Layer {}".format(i), **_common) for i in range(HEScintillator_min,HEScintillator_max+1)
1873                                                                                    ], ncols=7)
1874 
1875 _common_etaphi = dict(removeEmptyBins=False, xbinlabelsize=10, xbinlabeloption="d", ymin=None)
1876 
1877 _EtaPhi_EE_zplus = PlotGroup("EtaPhi_EE_zplus", [Plot("EtaPhi_Plus_layer_{:02d}".format(i), title="EtaPhi_EE_zplus",
1878                                                      xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_etaphi) for i in range(EE_min,EE_max+1)
1879                                                      ], ncols=7)
1880 
1881 _EtaPhi_HE_Silicon_zplus = PlotGroup("EtaPhi_HE_Silicon_zplus", [Plot("EtaPhi_Plus_layer_{:02d}".format(i), title="EtaPhi_HE_Silicon_zplus",
1882                                                      xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_etaphi) for i in range(HESilicon_min,HESilicon_max+1)
1883                                                      ], ncols=7)
1884 
1885 _EtaPhi_HE_Scintillator_zplus = PlotGroup("EtaPhi_HE_Scintillator_zplus", [Plot("EtaPhi_Plus_layer_{:02d}".format(i), title="EtaPhi_HE_Scintillator_zplus",
1886                                                      xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_etaphi) for i in range(HEScintillator_min,HEScintillator_max+1)
1887                                                      ], ncols=7)
1888 
1889 _EtaPhi_EE_zminus = PlotGroup("EtaPhi_EE_zminus", [Plot("EtaPhi_Minus_layer_{:02d}".format(i), title="EtaPhi_EE_zminus",
1890                                                       xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_etaphi) for i in range(EE_min,EE_max+1)
1891                                                       ], ncols=7)
1892 
1893 _EtaPhi_HE_Silicon_zminus = PlotGroup("EtaPhi_HE_Silicon_zminus", [Plot("EtaPhi_Minus_layer_{:02d}".format(i), title="EtaPhi_HE_Silicon_zminus",
1894                                                      xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_etaphi) for i in range(HESilicon_min,HESilicon_max+1)
1895                                                      ], ncols=7)
1896 
1897 _EtaPhi_HE_Scintillator_zminus = PlotGroup("EtaPhi_HE_Scintillator_zminus", [Plot("EtaPhi_Minus_layer_{:02d}".format(i), title="EtaPhi_HE_Scintillator_zminus",
1898                                                      xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_etaphi) for i in range(HEScintillator_min,HEScintillator_max+1)
1899                                                      ], ncols=7)
1900 
1901 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65, "ymin": 0.1, "ylog": True}
1902 
1903 _Energy_EE_0 = PlotGroup("Energy_Time_0_EE", [Plot("energy_time_0_layer_{:02d}".format(i), title="Energy_Time_0_EE",
1904                                               xtitle="Layer {}".format(i), **_common) for i in range(EE_min,EE_max+1)
1905                                               ], ncols=7)
1906 
1907 _Energy_HE_Silicon_0 = PlotGroup("Energy_Time_0_HE_Silicon", [Plot("energy_time_0_layer_{:02d}".format(i), title="Energy_Time_0_HE_Silicon",
1908                                                               xtitle="Layer {}".format(i), **_common) for i in range(HESilicon_min,HESilicon_max+1)
1909                                                               ], ncols=7)
1910 
1911 _Energy_HE_Scintillator_0 = PlotGroup("Energy_Time_0_HE_Scintillator", [Plot("energy_time_0_layer_{:02d}".format(i), title="Energy_Time_0_HE_Scintillator",
1912                                                                         xtitle="Layer {}".format(i), **_common) for i in range(HEScintillator_min,HEScintillator_max+1)
1913                                                                         ], ncols=7)
1914 
1915 _Energy_EE_1 = PlotGroup("Energy_Time_1_EE", [Plot("energy_time_1_layer_{:02d}".format(i), title="Energy_Time_1_EE",
1916                                               xtitle="Layer {}".format(i), **_common) for i in range(EE_min,EE_max+1)
1917                                               ], ncols=7)
1918 
1919 _Energy_HE_Silicon_1 = PlotGroup("Energy_Time_1_HE_Silicon", [Plot("energy_time_1_layer_{:02d}".format(i), title="Energy_Time_1_HE_Silicon",
1920                                                               xtitle="Layer {}".format(i), **_common) for i in range(HESilicon_min,HESilicon_max+1)
1921                                                               ], ncols=7)
1922 
1923 _Energy_HE_Scintillator_1 = PlotGroup("Energy_Time_1_HE_Scintillator", [Plot("energy_time_1_layer_{:02d}".format(i), title="Energy_Time_1_HE_Scintillator",
1924                                                                         xtitle="Layer {}".format(i), **_common) for i in range(HEScintillator_min,HEScintillator_max+1)
1925                                                                         ], ncols=7)
1926 
1927 _Energy_EE = PlotGroup("Energy_EE", [Plot("energy_layer_{:02d}".format(i), title="Energy_EE",
1928                                              xtitle="Layer {}".format(i), **_common) for i in range(EE_min,EE_max+1)
1929                                              ], ncols=7)
1930 
1931 _Energy_HE_Silicon = PlotGroup("Energy_HE_Silicon", [Plot("energy_layer_{:02d}".format(i), title="Energy_HE_Silicon",
1932                                                              xtitle="Layer {}".format(i), **_common) for i in range(HESilicon_min,HESilicon_max+1)
1933                                                              ], ncols=7)
1934 
1935 _Energy_HE_Scintillator = PlotGroup("Energy_HE_Scintillator", [Plot("energy_layer_{:02d}".format(i), title="Energy_HE_Scintillator",
1936                                                                                xtitle="Layer {}".format(i), **_common) for i in range(HEScintillator_min,HEScintillator_max+1)
1937                                                                                ], ncols=7)
1938 
1939 _DigiHits_ADC_EE = PlotGroup("ADC_EE", [Plot("ADC_layer_{:02d}".format(i), title="DigiHits_ADC_EE",
1940                                         xtitle="Layer {}".format(i), **_common) for i in range(EE_min,EE_max+1)
1941                                         ], ncols=7)
1942 
1943 _DigiHits_ADC_HE_Silicon = PlotGroup("ADC_HE_Silicon", [Plot("ADC_layer_{:02d}".format(i), title="DigiHits_ADC_HE_Silicon",
1944                                                        xtitle="Layer {}".format(i), **_common) for i in range(HESilicon_min,HESilicon_max+1)
1945                                                        ], ncols=7)
1946 
1947 _DigiHits_ADC_HE_Scintillator = PlotGroup("ADC_HE_Scintillator", [Plot("ADC_layer_{:02d}".format(i), title="DigiHits_ADC_HE_Scintillator",
1948                                                                   xtitle="Layer {}".format(i), **_common) for i in range(HEScintillator_min,HEScintillator_max+1)
1949                                                                   ], ncols=7)
1950 
1951 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65}
1952 
1953 _DigiHits_Occupancy_EE_zplus = PlotGroup("Occupancy_EE_zplus", [Plot("DigiOccupancy_Plus_layer_{:02d}".format(i), title="DigiHits_Occupancy_EE_zplus",
1954                                                                 xtitle="Layer {}".format(i), **_common) for i in range(EE_min,EE_max+1)
1955                                                                 ], ncols=7)
1956 
1957 _DigiHits_Occupancy_HE_Silicon_zplus = PlotGroup("Occupancy_HE_Silicon_zplus", [Plot("DigiOccupancy_Plus_layer_{:02d}".format(i), title="DigiHits_Occupancy_HE_Silicon_zplus",
1958                                                                                  xtitle="Layer {}".format(i), **_common) for i in range(HESilicon_min,HESilicon_max+1)
1959                                                                                  ], ncols=7)
1960 
1961 _DigiHits_Occupancy_HE_Scintillator_zplus = PlotGroup("Occupancy_HE_Scintillator_zplus", [Plot("DigiOccupancy_Plus_layer_{:02d}".format(i), title="DigiHits_Occupancy_HE_Scintillator_zplus",
1962                                                                                           xtitle="Layer {}".format(i), **_common) for i in range(HEScintillator_min,HEScintillator_max+1)
1963                                                                                            ], ncols=7)
1964 
1965 _DigiHits_Occupancy_EE_zminus = PlotGroup("Occupancy_EE_zminus", [Plot("DigiOccupancy_Minus_layer_{:02d}".format(i), title="DigiHits_Occupancy_EE_zminus",
1966                                                                   xtitle="Layer {}".format(i), **_common) for i in range(EE_min,EE_max+1)
1967                                                                   ], ncols=7)
1968 
1969 _DigiHits_Occupancy_HE_Silicon_zminus = PlotGroup("Occupancy_HE_Silicon_zminus", [Plot("DigiOccupancy_Minus_layer_{:02d}".format(i), title="DigiHits_Occupancy_HE_Silicon_zminus",
1970                                                                                   xtitle="Layer {}".format(i), **_common) for i in range(HESilicon_min,HESilicon_max+1)
1971                                                                                   ], ncols=7)
1972 
1973 _DigiHits_Occupancy_HE_Scintillator_zminus = PlotGroup("Occupancy_HE_Scintillator_zminus", [Plot("DigiOccupancy_Minus_layer_{:02d}".format(i), title="DigiHits_Occupancy_HE_Scintillator_zminus",
1974                                                                                             xtitle="Layer {}".format(i), **_common) for i in range(HEScintillator_min,HEScintillator_max+1)
1975                                                                                             ], ncols=7)
1976 
1977 _common_XY = dict(removeEmptyBins=True, xbinlabelsize=10, xbinlabeloption="d", ymin=None)
1978 
1979 _DigiHits_Occupancy_XY_EE = PlotGroup("Occupancy_XY_EE", [Plot("DigiOccupancy_XY_layer_{:02d}".format(i), title="DigiHits_Occupancy_XY_EE",
1980                                                      xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_XY) for i in range(EE_min,EE_max+1)
1981                                                      ], ncols=7)
1982 
1983 _DigiHits_Occupancy_XY_HE_Silicon = PlotGroup("Occupancy_XY_HE_Silicon", [Plot("DigiOccupancy_XY_layer_{:02d}".format(i), title="DigiHits_Occupancy_XY_HE_Silicon",
1984                                                      xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_XY) for i in range(HESilicon_min,HESilicon_max+1)
1985                                                      ], ncols=7)
1986 
1987 _DigiHits_Occupancy_XY_HE_Scintillator = PlotGroup("Occupancy_XY_HE_Scintillator", [Plot("DigiOccupancy_XY_layer_{:02d}".format(i), title="DigiHits_Occupancy_XY_HE_Scintillator",
1988                                                      xtitle="Layer {}".format(i), drawStyle="COLZ", adjustMarginRight=0.1, **_common_XY) for i in range(HEScintillator_min,HEScintillator_max+1)
1989                                                      ], ncols=7)
1990 
1991 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65, "ymin": 0.1, "ylog": True}
1992 
1993 _DigiHits_TOA_EE = PlotGroup("TOA_EE", [
1994                                                  Plot("TOA_layer_{:02d}".format(i), title="TOA_EE", xtitle="Layer {}".format(i), **_common) for i in range(EE_min,EE_max+1)
1995                                                  ], ncols=7)
1996 
1997 _DigiHits_TOA_HE_Silicon = PlotGroup("TOA_HE_Silicon", [
1998                                                                  Plot("TOA_layer_{:02d}".format(i), title="TOA_HE_Silicon", xtitle="Layer {}".format(i), **_common) for i in range(HESilicon_min,HESilicon_max+1)
1999                                                                  ], ncols=7)
2000 
2001 _DigiHits_TOA_HE_Scintillator = PlotGroup("TOA_HE_Scintillator", [
2002                                                                            Plot("TOA_layer_{:02d}".format(i), title="TOA_HE_Scintillator", xtitle="Layer {}".format(i), **_common) for i in range(HEScintillator_min,HEScintillator_max+1)
2003                                                                            ], ncols=7)
2004 
2005 _DigiHits_TOT_EE = PlotGroup("TOT_EE", [
2006                                                  Plot("TOT_layer_{:02d}".format(i), title="TOT_EE", xtitle="Layer {}".format(i), **_common) for i in range(EE_min,EE_max+1)
2007                                                  ], ncols=7)
2008 
2009 _DigiHits_TOT_HE_Silicon = PlotGroup("TOT_HE_Silicon", [
2010                                                                  Plot("TOT_layer_{:02d}".format(i), title="TOT_HE_Silicon", xtitle="Layer {}".format(i), **_common) for i in range(HESilicon_min,HESilicon_max+1)
2011                                                                  ], ncols=7)
2012 
2013 _DigiHits_TOT_HE_Scintillator = PlotGroup("TOT_HE_Scintillator", [
2014                                                                            Plot("TOT_layer_{:02d}".format(i), title="TOT_HE_Scintillator", xtitle="Layer {}".format(i), **_common) for i in range(HEScintillator_min,HEScintillator_max+1)
2015                                                                            ], ncols=7)
2016 
2017 #===================================================================================================================
2018 #Plot definition for HitCalibration
2019 _common = {"stat": True, "drawStyle": "hist", "staty": 0.65, "ymin": 0.1, "ylog": False}
2020 
2021 _LayerOccupancy = PlotGroup("LayerOccupancy", [
2022                                                Plot("LayerOccupancy", title="LayerOccupancy", **_common)], ncols=1)
2023 
2024 _ReconstructableEnergyOverCPenergy = PlotGroup("ReconstructableEnergyOverCPenergy", [
2025   Plot("h_EoP_CPene_100_calib_fraction", title="EoP_CPene_100_calib_fraction", **_common),
2026   Plot("h_EoP_CPene_200_calib_fraction", title="EoP_CPene_200_calib_fraction", **_common),
2027   Plot("h_EoP_CPene_300_calib_fraction", title="EoP_CPene_300_calib_fraction", **_common),
2028   Plot("h_EoP_CPene_scint_calib_fraction", title="EoP_CPene_scint_calib_fraction", **_common),
2029 ])
2030 
2031 _ParticleFlowClusterHGCalFromTrackster_Closest_EoverCPenergy = PlotGroup("ParticleFlowClusterHGCalFromTrackster", [
2032   Plot("hgcal_EoP_CPene_100_calib_fraction", title="hgcal_EoP_CPene_100_calib_fraction", **_common),
2033   Plot("hgcal_EoP_CPene_200_calib_fraction", title="hgcal_EoP_CPene_200_calib_fraction", **_common),
2034   Plot("hgcal_EoP_CPene_300_calib_fraction", title="hgcal_EoP_CPene_300_calib_fraction", **_common),
2035   Plot("hgcal_EoP_CPene_scint_calib_fraction", title="hgcal_EoP_CPene_scint_calib_fraction", **_common),
2036 ])
2037 
2038 _EcalDrivenGsfElectronsFromTrackster_Closest_EoverCPenergy = PlotGroup("EcalDrivenGsfElectronsFromTrackster", [
2039   Plot("hgcal_ele_EoP_CPene_100_calib_fraction", title="hgcal_ele_EoP_CPene_100_calib_fraction", **_common),
2040   Plot("hgcal_ele_EoP_CPene_200_calib_fraction", title="hgcal_ele_EoP_CPene_200_calib_fraction", **_common),
2041   Plot("hgcal_ele_EoP_CPene_300_calib_fraction", title="hgcal_ele_EoP_CPene_300_calib_fraction", **_common),
2042   Plot("hgcal_ele_EoP_CPene_scint_calib_fraction", title="hgcal_ele_EoP_CPene_scint_calib_fraction", **_common),
2043 ])
2044 
2045 _PhotonsFromTrackster_Closest_EoverCPenergy = PlotGroup("PhotonsFromTrackster", [
2046   Plot("hgcal_photon_EoP_CPene_100_calib_fraction", title="hgcal_photon_EoP_CPene_100_calib_fraction", **_common),
2047   Plot("hgcal_photon_EoP_CPene_200_calib_fraction", title="hgcal_photon_EoP_CPene_200_calib_fraction", **_common),
2048   Plot("hgcal_photon_EoP_CPene_300_calib_fraction", title="hgcal_photon_EoP_CPene_300_calib_fraction", **_common),
2049   Plot("hgcal_photon_EoP_CPene_scint_calib_fraction", title="hgcal_photon_EoP_CPene_scint_calib_fraction", **_common),
2050 ])
2051 
2052 #=================================================================================================
2053 hgcalLayerClustersPlotter = Plotter()
2054 layerClustersLabel = 'Layer Clusters'
2055 
2056 lc_general_clusterlevel = [
2057   # number of layer clusters per event in a) 120um, b) 200um, c) 300um, d) scint
2058   # (one entry per event in each of the four histos)
2059   _totclusternum_thick,
2060   # Miscellaneous plots:
2061   # longdepthbarycentre: The longitudinal depth barycentre. One entry per event.
2062   # mixedhitscluster: Number of clusters per event with hits in different thicknesses.
2063   # num_reco_cluster_eta: Number of reco clusters vs eta
2064   _num_reco_cluster_eta,
2065   _energyclustered,
2066   _mixedhitsclusters,
2067   _longdepthbarycentre,
2068   # calculated "energy density" for cells in a) 120um, b) 200um, c) 300um, d) scint
2069   # (one entry per rechit, in the appropriate histo)
2070   _cellsenedens_thick
2071 ]
2072 
2073 lc_clusterlevel_zminus = [
2074   # number of layer clusters per layer (one entry per event in each histo)
2075   _totclusternum_layer_EE_zminus,
2076   _totclusternum_layer_FH_zminus,
2077   _totclusternum_layer_BH_zminus,
2078   # Looking at the fraction of true energy that has been clustered; by layer and overall
2079   _energyclustered_perlayer_EE_zminus,
2080   _energyclustered_perlayer_FH_zminus,
2081   _energyclustered_perlayer_BH_zminus
2082 ]
2083 
2084 lc_cellevel_zminus = [
2085   # For each layer cluster:
2086   # number of cells in layer cluster, by layer - separate histos in each layer for 120um Si, 200/300um Si, Scint
2087   # NB: not all combinations exist; e.g. no 120um Si in layers with scint.
2088   # (One entry in the appropriate histo per layer cluster).
2089   _cellsnum_perthick_perlayer_120_EE_zminus,
2090   _cellsnum_perthick_perlayer_120_FH_zminus,
2091   _cellsnum_perthick_perlayer_120_BH_zminus,
2092   _cellsnum_perthick_perlayer_200_EE_zminus,
2093   _cellsnum_perthick_perlayer_200_FH_zminus,
2094   _cellsnum_perthick_perlayer_200_BH_zminus,
2095   _cellsnum_perthick_perlayer_300_EE_zminus,
2096   _cellsnum_perthick_perlayer_300_FH_zminus,
2097   _cellsnum_perthick_perlayer_300_BH_zminus,
2098   _cellsnum_perthick_perlayer_scint_EE_zminus,
2099   _cellsnum_perthick_perlayer_scint_FH_zminus,
2100   _cellsnum_perthick_perlayer_scint_BH_zminus,
2101   # Cell Association per Layer
2102   _cell_association_table_zminus
2103 ]
2104 
2105 lc_cp_association_zminus = [
2106   # Efficiency Plots
2107   _efficiencies_zminus,
2108   _efficiencies_zminus_eta,
2109   _efficiencies_zminus_phi,
2110   # Duplicate Plots
2111   _duplicates_zminus,
2112   _duplicates_zminus_eta,
2113   _duplicates_zminus_phi,
2114   # Fake Rate Plots
2115   _fakes_zminus,
2116   _fakes_zminus_eta,
2117   _fakes_zminus_phi,
2118   # Merge Rate Plots
2119   _merges_zminus,
2120   _merges_zminus_eta,
2121   _merges_zminus_phi,
2122   # Score of CaloParticles wrt Layer Clusters
2123   _score_caloparticle_to_layerclusters_zminus,
2124   # Score of LayerClusters wrt CaloParticles
2125   _score_layercluster_to_caloparticles_zminus,
2126   # Shared Energy between CaloParticle and LayerClusters
2127   _sharedEnergy_caloparticle_to_layercluster_zminus,
2128   # Shared Energy between LayerClusters and CaloParticle
2129   _sharedEnergy_layercluster_to_caloparticle_zminus,
2130   # Energy vs Score 2D plots CP to LC
2131   _energyscore_cp2lc_zminus,
2132   # Energy vs Score 2D plots LC to CP
2133   _energyscore_lc2cp_zminus
2134 ]
2135 
2136 lc_zminus_extended = [
2137   # For each layer cluster:
2138   # distance of cells from a) seed cell, b) max cell; and c), d): same with entries weighted by cell energy
2139   # separate histos in each layer for 120um Si, 200/300um Si, Scint
2140   # NB: not all combinations exist; e.g. no 120um Si in layers with scint.
2141   # (One entry in each of the four appropriate histos per cell in a layer cluster)
2142   _distancetomaxcell_perthickperlayer_120_EE_zminus,
2143   _distancetomaxcell_perthickperlayer_120_FH_zminus,
2144   _distancetomaxcell_perthickperlayer_120_BH_zminus,
2145   _distancetomaxcell_perthickperlayer_200_EE_zminus,
2146   _distancetomaxcell_perthickperlayer_200_FH_zminus,
2147   _distancetomaxcell_perthickperlayer_200_BH_zminus,
2148   _distancetomaxcell_perthickperlayer_300_EE_zminus,
2149   _distancetomaxcell_perthickperlayer_300_FH_zminus,
2150   _distancetomaxcell_perthickperlayer_300_BH_zminus,
2151   _distancetomaxcell_perthickperlayer_scint_EE_zminus,
2152   _distancetomaxcell_perthickperlayer_scint_FH_zminus,
2153   _distancetomaxcell_perthickperlayer_scint_BH_zminus,
2154   _distancetoseedcell_perthickperlayer_120_EE_zminus,
2155   _distancetoseedcell_perthickperlayer_120_FH_zminus,
2156   _distancetoseedcell_perthickperlayer_120_BH_zminus,
2157   _distancetoseedcell_perthickperlayer_200_EE_zminus,
2158   _distancetoseedcell_perthickperlayer_200_FH_zminus,
2159   _distancetoseedcell_perthickperlayer_200_BH_zminus,
2160   _distancetoseedcell_perthickperlayer_300_EE_zminus,
2161   _distancetoseedcell_perthickperlayer_300_FH_zminus,
2162   _distancetoseedcell_perthickperlayer_300_BH_zminus,
2163   _distancetoseedcell_perthickperlayer_scint_EE_zminus,
2164   _distancetoseedcell_perthickperlayer_scint_FH_zminus,
2165   _distancetoseedcell_perthickperlayer_scint_BH_zminus,
2166   _distancetomaxcell_perthickperlayer_eneweighted_120_EE_zminus,
2167   _distancetomaxcell_perthickperlayer_eneweighted_120_FH_zminus,
2168   _distancetomaxcell_perthickperlayer_eneweighted_120_BH_zminus,
2169   _distancetomaxcell_perthickperlayer_eneweighted_200_EE_zminus,
2170   _distancetomaxcell_perthickperlayer_eneweighted_200_FH_zminus,
2171   _distancetomaxcell_perthickperlayer_eneweighted_200_BH_zminus,
2172   _distancetomaxcell_perthickperlayer_eneweighted_300_EE_zminus,
2173   _distancetomaxcell_perthickperlayer_eneweighted_300_FH_zminus,
2174   _distancetomaxcell_perthickperlayer_eneweighted_300_BH_zminus,
2175   _distancetomaxcell_perthickperlayer_eneweighted_scint_EE_zminus,
2176   _distancetomaxcell_perthickperlayer_eneweighted_scint_FH_zminus,
2177   _distancetomaxcell_perthickperlayer_eneweighted_scint_BH_zminus,
2178   _distancetoseedcell_perthickperlayer_eneweighted_120_EE_zminus,
2179   _distancetoseedcell_perthickperlayer_eneweighted_120_FH_zminus,
2180   _distancetoseedcell_perthickperlayer_eneweighted_120_BH_zminus,
2181   _distancetoseedcell_perthickperlayer_eneweighted_200_EE_zminus,
2182   _distancetoseedcell_perthickperlayer_eneweighted_200_FH_zminus,
2183   _distancetoseedcell_perthickperlayer_eneweighted_200_BH_zminus,
2184   _distancetoseedcell_perthickperlayer_eneweighted_300_EE_zminus,
2185   _distancetoseedcell_perthickperlayer_eneweighted_300_FH_zminus,
2186   _distancetoseedcell_perthickperlayer_eneweighted_300_BH_zminus,
2187   _distancetoseedcell_perthickperlayer_eneweighted_scint_EE_zminus,
2188   _distancetoseedcell_perthickperlayer_eneweighted_scint_FH_zminus,
2189   _distancetoseedcell_perthickperlayer_eneweighted_scint_BH_zminus,
2190   _distancebetseedandmaxcell_perthickperlayer_120_EE_zminus,
2191   _distancebetseedandmaxcell_perthickperlayer_120_FH_zminus,
2192   _distancebetseedandmaxcell_perthickperlayer_120_BH_zminus,
2193   _distancebetseedandmaxcell_perthickperlayer_200_EE_zminus,
2194   _distancebetseedandmaxcell_perthickperlayer_200_FH_zminus,
2195   _distancebetseedandmaxcell_perthickperlayer_200_BH_zminus,
2196   _distancebetseedandmaxcell_perthickperlayer_300_EE_zminus,
2197   _distancebetseedandmaxcell_perthickperlayer_300_FH_zminus,
2198   _distancebetseedandmaxcell_perthickperlayer_300_BH_zminus,
2199   _distancebetseedandmaxcell_perthickperlayer_scint_EE_zminus,
2200   _distancebetseedandmaxcell_perthickperlayer_scint_FH_zminus,
2201   _distancebetseedandmaxcell_perthickperlayer_scint_BH_zminus,
2202   _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_EE_zminus,
2203   _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_FH_zminus,
2204   _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_BH_zminus,
2205   _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_EE_zminus,
2206   _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_FH_zminus,
2207   _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_BH_zminus,
2208   _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_EE_zminus,
2209   _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_FH_zminus,
2210   _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_BH_zminus,
2211   _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_EE_zminus,
2212   _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_FH_zminus,
2213   _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_BH_zminus
2214 ]
2215 
2216 lc_clusterlevel_zplus = [
2217   # number of layer clusters per layer (one entry per event in each histo)
2218   _totclusternum_layer_EE_zplus,
2219   _totclusternum_layer_FH_zplus,
2220   _totclusternum_layer_BH_zplus,
2221   # Looking at the fraction of true energy that has been clustered; by layer and overall
2222   _energyclustered_perlayer_EE_zplus,
2223   _energyclustered_perlayer_FH_zplus,
2224   _energyclustered_perlayer_BH_zplus
2225 ]
2226 
2227 lc_cellevel_zplus = [
2228   # number of cells in layer cluster, by layer - separate histos in each layer for 120um Si, 200/300um Si, Scint
2229   _cellsnum_perthick_perlayer_120_EE_zplus,
2230   _cellsnum_perthick_perlayer_120_FH_zplus,
2231   _cellsnum_perthick_perlayer_120_BH_zplus,
2232   _cellsnum_perthick_perlayer_200_EE_zplus,
2233   _cellsnum_perthick_perlayer_200_FH_zplus,
2234   _cellsnum_perthick_perlayer_200_BH_zplus,
2235   _cellsnum_perthick_perlayer_300_EE_zplus,
2236   _cellsnum_perthick_perlayer_300_FH_zplus,
2237   _cellsnum_perthick_perlayer_300_BH_zplus,
2238   _cellsnum_perthick_perlayer_scint_EE_zplus,
2239   _cellsnum_perthick_perlayer_scint_FH_zplus,
2240   _cellsnum_perthick_perlayer_scint_BH_zplus,
2241   # Cell Association per Layer
2242   _cell_association_table_zplus
2243 ]
2244 
2245 lc_cp_association_zplus = [
2246   # Efficiency Plots
2247   _efficiencies_zplus,
2248   _efficiencies_zplus_eta,
2249   _efficiencies_zplus_phi,
2250   # Duplicate Plots
2251   _duplicates_zplus,
2252   _duplicates_zplus_eta,
2253   _duplicates_zplus_phi,
2254   # Fake Rate Plots
2255   _fakes_zplus,
2256   _fakes_zplus_eta,
2257   _fakes_zplus_phi,
2258   # Merge Rate Plots
2259   _merges_zplus,
2260   _merges_zplus_eta,
2261   _merges_zplus_phi,
2262   # Score of CaloParticles wrt Layer Clusters
2263   _score_caloparticle_to_layerclusters_zplus,
2264   # Score of LayerClusters wrt CaloParticles
2265   _score_layercluster_to_caloparticles_zplus,
2266   # Shared Energy between CaloParticle and LayerClusters
2267   _sharedEnergy_caloparticle_to_layercluster_zplus,
2268   # Shared Energy between LayerClusters and CaloParticle
2269   _sharedEnergy_layercluster_to_caloparticle_zplus,
2270   _energyscore_cp2lc_zplus,
2271   _energyscore_lc2cp_zplus
2272 ]
2273 
2274 lc_zplus_extended = [
2275   # distance of cells from a) seed cell, b) max cell; and c), d): same with entries weighted by cell energy
2276   _distancetomaxcell_perthickperlayer_120_EE_zplus,
2277   _distancetomaxcell_perthickperlayer_120_FH_zplus,
2278   _distancetomaxcell_perthickperlayer_120_BH_zplus,
2279   _distancetomaxcell_perthickperlayer_200_EE_zplus,
2280   _distancetomaxcell_perthickperlayer_200_FH_zplus,
2281   _distancetomaxcell_perthickperlayer_200_BH_zplus,
2282   _distancetomaxcell_perthickperlayer_300_EE_zplus,
2283   _distancetomaxcell_perthickperlayer_300_FH_zplus,
2284   _distancetomaxcell_perthickperlayer_300_BH_zplus,
2285   _distancetomaxcell_perthickperlayer_scint_EE_zplus,
2286   _distancetomaxcell_perthickperlayer_scint_FH_zplus,
2287   _distancetomaxcell_perthickperlayer_scint_BH_zplus,
2288   _distancetoseedcell_perthickperlayer_120_EE_zplus,
2289   _distancetoseedcell_perthickperlayer_120_FH_zplus,
2290   _distancetoseedcell_perthickperlayer_120_BH_zplus,
2291   _distancetoseedcell_perthickperlayer_200_EE_zplus,
2292   _distancetoseedcell_perthickperlayer_200_FH_zplus,
2293   _distancetoseedcell_perthickperlayer_200_BH_zplus,
2294   _distancetoseedcell_perthickperlayer_300_EE_zplus,
2295   _distancetoseedcell_perthickperlayer_300_FH_zplus,
2296   _distancetoseedcell_perthickperlayer_300_BH_zplus,
2297   _distancetoseedcell_perthickperlayer_scint_EE_zplus,
2298   _distancetoseedcell_perthickperlayer_scint_FH_zplus,
2299   _distancetoseedcell_perthickperlayer_scint_BH_zplus,
2300   _distancetomaxcell_perthickperlayer_eneweighted_120_EE_zplus,
2301   _distancetomaxcell_perthickperlayer_eneweighted_120_FH_zplus,
2302   _distancetomaxcell_perthickperlayer_eneweighted_120_BH_zplus,
2303   _distancetomaxcell_perthickperlayer_eneweighted_200_EE_zplus,
2304   _distancetomaxcell_perthickperlayer_eneweighted_200_FH_zplus,
2305   _distancetomaxcell_perthickperlayer_eneweighted_200_BH_zplus,
2306   _distancetomaxcell_perthickperlayer_eneweighted_300_EE_zplus,
2307   _distancetomaxcell_perthickperlayer_eneweighted_300_FH_zplus,
2308   _distancetomaxcell_perthickperlayer_eneweighted_300_BH_zplus,
2309   _distancetomaxcell_perthickperlayer_eneweighted_scint_EE_zplus,
2310   _distancetomaxcell_perthickperlayer_eneweighted_scint_FH_zplus,
2311   _distancetomaxcell_perthickperlayer_eneweighted_scint_BH_zplus,
2312   _distancetoseedcell_perthickperlayer_eneweighted_120_EE_zplus,
2313   _distancetoseedcell_perthickperlayer_eneweighted_120_FH_zplus,
2314   _distancetoseedcell_perthickperlayer_eneweighted_120_BH_zplus,
2315   _distancetoseedcell_perthickperlayer_eneweighted_200_EE_zplus,
2316   _distancetoseedcell_perthickperlayer_eneweighted_200_FH_zplus,
2317   _distancetoseedcell_perthickperlayer_eneweighted_200_BH_zplus,
2318   _distancetoseedcell_perthickperlayer_eneweighted_300_EE_zplus,
2319   _distancetoseedcell_perthickperlayer_eneweighted_300_FH_zplus,
2320   _distancetoseedcell_perthickperlayer_eneweighted_300_BH_zplus,
2321   _distancetoseedcell_perthickperlayer_eneweighted_scint_EE_zplus,
2322   _distancetoseedcell_perthickperlayer_eneweighted_scint_FH_zplus,
2323   _distancetoseedcell_perthickperlayer_eneweighted_scint_BH_zplus,
2324   _distancebetseedandmaxcell_perthickperlayer_120_EE_zplus,
2325   _distancebetseedandmaxcell_perthickperlayer_120_FH_zplus,
2326   _distancebetseedandmaxcell_perthickperlayer_120_BH_zplus,
2327   _distancebetseedandmaxcell_perthickperlayer_200_EE_zplus,
2328   _distancebetseedandmaxcell_perthickperlayer_200_FH_zplus,
2329   _distancebetseedandmaxcell_perthickperlayer_200_BH_zplus,
2330   _distancebetseedandmaxcell_perthickperlayer_300_EE_zplus,
2331   _distancebetseedandmaxcell_perthickperlayer_300_FH_zplus,
2332   _distancebetseedandmaxcell_perthickperlayer_300_BH_zplus,
2333   _distancebetseedandmaxcell_perthickperlayer_scint_EE_zplus,
2334   _distancebetseedandmaxcell_perthickperlayer_scint_FH_zplus,
2335   _distancebetseedandmaxcell_perthickperlayer_scint_BH_zplus,
2336   _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_EE_zplus,
2337   _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_FH_zplus,
2338   _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_120_BH_zplus,
2339   _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_EE_zplus,
2340   _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_FH_zplus,
2341   _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_200_BH_zplus,
2342   _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_EE_zplus,
2343   _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_FH_zplus,
2344   _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_BH_zplus,
2345   _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_EE_zplus,
2346   _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_FH_zplus,
2347   _distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_BH_zplus
2348 ]
2349 
2350 def append_hgcalLayerClustersPlots(collection = hgcalValidator.label_layerClusterPlots._InputTag__moduleLabel, name_collection = layerClustersLabel, extended = False):
2351   print('extended : ',extended)
2352   regions_ClusterLevel       = ["General: Cluster Level", "Z-minus: Cluster Level", "Z-plus: Cluster Level"]
2353   regions_CellLevel          = ["Z-minus: Cell Level", "Z-plus: Cell Level"]
2354   regions_LCtoCP_association = ["Z-minus: LC_CP association", "Z-plus: LC_CP association"]
2355 
2356   plots_lc_general_clusterlevel  = lc_general_clusterlevel
2357   plots_lc_clusterlevel_zminus   = lc_clusterlevel_zminus
2358   plots_lc_cellevel_zminus       = lc_cellevel_zminus
2359   plots_lc_clusterlevel_zplus    = lc_clusterlevel_zplus
2360   plots_lc_cellevel_zplus        = lc_cellevel_zplus
2361   plots_lc_cp_association_zminus = lc_cp_association_zminus
2362   plots_lc_cp_association_zplus  = lc_cp_association_zplus
2363 
2364   if extended :
2365     #plots_lc_clusterlevel_zminus   = lc_clusterlevel_zminus
2366     #plots_lc_clusterlevel_zplus    = lc_clusterlevel_zplus
2367     plots_lc_cellevel_zminus       = lc_cellevel_zminus + lc_zminus_extended
2368     plots_lc_cellevel_zplus        = lc_cellevel_zplus + lc_zplus_extended
2369     #plots_lc_cp_association_zminus = lc_cp_association_zminus
2370     #plots_lc_cp_association_zplus  = lc_cp_association_zplus
2371 
2372   setPlots_ClusterLevel       = [plots_lc_general_clusterlevel, plots_lc_clusterlevel_zminus, plots_lc_clusterlevel_zplus]
2373   setPlots_CellLevel          = [plots_lc_cellevel_zminus, plots_lc_cellevel_zplus]
2374   setPlots_LCtoCP_association = [plots_lc_cp_association_zminus, plots_lc_cp_association_zplus]
2375   for reg, setPlot in zip(regions_ClusterLevel, setPlots_ClusterLevel):
2376     hgcalLayerClustersPlotter.append(collection+"_"+reg, [
2377                 _hgcalFolders(collection + "/ClusterLevel")
2378                 ], PlotFolder(
2379                 *setPlot,
2380                 loopSubFolders=False,
2381                 purpose=PlotPurpose.Timing, page=layerClustersLabel, section=reg))
2382   for reg, setPlot in zip(regions_CellLevel, setPlots_CellLevel):
2383     hgcalLayerClustersPlotter.append(collection+"_"+reg, [
2384                 _hgcalFolders(collection + "/CellLevel")
2385                 ], PlotFolder(
2386                 *setPlot,
2387                 loopSubFolders=False,
2388                 purpose=PlotPurpose.Timing, page=layerClustersLabel, section=reg))
2389   for reg, setPlot in zip(regions_LCtoCP_association, setPlots_LCtoCP_association):
2390     hgcalLayerClustersPlotter.append(collection+"_"+reg, [
2391                 _hgcalFolders(collection + "/" + lcToCP_linking)
2392                 ], PlotFolder(
2393                 *setPlot,
2394                 loopSubFolders=False,
2395                 purpose=PlotPurpose.Timing, page=layerClustersLabel, section=reg))
2396 
2397 #=================================================================================================
2398 
2399 sc_clusterlevel = [
2400   # number of layer clusters per event in a) 120um, b) 200um, c) 300um, d) scint
2401   # (one entry per event in each of the four histos) ([B] above)
2402   _totsimclusternum_thick,
2403   # number of simclusters per layer (one entry per event in each histo) ([C] above)
2404   # z-
2405   _totsimclusternum_layer_EE_zminus,
2406   _totsimclusternum_layer_FH_zminus,
2407   _totsimclusternum_layer_BH_zminus,
2408   # z+
2409   _totsimclusternum_layer_EE_zplus,
2410   _totsimclusternum_layer_FH_zplus,
2411   _totsimclusternum_layer_BH_zplus,
2412   # Miscellaneous plots ([G] above):
2413   # mixedhitscluster: Number of clusters per event with hits in different thicknesses.
2414   _mixedhitssimclusters,
2415 ]
2416 
2417 sc_ticltracksters = [
2418   # Score of SimClusters wrt Layer Clusters
2419   # z-
2420   _score_simcluster_to_layerclusters_zminus,
2421   # z+
2422   _score_simcluster_to_layerclusters_zplus,
2423   # Score of LayerClusters wrt SimClusters
2424   # z-
2425   _score_layercluster_to_simclusters_zminus,
2426   # z+
2427   _score_layercluster_to_simclusters_zplus,
2428   # Shared Energy between SimCluster and LayerClusters
2429   # z-
2430   _sharedEnergy_simcluster_to_layercluster_zminus,
2431   # z+
2432   _sharedEnergy_simcluster_to_layercluster_zplus,
2433   # Shared Energy between LayerClusters and SimCluster
2434   # z-
2435   _sharedEnergy_layercluster_to_simcluster_zminus,
2436   # z+
2437   _sharedEnergy_layercluster_to_simcluster_zplus,
2438   # Efficiency Plots
2439   # z-
2440   _efficiencies_sc_zminus,
2441   _duplicates_sc_zminus,
2442   _fakes_sc_zminus,
2443   _merges_sc_zminus,
2444   _efficiencies_sc_zminus_eta,
2445   _efficiencies_sc_zminus_phi,
2446   # z+
2447   _efficiencies_sc_zplus,
2448   _duplicates_sc_zplus,
2449   _fakes_sc_zplus,
2450   _merges_sc_zplus,
2451   _efficiencies_sc_zplus_eta,
2452   _efficiencies_sc_zplus_phi,
2453    # Duplicate Plots
2454   # z-
2455   _duplicates_sc_zminus_eta,
2456   _duplicates_sc_zminus_phi,
2457    # z+
2458   _duplicates_sc_zplus_eta,
2459   _duplicates_sc_zplus_phi,
2460   # Fake Rate Plots
2461   # z-
2462   _fakes_sc_zminus_eta,
2463   _fakes_sc_zminus_phi,
2464   # z+
2465   _fakes_sc_zplus_eta,
2466   _fakes_sc_zplus_phi,
2467   # Merge Rate Plots
2468   # z-
2469   _merges_sc_zminus_eta,
2470   _merges_sc_zminus_phi,
2471   # z+
2472   _merges_sc_zplus_eta,
2473   _merges_sc_zplus_phi,
2474   # Energy vs Score 2D plots SC to LC
2475   # z-
2476   _energyscore_sc2lc_zminus,
2477   # z+
2478   _energyscore_sc2lc_zplus,
2479   # Energy vs Score 2D plots LC to SC
2480   # z-
2481   _energyscore_lc2sc_zminus,
2482   # z+
2483   _energyscore_lc2sc_zplus
2484 ]
2485 
2486 hgcalSimClustersPlotter = Plotter()
2487 
2488 def append_hgcalSimClustersPlots(collection, name_collection):
2489   if collection == hgcalValidator.label_SimClustersLevel._InputTag__moduleLabel:
2490       hgcalSimClustersPlotter.append(collection, [
2491                   _hgcalFolders(hgcalValidator.label_SimClusters._InputTag__moduleLabel +"/"+ collection)
2492                   ], PlotFolder(
2493                   *sc_clusterlevel,
2494                   loopSubFolders=False,
2495                   purpose=PlotPurpose.Timing, page="SimClusters", section=name_collection))
2496   else:
2497       hgcalSimClustersPlotter.append(collection, [
2498                   _hgcalFolders(hgcalValidator.label_SimClusters._InputTag__moduleLabel +"/"+collection)
2499                   ], PlotFolder(
2500                   *sc_ticltracksters,
2501                   loopSubFolders=False,
2502                   purpose=PlotPurpose.Timing, page="SimClusters", section=name_collection))
2503 
2504 
2505 #=================================================================================================
2506 def _hgcalFolders(lastDirName="hgcalLayerClusters"):
2507     return hgcVal_dqm + lastDirName
2508 
2509 _trackstersPlots = [
2510   _trackster_eppe,
2511   _trackster_xyz,
2512   _tottracksternum,
2513   _clusternum_in_trackster,
2514   _clusternum_in_trackster_vs_layer,
2515   _clusternum_in_trackster_perlayer_zminus_EE,
2516   _clusternum_in_trackster_perlayer_zminus_FH,
2517   _clusternum_in_trackster_perlayer_zminus_BH,
2518   _clusternum_in_trackster_perlayer_zplus_EE,
2519   _clusternum_in_trackster_perlayer_zplus_FH,
2520   _clusternum_in_trackster_perlayer_zplus_BH,
2521   _trackster_layernum,
2522   _multiplicityOfLCinTST,
2523 ]
2524 
2525 _trackstersToSimTracksterFromCPByHitsPlots = [
2526   _efficiencies[0],
2527   _purities[0],
2528   _duplicates[0],
2529   _fakes[0],
2530   _merges[0],
2531   _score_caloparticle_to_tracksters,
2532   _score_trackster_to_caloparticles,
2533   _sharedEnergy_to_trackster[0],
2534   _sharedEnergy_trackster_to[0],
2535   _energyscore_to_trackster[0],
2536   _energyscore_trackster_to[0],
2537 ]
2538 
2539 _trackstersToSimTracksterByLCsPlots = [
2540   _efficiencies[1],
2541   _purities[1],
2542   _duplicates[1],
2543   _fakes[1],
2544   _merges[1],
2545   _score_simtrackster_to_tracksters,
2546   _score_trackster_to_simtracksters,
2547   _sharedEnergy_to_trackster[1],
2548   _sharedEnergy_trackster_to[1],
2549   _energyscore_to_trackster[1],
2550   _energyscore_trackster_to[1],
2551 ]
2552 
2553 _trackstersToSimTracksterFromCPByLCsPlots = [
2554   _efficiencies[2],
2555   _purities[2],
2556   _duplicates[2],
2557   _fakes[2],
2558   _merges[2],
2559   _score_simtrackster_to_tracksters,
2560   _score_trackster_to_simtracksters,
2561   _sharedEnergy_to_trackster[2],
2562   _sharedEnergy_trackster_to[2],
2563   _energyscore_to_trackster[2],
2564   _energyscore_trackster_to[2],
2565 ]
2566 
2567 _trackstersToSimTracksterByHitsPlots = [
2568   _efficiencies[3],
2569   _purities[3],
2570   _duplicates[3],
2571   _fakes[3],
2572   _merges[3],
2573   _score_simtrackster_to_tracksters,
2574   _score_trackster_to_simtracksters,
2575   _sharedEnergy_to_trackster[3],
2576   _sharedEnergy_trackster_to[3],
2577   _energyscore_to_trackster[3],
2578   _energyscore_trackster_to[3],
2579 ]
2580 
2581 hgcalTrackstersPlotter = Plotter()
2582 def append_hgcalTrackstersPlots(collection = 'ticlTrackstersMerge', name_collection = "TrackstersMerge"):
2583   # Appending generic plots for Tracksters
2584   hgcalTrackstersPlotter.append(collection, [
2585               _hgcalFolders(collection+ "/" + hgcalValidator.label_TS.value())
2586               ], PlotFolder(
2587               *_trackstersPlots,
2588               loopSubFolders=False,
2589               purpose=PlotPurpose.Timing, page="Tracksters", section=name_collection))
2590 
2591 
2592   # Appending plots for Tracksters TSbyHits_CP, TSbyLCs, TSbyLCs_CP, TSbyHits
2593   hgcalTrackstersPlotter.append(collection, [
2594               _hgcalFolders(collection + "/" + TSbyHits_CP)
2595               ], PlotFolder(
2596               *_trackstersToSimTracksterFromCPByHitsPlots,
2597               loopSubFolders=False,
2598               purpose=PlotPurpose.Timing
2599               ,page="Trackster to SimTracksters from CP Associated by Hits"
2600               ,section=name_collection)
2601               )
2602   
2603   hgcalTrackstersPlotter.append(collection, [
2604               _hgcalFolders(collection + "/" + TSbyLCs)
2605               ], PlotFolder(
2606               *_trackstersToSimTracksterByLCsPlots,
2607               loopSubFolders=False,
2608               purpose=PlotPurpose.Timing
2609               ,page="Trackster to SimTracksters Associated by LCs"
2610               ,section=name_collection)
2611               )
2612   
2613   hgcalTrackstersPlotter.append(collection, [
2614               _hgcalFolders(collection + "/" + TSbyLCs_CP)
2615               ], PlotFolder(
2616               *_trackstersToSimTracksterFromCPByLCsPlots,
2617               loopSubFolders=False,
2618               purpose=PlotPurpose.Timing
2619               ,page="Trackster to SimTracksters from CP Associated by LCs"
2620               ,section=name_collection)
2621               )
2622   
2623   hgcalTrackstersPlotter.append(collection, [
2624               _hgcalFolders(collection + "/" + TSbyHits)
2625               ], PlotFolder(
2626               *_trackstersToSimTracksterByHitsPlots,
2627               loopSubFolders=False,
2628               purpose=PlotPurpose.Timing
2629               ,page="Trackster to SimTracksters Associated by Hits"
2630               ,section=name_collection)
2631               )
2632   
2633   
2634 
2635 #=================================================================================================
2636 _common_Calo = {"stat": False, "drawStyle": "hist", "staty": 0.65, "ymin": 0.0, "ylog": False, "xtitle": "Default", "ytitle": "Default"}
2637 
2638 hgcalCaloParticlesPlotter = Plotter()
2639 def append_hgcalCaloParticlesPlots(files, collection = '-211', name_collection = "pion-"):
2640 
2641   list_2D_histos = ["Energy of Rec-matched Hits vs layer",
2642                     "Energy of Rec-matched Hits vs layer (1SC)",
2643                     "Rec-matched Hits Sum Energy vs layer"]
2644 
2645   dqmfolder = hgcVal_dqm + "SelectedCaloParticles/" + collection
2646   templateFile = ROOT.TFile.Open(files[0]) # assuming all files have same structure
2647   if not gDirectory.GetDirectory(dqmfolder):
2648     print("Error: GeneralInfo directory %s not found in DQM file, exit"%dqmfolder)
2649     return hgcalTrackstersPlotter
2650 
2651   keys = gDirectory.GetDirectory(dqmfolder,True).GetListOfKeys()
2652   key = keys[0]
2653   while key:
2654     obj = key.ReadObj()
2655     name = obj.GetName()
2656     fileName = TString(name)
2657     fileName.ReplaceAll(" ","_")
2658     pg = PlotGroup(fileName.Data(),[
2659                   Plot(name,
2660                        drawCommand = "",
2661                        normalizeToNumberOfEvents = True, **_common_Calo)
2662                   ],
2663                   ncols=1)
2664 
2665     if name in list_2D_histos :
2666         pg = PlotOnSideGroup(plotName.Data(),
2667                       Plot(name,
2668                            drawCommand = "COLZ",
2669                            normalizeToNumberOfEvents = True, **_common_Calo)
2670                       ,
2671                       ncols=1)
2672 
2673     hgcalCaloParticlesPlotter.append("CaloParticles_"+name_collection, [
2674               dqmfolder
2675               ], PlotFolder(
2676                 pg,
2677                 loopSubFolders=False,
2678                 purpose=PlotPurpose.Timing, page="CaloParticles", section=name_collection)
2679               )
2680 
2681     key = keys.After(key)
2682 
2683   templateFile.Close()
2684 
2685   return hgcalCaloParticlesPlotter
2686 
2687 #=================================================================================================
2688 def create_hgcalTrackstersPlotter(files, collection = 'ticlTrackstersMerge', name_collection = "TrackstersMerge"):
2689   grouped = {"cosAngle Beta": PlotGroup("cosAngle_Beta_per_layer",[],ncols=10), "cosAngle Beta Weighted": PlotGroup("cosAngle_Beta_Weighted_per_layer",[],ncols=10)}
2690   groupingFlag = " on Layer "
2691 
2692   hgcalTrackstersPlotter = Plotter()
2693   dqmfolder = hgcVal_dqm + collection
2694   #_multiplicity_tracksters_numberOfEventsHistogram = dqmfolder+"/Number of Trackster per Event"
2695 
2696   _common["ymin"] = 0.0
2697   _common["staty"] = 0.85
2698   templateFile = ROOT.TFile.Open(files[0]) # assuming all files have same structure
2699   if not gDirectory.GetDirectory(dqmfolder):
2700     print("Error: GeneralInfo directory %s not found in DQM file, exit"%dqmfolder)
2701     return hgcalTrackstersPlotter
2702 
2703   keys = gDirectory.GetDirectory(dqmfolder,True).GetListOfKeys()
2704   key = keys[0]
2705   while key:
2706     obj = key.ReadObj()
2707     name = obj.GetName()
2708     plotName = TString(name)
2709     plotName.ReplaceAll(" ","_")
2710 
2711     if groupingFlag in name:
2712         for group in grouped:
2713             if group+groupingFlag in name:
2714                 grouped[group].append(Plot(name,
2715                                            xtitle="Default", ytitle="Default",
2716                                            **_common)
2717                                      )
2718                 print("Adding %s to %s"%(name,group))
2719     else:
2720         pg = None
2721         if obj.InheritsFrom("TH2"):
2722             pg = PlotOnSideGroup(plotName.Data(),
2723                                  Plot(name,
2724                                       xtitle="Default", ytitle="Default",
2725                                       drawCommand = "COLZ",
2726                                       **_common),
2727                                  ncols=1)
2728         elif obj.InheritsFrom("TH1"):
2729             pg = PlotGroup(plotName.Data(),
2730                            [Plot(name,
2731                                  xtitle="Default", ytitle="Default",
2732                                  drawCommand = "COLZ", # ineffective for TH1
2733                                  **_common)
2734                            ],
2735                            ncols=1, legendDh=-0.03 * len(files))
2736 
2737         if (pg is not None):
2738             hgcalTrackstersPlotter.append(name_collection+"_TICLDebugger",
2739                 [dqmfolder], PlotFolder(pg,
2740                                         loopSubFolders=False,
2741                                         purpose=PlotPurpose.Timing, page="Tracksters", section=name_collection)
2742                 #numberOfEventsHistogram=_multiplicity_tracksters_numberOfEventsHistogram)
2743                 )
2744 
2745     key = keys.After(key)
2746 
2747   for group in grouped:
2748       hgcalTrackstersPlotter.append(name_collection+"_TICLDebugger",
2749           [dqmfolder], PlotFolder(grouped[group],
2750                                   loopSubFolders=False,
2751                                   purpose=PlotPurpose.Timing, page="Tracksters", section=name_collection)
2752           #numberOfEventsHistogram=_multiplicity_tracksters_numberOfEventsHistogram)
2753           )
2754 
2755   templateFile.Close()
2756 
2757   return hgcalTrackstersPlotter
2758 
2759 #=================================================================================================
2760 _common_Calo = {"stat": False, "drawStyle": "hist", "staty": 0.65, "ymin": 0.0, "ylog": False, "xtitle": "Default", "ytitle": "Default"}
2761 
2762 hgcalCaloParticlesPlotter = Plotter()
2763 
2764 def append_hgcalCaloParticlesPlots(files, collection = '-211', name_collection = "pion-"):
2765   dqmfolder = hgcVal_dqm + "SelectedCaloParticles/" + collection
2766   print(dqmfolder)
2767 #  _common["ymin"] = 0.0
2768   templateFile = ROOT.TFile.Open(files[0]) # assuming all files have same structure
2769   keys = gDirectory.GetDirectory(dqmfolder,True).GetListOfKeys()
2770   key = keys[0]
2771   while key:
2772     obj = key.ReadObj()
2773     name = obj.GetName()
2774     plotName = TString(name)
2775     plotName.ReplaceAll(" ","_")
2776 
2777     pg = None
2778     if obj.InheritsFrom("TH2"):
2779         pg = PlotOnSideGroup(plotName.Data(),
2780                       Plot(name,
2781                            drawCommand = "COLZ",
2782                            normalizeToNumberOfEvents = True, **_common_Calo),
2783                       ncols=1)
2784     elif obj.InheritsFrom("TH1"):
2785         pg = PlotGroup(plotName.Data(),[
2786                       Plot(name,
2787                            drawCommand = "", # may want to customize for TH2 (colz, etc.)
2788                            normalizeToNumberOfEvents = True, **_common_Calo)
2789                       ],
2790                       ncols=1)
2791 
2792     if (pg is not None):
2793         hgcalCaloParticlesPlotter.append("CaloParticles_"+name_collection, [
2794                   dqmfolder
2795                   ], PlotFolder(
2796                     pg,
2797                     loopSubFolders=False,
2798                     purpose=PlotPurpose.Timing, page="CaloParticles", section=name_collection)
2799                   )
2800 
2801     key = keys.After(key)
2802 
2803   templateFile.Close()
2804 
2805   return hgcalCaloParticlesPlotter
2806 
2807 #=================================================================================================
2808 # hitValidation
2809 def _hgcalHitFolders(dirName="HGCalSimHitsV/HGCalEESensitive"):
2810     return "DQMData/Run 1/HGCAL/Run summary/"+dirName
2811 
2812 hgcalHitPlotter = Plotter()
2813 hitsLabel = 'Hits'
2814 simHitsLabel = 'Simulated Hits'
2815 
2816 hgcalHitPlotter.append("SimHits_Validation", [
2817                                               "DQMData/Run 1/HGCAL/Run summary/HGCalSimHitsV/HitValidation",
2818                                               ], PlotFolder(
2819                                                             _HitValidation,
2820                                                             loopSubFolders=False,
2821                                                             purpose=PlotPurpose.Timing, page=hitsLabel, section=simHitsLabel
2822                                                             ))
2823 
2824 def append_hgcalHitsPlots(collection = "HGCalSimHitsV", name_collection = "Simulated Hits"):
2825   _hitsCommonPlots_EE = [
2826     _Occupancy_EE_zplus,
2827     _Occupancy_EE_zminus,
2828     _EtaPhi_EE_zminus,
2829     _EtaPhi_EE_zplus
2830   ]
2831   _hitsCommonPlots_HE_Sil = [
2832     _Occupancy_HE_Silicon_zplus,
2833     _Occupancy_HE_Silicon_zminus,
2834     _EtaPhi_HE_Silicon_zminus,
2835     _EtaPhi_HE_Silicon_zplus
2836   ]
2837   _hitsCommonPlots_HE_Sci = [
2838     _Occupancy_HE_Scintillator_zplus,
2839     _Occupancy_HE_Scintillator_zminus,
2840     _EtaPhi_HE_Scintillator_zminus,
2841     _EtaPhi_HE_Scintillator_zplus
2842   ]
2843 
2844   regions = ["HGCalEESensitive", "HGCalHESiliconSensitive", "HGCalHEScintillatorSensitive"]
2845   setPlots = [_hitsCommonPlots_EE, _hitsCommonPlots_HE_Sil, _hitsCommonPlots_HE_Sci]
2846   if "SimHits" in collection :
2847     _hitsCommonPlots_EE.append(_Energy_EE_0)
2848     _hitsCommonPlots_EE.append(_Energy_EE_1)
2849     _hitsCommonPlots_HE_Sil.append(_Energy_HE_Silicon_0)
2850     _hitsCommonPlots_HE_Sil.append( _Energy_HE_Silicon_1)
2851     _hitsCommonPlots_HE_Sil.append(_Energy_HE_Scintillator_0)
2852     _hitsCommonPlots_HE_Sil.append(_Energy_HE_Scintillator_1)
2853   if "RecHits" in collection :
2854     _hitsCommonPlots_EE.append(_Energy_EE)
2855     _hitsCommonPlots_HE_Sil.append(_Energy_HE_Silicon)
2856     _hitsCommonPlots_HE_Sil.append(_Energy_HE_Scintillator)
2857 
2858   for reg, setPlot in zip(regions, setPlots):
2859     dirName = collection+"/"+reg
2860     print(dirName)
2861     hgcalHitPlotter.append(collection, [
2862                 _hgcalHitFolders(dirName)
2863                 ], PlotFolder(
2864                 *setPlot,
2865                 loopSubFolders=False,
2866                 purpose=PlotPurpose.Timing, page=hitsLabel, section=name_collection))
2867 
2868 _digisCommonPlots_EE = [
2869   _DigiHits_Occupancy_EE_zplus,
2870   _DigiHits_Occupancy_EE_zminus,
2871   _DigiHits_Occupancy_XY_EE,
2872   _DigiHits_ADC_EE,
2873   _DigiHits_TOA_EE,
2874   _DigiHits_TOT_EE,
2875 ]
2876 _digisCommonPlots_HE_Sil = [
2877   _DigiHits_Occupancy_HE_Silicon_zplus,
2878   _DigiHits_Occupancy_HE_Silicon_zminus,
2879   _DigiHits_Occupancy_XY_HE_Silicon,
2880   _DigiHits_ADC_HE_Silicon,
2881   _DigiHits_TOA_HE_Silicon,
2882   _DigiHits_TOT_HE_Silicon,
2883 ]
2884 _digisCommonPlots_HE_Sci = [
2885   _DigiHits_Occupancy_HE_Scintillator_zplus,
2886   _DigiHits_Occupancy_HE_Scintillator_zminus,
2887   _DigiHits_Occupancy_XY_HE_Scintillator,
2888   _DigiHits_ADC_HE_Scintillator,
2889   _DigiHits_TOA_HE_Scintillator,
2890   _DigiHits_TOT_HE_Scintillator,
2891 ]
2892 
2893 def append_hgcalDigisPlots(collection = "HGCalDigisV", name_collection = "Digis"):
2894   regions = ["HGCalEESensitive", "HGCalHESiliconSensitive", "HGCalHEScintillatorSensitive"]
2895   setPlots = [_digisCommonPlots_EE, _digisCommonPlots_HE_Sil, _digisCommonPlots_HE_Sci]
2896   for reg, setPlot in zip(regions, setPlots):
2897     dirName = collection+"/"+reg
2898     print(dirName)
2899     hgcalHitPlotter.append(name_collection, [
2900                 _hgcalHitFolders(dirName)
2901                 ], PlotFolder(
2902                 *setPlot,
2903                 loopSubFolders=False,
2904                 purpose=PlotPurpose.Timing, page=hitsLabel, section=name_collection))
2905 
2906 #=================================================================================================
2907 # hitCalibration
2908 hgcalHitCalibPlotter = Plotter()
2909 hitCalibrationLabel = 'Calibrated RecHits'
2910 
2911 hgcalHitCalibPlotter.append("Layer_Occupancy", [
2912                                                 "DQMData/Run 1/HGCalHitCalibration/Run summary",
2913                                                 ], PlotFolder(
2914                                                               _LayerOccupancy,
2915                                                               loopSubFolders=False,
2916                                                               purpose=PlotPurpose.Timing, page=hitCalibrationLabel, section=hitCalibrationLabel
2917                                                               ))
2918 hgcalHitCalibPlotter.append("ReconstructableEnergyOverCPenergy", [
2919         "DQMData/Run 1/HGCalHitCalibration/Run summary",
2920         ], PlotFolder(
2921         _ReconstructableEnergyOverCPenergy,
2922         loopSubFolders=False,
2923         purpose=PlotPurpose.Timing, page=hitCalibrationLabel, section=hitCalibrationLabel
2924         ))
2925 
2926 hgcalHitCalibPlotter.append("ParticleFlowClusterHGCalFromTrackster_Closest_EoverCPenergy", [
2927         "DQMData/Run 1/HGCalHitCalibration/Run summary",
2928         ], PlotFolder(
2929         _ParticleFlowClusterHGCalFromTrackster_Closest_EoverCPenergy,
2930         loopSubFolders=False,
2931         purpose=PlotPurpose.Timing, page=hitCalibrationLabel, section=hitCalibrationLabel
2932         ))
2933 
2934 hgcalHitCalibPlotter.append("PhotonsFromTrackster_Closest_EoverCPenergy", [
2935         "DQMData/Run 1/HGCalHitCalibration/Run summary",
2936         ], PlotFolder(
2937         _PhotonsFromTrackster_Closest_EoverCPenergy,
2938         loopSubFolders=False,
2939         purpose=PlotPurpose.Timing, page=hitCalibrationLabel, section=hitCalibrationLabel
2940         ))
2941 
2942 hgcalHitCalibPlotter.append("EcalDrivenGsfElectronsFromTrackster_Closest_EoverCPenergy", [
2943         "DQMData/Run 1/HGCalHitCalibration/Run summary",
2944         ], PlotFolder(
2945         _EcalDrivenGsfElectronsFromTrackster_Closest_EoverCPenergy,
2946         loopSubFolders=False,
2947         purpose=PlotPurpose.Timing, page=hitCalibrationLabel, section=hitCalibrationLabel
2948         ))
2949 
2950 hgcalTICLCandPlotter = Plotter()
2951 
2952 hgcalTICLCandPlotter.append('ticlCandidates', [
2953              "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/"+hgcalValidator.ticlCandidates.value(),
2954             ], PlotFolder(
2955             *_candidatesPlots,
2956             loopSubFolders=False,
2957             purpose=PlotPurpose.Timing, page="General", section="Candidates"))
2958 
2959 for i in range(6):
2960     hgcalTICLCandPlotter.append('ticlCandidates', [
2961              "DQMData/Run 1/HGCAL/Run summary/HGCalValidator/"+hgcalValidator.ticlCandidates.value()+"/"+cand_type[i],
2962             ], PlotFolder(
2963             *_allCandidatesPlots[i],
2964             loopSubFolders=False,
2965             purpose=PlotPurpose.Timing, page=cand_type[i], section="Candidates"))