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 = subprocess.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 12_1_X" : [
87 "CMSSW_12_1_0_pre2_vs_CMSSW_12_0_0_pre6",
88 "CMSSW_12_1_0_pre2_D77_vs_CMSSW_12_1_0_pre2_D76"
91 "CMSSW_12_0_0_pre6_vs_CMSSW_12_0_0_pre4",
92 "CMSSW_12_0_0_pre4_vs_CMSSW_12_0_0_pre3",
93 "CMSSW_12_0_0_pre3_vs_CMSSW_12_0_0_pre2",
94 "CMSSW_12_0_0_pre2_vs_CMSSW_12_0_0_pre1",
95 "CMSSW_12_0_0_pre1_vs_CMSSW_11_3_0_pre6"
98 "CMSSW_11_3_0_vs_CMSSW_11_3_0_pre6",
99 "CMSSW_11_3_0_pre6_vs_CMSSW_11_3_0_pre5",
100 "CMSSW_11_3_0_pre5_vs_CMSSW_11_3_0_pre4",
101 "CMSSW_11_3_0_pre4_vs_CMSSW_11_3_0_pre3",
102 "CMSSW_11_3_0_pre3_G4VECGEOM_vs_CMSSW_11_3_0_pre3",
103 "CMSSW_11_3_0_pre3_D76_vs_CMSSW_11_3_0_pre3",
104 "CMSSW_11_3_0_pre3_vs_CMSSW_11_3_0_pre2",
105 "CMSSW_11_3_0_pre2_vs_CMSSW_11_3_0_pre1",
106 "CMSSW_11_3_0_pre1_vs_CMSSW_11_2_0_pre10",
109 "CMSSW_11_2_0_vs_CMSSW_11_2_0_pre10",
110 "CMSSW_11_2_0_pre10_vs_CMSSW_11_2_0_pre9",
111 "CMSSW_11_2_0_pre9_vs_CMSSW_11_2_0_pre8",
112 "CMSSW_11_2_0_pre8_vs_CMSSW_11_2_0_pre7",
113 "CMSSW_11_2_0_pre7_vs_CMSSW_11_2_0_pre6",
114 "CMSSW_11_2_0_pre6_ROOT622_vs_CMSSW_11_2_0_pre6",
115 "CMSSW_11_2_0_pre6_vs_CMSSW_11_2_0_pre5",
116 "CMSSW_11_2_0_pre5_GEANT106_vs_CMSSW_11_2_0_pre5",
117 "CMSSW_11_2_0_pre5_vs_CMSSW_11_2_0_pre3",
118 "CMSSW_11_2_0_pre3_vs_CMSSW_11_2_0_pre1",
119 "CMSSW_11_2_0_pre1_vs_CMSSW_11_1_0_pre8"
122 "CMSSW_11_1_0_pre8_raw1100_vs_CMSSW_11_1_0_pre8",
123 "CMSSW_11_1_0_pre8_raw1100_vs_CMSSW_11_1_0_pre7_raw1100",
124 "CMSSW_11_1_0_pre8_vs_CMSSW_11_1_0_pre7",
125 "CMSSW_11_1_0_pre7_raw1100_vs_CMSSW_11_1_0_pre7",
126 "CMSSW_11_1_0_pre7_raw1100_vs_CMSSW_11_1_0_pre6_raw1100",
127 "CMSSW_11_1_0_pre7_vs_CMSSW_11_1_0_pre6",
128 "CMSSW_11_1_0_pre6_raw1100_vs_CMSSW_11_1_0_pre6",
129 "CMSSW_11_1_0_pre6_raw1100_vs_CMSSW_11_1_0_pre5_raw1100",
130 "CMSSW_11_1_0_pre6_vs_CMSSW_11_1_0_pre5",
131 "CMSSW_11_1_0_pre5_vs_CMSSW_11_1_0_pre4",
132 "CMSSW_11_1_0_pre5_raw1100_vs_CMSSW_11_1_0_pre5",
133 "CMSSW_11_1_0_pre5_raw1100_vs_CMSSW_11_1_0_pre4_raw1100",
134 "CMSSW_11_1_0_pre4_raw1100_vs_CMSSW_11_1_0_pre4",
135 "CMSSW_11_1_0_pre4_raw1100_vs_CMSSW_11_1_0_pre3_raw1100",
136 "CMSSW_11_1_0_pre4_GEANT4",
"CMSSW_11_1_0_pre4"
140 geometryTests = OrderedDict()
141 geometryTests = {
"Material budget" : [
143 "Extended2026D49_vs_Extended2026D76",
144 "Extended2026D76_vs_Extended2026D83",
145 "Extended2026D83_vs_Extended2026D86"
149 GeoScenario =
"Extended2026D83_vs_Extended2026D86"
151 RefRelease=
'CMSSW_12_0_0_pre6'
153 NewRelease=
'CMSSW_12_1_0_pre2'
155 NotNormalRelease =
"normal"
156 NotNormalRefRelease =
"normal"
159 if ( os.path.isdir(
'%s/%s' %(opt.WWWAREA, NewRelease))) :
160 print(
"The campaign you are trying to validate has already an existing validation folder in the official www area.")
161 print(
"Make sure you are not overwriting anything and try again.")
164 if "raw" in NotNormalRelease:
168 appendglobaltag =
"_2026D76noPU"
171 appendglobaltag =
"_2026D76noPU"
176 phase2samples_noPU_oldnaming = [
177 # Sample("RelValCloseByParticleGun_CE_H_Fine_300um", dqmVersion="0002", scenario="2026D49", appendGlobalTag=appendglobaltag ),
178 Sample("RelValCloseByParticleGun_CE_H_Fine_300um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
179 Sample("RelValCloseByParticleGun_CE_H_Fine_200um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
180 Sample("RelValCloseByParticleGun_CE_H_Fine_120um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
181 Sample("RelValCloseByParticleGun_CE_H_Coarse_Scint", scenario="2026D49", appendGlobalTag=appendglobaltag ),
182 Sample("RelValCloseByParticleGun_CE_H_Coarse_300um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
183 Sample("RelValCloseByParticleGun_CE_E_Front_300um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
184 Sample("RelValCloseByParticleGun_CE_E_Front_200um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
185 Sample("RelValCloseByParticleGun_CE_E_Front_120um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
186 #Sample("RelValCloseByParticleGun_CE_E_Front_120um", scenario="2026D49", appendGlobalTag=appendglobaltag , version="v2"),
187 Sample("RelValTTbar", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
188 Sample("RelValZMM", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag ),
189 Sample("RelValSingleGammaFlatPt8To150", scenario="2026D49", appendGlobalTag=appendglobaltag ),
190 Sample("RelValSingleMuPt10", scenario="2026D49", appendGlobalTag=appendglobaltag ),
191 Sample("RelValSingleMuPt100", scenario="2026D49", appendGlobalTag=appendglobaltag ),
192 Sample("RelValSingleMuPt1000", scenario="2026D49", appendGlobalTag=appendglobaltag ),
193 Sample("RelValSingleMuFlatPt2To100", scenario="2026D49", appendGlobalTag=appendglobaltag ),
194 Sample("RelValSingleMuFlatPt0p7To10", scenario="2026D49", appendGlobalTag=appendglobaltag ),
195 Sample("RelValSingleEFlatPt2To100", scenario="2026D49", appendGlobalTag=appendglobaltag ),
196 Sample("RelValSingleTauFlatPt2To150", scenario="2026D49", appendGlobalTag=appendglobaltag ),
197 Sample("RelValSinglePiFlatPt0p7To10", scenario="2026D49", appendGlobalTag=appendglobaltag ),
198 Sample("RelValQCD_Pt20toInfMuEnrichPt15", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
199 Sample("RelValQCD_Pt15To7000_Flat", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
200 Sample("RelValZTT", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
201 Sample("RelValZMM", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag ),
202 Sample("RelValZEE", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag ),
203 Sample("RelValB0ToKstarMuMu", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
204 Sample("RelValBsToEleEle", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
205 Sample("RelValBsToMuMu", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
206 Sample("RelValBsToJpsiGamma", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
207 Sample("RelValBsToJpsiPhi_mumuKK", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
208 Sample("RelValBsToPhiPhi_KKKK", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
209 Sample("RelValDisplacedMuPt30To100", scenario="2026D49", appendGlobalTag=appendglobaltag ),
210 Sample("RelValDisplacedMuPt2To10", scenario="2026D49", appendGlobalTag=appendglobaltag ),
211 Sample("RelValDisplacedMuPt10To30", scenario="2026D49", appendGlobalTag=appendglobaltag ),
212 Sample("RelValTauToMuMuMu", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
213 #Sample("RelValMinBias", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
214 Sample("RelValH125GGgluonfusion", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag ),
215 Sample("RelValNuGun", scenario="2026D49", appendGlobalTag=appendglobaltag )
220 phase2samples_noPU = [
241 Sample(
"RelValZpTT_1500", midfix=
"14", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
243 Sample(
"RelValZTT", midfix=
"14TeV", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
244 Sample(
"RelValZMM", midfix=
"14", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
246 Sample(
"RelValZEE", midfix=
"14", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
247 Sample(
"RelValTenTau_15_500_Eta3p1", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
249 Sample(
"RelValTTbar", midfix=
"14TeV", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
250 Sample(
"RelValQCD_Pt15To7000_Flat", midfix=
"14", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
252 Sample(
"RelValNuGun", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
254 Sample(
"RelValMinBias", midfix=
"14TeV", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
255 Sample(
"RelValH125GGgluonfusion", midfix=
"14", scenario=
"2026D49", appendGlobalTag=appendglobaltag )
263 phase2samples_noPU_extend = [
269 Sample(
"RelValSingleMuPt10", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
270 Sample(
"RelValSingleMuPt100", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
271 Sample(
"RelValSingleMuPt1000", scenario=
"2026D49", appendGlobalTag=appendglobaltag )
278 phase2samples_noPU_extend_more = [
298 Sample(
"RelValCloseByPGun_CE_H_Fine_300um", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
299 Sample(
"RelValCloseByPGun_CE_H_Fine_200um", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
300 Sample(
"RelValCloseByPGun_CE_H_Fine_120um", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
301 Sample(
"RelValCloseByPGun_CE_H_Coarse_Scint", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
302 Sample(
"RelValCloseByPGun_CE_H_Coarse_300um", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
303 Sample(
"RelValCloseByPGun_CE_E_Front_300um", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
304 Sample(
"RelValCloseByPGun_CE_E_Front_200um", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
305 Sample(
"RelValCloseByPGun_CE_E_Front_120um", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
306 Sample(
"RelValSingleGammaFlatPt8To150", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
307 Sample(
"RelValSingleEFlatPt2To100", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
308 Sample(
"RelValSinglePiFlatPt0p7To10", scenario=
"2026D49", appendGlobalTag=appendglobaltag )
340 phase2samples_noPU.extend(phase2samples_noPU_extend)
341 phase2samples_noPU.extend(phase2samples_noPU_extend_more)
351 Sample(
"RelValTTbar", midfix=
"14TeV", scenario=
"2026D49", putype=
putype(
"25ns"), punum=200, appendGlobalTag=
"_2026D49PU200", version=
"v2"),
355 RefRepository =
'%s' %(opt.INPUT)
356 NewRepository =
'%s' %(opt.INPUT)
365 fullsimSamples = phase2samples_noPU,
367 refRelease=RefRelease, refRepository=RefRepository,
368 newRelease=NewRelease, newRepository=NewRepository
377 if (
not os.path.isdir(RefRepository+
'/'+NewRelease)) :
378 processCmd(
'mkdir -p '+RefRepository+
'/'+NewRelease)
380 for infi
in phase2samples_noPU:
381 if "_HGCal" in infi.filename(NewRelease):
382 processCmd(
'mv ' + infi.filename(NewRelease) +
' ' + infi.filename(NewRelease).
replace(
"_HGCal",
""))
383 processCmd(
'mv ' + infi.filename(NewRelease).
replace(
"_HGCal",
"") +
' ' + RefRepository+
'/'+NewRelease)
387 processCmd(
'mv ' + infi.filename(NewRelease) +
' ' + RefRepository+
'/'+NewRelease)
392 if (opt.OBJ ==
'layerClusters' or opt.OBJ ==
'hitCalibration' or opt.OBJ ==
'hitValidation' or opt.OBJ ==
'tracksters'):
396 for infi
in phase2samples_noPU:
397 samplename = infi.filename(NewRelease).
replace(
"DQM_V0001_R000000001__",
"").
replace(
"__DQMIO.root",
"")
400 if infi.pileup() ==
"PU":
401 samplename = samplename +
str(infi.pileupNumber())
404 print(_sampleName[infi.name()])
410 if RefRelease !=
None: inputpathRef = RefRepository +
'/' + RefRelease +
'/'
411 inputpathNew = NewRepository +
'/' + NewRelease+
'/'
413 if RefRelease ==
None:
414 cmd =
'python3 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)
415 elif "raw" in NotNormalRelease
and "normal" in NotNormalRefRelease:
416 cmd =
'python3 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)
418 elif "normal" in NotNormalRelease
and "raw" in NotNormalRefRelease:
419 cmd =
'python3 Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease).
replace(
"mcRun4_realistic_v7_2026D77noPU-v1",
"mcRun4_realistic_v7_2026D76noPU-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)
421 elif "raw" in NotNormalRelease
and "raw" in NotNormalRefRelease:
423 cmd =
'python3 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)
424 elif "normal" in NotNormalRelease
and "normal" in NotNormalRefRelease:
425 cmd =
'python3 Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease) +
' ' + 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)
431 cmd =
'python3 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)
435 print(
'Dry-run: ['+cmd+
']')
438 if opt.OBJ ==
'layerClusters':
439 processCmd(
'mv HGCValid_%s_Plots/plots_%s_Layer\ Clusters.html HGCValid_%s_Plots/index.html'%(opt.HTMLVALNAME,samplename,opt.HTMLVALNAME))
440 processCmd(
'awk \'NR>=6&&NR<=396\' HGCValid_%s_Plots/index.html > HGCValid_%s_Plots/index_%s.html '% (opt.HTMLVALNAME,opt.HTMLVALNAME, samplename))
441 processCmd(
'echo " <br/>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
442 processCmd(
'echo " <hr>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
444 if opt.OBJ ==
'hitCalibration':
446 processCmd(
'mv HGCValid_%s_Plots/plots_%s_Calibrated\ RecHits.html HGCValid_%s_Plots/index.html'%(opt.HTMLVALNAME,samplename,opt.HTMLVALNAME))
447 processCmd(
'sed -i \'s/Calibrated\ RecHits//g\' HGCValid_%s_Plots/index.html'%(opt.HTMLVALNAME) )
448 processCmd(
'awk \'NR>=6&&NR<=27\' HGCValid_%s_Plots/index.html > HGCValid_%s_Plots/index_%s.html '% (opt.HTMLVALNAME,opt.HTMLVALNAME, samplename))
449 processCmd(
'echo " <br/>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
450 processCmd(
'echo " <hr>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
452 if opt.OBJ ==
'hitValidation':
453 processCmd(
'mv HGCValid_%s_Plots/plots_%s_Hits.html HGCValid_%s_Plots/index.html'%(opt.HTMLVALNAME,samplename,opt.HTMLVALNAME))
454 processCmd(
'awk \'NR>=6&&NR<=184\' HGCValid_%s_Plots/index.html > HGCValid_%s_Plots/index_%s.html '% (opt.HTMLVALNAME,opt.HTMLVALNAME, samplename))
455 processCmd(
'echo " <br/>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
456 processCmd(
'echo " <hr>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
458 if opt.OBJ ==
'tracksters':
459 processCmd(
'mv HGCValid_%s_Plots/plots_%s_Tracksters.html HGCValid_%s_Plots/index.html'%(opt.HTMLVALNAME,samplename,opt.HTMLVALNAME))
460 processCmd(
'awk \'NR>=6&&NR<=209\' HGCValid_%s_Plots/index.html > HGCValid_%s_Plots/index_%s.html '% (opt.HTMLVALNAME,opt.HTMLVALNAME, samplename))
461 processCmd(
'echo " <br/>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
462 processCmd(
'echo " <hr>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
465 fragments.append(
'HGCValid_%s_Plots/index_%s.html'% (opt.HTMLVALNAME, samplename) )
469 processCmd(
'mv HGCValid_%s_Plots/index.html HGCValid_%s_Plots/test.html' %(opt.HTMLVALNAME,opt.HTMLVALNAME) )
470 index_file = open(
'HGCValid_%s_Plots/index.html'%(opt.HTMLVALNAME),
'w')
472 index_file.write(
'<html>\n')
473 index_file.write(
' <head>\n')
474 index_file.write(
' <title>HGCal validation %s </title>\n' %(opt.HTMLVALNAME) )
475 index_file.write(
' </head>\n')
476 index_file.write(
' <body>\n')
478 for frag
in fragments:
479 with open(frag,
'r') as f:
480 lines = f.read().splitlines()
483 index_file.write(line +
'\n')
489 index_file.write(
' </body>\n')
490 index_file.write(
'</html>\n')
495 if (opt.OBJ ==
'SimHits'):
497 if (
not os.path.isdir(
"hgcalSimHitStudy")) :
500 processCmd(
'cp %s/../public/index.php hgcalSimHitStudy/.'%(opt.WWWAREA) )
504 cmd =
'root.exe -b -q Validation/HGCalValidation/macros/validationplots.C\(\\"hgcSimHit.root' +
'\\",\\"'+ opt.OBJ +
'\\"\)'
506 print(
'Dry-run: ['+cmd+
']')
512 if (opt.OBJ == 'hitValidation'):
514 #Now that we have them in eos lets produce plots
515 #Let's loop through RelVals
516 for infi in phase2samples_noPU:
517 samplename = infi.filename(NewRelease).replace("DQM_V0001_R000000001__","").replace("__DQMIO.root","")
518 #samplename = infi.filename(NewRelease).replace("DQM_V0001_R000000001__","").split("__CMSSW_10_6_0_pre4",1)[0]
519 #samplename = samplename + infi.pileup()
520 if infi.pileup() == "PU":
521 samplename = samplename + str(infi.pileupNumber())
528 if RefRelease != None: inputpathRef = RefRepository +'/' + RefRelease +'/'
529 inputpathNew = NewRepository +'/' + NewRelease+ '/'
531 if RefRelease == None:
532 cmd = 'python3 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)
533 elif "raw" in NotNormalRelease and "normal" in NotNormalRefRelease:
534 cmd = 'python3 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)
535 #cmd = 'python3 Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease).replace("mcRun4_realistic_v3_2026D49noPU_raw1100_rsb-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)
536 elif "raw" in NotNormalRelease and "raw" in NotNormalRefRelease:
537 #cmd = 'python3 Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease) + ' ' + 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)
538 cmd = 'python3 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)
539 elif "normal" in NotNormalRelease and "normal" in NotNormalRefRelease:
540 cmd = 'python3 Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease) + ' ' + 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)
541 #cmd = 'python3 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)
543 #cmd = 'python3 Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease).replace("D49","D41").replace("200-v2","200-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)
544 cmd = 'python3 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)
545 #cmd = 'python3 Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease) + ' ' + 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)
549 print('Dry-run: ['+cmd+']')
551 output = processCmd(cmd)
552 processCmd('mv HGCValid_%s_Plots/plots_%s_Hits.html HGCValid_%s_Plots/index.html'%(opt.HTMLVALNAME,samplename,opt.HTMLVALNAME))
553 processCmd('awk \'NR>=6&&NR<=184\' HGCValid_%s_Plots/index.html > HGCValid_%s_Plots/index_%s.html '% (opt.HTMLVALNAME,opt.HTMLVALNAME, samplename))
554 processCmd('echo " <br/>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
555 processCmd('echo " <hr>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
557 fragments.append( 'HGCValid_%s_Plots/index_%s.html'% (opt.HTMLVALNAME, samplename) )
560 #Let's also create the final index xml file.
561 processCmd('mv HGCValid_%s_Plots/index.html HGCValid_%s_Plots/test.html' %(opt.HTMLVALNAME,opt.HTMLVALNAME) )
562 index_file = open('HGCValid_%s_Plots/index.html'%(opt.HTMLVALNAME),'w')
564 index_file.write('<html>\n')
565 index_file.write(' <head>\n')
566 index_file.write(' <title>HGCal validation %s </title>\n' %(opt.HTMLVALNAME) )
567 index_file.write(' </head>\n')
568 index_file.write(' <body>\n')
570 for frag in fragments:
571 with open(frag,'r') as f:
572 lines = f.read().splitlines()
575 index_file.write(line +
'\n')
581 index_file.write(
' </body>\n')
582 index_file.write(
'</html>\n')
586 #-------------------------------------------------------------------------------------------
587 #This is the Digis part
588 if (opt.OBJ == 'Digis'):
589 #This is where we will save the final output pngs:
590 if (not os.path.isdir("hgcalDigiStudy")) :
591 processCmd('mkdir -p hgcalDigiStudy')
592 processCmd('mkdir -p hgcalDigiStudyEE')
593 processCmd('mkdir -p hgcalDigiStudyHEF')
594 processCmd('mkdir -p hgcalDigiStudyHEB')
596 processCmd('cp %s/../public/index.php hgcalDigiStudy/.'%(opt.WWWAREA) )
597 processCmd('cp %s/../public/index.php hgcalDigiStudyEE/.'%(opt.WWWAREA) )
598 processCmd('cp %s/../public/index.php hgcalDigiStudyHEF/.'%(opt.WWWAREA) )
599 processCmd('cp %s/../public/index.php hgcalDigiStudyHEB/.'%(opt.WWWAREA) )
600 #The input here is from running cmsRun runHGCalDigiStudy_cfg.py, to which
601 #we usually give ttbar noPU as input
603 cmd = 'root.exe -b -q Validation/HGCalValidation/macros/validationplots.C\(\\"hgcDigi.root' + '\\",\\"'+ opt.OBJ + '\\"\)'
605 print('Dry-run: ['+cmd+']')
607 output = processCmd(cmd)
608 #mv the output under the main directory
609 processCmd('mv hgcalDigiStudyEE hgcalDigiStudy/.')
610 processCmd('mv hgcalDigiStudyHEF hgcalDigiStudy/.')
611 processCmd('mv hgcalDigiStudyHEB hgcalDigiStudy/.')
613 #-------------------------------------------------------------------------------------------
614 #This is the RecHits part
615 if (opt.OBJ == 'RecHits'):
616 #This is where we will save the final output pngs:
617 if (not os.path.isdir("hgcalRecHitStudy")) :
618 processCmd('mkdir -p hgcalRecHitStudy')
619 processCmd('mkdir -p hgcalRecHitStudyEE')
620 processCmd('mkdir -p hgcalRecHitStudyHEF')
621 processCmd('mkdir -p hgcalRecHitStudyHEB')
623 processCmd('cp %s/../public/index.php hgcalRecHitStudy/.'%(opt.WWWAREA) )
624 processCmd('cp %s/../public/index.php hgcalRecHitStudyEE/.'%(opt.WWWAREA) )
625 processCmd('cp %s/../public/index.php hgcalRecHitStudyHEF/.'%(opt.WWWAREA) )
626 processCmd('cp %s/../public/index.php hgcalRecHitStudyHEB/.'%(opt.WWWAREA) )
627 #The input here is from running cmsRun runHGCalRecHitStudy_cfg.py, to which
628 #we usually give ttbar noPU as input
629 #Input: hgcRecHit.root
630 cmd = 'root.exe -b -q Validation/HGCalValidation/macros/validationplots.C\(\\"hgcRecHit.root' + '\\",\\"'+ opt.OBJ + '\\"\)'
632 print('Dry-run: ['+cmd+']')
634 output = processCmd(cmd)
635 #mv the output under the main directory
636 processCmd('mv hgcalRecHitStudyEE hgcalRecHitStudy/.')
637 processCmd('mv hgcalRecHitStudyHEF hgcalRecHitStudy/.')
638 processCmd('mv hgcalRecHitStudyHEB hgcalRecHitStudy/.')
640 #-------------------------------------------------------------------------------------------
641 ## TODO #This is the CaloParticles part
642 if (opt.OBJ == 'CaloParticles'):
643 particletypes = ["-11","-13","-211","-321","11","111","13","211","22","321"]
644 #This is where we will save the final output pngs:
645 if (not os.path.isdir("CaloParticles")) :
646 processCmd('mkdir -p CaloParticles')
648 processCmd('cp %s/../public/index.php CaloParticles/.'%(opt.WWWAREA) )
650 #Let's loop through RelVals
651 for infi in phase2samples_noPU:
652 #samplename = infi.filename(NewRelease).replace("DQM_V0001_R000000001__","").replace("__DQMIO.root","")
653 samplename = infi.filename(NewRelease).replace("DQM_V0001_R000000001__","").split("__"+NewRelease,1)[0]
654 samplename = samplename + infi.pileup()
655 if infi.pileup() == "PU":
656 samplename = samplename + str(infi.pileupNumber())
661 if (not os.path.isdir(samplename)) :
662 processCmd('mkdir -p ' + samplename )
663 processCmd('cp %s/RelVals/index.php '%(opt.WWWAREA) + samplename + '/.')
664 for part in particletypes:
665 processCmd('mkdir -p ' + samplename + '/' +part )
667 processCmd('cp %s/RelVals/index.php '%(opt.WWWAREA) + samplename + '/' +part + '/.')
670 if RefRelease != None: inputpathRef = RefRepository +'/' + RefRelease +'/'
671 inputpathNew = NewRepository +'/' + NewRelease+ '/'
672 cmd = 'root.exe -b -q Validation/HGCalValidation/macros/validationplots.C\(\\"'+ inputpathNew + infi.filename(NewRelease) + '\\",\\"'+ opt.OBJ + '\\",\\"'+ samplename + '\\"\\)'
674 print('Dry-run: ['+cmd+']')
676 output = processCmd(cmd)
677 processCmd('mv ' +samplename+ ' CaloParticles/.' )
679 #------------------------------------------------------------------------------------------
680 #Summary section: After processing all the objects the results are gathered, webpages are
681 # created and a summary page is added.
682 #-------------------------------------------------------------------------------------------
683 #Here we will gather all results.
684 if (opt.GATHER != None) :
686 #First we need the top folder to contain all validation releases.
687 index_file = open('index.html','w')
689 index_file.write('<html>\n')
690 index_file.write(' <head>\n')
691 index_file.write(' <title>HGCAL validation results </title>\n' )
692 index_file.write(' </head>\n')
693 index_file.write(' <body>\n')
694 index_file.write(' <h1>\n')
695 index_file.write(' HGCAL Validation Results \n' )
696 index_file.write(' </h1>\n')
697 index_file.write(' <hr/>\n' )
698 index_file.write(' <h2>\n')
699 index_file.write(' Release Validation Campaigns \n' )
700 index_file.write(' </h2>\n')
701 index_file.write(' <ul>\n' )
703 for trel in thereleases.keys():
704 index_file.write(' <li>\n' )
705 index_file.write(' %s\n' %(trel) )
706 for rel in thereleases[trel]:
707 index_file.write(' <ul>\n' )
708 index_file.write(' <li><a href="%s/index.html">%s</a></li>\n' %(rel, rel ) )
709 index_file.write(' </ul>\n' )
710 index_file.write(' </li>\n' )
711 index_file.write(' <br>\n' )
712 index_file.write(' <br>\n' )
713 index_file.write(' <br>\n' )
715 index_file.write(' </ul>\n' )
716 index_file.write(' <hr/>\n' )
718 #New section : Geometry Validation
719 #Regardless of the release validation, the top html menu should contain the geometry section.
720 #we put this in the "gather" step.
721 index_file.write(' <h2>\n')
722 index_file.write(' Geometry Validation \n' )
723 index_file.write(' </h2>\n')
724 index_file.write(' <ul>\n' )
726 for tgeo in geometryTests.keys():
727 index_file.write(' <li>\n' )
728 index_file.write(' %s\n' %(tgeo) )
729 for geo in geometryTests[tgeo]:
730 #We need the directory for the geometry related results
731 if (not os.path.isdir(geo)):
732 processCmd('mkdir -p %s/%s' %(opt.WWWAREA,geo) )
733 processCmd('mkdir -p %s' %(geo) )
734 for mats in _individualmaterials:
735 processCmd('mkdir -p %s/%s/indimat/%s' %(opt.WWWAREA,geo,mats) )
736 processCmd('mkdir -p %s/indimat/%s' %(geo,mats) )
738 index_file.write(' <ul>\n' )
739 index_file.write(' <li><a href="%s/index.html">%s</a></li>\n' %(geo, geo ) )
740 index_file.write(' </ul>\n' )
741 index_file.write(' </li>\n' )
742 index_file.write(' <br>\n' )
743 index_file.write(' <br>\n' )
744 index_file.write(' <br>\n' )
747 index_file.write(' </body>\n')
748 index_file.write('</html>\n')
751 #This is the main html file for the validation webpage. In order to avoid
752 #surprises when experimenting, in order to copy it automatically to the
753 #www area you should have activated the relevant flag:
754 if (opt.COPYHTML) : processCmd('cp index.html %s/.' %(opt.WWWAREA) )
756 #Let's make also the summary folder
757 if (not os.path.isdir("HGCValid_summary_Plots")):
758 processCmd('mkdir -p HGCValid_summary_Plots')
760 #To avoid the nans transpose later
761 df = pd.DataFrame.from_dict(_summary, orient = 'index').transpose()
762 #Make a specific order in columns
765 index_file = open('HGCValid_summary_Plots/index.html','w')
767 index_file.write('<html>\n')
768 index_file.write(' <body>\n')
770 #Let's loop through RelVals
771 for infi in phase2samples_noPU:
772 samplename = infi.filename(NewRelease).replace("DQM_V0001_R000000001__","").replace("__DQMIO.root","")
773 index_file.write( '<h2> %s </h2> \n' %(_sampleName[infi.name()]) )
774 #table here with summary objects
775 index_file.write('<table> \n')
776 index_file.write(' <tr>\n')
777 #This is the row with the headers. So, the objects for us.
779 index_file.write(' <th>%s</th>\n' %(_pageNameMap[obj]) )
780 index_file.write(' </tr>\n')
782 for i, row in df.iterrows():
783 index_file.write(' <tr>\n')
784 for j, column in row.iteritems():
786 index_file.write(' <td>\n')
787 index_file.write(' <ul>\n')
789 # if df[obj][ind] == None:
791 index_file.write(' </ul>\n')
792 index_file.write(' </td>\n')
794 #index_file.write(' \n')
798 #index_file.write(' <li><a href="plots_%s_%s">%s</a></li> \n' %(samplename, df[obj][ind], df[obj][ind].partition("/")[2] ))
799 if "tracksters" in j:
800 index_file.write(' <li><a href="../HGCValid_%s_Plots/plots_%s_%s">%s</a></li> \n' %(j, samplename, column, column.replace("ticlTracksters","") ))
802 index_file.write(' <li><a href="../HGCValid_%s_Plots/plots_%s_%s">%s</a></li> \n' %(j, samplename, column, column.partition("/")[2] ))
804 index_file.write(' </ul>\n')
805 index_file.write(' </td>\n')
807 index_file.write(' </tr>\n')
809 index_file.write(' </table>\n')
810 index_file.write(' <br/>\n' )
811 index_file.write(' <br/>\n' )
812 index_file.write(' <br/>\n' )
815 index_file.write(' </body>\n')
816 index_file.write('</html>\n')
819 objects = opt.GATHER.split(",")
822 if "raw" in NotNormalRelease and "raw" in NotNormalRefRelease:
823 localoutputdir = NewRelease + "_raw1100" + "_vs_" + RefRelease + "_raw1100"
824 elif "raw" in NotNormalRelease and "normal" in NotNormalRefRelease:
825 #localoutputdir = NewRelease + "_raw1100" + "_vs_" + RefRelease
826 localoutputdir = NewRelease + "_D76" + "_vs_" + RefRelease
827 elif "normal" in NotNormalRelease and "normal" in NotNormalRefRelease:
828 localoutputdir = NewRelease + "_vs_" + RefRelease
830 localoutputdir = NewRelease
832 #make the structure to hold the objects
834 #This is where we will save the final output per campaing:
835 if (not os.path.isdir('%s/standalone' %(localoutputdir))) :
836 processCmd('mkdir -p %s/standalone' %(localoutputdir))
837 if (obj!="standalone"): processCmd('mv HGCValid_%s_Plots %s'%(obj, localoutputdir) )
839 processCmd('mv hgcalSimHitStudy %s/standalone/.'%(localoutputdir) )
840 processCmd('mv hgcalDigiStudy %s/standalone/.'%(localoutputdir) )
841 processCmd('mv hgcalRecHitStudy %s/standalone/.'%(localoutputdir) )
842 processCmd('cp %s/../public/index.php %s/standalone/.'%(opt.WWWAREA, localoutputdir) )
846 for infi
in phase2samples_noPU:
847 samplename = infi.filename(NewRelease).
replace(
"DQM_V0001_R000000001__",
"").
replace(
"__DQMIO.root",
"")
853 if df[obj][ind] ==
None:
continue
854 else:
processCmd(
'cp -r %s/HGCValid_%s_Plots/plots_%s_%s %s/HGCValid_summary_Plots ' %(NewRelease, obj, samplename, df[obj][ind].partition(
"/")[0], NewRelease ) )
857 #html file of the relval campaign we are validating
858 index_file = open('%s/index.html'%(localoutputdir),'w')
860 index_file.write('<html>\n')
861 index_file.write(' <head>\n')
862 index_file.write(' <title> <h2> HGCal validation results for %s </h2> </title>\n' %(localoutputdir) )
863 index_file.write(' </head>\n')
864 index_file.write(' <body>\n')
865 index_file.write(' <h2> HGCal validation results for %s </h2> \n' %(localoutputdir) )
869 if (obj!="standalone"):
870 index_file.write(' <br/>\n' )
871 index_file.write(' <ul>\n' )
872 index_file.write(' <li><a href="HGCValid_%s_Plots/index.html">%s</a></li>\n' %(obj, _pageNameMap[obj] ) )
873 index_file.write(' </ul>\n' )
874 index_file.write(' <br/>\n' )
876 index_file.write(' <br/>\n' )
877 index_file.write(' <ul>\n' )
878 index_file.write(' <li><a href="%s/index.php">%s</a></li>\n' %(obj, _pageNameMap[obj] ) )
879 index_file.write(' </ul>\n' )
880 index_file.write(' <br/>\n' )
884 index_file.write(' </body>\n')
885 index_file.write('</html>\n')
888 #We choose to zip in uncompressed form all the files for two reasons:
889 #1. Copying to eos so many files is really slow. It is faster to
890 # create one uncompressed file, copy that and unzip there.
891 #2. Inevitably, we will have to do some cleanup of the older campaigns,
892 # since we will reach the number of files limit quite easily.
893 # It will be easier to have already save the zip file and just delete
894 # the directory content, leaving inside only the zip file.
896 # This will take some time.
897 # processCmd('zip -0 -r %s.zip %s' %(localoutputdir,localoutputdir) )
898 # processCmd('cp %s.zip %s/.' %(localoutputdir,opt.WWWAREA) )
899 # processCmd('cd %s' %(opt.WWWAREA) )
900 # processCmd('unzip -q %s.zip' %(localoutputdir) )
901 # processCmd('mv %s.zip %s/.' %(localoutputdir,localoutputdir) )
905 #------------------------------------------------------------------------------------------
906 #Geometry section: Here we gather results from geometry related validation packages.
907 #-------------------------------------------------------------------------------------------
908 #Keep in mind that the gne
910 #html file of the geometry scenario we are estimating the material budget
911 index_file = open('%s/index.html'%(GeoScenario),'w')
913 index_file.write('<html>\n')
914 index_file.write(' <head>\n')
915 index_file.write(' <title> <h2> HGCAL material budget results for %s </h2> </title>\n' %(GeoScenario) )
916 index_file.write(' </head>\n')
917 index_file.write(' <body>\n')
918 index_file.write(' <h2> HGCAL material budget results for %s </h2> \n' %(GeoScenario) )
920 for obj in _MatBudSections:
922 #We need the directory for the geometry related results
923 if (not os.path.isdir('%s/%s/%s' %(opt.WWWAREA,GeoScenario,obj))):
924 processCmd('mkdir -p %s/%s/%s' %(opt.WWWAREA,GeoScenario,obj) )
925 processCmd('mkdir -p %s/%s' %(GeoScenario,obj) )
927 index_file.write(' <br/>\n' )
928 index_file.write(' <ul>\n' )
929 index_file.write(' <li><a href="%s/index.html">%s</a></li>\n' %(obj, _geoPageNameMap[obj] ) )
930 index_file.write(' </ul>\n' )
931 index_file.write(' <br/>\n' )
934 index_file.write(' </body>\n')
935 index_file.write('</html>\n')
938 #Copy the material budget menu file in the current geometry scenario
939 processCmd('cp %s/index.html %s/%s/.' %(GeoScenario, opt.WWWAREA,GeoScenario) )
941 #html file for the menu of the individual materials
942 index_file = open('%s/indimat/index.html'%(GeoScenario),'w')
944 index_file.write('<html>\n')
945 index_file.write(' <head>\n')
946 index_file.write(' <title> <h2> HGCAL material budget results for individual materials for %s </h2> </title>\n' %(GeoScenario) )
947 index_file.write(' </head>\n')
948 index_file.write(' <body>\n')
949 index_file.write(' <h2> HGCAL material budget results for individual materials for %s </h2> \n' %(GeoScenario) )
950 for mats in _individualmaterials:
952 #index_file.write(' <br/>\n' )
953 index_file.write(' <ul>\n' )
954 index_file.write(' <li><a href="%s/index.html">%s</a></li>\n' %(mats, _matPageNameMap[mats] ) )
955 index_file.write(' </ul>\n' )
956 #index_file.write(' <br/>\n' )
959 index_file.write(' </body>\n')
960 index_file.write('</html>\n')
963 #Copy the menu html file for the individual materials
964 processCmd('cp %s/indimat/index.html %s/%s/indimat/.' %(GeoScenario, opt.WWWAREA,GeoScenario) )
966 #html file for all HGCal stack plots materials
967 index_file = open('%s/allhgcal/index.html'%(GeoScenario),'w')
969 index_file.write('<html>\n')
970 index_file.write(' <head>\n')
972 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')
974 index_file.write(_hideShowFun["thestyle"])
976 index_file.write(' <title> <h2> HGCAL material budget results for all materials for %s </h2> </title>\n' %(GeoScenario) )
977 index_file.write(' </head>\n')
978 index_file.write(' <body>\n')
980 index_file.write(' <h2> HGCAL material budget results for : <span style="color:red;font-size:120%%" >All Materials </span></h2> \n' )
982 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]) )
984 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]) )
986 index_file.write('<hr/>\n')
988 index_file.write(_hideShowFun["divTabs"])
990 for region in ["_AllHGCAL", "_ZminusZoom", "_ZplusZoom"]:
992 index_file.write('<div id="%s" class="tabcontent"> \n' %(region))
994 if region == "_AllHGCAL": pngnamestring = ""
995 else: pngnamestring = region
997 for allmatplot in _allmaterialsplots:
998 if region == "_AllHGCAL":
999 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]))
1000 index_file.write('<img class="Reference" src="../%s/%s%s.png" width="375"/> \n' %(GeoScenario.split("_")[0],allmatplot,pngnamestring) )
1001 index_file.write('<img class="New" src="../%s/%s%s.png" width="375"/> \n' %(GeoScenario.split("_")[2],allmatplot,pngnamestring))
1002 index_file.write('<hr/>\n')
1003 elif region != "_AllHGCAL" and "HGCal_l_vs_z_vs_R" in allmatplot:
1004 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]))
1005 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) )
1006 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))
1007 index_file.write('<hr/>\n')
1010 index_file.write('</div>\n')
1012 index_file.write(_hideShowFun["buttonandFunction"])
1013 index_file.write(' </body>\n')
1014 index_file.write('</html>\n')
1017 #Copy all materials budget file
1018 processCmd('cp %s/allhgcal/index.html %s/%s/allhgcal/.' %(GeoScenario, opt.WWWAREA,GeoScenario) )
1020 #html file of the individual materials for the material budget analysis
1021 for mats in _individualmaterials:
1022 index_file = open('%s/indimat/%s/index.html'%(GeoScenario,mats),'w')
1024 index_file.write('<html>\n')
1025 index_file.write(' <head>\n')
1027 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')
1029 index_file.write(_hideShowFun["thestyle"])
1031 index_file.write(' <title> <h2> HGCAL material budget results for individual materials for %s </h2> </title>\n' %(GeoScenario) )
1032 index_file.write(' </head>\n')
1033 index_file.write(' <body>\n')
1034 index_file.write(' <h2> HGCAL material budget results for : <span style="color:red;font-size:120%%" >%s </span></h2> \n' %(_matPageNameMap[mats]) )
1036 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]) )
1038 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]) )
1040 index_file.write('<hr/>\n')
1042 #--------------------------------------------------------------
1043 #This one below is a solution using a table with 3 columns:
1044 #Two for the plots and the third for the text.
1046 #index_file.write('<table style=\'font-size:120%%\' border="1" cellspacing="1" cellpadding="0">\n')
1047 #index_file.write('<tbody>\n')
1049 #for indiplots in _individualmatplots:
1050 # index_file.write('<tr>\n')
1051 # index_file.write('<td> <img class="Reference" src="../../%s/%s/%s%s.png" width="375"/> </td>\n' %(GeoScenario.split("_")[0],mats,indiplots,mats) )
1052 # index_file.write('<td> <img class="New" src="../../%s/%s/%s%s.png" width="375"/> </td>\n' %(GeoScenario.split("_")[2],mats,indiplots,mats))
1053 # index_file.write('<td> %s <a href="../../%s/%s/%s%s.pdf" class="TMLlink">Click to enlarge %s plot</a></td>\n' %(_individualMatPlotsDesc[indiplots].replace("THEMAT",_matPageNameMap[mats]), GeoScenario.split("_")[2],mats,indiplots,mats,GeoScenario.split("_")[2]))
1054 # index_file.write('</tr>\n')
1057 #index_file.write('</tbody>\n')
1058 #index_file.write('</table>\n')
1059 #--------------------------------------------------------------
1060 index_file.write(_hideShowFun["divTabs"])
1062 #Individual material here for: All HGCAL, Zminus, Zplus
1063 for region in ["_AllHGCAL", "_ZminusZoom", "_ZplusZoom"]:
1064 #The hide/show button
1065 #index_file.write(_hideShowFun["buttonandFunction%s"%(region)])
1067 index_file.write('<div id="%s" class="tabcontent"> \n' %(region))
1069 if region == "_AllHGCAL": pngnamestring = ""
1070 else: pngnamestring = region
1071 for indiplots in _individualmatplots:
1072 if region == "_AllHGCAL":
1073 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]))
1074 index_file.write('<img class="Reference" src="../../%s/%s/%s%s%s.png" width="375"/> \n' %(GeoScenario.split("_")[0],mats,indiplots,mats,pngnamestring) )
1075 index_file.write('<img class="New" src="../../%s/%s/%s%s%s.png" width="375"/> \n' %(GeoScenario.split("_")[2],mats,indiplots,mats,pngnamestring))
1076 index_file.write('<hr/>\n')
1078 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]))
1079 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) )
1080 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))
1081 index_file.write('<hr/>\n')
1084 index_file.write('</div>\n')
1086 index_file.write(_hideShowFun["buttonandFunction"])
1087 index_file.write(' </body>\n')
1088 index_file.write('</html>\n')
1091 #Copy the individual materials budget file
1092 processCmd('cp %s/indimat/%s/index.html %s/%s/indimat/%s/.' %(GeoScenario, mats, opt.WWWAREA,GeoScenario,mats) )
1094 #html file for from vertex up to muon stations
1095 index_file = open('%s/fromvertex/index.html'%(GeoScenario),'w')
1097 index_file.write('<html>\n')
1098 index_file.write(' <head>\n')
1100 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')
1102 index_file.write(_hideShowFun["thestyle"])
1104 index_file.write(' <title> <h2> HGCAL material budget results from vertex up to in front of muon stations for %s </h2> </title>\n' %(GeoScenario) )
1105 index_file.write(' </head>\n')
1106 index_file.write(' <body>\n')
1108 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' )
1110 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]) )
1112 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]) )
1114 index_file.write('<hr/>\n')
1116 #index_file.write(_hideShowFun["divTabs"])
1118 for vertexplots in _fromvertexplots:
1119 index_file.write('<p> %s </p>\n' %(_fromVertexPlotsDesc[vertexplots]))
1120 index_file.write('<img class="Reference" src="%s/Figures/MaterialBdg_FromVertexToBackOf%s.png" width="375"/> \n' %(GeoScenario.split("_")[0],vertexplots) )
1121 index_file.write('<img class="New" src="%s/Figures/MaterialBdg_FromVertexToBackOf%s.png" width="375"/> \n' %(GeoScenario.split("_")[2],vertexplots) )
1122 index_file.write('<hr/>\n')
1124 #index_file.write(_hideShowFun["buttonandFunction"])
1125 index_file.write(' </body>\n')
1126 index_file.write('</html>\n')
1129 #Copy all materials budget file
1130 processCmd('cp %s/fromvertex/index.html %s/%s/fromvertex/.' %(GeoScenario, opt.WWWAREA,GeoScenario) )
if(conf_.getParameter< bool >("UseStripCablingDB"))
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)