20 from collections
import OrderedDict
22 from Validation.RecoTrack.plotting.validation
import Sample, Validation
23 from Validation.HGCalValidation.html
import _sampleName,_pageNameMap,_summary,_summobj,_MatBudSections,_geoPageNameMap,_individualmaterials,_matPageNameMap,_individualmatplots,_individualMatPlotsDesc,_hideShowFun,_allmaterialsplots,_allmaterialsPlotsDesc, _fromvertexplots, _fromVertexPlotsDesc
29 usage = (
'usage: %prog [options]\n'
30 +
'%prog -h for help')
31 parser = optparse.OptionParser(usage)
33 parser.add_option(
'',
'--Obj', dest=
'OBJ', type=
'string', default=
None, help=
'Object to run. Options are: Geometry, SimHits, Digis, RecHits, Calibrations, CaloParticles, hgcalLayerClusters')
34 parser.add_option(
'',
'--html-validation-name', dest=
'HTMLVALNAME', type=
'string', default=
'', help=
'Could be either be hgcalLayerClusters or hgcalMultiClusters')
35 parser.add_option(
'-d',
'--download', action=
'store_true', dest=
'DOWNLOAD', default=
False, help=
'Download DQM files from RelVals')
36 parser.add_option(
'-g',
'--gather', dest=
'GATHER', type=
'string', default=
None, help=
'Objects to gather: hitValidation, hitCalibration, hgcalLayerClusters, hgcalMultiClusters, ticlMultiClustersFromTrackstersEM, ticlMultiClustersFromTrackstersHAD')
37 parser.add_option(
'-w',
'--wwwarea', dest=
'WWWAREA', type=
'string', default=
'/eos/project/h/hgcaldpg/www', help=
'Objects to gather: hitValidation, hitCalibration, hgcalLayerClusters, hgcalMultiClusters, ticlMultiClustersFromTrackstersEM, ticlMultiClustersFromTrackstersHAD')
38 parser.add_option(
'-y',
'--dry-run', action=
'store_true', dest=
'DRYRUN', default=
False, help=
'perform a dry run (nothing is lauched).')
39 parser.add_option(
'-i',
'--inputeosarea', dest=
'INPUT', type=
'string', default=
'/eos/cms/store/group/dpg_hgcal/comm_hgcal/apsallid/RelVals', help=
'Eos area where we will place all DQM files of the new and reference release campaign')
40 parser.add_option(
'',
'--geometry', action=
'store_true', dest=
'GEOMETRY', default=
False, help=
'Geometry validation section')
41 parser.add_option(
'',
'--copyhtml', action=
'store_true', dest=
'COPYHTML', default=
False, help=
'If used the main index.html file will be copied to the www area. Useful in case of experimenting to avoid surprises.')
45 (opt, args) = parser.parse_args()
54 status, output = commands.getstatusoutput(cmd)
55 if (status !=0
and not quite):
56 print(
'Error in processing command:\n ['+cmd+
']')
57 print(
'Output:\n ['+output+
'] \n')
62 if "_pmx" in NewRelease:
63 if "_pmx" in RefRelease:
64 return {
"default":
"pmx"+t}
65 return {
"default": t, NewRelease:
"pmx"+t}
85 thereleases = OrderedDict()
86 thereleases = {
"CMSSW 11_3_X" : [
87 "CMSSW_11_3_0_pre3_G4VECGEOM_vs_CMSSW_11_3_0_pre3",
88 "CMSSW_11_3_0_pre3_D76_vs_CMSSW_11_3_0_pre3",
89 "CMSSW_11_3_0_pre3_vs_CMSSW_11_3_0_pre2",
90 "CMSSW_11_3_0_pre2_vs_CMSSW_11_3_0_pre1",
91 "CMSSW_11_3_0_pre1_vs_CMSSW_11_2_0_pre10",
94 "CMSSW_11_2_0_vs_CMSSW_11_2_0_pre10",
95 "CMSSW_11_2_0_pre10_vs_CMSSW_11_2_0_pre9",
96 "CMSSW_11_2_0_pre9_vs_CMSSW_11_2_0_pre8",
97 "CMSSW_11_2_0_pre8_vs_CMSSW_11_2_0_pre7",
98 "CMSSW_11_2_0_pre7_vs_CMSSW_11_2_0_pre6",
99 "CMSSW_11_2_0_pre6_ROOT622_vs_CMSSW_11_2_0_pre6",
100 "CMSSW_11_2_0_pre6_vs_CMSSW_11_2_0_pre5",
101 "CMSSW_11_2_0_pre5_GEANT106_vs_CMSSW_11_2_0_pre5",
102 "CMSSW_11_2_0_pre5_vs_CMSSW_11_2_0_pre3",
103 "CMSSW_11_2_0_pre3_vs_CMSSW_11_2_0_pre1",
104 "CMSSW_11_2_0_pre1_vs_CMSSW_11_1_0_pre8"
107 "CMSSW_11_1_0_pre8_raw1100_vs_CMSSW_11_1_0_pre8",
108 "CMSSW_11_1_0_pre8_raw1100_vs_CMSSW_11_1_0_pre7_raw1100",
109 "CMSSW_11_1_0_pre8_vs_CMSSW_11_1_0_pre7",
110 "CMSSW_11_1_0_pre7_raw1100_vs_CMSSW_11_1_0_pre7",
111 "CMSSW_11_1_0_pre7_raw1100_vs_CMSSW_11_1_0_pre6_raw1100",
112 "CMSSW_11_1_0_pre7_vs_CMSSW_11_1_0_pre6",
113 "CMSSW_11_1_0_pre6_raw1100_vs_CMSSW_11_1_0_pre6",
114 "CMSSW_11_1_0_pre6_raw1100_vs_CMSSW_11_1_0_pre5_raw1100",
115 "CMSSW_11_1_0_pre6_vs_CMSSW_11_1_0_pre5",
116 "CMSSW_11_1_0_pre5_vs_CMSSW_11_1_0_pre4",
117 "CMSSW_11_1_0_pre5_raw1100_vs_CMSSW_11_1_0_pre5",
118 "CMSSW_11_1_0_pre5_raw1100_vs_CMSSW_11_1_0_pre4_raw1100",
119 "CMSSW_11_1_0_pre4_raw1100_vs_CMSSW_11_1_0_pre4",
120 "CMSSW_11_1_0_pre4_raw1100_vs_CMSSW_11_1_0_pre3_raw1100",
121 "CMSSW_11_1_0_pre4_GEANT4",
"CMSSW_11_1_0_pre4"
125 geometryTests = OrderedDict()
126 geometryTests = {
"Material budget" : [
128 "Extended2026D49_vs_Extended2026D76"
132 GeoScenario =
"Extended2026D49_vs_Extended2026D76"
134 RefRelease=
'CMSSW_11_3_0_pre3'
136 NewRelease=
'CMSSW_11_3_0_pre3_G4VECGEOM'
138 NotNormalRelease =
"normal"
139 NotNormalRefRelease =
"normal"
141 if ( os.path.isdir(
'%s/%s' %(opt.WWWAREA, NewRelease))) :
142 print(
"The campaign you are trying to validate has already an existing validation folder in the official www area.")
143 print(
"Make sure you are not overwriting anything and try again.")
146 if "raw" in NotNormalRelease:
150 appendglobaltag =
"_2026D76noPU"
152 appendglobaltag =
"_2026D49noPU"
156 phase2samples_noPU_oldnaming = [
157 # Sample("RelValCloseByParticleGun_CE_H_Fine_300um", dqmVersion="0002", scenario="2026D49", appendGlobalTag=appendglobaltag ),
158 Sample("RelValCloseByParticleGun_CE_H_Fine_300um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
159 Sample("RelValCloseByParticleGun_CE_H_Fine_200um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
160 Sample("RelValCloseByParticleGun_CE_H_Fine_120um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
161 Sample("RelValCloseByParticleGun_CE_H_Coarse_Scint", scenario="2026D49", appendGlobalTag=appendglobaltag ),
162 Sample("RelValCloseByParticleGun_CE_H_Coarse_300um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
163 Sample("RelValCloseByParticleGun_CE_E_Front_300um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
164 Sample("RelValCloseByParticleGun_CE_E_Front_200um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
165 Sample("RelValCloseByParticleGun_CE_E_Front_120um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
166 #Sample("RelValCloseByParticleGun_CE_E_Front_120um", scenario="2026D49", appendGlobalTag=appendglobaltag , version="v2"),
167 Sample("RelValTTbar", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
168 Sample("RelValZMM", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag ),
169 Sample("RelValSingleGammaFlatPt8To150", scenario="2026D49", appendGlobalTag=appendglobaltag ),
170 Sample("RelValSingleMuPt10", scenario="2026D49", appendGlobalTag=appendglobaltag ),
171 Sample("RelValSingleMuPt100", scenario="2026D49", appendGlobalTag=appendglobaltag ),
172 Sample("RelValSingleMuPt1000", scenario="2026D49", appendGlobalTag=appendglobaltag ),
173 Sample("RelValSingleMuFlatPt2To100", scenario="2026D49", appendGlobalTag=appendglobaltag ),
174 Sample("RelValSingleMuFlatPt0p7To10", scenario="2026D49", appendGlobalTag=appendglobaltag ),
175 Sample("RelValSingleEFlatPt2To100", scenario="2026D49", appendGlobalTag=appendglobaltag ),
176 Sample("RelValSingleTauFlatPt2To150", scenario="2026D49", appendGlobalTag=appendglobaltag ),
177 Sample("RelValSinglePiFlatPt0p7To10", scenario="2026D49", appendGlobalTag=appendglobaltag ),
178 Sample("RelValQCD_Pt20toInfMuEnrichPt15", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
179 Sample("RelValQCD_Pt15To7000_Flat", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
180 Sample("RelValZTT", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
181 Sample("RelValZMM", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag ),
182 Sample("RelValZEE", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag ),
183 Sample("RelValB0ToKstarMuMu", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
184 Sample("RelValBsToEleEle", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
185 Sample("RelValBsToMuMu", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
186 Sample("RelValBsToJpsiGamma", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
187 Sample("RelValBsToJpsiPhi_mumuKK", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
188 Sample("RelValBsToPhiPhi_KKKK", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
189 Sample("RelValDisplacedMuPt30To100", scenario="2026D49", appendGlobalTag=appendglobaltag ),
190 Sample("RelValDisplacedMuPt2To10", scenario="2026D49", appendGlobalTag=appendglobaltag ),
191 Sample("RelValDisplacedMuPt10To30", scenario="2026D49", appendGlobalTag=appendglobaltag ),
192 Sample("RelValTauToMuMuMu", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
193 #Sample("RelValMinBias", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
194 Sample("RelValH125GGgluonfusion", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag ),
195 Sample("RelValNuGun", scenario="2026D49", appendGlobalTag=appendglobaltag )
200 phase2samples_noPU = [
221 Sample(
"RelValZpTT_1500", midfix=
"14", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
223 Sample(
"RelValZTT", midfix=
"14TeV", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
224 Sample(
"RelValZMM", midfix=
"14", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
225 Sample(
"RelValZEE", midfix=
"14", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
227 Sample(
"RelValTenTau_15_500", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
228 Sample(
"RelValTTbar", midfix=
"14TeV", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
229 Sample(
"RelValQCD_Pt15To7000_Flat", midfix=
"14", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
231 Sample(
"RelValNuGun", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
233 Sample(
"RelValMinBias", midfix=
"14TeV", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
234 Sample(
"RelValH125GGgluonfusion", midfix=
"14", scenario=
"2026D49", appendGlobalTag=appendglobaltag )
242 phase2samples_noPU_extend = [
250 Sample(
"RelValSingleMuPt10", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
251 Sample(
"RelValSingleMuPt100", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
252 Sample(
"RelValSingleMuPt1000", scenario=
"2026D49", appendGlobalTag=appendglobaltag )
259 phase2samples_noPU_extend_more = [
263 Sample(
"RelValCloseByPGun_CE_H_Fine_300um", scenario=
"2026D49", appendGlobalTag=appendglobaltag, version=
"v2" ),
264 Sample(
"RelValCloseByPGun_CE_H_Fine_200um", scenario=
"2026D49", appendGlobalTag=appendglobaltag, version=
"v2" ),
265 Sample(
"RelValCloseByPGun_CE_H_Fine_120um", scenario=
"2026D49", appendGlobalTag=appendglobaltag, version=
"v2" ),
266 Sample(
"RelValCloseByPGun_CE_H_Coarse_Scint", scenario=
"2026D49", appendGlobalTag=appendglobaltag, version=
"v2" ),
267 Sample(
"RelValCloseByPGun_CE_H_Coarse_300um", scenario=
"2026D49", appendGlobalTag=appendglobaltag, version=
"v2" ),
268 Sample(
"RelValCloseByPGun_CE_E_Front_300um", scenario=
"2026D49", appendGlobalTag=appendglobaltag, version=
"v2" ),
269 Sample(
"RelValCloseByPGun_CE_E_Front_200um", scenario=
"2026D49", appendGlobalTag=appendglobaltag, version=
"v2" ),
270 Sample(
"RelValCloseByPGun_CE_E_Front_120um", scenario=
"2026D49", appendGlobalTag=appendglobaltag, version=
"v2" ),
271 Sample(
"RelValSingleGammaFlatPt8To150", scenario=
"2026D49", appendGlobalTag=appendglobaltag, version=
"v2" ),
272 Sample(
"RelValSingleEFlatPt2To100", scenario=
"2026D49", appendGlobalTag=appendglobaltag, version=
"v2" ),
273 Sample(
"RelValSinglePiFlatPt0p7To10", scenario=
"2026D49", appendGlobalTag=appendglobaltag, version=
"v2" )
321 phase2samples_noPU.extend(phase2samples_noPU_extend)
322 phase2samples_noPU.extend(phase2samples_noPU_extend_more)
332 Sample(
"RelValTTbar", midfix=
"14TeV", scenario=
"2026D49", putype=
putype(
"25ns"), punum=200, appendGlobalTag=
"_2026D49PU200", version=
"v2"),
336 RefRepository =
'%s' %(opt.INPUT)
337 NewRepository =
'%s' %(opt.INPUT)
346 fullsimSamples = phase2samples_noPU,
348 refRelease=RefRelease, refRepository=RefRepository,
349 newRelease=NewRelease, newRepository=NewRepository
358 if (
not os.path.isdir(RefRepository+
'/'+NewRelease)) :
359 processCmd(
'mkdir -p '+RefRepository+
'/'+NewRelease)
361 for infi
in phase2samples_noPU:
362 if "_HGCal" in infi.filename(NewRelease):
363 processCmd(
'mv ' + infi.filename(NewRelease) +
' ' + infi.filename(NewRelease).
replace(
"_HGCal",
""))
364 processCmd(
'mv ' + infi.filename(NewRelease).
replace(
"_HGCal",
"") +
' ' + RefRepository+
'/'+NewRelease)
368 processCmd(
'mv ' + infi.filename(NewRelease) +
' ' + RefRepository+
'/'+NewRelease)
375 if (opt.OBJ ==
'hgcalLayerClusters' or opt.OBJ ==
'hitCalibration' or opt.OBJ ==
'ticlMultiClustersFromTrackstersEM' or opt.OBJ ==
'ticlMultiClustersFromTrackstersHAD' or opt.OBJ ==
'allTiclMultiClusters'):
379 for infi
in phase2samples_noPU:
380 samplename = infi.filename(NewRelease).
replace(
"DQM_V0001_R000000001__",
"").
replace(
"__DQMIO.root",
"")
383 if infi.pileup() ==
"PU":
384 samplename = samplename +
str(infi.pileupNumber())
387 print(_sampleName[infi.name()])
393 if RefRelease !=
None: inputpathRef = RefRepository +
'/' + RefRelease +
'/'
394 inputpathNew = NewRepository +
'/' + NewRelease+
'/'
396 if RefRelease ==
None:
397 cmd =
'python Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathNew + infi.filename(NewRelease) +
' --outputDir HGCValid_%s_Plots --no-ratio --png --separate --html-sample "%s" ' %(opt.HTMLVALNAME, _sampleName[infi.name()] ) +
' --html-validation-name %s --subdirprefix ' %(opt.HTMLVALNAME) +
' plots_%s' % (samplename)+
' --collection %s' %(opt.HTMLVALNAME)
398 elif "raw" in NotNormalRelease
and "normal" in NotNormalRefRelease:
399 cmd =
'python Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease).
replace(
"mcRun4_realistic_v3_2026D76noPU-v1",
"mcRun4_realistic_v3_2026D49noPU-v1") +
' ' + inputpathNew + infi.filename(NewRelease) +
' --outputDir HGCValid_%s_Plots --no-ratio --png --separate --html-sample "%s" ' %(opt.HTMLVALNAME, _sampleName[infi.name()] ) +
' --html-validation-name %s --subdirprefix ' %(opt.HTMLVALNAME) +
' plots_%s' % (samplename) +
' --collection %s' %(opt.HTMLVALNAME)
401 elif "raw" in NotNormalRelease
and "raw" in NotNormalRefRelease:
403 cmd =
'python Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease).
replace(
"_raw1100",
"_raw1100_rsb") +
' ' + inputpathNew + infi.filename(NewRelease) +
' --outputDir HGCValid_%s_Plots --no-ratio --png --separate --html-sample "%s" ' %(opt.HTMLVALNAME, _sampleName[infi.name()] ) +
' --html-validation-name %s --subdirprefix ' %(opt.HTMLVALNAME) +
' plots_%s' % (samplename) +
' --collection %s' %(opt.HTMLVALNAME)
404 elif "normal" in NotNormalRelease
and "normal" in NotNormalRefRelease:
406 cmd =
'python Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease).
replace(
"2026D49noPU-v2",
"2026D49noPU-v1") +
' ' + inputpathNew + infi.filename(NewRelease) +
' --outputDir HGCValid_%s_Plots --no-ratio --png --separate --html-sample "%s" ' %(opt.HTMLVALNAME, _sampleName[infi.name()] ) +
' --html-validation-name %s --subdirprefix ' %(opt.HTMLVALNAME) +
' plots_%s' % (samplename) +
' --collection %s' %(opt.HTMLVALNAME)
411 cmd =
'python Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease).
replace(
"mcRun4_realistic_v2-v1",
"mcRun4_realistic_v2_2026D49noPU-v1") +
' ' + inputpathNew + infi.filename(NewRelease) +
' --outputDir HGCValid_%s_Plots --no-ratio --png --separate --html-sample "%s" ' %(opt.HTMLVALNAME, _sampleName[infi.name()] ) +
' --html-validation-name %s --subdirprefix ' %(opt.HTMLVALNAME) +
' plots_%s' % (samplename) +
' --collection %s' %(opt.HTMLVALNAME)
415 print(
'Dry-run: ['+cmd+
']')
418 if opt.OBJ ==
'hgcalLayerClusters':
419 processCmd(
'mv HGCValid_%s_Plots/plots_%s_Layer\ Clusters.html HGCValid_%s_Plots/index.html'%(opt.HTMLVALNAME,samplename,opt.HTMLVALNAME))
420 processCmd(
'awk \'NR>=6&&NR<=589\' HGCValid_%s_Plots/index.html > HGCValid_%s_Plots/index_%s.html '% (opt.HTMLVALNAME,opt.HTMLVALNAME, samplename))
421 processCmd(
'echo " <br/>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
422 processCmd(
'echo " <hr>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
424 if opt.OBJ ==
'hitCalibration':
426 processCmd(
'mv HGCValid_%s_Plots/plots_%s_Calibrated\ RecHits.html HGCValid_%s_Plots/index.html'%(opt.HTMLVALNAME,samplename,opt.HTMLVALNAME))
427 processCmd(
'sed -i \'s/Calibrated\ RecHits//g\' HGCValid_%s_Plots/index.html'%(opt.HTMLVALNAME) )
428 processCmd(
'awk \'NR>=6&&NR<=27\' HGCValid_%s_Plots/index.html > HGCValid_%s_Plots/index_%s.html '% (opt.HTMLVALNAME,opt.HTMLVALNAME, samplename))
429 processCmd(
'echo " <br/>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
430 processCmd(
'echo " <hr>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
432 if opt.OBJ ==
'ticlMultiClustersFromTrackstersEM' or opt.OBJ ==
'ticlMultiClustersFromTrackstersHAD' or opt.OBJ ==
'allTiclMultiClusters':
433 processCmd(
'mv HGCValid_%s_Plots/plots_%s_MultiClusters.html HGCValid_%s_Plots/index.html'%(opt.HTMLVALNAME,samplename,opt.HTMLVALNAME))
434 processCmd(
'awk \'NR>=6&&NR<=141\' HGCValid_%s_Plots/index.html > HGCValid_%s_Plots/index_%s.html '% (opt.HTMLVALNAME,opt.HTMLVALNAME, samplename))
435 processCmd(
'echo " <br/>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
436 processCmd(
'echo " <hr>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
439 fragments.append(
'HGCValid_%s_Plots/index_%s.html'% (opt.HTMLVALNAME, samplename) )
443 processCmd(
'mv HGCValid_%s_Plots/index.html HGCValid_%s_Plots/test.html' %(opt.HTMLVALNAME,opt.HTMLVALNAME) )
444 index_file = open(
'HGCValid_%s_Plots/index.html'%(opt.HTMLVALNAME),
'w')
446 index_file.write(
'<html>\n')
447 index_file.write(
' <head>\n')
448 index_file.write(
' <title>HGCal validation %s </title>\n' %(opt.HTMLVALNAME) )
449 index_file.write(
' </head>\n')
450 index_file.write(
' <body>\n')
452 for frag
in fragments:
453 with open(frag,
'r')
as f:
454 lines = f.read().splitlines()
457 index_file.write(line +
'\n')
463 index_file.write(
' </body>\n')
464 index_file.write(
'</html>\n')
469 if (opt.OBJ ==
'SimHits'):
471 if (
not os.path.isdir(
"hgcalSimHitStudy")) :
474 processCmd(
'cp %s/../public/index.php hgcalSimHitStudy/.'%(opt.WWWAREA) )
478 cmd =
'root.exe -b -q Validation/HGCalValidation/macros/validationplots.C\(\\"hgcSimHit.root' +
'\\",\\"'+ opt.OBJ +
'\\"\)'
480 print(
'Dry-run: ['+cmd+
']')
485 if (opt.OBJ ==
'hitValidation'):
489 for infi
in phase2samples_noPU:
490 samplename = infi.filename(NewRelease).
replace(
"DQM_V0001_R000000001__",
"").
replace(
"__DQMIO.root",
"")
493 if infi.pileup() ==
"PU":
494 samplename = samplename +
str(infi.pileupNumber())
501 if RefRelease !=
None: inputpathRef = RefRepository +
'/' + RefRelease +
'/'
502 inputpathNew = NewRepository +
'/' + NewRelease+
'/'
504 if RefRelease ==
None:
505 cmd =
'python Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathNew + infi.filename(NewRelease) +
' --outputDir HGCValid_%s_Plots --no-ratio --png --separate --html-sample "%s" ' %(opt.HTMLVALNAME, _sampleName[infi.name()] ) +
' --html-validation-name %s --subdirprefix ' %(opt.HTMLVALNAME) +
' plots_%s' % (samplename)+
' --collection %s' %(opt.HTMLVALNAME)
506 elif "raw" in NotNormalRelease
and "normal" in NotNormalRefRelease:
507 cmd =
'python Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease).
replace(
"mcRun4_realistic_v3_2026D76noPU-v1",
"mcRun4_realistic_v3_2026D49noPU-v1") +
' ' + inputpathNew + infi.filename(NewRelease) +
' --outputDir HGCValid_%s_Plots --no-ratio --png --separate --html-sample "%s" ' %(opt.HTMLVALNAME, _sampleName[infi.name()] ) +
' --html-validation-name %s --subdirprefix ' %(opt.HTMLVALNAME) +
' plots_%s' % (samplename) +
' --collection %s' %(opt.HTMLVALNAME)
509 elif "raw" in NotNormalRelease
and "raw" in NotNormalRefRelease:
511 cmd =
'python Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease).
replace(
"_raw1100",
"_raw1100_rsb") +
' ' + inputpathNew + infi.filename(NewRelease) +
' --outputDir HGCValid_%s_Plots --no-ratio --png --separate --html-sample "%s" ' %(opt.HTMLVALNAME, _sampleName[infi.name()] ) +
' --html-validation-name %s --subdirprefix ' %(opt.HTMLVALNAME) +
' plots_%s' % (samplename) +
' --collection %s' %(opt.HTMLVALNAME)
512 elif "normal" in NotNormalRelease
and "normal" in NotNormalRefRelease:
514 cmd =
'python Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease).
replace(
"2026D49noPU-v2",
"2026D49noPU-v1") +
' ' + inputpathNew + infi.filename(NewRelease) +
' --outputDir HGCValid_%s_Plots --no-ratio --png --separate --html-sample "%s" ' %(opt.HTMLVALNAME, _sampleName[infi.name()] ) +
' --html-validation-name %s --subdirprefix ' %(opt.HTMLVALNAME) +
' plots_%s' % (samplename) +
' --collection %s' %(opt.HTMLVALNAME)
517 cmd =
'python Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease).
replace(
"mcRun4_realistic_v2-v1",
"mcRun4_realistic_v2_2026D49noPU-v1") +
' ' + inputpathNew + infi.filename(NewRelease) +
' --outputDir HGCValid_%s_Plots --no-ratio --png --separate --html-sample "%s" ' %(opt.HTMLVALNAME, _sampleName[infi.name()] ) +
' --html-validation-name %s --subdirprefix ' %(opt.HTMLVALNAME) +
' plots_%s' % (samplename) +
' --collection %s' %(opt.HTMLVALNAME)
522 print(
'Dry-run: ['+cmd+
']')
525 processCmd(
'mv HGCValid_%s_Plots/plots_%s_Hits.html HGCValid_%s_Plots/index.html'%(opt.HTMLVALNAME,samplename,opt.HTMLVALNAME))
526 processCmd(
'awk \'NR>=6&&NR<=184\' HGCValid_%s_Plots/index.html > HGCValid_%s_Plots/index_%s.html '% (opt.HTMLVALNAME,opt.HTMLVALNAME, samplename))
527 processCmd(
'echo " <br/>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
528 processCmd(
'echo " <hr>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
530 fragments.append(
'HGCValid_%s_Plots/index_%s.html'% (opt.HTMLVALNAME, samplename) )
534 processCmd(
'mv HGCValid_%s_Plots/index.html HGCValid_%s_Plots/test.html' %(opt.HTMLVALNAME,opt.HTMLVALNAME) )
535 index_file = open(
'HGCValid_%s_Plots/index.html'%(opt.HTMLVALNAME),
'w')
537 index_file.write(
'<html>\n')
538 index_file.write(
' <head>\n')
539 index_file.write(
' <title>HGCal validation %s </title>\n' %(opt.HTMLVALNAME) )
540 index_file.write(
' </head>\n')
541 index_file.write(
' <body>\n')
543 for frag
in fragments:
544 with open(frag,
'r')
as f:
545 lines = f.read().splitlines()
548 index_file.write(line +
'\n')
554 index_file.write(
' </body>\n')
555 index_file.write(
'</html>\n')
560 if (opt.OBJ ==
'Digis'):
562 if (
not os.path.isdir(
"hgcalDigiStudy")) :
568 processCmd(
'cp %s/../public/index.php hgcalDigiStudy/.'%(opt.WWWAREA) )
569 processCmd(
'cp %s/../public/index.php hgcalDigiStudyEE/.'%(opt.WWWAREA) )
570 processCmd(
'cp %s/../public/index.php hgcalDigiStudyHEF/.'%(opt.WWWAREA) )
571 processCmd(
'cp %s/../public/index.php hgcalDigiStudyHEB/.'%(opt.WWWAREA) )
575 cmd =
'root.exe -b -q Validation/HGCalValidation/macros/validationplots.C\(\\"hgcDigi.root' +
'\\",\\"'+ opt.OBJ +
'\\"\)'
577 print(
'Dry-run: ['+cmd+
']')
581 processCmd(
'mv hgcalDigiStudyEE hgcalDigiStudy/.')
582 processCmd(
'mv hgcalDigiStudyHEF hgcalDigiStudy/.')
583 processCmd(
'mv hgcalDigiStudyHEB hgcalDigiStudy/.')
587 if (opt.OBJ ==
'RecHits'):
589 if (
not os.path.isdir(
"hgcalRecHitStudy")) :
595 processCmd(
'cp %s/../public/index.php hgcalRecHitStudy/.'%(opt.WWWAREA) )
596 processCmd(
'cp %s/../public/index.php hgcalRecHitStudyEE/.'%(opt.WWWAREA) )
597 processCmd(
'cp %s/../public/index.php hgcalRecHitStudyHEF/.'%(opt.WWWAREA) )
598 processCmd(
'cp %s/../public/index.php hgcalRecHitStudyHEB/.'%(opt.WWWAREA) )
602 cmd =
'root.exe -b -q Validation/HGCalValidation/macros/validationplots.C\(\\"hgcRecHit.root' +
'\\",\\"'+ opt.OBJ +
'\\"\)'
604 print(
'Dry-run: ['+cmd+
']')
608 processCmd(
'mv hgcalRecHitStudyEE hgcalRecHitStudy/.')
609 processCmd(
'mv hgcalRecHitStudyHEF hgcalRecHitStudy/.')
610 processCmd(
'mv hgcalRecHitStudyHEB hgcalRecHitStudy/.')
614 if (opt.OBJ ==
'CaloParticles'):
615 particletypes = [
"-11",
"-13",
"-211",
"-321",
"11",
"111",
"13",
"211",
"22",
"321"]
617 if (
not os.path.isdir(
"CaloParticles")) :
620 processCmd(
'cp %s/../public/index.php CaloParticles/.'%(opt.WWWAREA) )
623 for infi
in phase2samples_noPU:
625 samplename = infi.filename(NewRelease).
replace(
"DQM_V0001_R000000001__",
"").
split(
"__"+NewRelease,1)[0]
626 samplename = samplename + infi.pileup()
627 if infi.pileup() ==
"PU":
628 samplename = samplename +
str(infi.pileupNumber())
633 if (
not os.path.isdir(samplename)) :
635 processCmd(
'cp %s/RelVals/index.php '%(opt.WWWAREA) + samplename +
'/.')
636 for part
in particletypes:
637 processCmd(
'mkdir -p ' + samplename +
'/' +part )
639 processCmd(
'cp %s/RelVals/index.php '%(opt.WWWAREA) + samplename +
'/' +part +
'/.')
642 if RefRelease !=
None: inputpathRef = RefRepository +
'/' + RefRelease +
'/'
643 inputpathNew = NewRepository +
'/' + NewRelease+
'/'
644 cmd =
'root.exe -b -q Validation/HGCalValidation/macros/validationplots.C\(\\"'+ inputpathNew + infi.filename(NewRelease) +
'\\",\\"'+ opt.OBJ +
'\\",\\"'+ samplename +
'\\"\\)'
646 print(
'Dry-run: ['+cmd+
']')
649 processCmd(
'mv ' +samplename+
' CaloParticles/.' )
656 if (opt.GATHER !=
None) :
659 index_file = open(
'index.html',
'w')
661 index_file.write(
'<html>\n')
662 index_file.write(
' <head>\n')
663 index_file.write(
' <title>HGCAL validation results </title>\n' )
664 index_file.write(
' </head>\n')
665 index_file.write(
' <body>\n')
666 index_file.write(
' <h1>\n')
667 index_file.write(
' HGCAL Validation Results \n' )
668 index_file.write(
' </h1>\n')
669 index_file.write(
' <hr/>\n' )
670 index_file.write(
' <h2>\n')
671 index_file.write(
' Release Validation Campaigns \n' )
672 index_file.write(
' </h2>\n')
673 index_file.write(
' <ul>\n' )
675 for trel
in thereleases.keys():
676 index_file.write(
' <li>\n' )
677 index_file.write(
' %s\n' %(trel) )
678 for rel
in thereleases[trel]:
679 index_file.write(
' <ul>\n' )
680 index_file.write(
' <li><a href="%s/index.html">%s</a></li>\n' %(rel, rel ) )
681 index_file.write(
' </ul>\n' )
682 index_file.write(
' </li>\n' )
683 index_file.write(
' <br>\n' )
684 index_file.write(
' <br>\n' )
685 index_file.write(
' <br>\n' )
687 index_file.write(
' </ul>\n' )
688 index_file.write(
' <hr/>\n' )
693 index_file.write(
' <h2>\n')
694 index_file.write(
' Geometry Validation \n' )
695 index_file.write(
' </h2>\n')
696 index_file.write(
' <ul>\n' )
698 for tgeo
in geometryTests.keys():
699 index_file.write(
' <li>\n' )
700 index_file.write(
' %s\n' %(tgeo) )
701 for geo
in geometryTests[tgeo]:
703 if (
not os.path.isdir(geo)):
704 processCmd(
'mkdir -p %s/%s' %(opt.WWWAREA,geo) )
706 for mats
in _individualmaterials:
707 processCmd(
'mkdir -p %s/%s/indimat/%s' %(opt.WWWAREA,geo,mats) )
708 processCmd(
'mkdir -p %s/indimat/%s' %(geo,mats) )
710 index_file.write(
' <ul>\n' )
711 index_file.write(
' <li><a href="%s/index.html">%s</a></li>\n' %(geo, geo ) )
712 index_file.write(
' </ul>\n' )
713 index_file.write(
' </li>\n' )
714 index_file.write(
' <br>\n' )
715 index_file.write(
' <br>\n' )
716 index_file.write(
' <br>\n' )
719 index_file.write(
' </body>\n')
720 index_file.write(
'</html>\n')
726 if (opt.COPYHTML) :
processCmd(
'cp index.html %s/.' %(opt.WWWAREA) )
729 if (
not os.path.isdir(
"HGCValid_summary_Plots")):
733 df = pd.DataFrame.from_dict(_summary, orient =
'index').
transpose()
737 index_file = open(
'HGCValid_summary_Plots/index.html',
'w')
739 index_file.write(
'<html>\n')
740 index_file.write(
' <body>\n')
743 for infi
in phase2samples_noPU:
744 samplename = infi.filename(NewRelease).
replace(
"DQM_V0001_R000000001__",
"").
replace(
"__DQMIO.root",
"")
745 index_file.write(
'<h2> %s </h2> \n' %(_sampleName[infi.name()]) )
747 index_file.write(
'<table> \n')
748 index_file.write(
' <tr>\n')
751 index_file.write(
' <th>%s</th>\n' %(_pageNameMap[obj]) )
752 index_file.write(
' </tr>\n')
754 for i, row
in df.iterrows():
755 index_file.write(
' <tr>\n')
756 for j, column
in row.iteritems():
758 index_file.write(
' <td>\n')
759 index_file.write(
' <ul>\n')
763 index_file.write(
' </ul>\n')
764 index_file.write(
' </td>\n')
772 index_file.write(
' <li><a href="../HGCValid_%s_Plots/plots_%s_%s">%s</a></li> \n' %(j, samplename, column, column.replace(
"ticlMultiClustersFromTracksters",
"") ))
774 index_file.write(
' <li><a href="../HGCValid_%s_Plots/plots_%s_%s">%s</a></li> \n' %(j, samplename, column, column.partition(
"/")[2] ))
776 index_file.write(
' </ul>\n')
777 index_file.write(
' </td>\n')
779 index_file.write(
' </tr>\n')
781 index_file.write(
' </table>\n')
782 index_file.write(
' <br/>\n' )
783 index_file.write(
' <br/>\n' )
784 index_file.write(
' <br/>\n' )
787 index_file.write(
' </body>\n')
788 index_file.write(
'</html>\n')
791 objects = opt.GATHER.split(
",")
794 if "raw" in NotNormalRelease
and "raw" in NotNormalRefRelease:
795 localoutputdir = NewRelease +
"_raw1100" +
"_vs_" + RefRelease +
"_raw1100"
796 elif "raw" in NotNormalRelease
and "normal" in NotNormalRefRelease:
798 localoutputdir = NewRelease +
"_D76" +
"_vs_" + RefRelease
799 elif "normal" in NotNormalRelease
and "normal" in NotNormalRefRelease:
800 localoutputdir = NewRelease +
"_vs_" + RefRelease
802 localoutputdir = NewRelease
807 if (
not os.path.isdir(
'%s/standalone' %(localoutputdir))) :
808 processCmd(
'mkdir -p %s/standalone' %(localoutputdir))
809 if (obj!=
"standalone"):
processCmd(
'mv HGCValid_%s_Plots %s'%(obj, localoutputdir) )
811 processCmd(
'mv hgcalSimHitStudy %s/standalone/.'%(localoutputdir) )
812 processCmd(
'mv hgcalDigiStudy %s/standalone/.'%(localoutputdir) )
813 processCmd(
'mv hgcalRecHitStudy %s/standalone/.'%(localoutputdir) )
814 processCmd(
'cp %s/../public/index.php %s/standalone/.'%(opt.WWWAREA, localoutputdir) )
817 #Let's also copy to the summary folder what we need.
818 for infi in phase2samples_noPU:
819 samplename = infi.filename(NewRelease).replace("DQM_V0001_R000000001__","").replace("__DQMIO.root","")
822 #if obj == "hitValidation" : samplename = samplename + infi.pileup()
823 #else : samplename = infi.filename(NewRelease).replace("DQM_V0001_R000000001__","").replace("__DQMIO.root","")
825 if df[obj][ind] == None: continue
826 else: processCmd('cp -r %s/HGCValid_%s_Plots/plots_%s_%s %s/HGCValid_summary_Plots ' %(NewRelease, obj, samplename, df[obj][ind].partition("/")[0], NewRelease ) )
830 index_file = open(
'%s/index.html'%(localoutputdir),
'w')
832 index_file.write(
'<html>\n')
833 index_file.write(
' <head>\n')
834 index_file.write(
' <title> <h2> HGCal validation results for %s </h2> </title>\n' %(localoutputdir) )
835 index_file.write(
' </head>\n')
836 index_file.write(
' <body>\n')
837 index_file.write(
' <h2> HGCal validation results for %s </h2> \n' %(localoutputdir) )
841 if (obj!=
"standalone"):
842 index_file.write(
' <br/>\n' )
843 index_file.write(
' <ul>\n' )
844 index_file.write(
' <li><a href="HGCValid_%s_Plots/index.html">%s</a></li>\n' %(obj, _pageNameMap[obj] ) )
845 index_file.write(
' </ul>\n' )
846 index_file.write(
' <br/>\n' )
848 index_file.write(
' <br/>\n' )
849 index_file.write(
' <ul>\n' )
850 index_file.write(
' <li><a href="%s/index.php">%s</a></li>\n' %(obj, _pageNameMap[obj] ) )
851 index_file.write(
' </ul>\n' )
852 index_file.write(
' <br/>\n' )
856 index_file.write(
' </body>\n')
857 index_file.write(
'</html>\n')
883 index_file = open(
'%s/index.html'%(GeoScenario),
'w')
885 index_file.write(
'<html>\n')
886 index_file.write(
' <head>\n')
887 index_file.write(
' <title> <h2> HGCAL material budget results for %s </h2> </title>\n' %(GeoScenario) )
888 index_file.write(
' </head>\n')
889 index_file.write(
' <body>\n')
890 index_file.write(
' <h2> HGCAL material budget results for %s </h2> \n' %(GeoScenario) )
892 for obj
in _MatBudSections:
895 if (
not os.path.isdir(
'%s/%s/%s' %(opt.WWWAREA,GeoScenario,obj))):
896 processCmd(
'mkdir -p %s/%s/%s' %(opt.WWWAREA,GeoScenario,obj) )
897 index_file.write(
' <br/>\n' )
898 index_file.write(
' <ul>\n' )
899 index_file.write(
' <li><a href="%s/index.html">%s</a></li>\n' %(obj, _geoPageNameMap[obj] ) )
900 index_file.write(
' </ul>\n' )
901 index_file.write(
' <br/>\n' )
904 index_file.write(
' </body>\n')
905 index_file.write(
'</html>\n')
909 processCmd(
'cp %s/index.html %s/%s/.' %(GeoScenario, opt.WWWAREA,GeoScenario) )
912 index_file = open(
'%s/indimat/index.html'%(GeoScenario),
'w')
914 index_file.write(
'<html>\n')
915 index_file.write(
' <head>\n')
916 index_file.write(
' <title> <h2> HGCAL material budget results for individual materials for %s </h2> </title>\n' %(GeoScenario) )
917 index_file.write(
' </head>\n')
918 index_file.write(
' <body>\n')
919 index_file.write(
' <h2> HGCAL material budget results for individual materials for %s </h2> \n' %(GeoScenario) )
920 for mats
in _individualmaterials:
923 index_file.write(
' <ul>\n' )
924 index_file.write(
' <li><a href="%s/index.html">%s</a></li>\n' %(mats, _matPageNameMap[mats] ) )
925 index_file.write(
' </ul>\n' )
929 index_file.write(
' </body>\n')
930 index_file.write(
'</html>\n')
934 processCmd(
'cp %s/indimat/index.html %s/%s/indimat/.' %(GeoScenario, opt.WWWAREA,GeoScenario) )
937 index_file = open(
'%s/allhgcal/index.html'%(GeoScenario),
'w')
939 index_file.write(
'<html>\n')
940 index_file.write(
' <head>\n')
942 index_file.write(
' <style>img.Reference{margin: 20px auto 20px auto; border: 10px solid green; border-radius: 10px;}img.New{margin: 20px auto 20px auto; border: 10px solid red; border-radius: 10px;} </style> \n')
944 index_file.write(_hideShowFun[
"thestyle"])
946 index_file.write(
' <title> <h2> HGCAL material budget results for all materials for %s </h2> </title>\n' %(GeoScenario) )
947 index_file.write(
' </head>\n')
948 index_file.write(
' <body>\n')
950 index_file.write(
' <h2> HGCAL material budget results for : <span style="color:red;font-size:120%%" >All Materials </span></h2> \n' )
952 index_file.write(
'<p> %s plots have a green border followed by the %s plots which features a red border. </p>\n' % (GeoScenario.split(
"_")[0], GeoScenario.split(
"_")[2]) )
954 index_file.write(
'<h2> Geometry: <span style="color:green;" > %s</span>_vs_<span style="color:red;" >%s </span> </h2>\n' % (GeoScenario.split(
"_")[0], GeoScenario.split(
"_")[2]) )
956 index_file.write(
'<hr/>\n')
958 index_file.write(_hideShowFun[
"divTabs"])
960 for region
in [
"_AllHGCAL",
"_ZminusZoom",
"_ZplusZoom"]:
962 index_file.write(
'<div id="%s" class="tabcontent"> \n' %(region))
964 if region ==
"_AllHGCAL": pngnamestring =
""
965 else: pngnamestring = region
967 for allmatplot
in _allmaterialsplots:
968 if region ==
"_AllHGCAL":
969 index_file.write(
'<p> %s <a href="../%s/%s%s.pdf" class="TMLlink">Click to enlarge %s plot</a></p>\n' %(_allmaterialsPlotsDesc[allmatplot], GeoScenario.split(
"_")[2],allmatplot,pngnamestring,GeoScenario.split(
"_")[2]))
970 index_file.write(
'<img class="Reference" src="../%s/%s%s.png" width="375"/> \n' %(GeoScenario.split(
"_")[0],allmatplot,pngnamestring) )
971 index_file.write(
'<img class="New" src="../%s/%s%s.png" width="375"/> \n' %(GeoScenario.split(
"_")[2],allmatplot,pngnamestring))
972 index_file.write(
'<hr/>\n')
973 elif region !=
"_AllHGCAL" and "HGCal_l_vs_z_vs_R" in allmatplot:
974 index_file.write(
'<p> %s <a href="../%s/%s/%s%s.pdf" class="TMLlink">Click to enlarge %s plot</a></p>\n' %(_allmaterialsPlotsDesc[allmatplot], GeoScenario.split(
"_")[2],region.replace(
"_Zminus",
"ZMinus").
replace(
"_Zplus",
"ZPlus"),allmatplot,pngnamestring,GeoScenario.split(
"_")[2]))
975 index_file.write(
'<img class="Reference" src="../%s/%s/%s%s.png" width="375"/> \n' %(GeoScenario.split(
"_")[0],region.replace(
"_Zminus",
"ZMinus").
replace(
"_Zplus",
"ZPlus"),allmatplot,pngnamestring) )
976 index_file.write(
'<img class="New" src="../%s/%s/%s%s.png" width="375"/> \n' %(GeoScenario.split(
"_")[2],region.replace(
"_Zminus",
"ZMinus").
replace(
"_Zplus",
"ZPlus"),allmatplot,pngnamestring))
977 index_file.write(
'<hr/>\n')
980 index_file.write(
'</div>\n')
982 index_file.write(_hideShowFun[
"buttonandFunction"])
983 index_file.write(
' </body>\n')
984 index_file.write(
'</html>\n')
988 processCmd(
'cp %s/allhgcal/index.html %s/%s/allhgcal/.' %(GeoScenario, opt.WWWAREA,GeoScenario) )
991 for mats
in _individualmaterials:
992 index_file = open(
'%s/indimat/%s/index.html'%(GeoScenario,mats),
'w')
994 index_file.write(
'<html>\n')
995 index_file.write(
' <head>\n')
997 index_file.write(
' <style>img.Reference{margin: 20px auto 20px auto; border: 10px solid green; border-radius: 10px;}img.New{margin: 20px auto 20px auto; border: 10px solid red; border-radius: 10px;} </style> \n')
999 index_file.write(_hideShowFun[
"thestyle"])
1001 index_file.write(
' <title> <h2> HGCAL material budget results for individual materials for %s </h2> </title>\n' %(GeoScenario) )
1002 index_file.write(
' </head>\n')
1003 index_file.write(
' <body>\n')
1004 index_file.write(
' <h2> HGCAL material budget results for : <span style="color:red;font-size:120%%" >%s </span></h2> \n' %(_matPageNameMap[mats]) )
1006 index_file.write(
'<p> %s plots have a green border followed by the %s plots which features a red border. </p>\n' % (GeoScenario.split(
"_")[0], GeoScenario.split(
"_")[2]) )
1008 index_file.write(
'<h2> Geometry: <span style="color:green;" > %s</span>_vs_<span style="color:red;" >%s </span> </h2>\n' % (GeoScenario.split(
"_")[0], GeoScenario.split(
"_")[2]) )
1010 index_file.write(
'<hr/>\n')
1030 index_file.write(_hideShowFun[
"divTabs"])
1033 for region
in [
"_AllHGCAL",
"_ZminusZoom",
"_ZplusZoom"]:
1037 index_file.write(
'<div id="%s" class="tabcontent"> \n' %(region))
1039 if region ==
"_AllHGCAL": pngnamestring =
""
1040 else: pngnamestring = region
1041 for indiplots
in _individualmatplots:
1042 if region ==
"_AllHGCAL":
1043 index_file.write(
'<p> %s <a href="../../%s/%s/%s%s%s.pdf" class="TMLlink">Click to enlarge %s plot</a></p>\n' %(_individualMatPlotsDesc[indiplots].
replace(
"THEMAT",_matPageNameMap[mats]), GeoScenario.split(
"_")[2],mats,indiplots,mats,pngnamestring,GeoScenario.split(
"_")[2]))
1044 index_file.write(
'<img class="Reference" src="../../%s/%s/%s%s%s.png" width="375"/> \n' %(GeoScenario.split(
"_")[0],mats,indiplots,mats,pngnamestring) )
1045 index_file.write(
'<img class="New" src="../../%s/%s/%s%s%s.png" width="375"/> \n' %(GeoScenario.split(
"_")[2],mats,indiplots,mats,pngnamestring))
1046 index_file.write(
'<hr/>\n')
1048 index_file.write(
'<p> %s <a href="../../%s/%s/%s/%s%s%s.pdf" class="TMLlink">Click to enlarge %s plot</a></p>\n' %(_individualMatPlotsDesc[indiplots].
replace(
"THEMAT",_matPageNameMap[mats]), GeoScenario.split(
"_")[2],mats,region.replace(
"_Zminus",
"ZMinus").
replace(
"_Zplus",
"ZPlus"),indiplots,mats,pngnamestring,GeoScenario.split(
"_")[2]))
1049 index_file.write(
'<img class="Reference" src="../../%s/%s/%s/%s%s%s.png" width="375"/> \n' %(GeoScenario.split(
"_")[0],mats,region.replace(
"_Zminus",
"ZMinus").
replace(
"_Zplus",
"ZPlus"),indiplots,mats,pngnamestring) )
1050 index_file.write(
'<img class="New" src="../../%s/%s/%s/%s%s%s.png" width="375"/> \n' %(GeoScenario.split(
"_")[2],mats,region.replace(
"_Zminus",
"ZMinus").
replace(
"_Zplus",
"ZPlus"),indiplots,mats,pngnamestring))
1051 index_file.write(
'<hr/>\n')
1054 index_file.write(
'</div>\n')
1056 index_file.write(_hideShowFun[
"buttonandFunction"])
1057 index_file.write(
' </body>\n')
1058 index_file.write(
'</html>\n')
1062 processCmd(
'cp %s/indimat/%s/index.html %s/%s/indimat/%s/.' %(GeoScenario, mats, opt.WWWAREA,GeoScenario,mats) )
1065 index_file = open(
'%s/fromvertex/index.html'%(GeoScenario),
'w')
1067 index_file.write(
'<html>\n')
1068 index_file.write(
' <head>\n')
1070 index_file.write(
' <style>img.Reference{margin: 20px auto 20px auto; border: 10px solid green; border-radius: 10px;}img.New{margin: 20px auto 20px auto; border: 10px solid red; border-radius: 10px;} </style> \n')
1072 index_file.write(_hideShowFun[
"thestyle"])
1074 index_file.write(
' <title> <h2> HGCAL material budget results from vertex up to in front of muon stations for %s </h2> </title>\n' %(GeoScenario) )
1075 index_file.write(
' </head>\n')
1076 index_file.write(
' <body>\n')
1078 index_file.write(
' <h2> HGCAL material budget results from vertex up to in front of muon stations: <span style="color:red;font-size:120%%" >All detectors </span></h2> \n' )
1080 index_file.write(
'<p> %s plots have a green border followed by the %s plots which features a red border. </p>\n' % (GeoScenario.split(
"_")[0], GeoScenario.split(
"_")[2]) )
1082 index_file.write(
'<h2> Geometry: <span style="color:green;" > %s</span>_vs_<span style="color:red;" >%s </span> </h2>\n' % (GeoScenario.split(
"_")[0], GeoScenario.split(
"_")[2]) )
1084 index_file.write(
'<hr/>\n')
1088 for vertexplots
in _fromvertexplots:
1089 index_file.write(
'<p> %s </p>\n' %(_fromVertexPlotsDesc[vertexplots]))
1090 index_file.write(
'<img class="Reference" src="%s/Figures/MaterialBdg_FromVertexToBackOf%s.png" width="375"/> \n' %(GeoScenario.split(
"_")[0],vertexplots) )
1091 index_file.write(
'<img class="New" src="%s/Figures/MaterialBdg_FromVertexToBackOf%s.png" width="375"/> \n' %(GeoScenario.split(
"_")[2],vertexplots) )
1092 index_file.write(
'<hr/>\n')
1095 index_file.write(
' </body>\n')
1096 index_file.write(
'</html>\n')
1100 processCmd(
'cp %s/fromvertex/index.html %s/%s/fromvertex/.' %(GeoScenario, opt.WWWAREA,GeoScenario) )