20 from collections
import OrderedDict
22 from Validation.RecoTrack.plotting.validation
import Sample, Validation
23 from Validation.HGCalValidation.hgcalHtml
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_2_X" : [
87 "CMSSW_12_2_0_pre3_D88_vs_CMSSW_12_2_0_pre3_D77",
88 "CMSSW_12_2_0_pre3_vs_CMSSW_12_2_0_pre2",
89 "CMSSW_12_2_0_pre2_vs_CMSSW_12_1_0_pre5"
92 "CMSSW_12_1_0_pre5_vs_CMSSW_12_1_0_pre4",
93 "CMSSW_12_1_0_pre5_D77_vs_CMSSW_12_1_0_pre4_D76",
94 "CMSSW_12_1_0_pre4_ROOT624_vs_CMSSW_12_1_0_pre4",
95 "CMSSW_12_1_0_pre4_vs_CMSSW_12_1_0_pre3",
96 "CMSSW_12_1_0_pre3_vs_CMSSW_12_1_0_pre2",
97 "CMSSW_12_1_0_pre2_vs_CMSSW_12_0_0_pre6",
98 "CMSSW_12_1_0_pre2_D77_vs_CMSSW_12_1_0_pre2_D76"
101 "CMSSW_12_0_1_vs_CMSSW_12_0_0_pre4",
102 "CMSSW_12_0_0_pre6_vs_CMSSW_12_0_0_pre4",
103 "CMSSW_12_0_0_pre4_vs_CMSSW_12_0_0_pre3",
104 "CMSSW_12_0_0_pre3_vs_CMSSW_12_0_0_pre2",
105 "CMSSW_12_0_0_pre2_vs_CMSSW_12_0_0_pre1",
106 "CMSSW_12_0_0_pre1_vs_CMSSW_11_3_0_pre6"
109 "CMSSW_11_3_0_vs_CMSSW_11_3_0_pre6",
110 "CMSSW_11_3_0_pre6_vs_CMSSW_11_3_0_pre5",
111 "CMSSW_11_3_0_pre5_vs_CMSSW_11_3_0_pre4",
112 "CMSSW_11_3_0_pre4_vs_CMSSW_11_3_0_pre3",
113 "CMSSW_11_3_0_pre3_G4VECGEOM_vs_CMSSW_11_3_0_pre3",
114 "CMSSW_11_3_0_pre3_D76_vs_CMSSW_11_3_0_pre3",
115 "CMSSW_11_3_0_pre3_vs_CMSSW_11_3_0_pre2",
116 "CMSSW_11_3_0_pre2_vs_CMSSW_11_3_0_pre1",
117 "CMSSW_11_3_0_pre1_vs_CMSSW_11_2_0_pre10",
120 "CMSSW_11_2_0_vs_CMSSW_11_2_0_pre10",
121 "CMSSW_11_2_0_pre10_vs_CMSSW_11_2_0_pre9",
122 "CMSSW_11_2_0_pre9_vs_CMSSW_11_2_0_pre8",
123 "CMSSW_11_2_0_pre8_vs_CMSSW_11_2_0_pre7",
124 "CMSSW_11_2_0_pre7_vs_CMSSW_11_2_0_pre6",
125 "CMSSW_11_2_0_pre6_ROOT622_vs_CMSSW_11_2_0_pre6",
126 "CMSSW_11_2_0_pre6_vs_CMSSW_11_2_0_pre5",
127 "CMSSW_11_2_0_pre5_GEANT106_vs_CMSSW_11_2_0_pre5",
128 "CMSSW_11_2_0_pre5_vs_CMSSW_11_2_0_pre3",
129 "CMSSW_11_2_0_pre3_vs_CMSSW_11_2_0_pre1",
130 "CMSSW_11_2_0_pre1_vs_CMSSW_11_1_0_pre8"
133 "CMSSW_11_1_0_pre8_raw1100_vs_CMSSW_11_1_0_pre8",
134 "CMSSW_11_1_0_pre8_raw1100_vs_CMSSW_11_1_0_pre7_raw1100",
135 "CMSSW_11_1_0_pre8_vs_CMSSW_11_1_0_pre7",
136 "CMSSW_11_1_0_pre7_raw1100_vs_CMSSW_11_1_0_pre7",
137 "CMSSW_11_1_0_pre7_raw1100_vs_CMSSW_11_1_0_pre6_raw1100",
138 "CMSSW_11_1_0_pre7_vs_CMSSW_11_1_0_pre6",
139 "CMSSW_11_1_0_pre6_raw1100_vs_CMSSW_11_1_0_pre6",
140 "CMSSW_11_1_0_pre6_raw1100_vs_CMSSW_11_1_0_pre5_raw1100",
141 "CMSSW_11_1_0_pre6_vs_CMSSW_11_1_0_pre5",
142 "CMSSW_11_1_0_pre5_vs_CMSSW_11_1_0_pre4",
143 "CMSSW_11_1_0_pre5_raw1100_vs_CMSSW_11_1_0_pre5",
144 "CMSSW_11_1_0_pre5_raw1100_vs_CMSSW_11_1_0_pre4_raw1100",
145 "CMSSW_11_1_0_pre4_raw1100_vs_CMSSW_11_1_0_pre4",
146 "CMSSW_11_1_0_pre4_raw1100_vs_CMSSW_11_1_0_pre3_raw1100",
147 "CMSSW_11_1_0_pre4_GEANT4",
"CMSSW_11_1_0_pre4"
151 geometryTests = OrderedDict()
152 geometryTests = {
"Material budget" : [
154 "Extended2026D49_vs_Extended2026D76",
155 "Extended2026D76_vs_Extended2026D83",
156 "Extended2026D83_vs_Extended2026D86",
157 "Extended2026D77_vs_Extended2026D88"
161 GeoScenario =
"Extended2026D77_vs_Extended2026D88"
163 RefRelease=
'CMSSW_12_2_0_pre3'
165 NewRelease=
'CMSSW_12_2_0_pre3'
167 NotNormalRelease =
"normal"
168 NotNormalRefRelease =
"normal"
171 if ( os.path.isdir(
'%s/%s' %(opt.WWWAREA, NewRelease))) :
172 print(
"The campaign you are trying to validate has already an existing validation folder in the official www area.")
173 print(
"Make sure you are not overwriting anything and try again.")
176 if "raw" in NotNormalRelease:
181 appendglobaltag =
"_2026D88noPU"
186 appendglobaltag =
"_2026D88noPU"
190 phase2samples_noPU_oldnaming = [
191 # Sample("RelValCloseByParticleGun_CE_H_Fine_300um", dqmVersion="0002", scenario="2026D49", appendGlobalTag=appendglobaltag ),
192 Sample("RelValCloseByParticleGun_CE_H_Fine_300um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
193 Sample("RelValCloseByParticleGun_CE_H_Fine_200um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
194 Sample("RelValCloseByParticleGun_CE_H_Fine_120um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
195 Sample("RelValCloseByParticleGun_CE_H_Coarse_Scint", scenario="2026D49", appendGlobalTag=appendglobaltag ),
196 Sample("RelValCloseByParticleGun_CE_H_Coarse_300um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
197 Sample("RelValCloseByParticleGun_CE_E_Front_300um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
198 Sample("RelValCloseByParticleGun_CE_E_Front_200um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
199 Sample("RelValCloseByParticleGun_CE_E_Front_120um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
200 #Sample("RelValCloseByParticleGun_CE_E_Front_120um", scenario="2026D49", appendGlobalTag=appendglobaltag , version="v2"),
201 Sample("RelValTTbar", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
202 Sample("RelValZMM", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag ),
203 Sample("RelValSingleGammaFlatPt8To150", scenario="2026D49", appendGlobalTag=appendglobaltag ),
204 Sample("RelValSingleMuPt10", scenario="2026D49", appendGlobalTag=appendglobaltag ),
205 Sample("RelValSingleMuPt100", scenario="2026D49", appendGlobalTag=appendglobaltag ),
206 Sample("RelValSingleMuPt1000", scenario="2026D49", appendGlobalTag=appendglobaltag ),
207 Sample("RelValSingleMuFlatPt2To100", scenario="2026D49", appendGlobalTag=appendglobaltag ),
208 Sample("RelValSingleMuFlatPt0p7To10", scenario="2026D49", appendGlobalTag=appendglobaltag ),
209 Sample("RelValSingleEFlatPt2To100", scenario="2026D49", appendGlobalTag=appendglobaltag ),
210 Sample("RelValSingleTauFlatPt2To150", scenario="2026D49", appendGlobalTag=appendglobaltag ),
211 Sample("RelValSinglePiFlatPt0p7To10", scenario="2026D49", appendGlobalTag=appendglobaltag ),
212 Sample("RelValQCD_Pt20toInfMuEnrichPt15", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
213 Sample("RelValQCD_Pt15To7000_Flat", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
214 Sample("RelValZTT", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
215 Sample("RelValZMM", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag ),
216 Sample("RelValZEE", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag ),
217 Sample("RelValB0ToKstarMuMu", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
218 Sample("RelValBsToEleEle", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
219 Sample("RelValBsToMuMu", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
220 Sample("RelValBsToJpsiGamma", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
221 Sample("RelValBsToJpsiPhi_mumuKK", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
222 Sample("RelValBsToPhiPhi_KKKK", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
223 Sample("RelValDisplacedMuPt30To100", scenario="2026D49", appendGlobalTag=appendglobaltag ),
224 Sample("RelValDisplacedMuPt2To10", scenario="2026D49", appendGlobalTag=appendglobaltag ),
225 Sample("RelValDisplacedMuPt10To30", scenario="2026D49", appendGlobalTag=appendglobaltag ),
226 Sample("RelValTauToMuMuMu", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
227 #Sample("RelValMinBias", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
228 Sample("RelValH125GGgluonfusion", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag ),
229 Sample("RelValNuGun", scenario="2026D49", appendGlobalTag=appendglobaltag )
234 phase2samples_noPU = [
255 Sample(
"RelValZpTT_1500", midfix=
"14", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
257 Sample(
"RelValZTT", midfix=
"14TeV", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
258 Sample(
"RelValZMM", midfix=
"14", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
260 Sample(
"RelValZEE", midfix=
"14", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
261 Sample(
"RelValTenTau_15_500_Eta3p1", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
263 Sample(
"RelValTTbar", midfix=
"14TeV", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
264 Sample(
"RelValQCD_Pt15To7000_Flat", midfix=
"14", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
266 Sample(
"RelValNuGun", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
268 Sample(
"RelValMinBias", midfix=
"14TeV", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
269 Sample(
"RelValH125GGgluonfusion", midfix=
"14", scenario=
"2026D49", appendGlobalTag=appendglobaltag )
277 phase2samples_noPU_extend = [
283 Sample(
"RelValSingleMuPt10", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
284 Sample(
"RelValSingleMuPt100", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
285 Sample(
"RelValSingleMuPt1000", scenario=
"2026D49", appendGlobalTag=appendglobaltag )
292 phase2samples_noPU_extend_more = [
326 Sample(
"RelValCloseByPGun_CE_H_Fine_300um", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
327 Sample(
"RelValCloseByPGun_CE_H_Fine_200um", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
328 Sample(
"RelValCloseByPGun_CE_H_Fine_120um", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
329 Sample(
"RelValCloseByPGun_CE_H_Coarse_Scint", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
330 Sample(
"RelValCloseByPGun_CE_H_Coarse_300um", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
331 Sample(
"RelValCloseByPGun_CE_E_Front_300um", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
332 Sample(
"RelValCloseByPGun_CE_E_Front_200um", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
333 Sample(
"RelValCloseByPGun_CE_E_Front_120um", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
334 Sample(
"RelValSingleGammaFlatPt8To150", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
335 Sample(
"RelValSingleEFlatPt2To100", scenario=
"2026D49", appendGlobalTag=appendglobaltag ),
336 Sample(
"RelValSinglePiFlatPt0p7To10", scenario=
"2026D49", appendGlobalTag=appendglobaltag )
368 phase2samples_noPU.extend(phase2samples_noPU_extend)
369 phase2samples_noPU.extend(phase2samples_noPU_extend_more)
380 Sample(
"RelValTTbar", midfix=
"14TeV", scenario=
"2026D49", putype=
putype(
"25ns"), punum=200, appendGlobalTag=
"_2026D49PU200", version=
"v2"),
384 RefRepository =
'%s' %(opt.INPUT)
385 NewRepository =
'%s' %(opt.INPUT)
394 fullsimSamples = phase2samples_noPU,
396 refRelease=RefRelease, refRepository=RefRepository,
397 newRelease=NewRelease, newRepository=NewRepository
406 if (
not os.path.isdir(RefRepository+
'/'+NewRelease)) :
407 processCmd(
'mkdir -p '+RefRepository+
'/'+NewRelease)
409 for infi
in phase2samples_noPU:
410 if "_HGCal" in infi.filename(NewRelease):
411 processCmd(
'mv ' + infi.filename(NewRelease) +
' ' + infi.filename(NewRelease).
replace(
"_HGCal",
""))
412 processCmd(
'mv ' + infi.filename(NewRelease).
replace(
"_HGCal",
"") +
' ' + RefRepository+
'/'+NewRelease)
416 processCmd(
'mv ' + infi.filename(NewRelease) +
' ' + RefRepository+
'/'+NewRelease)
421 if (opt.OBJ ==
'layerClusters' or opt.OBJ ==
'hitCalibration' or opt.OBJ ==
'hitValidation' or opt.OBJ ==
'tracksters' or opt.OBJ ==
'simulation'):
424 if opt.OBJ ==
'simulation':
processCmd(
'mkdir HGCValid_SimClusters_Plots HGCValid_CaloParticles_Plots')
427 for infi
in phase2samples_noPU:
428 samplename = infi.filename(NewRelease).
replace(
"DQM_V0001_R000000001__",
"").
replace(
"__DQMIO.root",
"")
431 if infi.pileup() ==
"PU":
432 samplename = samplename +
str(infi.pileupNumber())
435 print(_sampleName[infi.name()])
441 if RefRelease !=
None: inputpathRef = RefRepository +
'/' + RefRelease +
'/'
442 inputpathNew = NewRepository +
'/' + NewRelease+
'/'
444 if RefRelease ==
None:
445 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)
446 elif "raw" in NotNormalRelease
and "normal" in NotNormalRefRelease:
447 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)
449 elif "normal" in NotNormalRelease
and "raw" in NotNormalRefRelease:
450 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)
452 elif "raw" in NotNormalRelease
and "raw" in NotNormalRefRelease:
454 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)
455 elif "normal" in NotNormalRelease
and "normal" in NotNormalRefRelease:
457 cmd =
'python3 Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease).
replace(
"2026D88noPU-v1",
"2026D77noPU-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)
462 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)
466 print(
'Dry-run: ['+cmd+
']')
469 if opt.OBJ ==
'layerClusters':
470 processCmd(
'mv HGCValid_%s_Plots/plots_%s_Layer\ Clusters.html HGCValid_%s_Plots/index.html'%(opt.HTMLVALNAME,samplename,opt.HTMLVALNAME))
471 processCmd(
'awk \'NR>=6&&NR<=396\' HGCValid_%s_Plots/index.html > HGCValid_%s_Plots/index_%s.html '% (opt.HTMLVALNAME,opt.HTMLVALNAME, samplename))
472 processCmd(
'echo " <br/>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
473 processCmd(
'echo " <hr>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
475 if opt.OBJ ==
'hitCalibration':
477 processCmd(
'mv HGCValid_%s_Plots/plots_%s_Calibrated\ RecHits.html HGCValid_%s_Plots/index.html'%(opt.HTMLVALNAME,samplename,opt.HTMLVALNAME))
478 processCmd(
'sed -i \'s/Calibrated\ RecHits//g\' HGCValid_%s_Plots/index.html'%(opt.HTMLVALNAME) )
479 processCmd(
'awk \'NR>=6&&NR<=27\' HGCValid_%s_Plots/index.html > HGCValid_%s_Plots/index_%s.html '% (opt.HTMLVALNAME,opt.HTMLVALNAME, samplename))
480 processCmd(
'echo " <br/>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
481 processCmd(
'echo " <hr>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
483 if opt.OBJ ==
'hitValidation':
484 processCmd(
'mv HGCValid_%s_Plots/plots_%s_Hits.html HGCValid_%s_Plots/index.html'%(opt.HTMLVALNAME,samplename,opt.HTMLVALNAME))
485 processCmd(
'awk \'NR>=6&&NR<=184\' HGCValid_%s_Plots/index.html > HGCValid_%s_Plots/index_%s.html '% (opt.HTMLVALNAME,opt.HTMLVALNAME, samplename))
486 processCmd(
'echo " <br/>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
487 processCmd(
'echo " <hr>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
489 if opt.OBJ ==
'tracksters':
490 processCmd(
'mv HGCValid_%s_Plots/plots_%s_Tracksters.html HGCValid_%s_Plots/index.html'%(opt.HTMLVALNAME,samplename,opt.HTMLVALNAME))
491 processCmd(
'awk \'NR>=6&&NR<=209\' HGCValid_%s_Plots/index.html > HGCValid_%s_Plots/index_%s.html '% (opt.HTMLVALNAME,opt.HTMLVALNAME, samplename))
492 processCmd(
'echo " <br/>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
493 processCmd(
'echo " <hr>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
495 if opt.OBJ ==
'simulation':
496 processCmd(
'mv HGCValid_%s_Plots/plots_%s_SimClusters.html HGCValid_SimClusters_Plots/index.html'%(opt.HTMLVALNAME,samplename))
497 processCmd(
'mv HGCValid_%s_Plots/plots_%s_CaloParticles.html HGCValid_CaloParticles_Plots/index.html'%(opt.HTMLVALNAME,samplename))
498 processCmd(
'awk \'NR>=6&&NR<=158\' HGCValid_SimClusters_Plots/index.html > HGCValid_SimClusters_Plots/index_%s.html '% (samplename))
499 processCmd(
'awk \'NR>=6&&NR<=304\' HGCValid_CaloParticles_Plots/index.html > HGCValid_CaloParticles_Plots/index_%s.html '% (samplename))
500 processCmd(
'echo " <br/>" >> HGCValid_SimClusters_Plots/index_%s.html '%(samplename) )
501 processCmd(
'echo " <br/>" >> HGCValid_CaloParticles_Plots/index_%s.html '%(samplename) )
502 processCmd(
'echo " <hr>" >> HGCValid_SimClusters_Plots/index_%s.html '%(samplename) )
503 processCmd(
'echo " <hr>" >> HGCValid_CaloParticles_Plots/index_%s.html '%(samplename) )
505 processCmd(
'mv HGCValid_%s_Plots/plots_%s_ClusterLevel HGCValid_SimClusters_Plots/.'%(opt.HTMLVALNAME,samplename))
506 processCmd(
'mv HGCValid_%s_Plots/plots_%s_ticlSimTracksters HGCValid_SimClusters_Plots/.'%(opt.HTMLVALNAME,samplename))
507 processCmd(
'mv HGCValid_%s_Plots/plots_%s_CaloParticles_* HGCValid_CaloParticles_Plots/.'%(opt.HTMLVALNAME,samplename))
510 if opt.OBJ ==
'simulation':
511 fragments.append(
'HGCValid_SimClusters_Plots/index_%s.html'% (samplename) )
512 fragments.append(
'HGCValid_CaloParticles_Plots/index_%s.html'% (samplename) )
514 fragments.append(
'HGCValid_%s_Plots/index_%s.html'% (opt.HTMLVALNAME, samplename) )
519 if opt.OBJ ==
'simulation':
520 indexfiles = [
"SimClusters",
"CaloParticles"]
522 indexfiles = [opt.HTMLVALNAME]
524 for ind
in indexfiles:
525 processCmd(
'mv HGCValid_%s_Plots/index.html HGCValid_%s_Plots/test.html' %(ind,ind) )
526 index_file = open(
'HGCValid_%s_Plots/index.html'%(ind),
'w')
528 index_file.write(
'<html>\n')
529 index_file.write(
' <head>\n')
530 index_file.write(
' <title>HGCal validation %s </title>\n' %(ind) )
531 index_file.write(
' </head>\n')
532 index_file.write(
' <body>\n')
534 for frag
in fragments:
535 if ind
not in frag:
continue
536 with open(frag,
'r') as f:
537 lines = f.read().splitlines()
540 index_file.write(line +
'\n')
545 index_file.write(
' </body>\n')
546 index_file.write(
'</html>\n')
551 if (opt.OBJ ==
'SimHits'):
553 if (
not os.path.isdir(
"hgcalSimHitStudy")) :
556 processCmd(
'cp %s/../public/index.php hgcalSimHitStudy/.'%(opt.WWWAREA) )
560 cmd =
'root.exe -b -q Validation/HGCalValidation/macros/validationplots.C\(\\"hgcSimHit.root' +
'\\",\\"'+ opt.OBJ +
'\\"\)'
562 print(
'Dry-run: ['+cmd+
']')
568 if (opt.OBJ == 'hitValidation'):
570 #Now that we have them in eos lets produce plots
571 #Let's loop through RelVals
572 for infi in phase2samples_noPU:
573 samplename = infi.filename(NewRelease).replace("DQM_V0001_R000000001__","").replace("__DQMIO.root","")
574 #samplename = infi.filename(NewRelease).replace("DQM_V0001_R000000001__","").split("__CMSSW_10_6_0_pre4",1)[0]
575 #samplename = samplename + infi.pileup()
576 if infi.pileup() == "PU":
577 samplename = samplename + str(infi.pileupNumber())
584 if RefRelease != None: inputpathRef = RefRepository +'/' + RefRelease +'/'
585 inputpathNew = NewRepository +'/' + NewRelease+ '/'
587 if RefRelease == None:
588 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)
589 elif "raw" in NotNormalRelease and "normal" in NotNormalRefRelease:
590 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)
591 #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)
592 elif "raw" in NotNormalRelease and "raw" in NotNormalRefRelease:
593 #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)
594 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)
595 elif "normal" in NotNormalRelease and "normal" in NotNormalRefRelease:
596 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)
597 #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)
599 #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)
600 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)
601 #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)
605 print('Dry-run: ['+cmd+']')
607 output = processCmd(cmd)
608 processCmd('mv HGCValid_%s_Plots/plots_%s_Hits.html HGCValid_%s_Plots/index.html'%(opt.HTMLVALNAME,samplename,opt.HTMLVALNAME))
609 processCmd('awk \'NR>=6&&NR<=184\' HGCValid_%s_Plots/index.html > HGCValid_%s_Plots/index_%s.html '% (opt.HTMLVALNAME,opt.HTMLVALNAME, samplename))
610 processCmd('echo " <br/>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
611 processCmd('echo " <hr>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
613 fragments.append( 'HGCValid_%s_Plots/index_%s.html'% (opt.HTMLVALNAME, samplename) )
616 #Let's also create the final index xml file.
617 processCmd('mv HGCValid_%s_Plots/index.html HGCValid_%s_Plots/test.html' %(opt.HTMLVALNAME,opt.HTMLVALNAME) )
618 index_file = open('HGCValid_%s_Plots/index.html'%(opt.HTMLVALNAME),'w')
620 index_file.write('<html>\n')
621 index_file.write(' <head>\n')
622 index_file.write(' <title>HGCal validation %s </title>\n' %(opt.HTMLVALNAME) )
623 index_file.write(' </head>\n')
624 index_file.write(' <body>\n')
626 for frag in fragments:
627 with open(frag,'r') as f:
628 lines = f.read().splitlines()
631 index_file.write(line +
'\n')
637 index_file.write(
' </body>\n')
638 index_file.write(
'</html>\n')
642 #-------------------------------------------------------------------------------------------
643 #This is the Digis part
644 if (opt.OBJ == 'Digis'):
645 #This is where we will save the final output pngs:
646 if (not os.path.isdir("hgcalDigiStudy")) :
647 processCmd('mkdir -p hgcalDigiStudy')
648 processCmd('mkdir -p hgcalDigiStudyEE')
649 processCmd('mkdir -p hgcalDigiStudyHEF')
650 processCmd('mkdir -p hgcalDigiStudyHEB')
652 processCmd('cp %s/../public/index.php hgcalDigiStudy/.'%(opt.WWWAREA) )
653 processCmd('cp %s/../public/index.php hgcalDigiStudyEE/.'%(opt.WWWAREA) )
654 processCmd('cp %s/../public/index.php hgcalDigiStudyHEF/.'%(opt.WWWAREA) )
655 processCmd('cp %s/../public/index.php hgcalDigiStudyHEB/.'%(opt.WWWAREA) )
656 #The input here is from running cmsRun runHGCalDigiStudy_cfg.py, to which
657 #we usually give ttbar noPU as input
659 cmd = 'root.exe -b -q Validation/HGCalValidation/macros/validationplots.C\(\\"hgcDigi.root' + '\\",\\"'+ opt.OBJ + '\\"\)'
661 print('Dry-run: ['+cmd+']')
663 output = processCmd(cmd)
664 #mv the output under the main directory
665 processCmd('mv hgcalDigiStudyEE hgcalDigiStudy/.')
666 processCmd('mv hgcalDigiStudyHEF hgcalDigiStudy/.')
667 processCmd('mv hgcalDigiStudyHEB hgcalDigiStudy/.')
669 #-------------------------------------------------------------------------------------------
670 #This is the RecHits part
671 if (opt.OBJ == 'RecHits'):
672 #This is where we will save the final output pngs:
673 if (not os.path.isdir("hgcalRecHitStudy")) :
674 processCmd('mkdir -p hgcalRecHitStudy')
675 processCmd('mkdir -p hgcalRecHitStudyEE')
676 processCmd('mkdir -p hgcalRecHitStudyHEF')
677 processCmd('mkdir -p hgcalRecHitStudyHEB')
679 processCmd('cp %s/../public/index.php hgcalRecHitStudy/.'%(opt.WWWAREA) )
680 processCmd('cp %s/../public/index.php hgcalRecHitStudyEE/.'%(opt.WWWAREA) )
681 processCmd('cp %s/../public/index.php hgcalRecHitStudyHEF/.'%(opt.WWWAREA) )
682 processCmd('cp %s/../public/index.php hgcalRecHitStudyHEB/.'%(opt.WWWAREA) )
683 #The input here is from running cmsRun runHGCalRecHitStudy_cfg.py, to which
684 #we usually give ttbar noPU as input
685 #Input: hgcRecHit.root
686 cmd = 'root.exe -b -q Validation/HGCalValidation/macros/validationplots.C\(\\"hgcRecHit.root' + '\\",\\"'+ opt.OBJ + '\\"\)'
688 print('Dry-run: ['+cmd+']')
690 output = processCmd(cmd)
691 #mv the output under the main directory
692 processCmd('mv hgcalRecHitStudyEE hgcalRecHitStudy/.')
693 processCmd('mv hgcalRecHitStudyHEF hgcalRecHitStudy/.')
694 processCmd('mv hgcalRecHitStudyHEB hgcalRecHitStudy/.')
696 #-------------------------------------------------------------------------------------------
697 ## TODO #This is the CaloParticles part
698 if (opt.OBJ == 'CaloParticles'):
699 particletypes = ["-11","-13","-211","-321","11","111","13","211","22","321"]
700 #This is where we will save the final output pngs:
701 if (not os.path.isdir("CaloParticles")) :
702 processCmd('mkdir -p CaloParticles')
704 processCmd('cp %s/../public/index.php CaloParticles/.'%(opt.WWWAREA) )
706 #Let's loop through RelVals
707 for infi in phase2samples_noPU:
708 #samplename = infi.filename(NewRelease).replace("DQM_V0001_R000000001__","").replace("__DQMIO.root","")
709 samplename = infi.filename(NewRelease).replace("DQM_V0001_R000000001__","").split("__"+NewRelease,1)[0]
710 samplename = samplename + infi.pileup()
711 if infi.pileup() == "PU":
712 samplename = samplename + str(infi.pileupNumber())
717 if (not os.path.isdir(samplename)) :
718 processCmd('mkdir -p ' + samplename )
719 processCmd('cp %s/RelVals/index.php '%(opt.WWWAREA) + samplename + '/.')
720 for part in particletypes:
721 processCmd('mkdir -p ' + samplename + '/' +part )
723 processCmd('cp %s/RelVals/index.php '%(opt.WWWAREA) + samplename + '/' +part + '/.')
726 if RefRelease != None: inputpathRef = RefRepository +'/' + RefRelease +'/'
727 inputpathNew = NewRepository +'/' + NewRelease+ '/'
728 cmd = 'root.exe -b -q Validation/HGCalValidation/macros/validationplots.C\(\\"'+ inputpathNew + infi.filename(NewRelease) + '\\",\\"'+ opt.OBJ + '\\",\\"'+ samplename + '\\"\\)'
730 print('Dry-run: ['+cmd+']')
732 output = processCmd(cmd)
733 processCmd('mv ' +samplename+ ' CaloParticles/.' )
735 #------------------------------------------------------------------------------------------
736 #Summary section: After processing all the objects the results are gathered, webpages are
737 # created and a summary page is added.
738 #-------------------------------------------------------------------------------------------
739 #Here we will gather all results.
740 if (opt.GATHER != None) :
742 #First we need the top folder to contain all validation releases.
743 index_file = open('index.html','w')
745 index_file.write('<html>\n')
746 index_file.write(' <head>\n')
747 index_file.write(' <title>HGCAL validation results </title>\n' )
748 index_file.write(' </head>\n')
749 index_file.write(' <body>\n')
750 index_file.write(' <h1>\n')
751 index_file.write(' HGCAL Validation Results \n' )
752 index_file.write(' </h1>\n')
753 index_file.write(' <hr/>\n' )
754 index_file.write(' <h2>\n')
755 index_file.write(' Release Validation Campaigns \n' )
756 index_file.write(' </h2>\n')
757 index_file.write(' <ul>\n' )
759 for trel in thereleases.keys():
760 index_file.write(' <li>\n' )
761 index_file.write(' %s\n' %(trel) )
762 for rel in thereleases[trel]:
763 index_file.write(' <ul>\n' )
764 index_file.write(' <li><a href="%s/index.html">%s</a></li>\n' %(rel, rel ) )
765 index_file.write(' </ul>\n' )
766 index_file.write(' </li>\n' )
767 index_file.write(' <br>\n' )
768 index_file.write(' <br>\n' )
769 index_file.write(' <br>\n' )
771 index_file.write(' </ul>\n' )
772 index_file.write(' <hr/>\n' )
774 #New section : Geometry Validation
775 #Regardless of the release validation, the top html menu should contain the geometry section.
776 #we put this in the "gather" step.
777 index_file.write(' <h2>\n')
778 index_file.write(' Geometry Validation \n' )
779 index_file.write(' </h2>\n')
780 index_file.write(' <ul>\n' )
782 for tgeo in geometryTests.keys():
783 index_file.write(' <li>\n' )
784 index_file.write(' %s\n' %(tgeo) )
785 for geo in geometryTests[tgeo]:
786 #We need the directory for the geometry related results
787 if (not os.path.isdir(geo)):
788 processCmd('mkdir -p %s/%s' %(opt.WWWAREA,geo) )
789 processCmd('mkdir -p %s' %(geo) )
790 for mats in _individualmaterials:
791 processCmd('mkdir -p %s/%s/indimat/%s' %(opt.WWWAREA,geo,mats) )
792 processCmd('mkdir -p %s/indimat/%s' %(geo,mats) )
794 index_file.write(' <ul>\n' )
795 index_file.write(' <li><a href="%s/index.html">%s</a></li>\n' %(geo, geo ) )
796 index_file.write(' </ul>\n' )
797 index_file.write(' </li>\n' )
798 index_file.write(' <br>\n' )
799 index_file.write(' <br>\n' )
800 index_file.write(' <br>\n' )
803 index_file.write(' </body>\n')
804 index_file.write('</html>\n')
807 #This is the main html file for the validation webpage. In order to avoid
808 #surprises when experimenting, in order to copy it automatically to the
809 #www area you should have activated the relevant flag:
810 if (opt.COPYHTML) : processCmd('cp index.html %s/.' %(opt.WWWAREA) )
812 #Let's make also the summary folder
813 if (not os.path.isdir("HGCValid_summary_Plots")):
814 processCmd('mkdir -p HGCValid_summary_Plots')
816 #To avoid the nans transpose later
817 df = pd.DataFrame.from_dict(_summary, orient = 'index').transpose()
818 #Make a specific order in columns
821 index_file = open('HGCValid_summary_Plots/index.html','w')
823 index_file.write('<html>\n')
824 index_file.write(' <body>\n')
826 #Let's loop through RelVals
827 for infi in phase2samples_noPU:
828 samplename = infi.filename(NewRelease).replace("DQM_V0001_R000000001__","").replace("__DQMIO.root","")
829 index_file.write( '<h2> %s </h2> \n' %(_sampleName[infi.name()]) )
830 #table here with summary objects
831 index_file.write('<table> \n')
832 index_file.write(' <tr>\n')
833 #This is the row with the headers. So, the objects for us.
835 index_file.write(' <th>%s</th>\n' %(_pageNameMap[obj]) )
836 index_file.write(' </tr>\n')
838 for i, row in df.iterrows():
839 index_file.write(' <tr>\n')
840 for j, column in row.iteritems():
842 index_file.write(' <td>\n')
843 index_file.write(' <ul>\n')
845 # if df[obj][ind] == None:
847 index_file.write(' </ul>\n')
848 index_file.write(' </td>\n')
850 #index_file.write(' \n')
854 #index_file.write(' <li><a href="plots_%s_%s">%s</a></li> \n' %(samplename, df[obj][ind], df[obj][ind].partition("/")[2] ))
855 if "tracksters" in j:
856 index_file.write(' <li><a href="../HGCValid_%s_Plots/plots_%s_%s">%s</a></li> \n' %(j, samplename, column, column.replace("ticlTracksters","") ))
858 index_file.write(' <li><a href="../HGCValid_%s_Plots/plots_%s_%s">%s</a></li> \n' %(j, samplename, column, column.partition("/")[2] ))
860 index_file.write(' </ul>\n')
861 index_file.write(' </td>\n')
863 index_file.write(' </tr>\n')
865 index_file.write(' </table>\n')
866 index_file.write(' <br/>\n' )
867 index_file.write(' <br/>\n' )
868 index_file.write(' <br/>\n' )
871 index_file.write(' </body>\n')
872 index_file.write('</html>\n')
875 objects = opt.GATHER.split(",")
878 if "raw" in NotNormalRelease and "raw" in NotNormalRefRelease:
879 localoutputdir = NewRelease + "_raw1100" + "_vs_" + RefRelease + "_raw1100"
880 elif "raw" in NotNormalRelease and "normal" in NotNormalRefRelease:
881 #localoutputdir = NewRelease + "_raw1100" + "_vs_" + RefRelease
882 localoutputdir = NewRelease + "_D76" + "_vs_" + RefRelease
883 elif "normal" in NotNormalRelease and "normal" in NotNormalRefRelease:
884 localoutputdir = NewRelease + "_vs_" + RefRelease
886 localoutputdir = NewRelease
888 #make the structure to hold the objects
890 #This is where we will save the final output per campaing:
891 if (not os.path.isdir('%s/standalone' %(localoutputdir))) :
892 processCmd('mkdir -p %s/standalone' %(localoutputdir))
893 if (obj!="standalone"): processCmd('mv HGCValid_%s_Plots %s'%(obj, localoutputdir) )
895 processCmd('mv hgcalSimHitStudy %s/standalone/.'%(localoutputdir) )
896 processCmd('mv hgcalDigiStudy %s/standalone/.'%(localoutputdir) )
897 processCmd('mv hgcalRecHitStudy %s/standalone/.'%(localoutputdir) )
898 processCmd('cp %s/../public/index.php %s/standalone/.'%(opt.WWWAREA, localoutputdir) )
902 for infi
in phase2samples_noPU:
903 samplename = infi.filename(NewRelease).
replace(
"DQM_V0001_R000000001__",
"").
replace(
"__DQMIO.root",
"")
909 if df[obj][ind] ==
None:
continue
910 else:
processCmd(
'cp -r %s/HGCValid_%s_Plots/plots_%s_%s %s/HGCValid_summary_Plots ' %(NewRelease, obj, samplename, df[obj][ind].partition(
"/")[0], NewRelease ) )
913 #html file of the relval campaign we are validating
914 index_file = open('%s/index.html'%(localoutputdir),'w')
916 index_file.write('<html>\n')
917 index_file.write(' <head>\n')
918 index_file.write(' <title> <h2> HGCal validation results for %s </h2> </title>\n' %(localoutputdir) )
919 index_file.write(' </head>\n')
920 index_file.write(' <body>\n')
921 index_file.write(' <h2> HGCal validation results for %s </h2> \n' %(localoutputdir) )
925 if (obj!="standalone"):
926 index_file.write(' <br/>\n' )
927 index_file.write(' <ul>\n' )
928 index_file.write(' <li><a href="HGCValid_%s_Plots/index.html">%s</a></li>\n' %(obj, _pageNameMap[obj] ) )
929 index_file.write(' </ul>\n' )
930 index_file.write(' <br/>\n' )
932 index_file.write(' <br/>\n' )
933 index_file.write(' <ul>\n' )
934 index_file.write(' <li><a href="%s/index.php">%s</a></li>\n' %(obj, _pageNameMap[obj] ) )
935 index_file.write(' </ul>\n' )
936 index_file.write(' <br/>\n' )
940 index_file.write(' </body>\n')
941 index_file.write('</html>\n')
944 #We choose to zip in uncompressed form all the files for two reasons:
945 #1. Copying to eos so many files is really slow. It is faster to
946 # create one uncompressed file, copy that and unzip there.
947 #2. Inevitably, we will have to do some cleanup of the older campaigns,
948 # since we will reach the number of files limit quite easily.
949 # It will be easier to have already save the zip file and just delete
950 # the directory content, leaving inside only the zip file.
952 # This will take some time.
953 # processCmd('zip -0 -r %s.zip %s' %(localoutputdir,localoutputdir) )
954 # processCmd('cp %s.zip %s/.' %(localoutputdir,opt.WWWAREA) )
955 # processCmd('cd %s' %(opt.WWWAREA) )
956 # processCmd('unzip -q %s.zip' %(localoutputdir) )
957 # processCmd('mv %s.zip %s/.' %(localoutputdir,localoutputdir) )
961 #------------------------------------------------------------------------------------------
962 #Geometry section: Here we gather results from geometry related validation packages.
963 #-------------------------------------------------------------------------------------------
964 #Keep in mind that the gne
966 #html file of the geometry scenario we are estimating the material budget
967 index_file = open('%s/index.html'%(GeoScenario),'w')
969 index_file.write('<html>\n')
970 index_file.write(' <head>\n')
971 index_file.write(' <title> <h2> HGCAL material budget results for %s </h2> </title>\n' %(GeoScenario) )
972 index_file.write(' </head>\n')
973 index_file.write(' <body>\n')
974 index_file.write(' <h2> HGCAL material budget results for %s </h2> \n' %(GeoScenario) )
976 for obj in _MatBudSections:
978 #We need the directory for the geometry related results
979 if (not os.path.isdir('%s/%s/%s' %(opt.WWWAREA,GeoScenario,obj))):
980 processCmd('mkdir -p %s/%s/%s' %(opt.WWWAREA,GeoScenario,obj) )
981 processCmd('mkdir -p %s/%s' %(GeoScenario,obj) )
983 index_file.write(' <br/>\n' )
984 index_file.write(' <ul>\n' )
985 index_file.write(' <li><a href="%s/index.html">%s</a></li>\n' %(obj, _geoPageNameMap[obj] ) )
986 index_file.write(' </ul>\n' )
987 index_file.write(' <br/>\n' )
990 index_file.write(' </body>\n')
991 index_file.write('</html>\n')
994 #Copy the material budget menu file in the current geometry scenario
995 processCmd('cp %s/index.html %s/%s/.' %(GeoScenario, opt.WWWAREA,GeoScenario) )
997 #html file for the menu of the individual materials
998 index_file = open('%s/indimat/index.html'%(GeoScenario),'w')
1000 index_file.write('<html>\n')
1001 index_file.write(' <head>\n')
1002 index_file.write(' <title> <h2> HGCAL material budget results for individual materials for %s </h2> </title>\n' %(GeoScenario) )
1003 index_file.write(' </head>\n')
1004 index_file.write(' <body>\n')
1005 index_file.write(' <h2> HGCAL material budget results for individual materials for %s </h2> \n' %(GeoScenario) )
1006 for mats in _individualmaterials:
1008 #index_file.write(' <br/>\n' )
1009 index_file.write(' <ul>\n' )
1010 index_file.write(' <li><a href="%s/index.html">%s</a></li>\n' %(mats, _matPageNameMap[mats] ) )
1011 index_file.write(' </ul>\n' )
1012 #index_file.write(' <br/>\n' )
1015 index_file.write(' </body>\n')
1016 index_file.write('</html>\n')
1019 #Copy the menu html file for the individual materials
1020 processCmd('cp %s/indimat/index.html %s/%s/indimat/.' %(GeoScenario, opt.WWWAREA,GeoScenario) )
1022 #html file for all HGCal stack plots materials
1023 index_file = open('%s/allhgcal/index.html'%(GeoScenario),'w')
1025 index_file.write('<html>\n')
1026 index_file.write(' <head>\n')
1028 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')
1030 index_file.write(_hideShowFun["thestyle"])
1032 index_file.write(' <title> <h2> HGCAL material budget results for all materials for %s </h2> </title>\n' %(GeoScenario) )
1033 index_file.write(' </head>\n')
1034 index_file.write(' <body>\n')
1036 index_file.write(' <h2> HGCAL material budget results for : <span style="color:red;font-size:120%%" >All Materials </span></h2> \n' )
1038 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]) )
1040 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]) )
1042 index_file.write('<hr/>\n')
1044 index_file.write(_hideShowFun["divTabs"])
1046 for region in ["_AllHGCAL", "_ZminusZoom", "_ZplusZoom"]:
1048 index_file.write('<div id="%s" class="tabcontent"> \n' %(region))
1050 if region == "_AllHGCAL": pngnamestring = ""
1051 else: pngnamestring = region
1053 for allmatplot in _allmaterialsplots:
1054 if region == "_AllHGCAL":
1055 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]))
1056 index_file.write('<img class="Reference" src="../%s/%s%s.png" width="375"/> \n' %(GeoScenario.split("_")[0],allmatplot,pngnamestring) )
1057 index_file.write('<img class="New" src="../%s/%s%s.png" width="375"/> \n' %(GeoScenario.split("_")[2],allmatplot,pngnamestring))
1058 index_file.write('<hr/>\n')
1059 elif region != "_AllHGCAL" and "HGCal_l_vs_z_vs_R" in allmatplot:
1060 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]))
1061 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) )
1062 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))
1063 index_file.write('<hr/>\n')
1066 index_file.write('</div>\n')
1068 index_file.write(_hideShowFun["buttonandFunction"])
1069 index_file.write(' </body>\n')
1070 index_file.write('</html>\n')
1073 #Copy all materials budget file
1074 processCmd('cp %s/allhgcal/index.html %s/%s/allhgcal/.' %(GeoScenario, opt.WWWAREA,GeoScenario) )
1076 #html file of the individual materials for the material budget analysis
1077 for mats in _individualmaterials:
1078 index_file = open('%s/indimat/%s/index.html'%(GeoScenario,mats),'w')
1080 index_file.write('<html>\n')
1081 index_file.write(' <head>\n')
1083 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')
1085 index_file.write(_hideShowFun["thestyle"])
1087 index_file.write(' <title> <h2> HGCAL material budget results for individual materials for %s </h2> </title>\n' %(GeoScenario) )
1088 index_file.write(' </head>\n')
1089 index_file.write(' <body>\n')
1090 index_file.write(' <h2> HGCAL material budget results for : <span style="color:red;font-size:120%%" >%s </span></h2> \n' %(_matPageNameMap[mats]) )
1092 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]) )
1094 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]) )
1096 index_file.write('<hr/>\n')
1098 #--------------------------------------------------------------
1099 #This one below is a solution using a table with 3 columns:
1100 #Two for the plots and the third for the text.
1102 #index_file.write('<table style=\'font-size:120%%\' border="1" cellspacing="1" cellpadding="0">\n')
1103 #index_file.write('<tbody>\n')
1105 #for indiplots in _individualmatplots:
1106 # index_file.write('<tr>\n')
1107 # index_file.write('<td> <img class="Reference" src="../../%s/%s/%s%s.png" width="375"/> </td>\n' %(GeoScenario.split("_")[0],mats,indiplots,mats) )
1108 # index_file.write('<td> <img class="New" src="../../%s/%s/%s%s.png" width="375"/> </td>\n' %(GeoScenario.split("_")[2],mats,indiplots,mats))
1109 # 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]))
1110 # index_file.write('</tr>\n')
1113 #index_file.write('</tbody>\n')
1114 #index_file.write('</table>\n')
1115 #--------------------------------------------------------------
1116 index_file.write(_hideShowFun["divTabs"])
1118 #Individual material here for: All HGCAL, Zminus, Zplus
1119 for region in ["_AllHGCAL", "_ZminusZoom", "_ZplusZoom"]:
1120 #The hide/show button
1121 #index_file.write(_hideShowFun["buttonandFunction%s"%(region)])
1123 index_file.write('<div id="%s" class="tabcontent"> \n' %(region))
1125 if region == "_AllHGCAL": pngnamestring = ""
1126 else: pngnamestring = region
1127 for indiplots in _individualmatplots:
1128 if region == "_AllHGCAL":
1129 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]))
1130 index_file.write('<img class="Reference" src="../../%s/%s/%s%s%s.png" width="375"/> \n' %(GeoScenario.split("_")[0],mats,indiplots,mats,pngnamestring) )
1131 index_file.write('<img class="New" src="../../%s/%s/%s%s%s.png" width="375"/> \n' %(GeoScenario.split("_")[2],mats,indiplots,mats,pngnamestring))
1132 index_file.write('<hr/>\n')
1134 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]))
1135 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) )
1136 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))
1137 index_file.write('<hr/>\n')
1140 index_file.write('</div>\n')
1142 index_file.write(_hideShowFun["buttonandFunction"])
1143 index_file.write(' </body>\n')
1144 index_file.write('</html>\n')
1147 #Copy the individual materials budget file
1148 processCmd('cp %s/indimat/%s/index.html %s/%s/indimat/%s/.' %(GeoScenario, mats, opt.WWWAREA,GeoScenario,mats) )
1150 #html file for from vertex up to muon stations
1151 index_file = open('%s/fromvertex/index.html'%(GeoScenario),'w')
1153 index_file.write('<html>\n')
1154 index_file.write(' <head>\n')
1156 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')
1158 index_file.write(_hideShowFun["thestyle"])
1160 index_file.write(' <title> <h2> HGCAL material budget results from vertex up to in front of muon stations for %s </h2> </title>\n' %(GeoScenario) )
1161 index_file.write(' </head>\n')
1162 index_file.write(' <body>\n')
1164 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' )
1166 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]) )
1168 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]) )
1170 index_file.write('<hr/>\n')
1172 #index_file.write(_hideShowFun["divTabs"])
1174 for vertexplots in _fromvertexplots:
1175 index_file.write('<p> %s </p>\n' %(_fromVertexPlotsDesc[vertexplots]))
1176 index_file.write('<img class="Reference" src="%s/Figures/MaterialBdg_FromVertexToBackOf%s.png" width="375"/> \n' %(GeoScenario.split("_")[0],vertexplots) )
1177 index_file.write('<img class="New" src="%s/Figures/MaterialBdg_FromVertexToBackOf%s.png" width="375"/> \n' %(GeoScenario.split("_")[2],vertexplots) )
1178 index_file.write('<hr/>\n')
1180 #index_file.write(_hideShowFun["buttonandFunction"])
1181 index_file.write(' </body>\n')
1182 index_file.write('</html>\n')
1185 #Copy all materials budget file
1186 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)