File indexing completed on 2024-04-06 12:32:36
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 import sys
0015 import os
0016 import subprocess
0017 import optparse
0018 import pandas as pd
0019
0020 from collections import OrderedDict
0021
0022 from Validation.RecoTrack.plotting.validation import Sample, Validation
0023 from Validation.HGCalValidation.hgcalHtml import _sampleName,_pageNameMap,_summary,_summobj,_MatBudSections,_geoPageNameMap,_individualmaterials,_matPageNameMap,_individualmatplots,_individualMatPlotsDesc,_hideShowFun,_allmaterialsplots,_allmaterialsPlotsDesc, _fromvertexplots, _fromVertexPlotsDesc
0024
0025 from Validation.HGCalValidation.PostProcessorHGCAL_cfi import tracksterLabels as trackstersIters
0026
0027
0028
0029 def parseOptions():
0030
0031 usage = ('usage: %prog [options]\n'
0032 + '%prog -h for help')
0033 parser = optparse.OptionParser(usage)
0034
0035 parser.add_option('', '--Obj', dest='OBJ', type='string', default=None, help='Object to run. Options are: Geometry, SimHits, Digis, RecHits, Calibrations, CaloParticles, hgcalLayerClusters')
0036 parser.add_option('', '--html-validation-name', dest='HTMLVALNAME', type='string', default='', help='Could be either be hgcalLayerClusters or hgcalMultiClusters')
0037 parser.add_option('-d', '--download', action='store_true', dest='DOWNLOAD', default=False, help='Download DQM files from RelVals')
0038 parser.add_option('-g', '--gather', dest='GATHER', type='string', default=None, help='Objects to gather: hitValidation, hitCalibration, hgcalLayerClusters, hgcalMultiClusters, ticlMultiClustersFromTrackstersEM, ticlMultiClustersFromTrackstersHAD')
0039 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')
0040 parser.add_option('-y', '--dry-run', action='store_true', dest='DRYRUN', default=False, help='perform a dry run (nothing is lauched).')
0041 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')
0042 parser.add_option('', '--geometry', action='store_true', dest='GEOMETRY', default=False, help='Geometry validation section')
0043 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.')
0044
0045
0046 global opt, args
0047 (opt, args) = parser.parse_args()
0048
0049 parseOptions()
0050
0051
0052
0053
0054 def processCmd(cmd, quite = 0):
0055 print(cmd)
0056 status, output = subprocess.getstatusoutput(cmd)
0057 if (status !=0 and not quite):
0058 print('Error in processing command:\n ['+cmd+']')
0059 print('Output:\n ['+output+'] \n')
0060 return output
0061
0062
0063 def putype(t):
0064 if "_pmx" in NewRelease:
0065 if "_pmx" in RefRelease:
0066 return {"default": "pmx"+t}
0067 return {"default": t, NewRelease: "pmx"+t}
0068 return t
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087 thereleases = OrderedDict()
0088 thereleases = { "CMSSW 12_4_X" : [
0089 "CMSSW_12_4_0_pre3_DD4HEP_vs_CMSSW_12_4_0_pre3_DDD",
0090 "CMSSW_12_4_0_pre3_vs_CMSSW_12_4_0_pre2",
0091 "CMSSW_12_4_0_pre2_vs_CMSSW_12_3_0_pre6"
0092 ],
0093 "CMSSW 12_3_X" : [
0094 "CMSSW_12_3_1_vs_CMSSW_12_3_0_pre6",
0095 "CMSSW_12_3_0_pre6_vs_CMSSW_12_3_0_pre5",
0096 "CMSSW_12_3_0_pre5_D88_vs_CMSSW_12_3_0_pre5_D77",
0097 "CMSSW_12_3_0_pre5_D77_vs_CMSSW_12_3_0_pre3_D77",
0098 "CMSSW_12_3_0_pre4_vs_CMSSW_12_3_0_pre3",
0099 "CMSSW_12_3_0_pre3_vs_CMSSW_12_3_0_pre2"
0100 ],
0101 "CMSSW 12_2_X" : [
0102 "CMSSW_12_2_0_vs_CMSSW_12_2_0_pre3",
0103 "CMSSW_12_2_0_pre3_D88_vs_CMSSW_12_2_0_pre3_D77",
0104 "CMSSW_12_2_0_pre3_vs_CMSSW_12_2_0_pre2",
0105 "CMSSW_12_2_0_pre2_vs_CMSSW_12_1_0_pre5"
0106 ],
0107 "CMSSW 12_1_X" : [
0108 "CMSSW_12_1_0_pre5_vs_CMSSW_12_1_0_pre4",
0109 "CMSSW_12_1_0_pre5_D77_vs_CMSSW_12_1_0_pre4_D76",
0110 "CMSSW_12_1_0_pre4_ROOT624_vs_CMSSW_12_1_0_pre4",
0111 "CMSSW_12_1_0_pre4_vs_CMSSW_12_1_0_pre3",
0112 "CMSSW_12_1_0_pre3_vs_CMSSW_12_1_0_pre2",
0113 "CMSSW_12_1_0_pre2_vs_CMSSW_12_0_0_pre6",
0114 "CMSSW_12_1_0_pre2_D77_vs_CMSSW_12_1_0_pre2_D76"
0115 ],
0116 "CMSSW 12_0_X" : [
0117 "CMSSW_12_0_1_vs_CMSSW_12_0_0_pre4",
0118 "CMSSW_12_0_0_pre6_vs_CMSSW_12_0_0_pre4",
0119 "CMSSW_12_0_0_pre4_vs_CMSSW_12_0_0_pre3",
0120 "CMSSW_12_0_0_pre3_vs_CMSSW_12_0_0_pre2",
0121 "CMSSW_12_0_0_pre2_vs_CMSSW_12_0_0_pre1",
0122 "CMSSW_12_0_0_pre1_vs_CMSSW_11_3_0_pre6"
0123 ],
0124 "CMSSW 11_3_X" : [
0125 "CMSSW_11_3_0_vs_CMSSW_11_3_0_pre6",
0126 "CMSSW_11_3_0_pre6_vs_CMSSW_11_3_0_pre5",
0127 "CMSSW_11_3_0_pre5_vs_CMSSW_11_3_0_pre4",
0128 "CMSSW_11_3_0_pre4_vs_CMSSW_11_3_0_pre3",
0129 "CMSSW_11_3_0_pre3_G4VECGEOM_vs_CMSSW_11_3_0_pre3",
0130 "CMSSW_11_3_0_pre3_D76_vs_CMSSW_11_3_0_pre3",
0131 "CMSSW_11_3_0_pre3_vs_CMSSW_11_3_0_pre2",
0132 "CMSSW_11_3_0_pre2_vs_CMSSW_11_3_0_pre1",
0133 "CMSSW_11_3_0_pre1_vs_CMSSW_11_2_0_pre10",
0134 ],
0135 "CMSSW 11_2_X" : [
0136 "CMSSW_11_2_0_vs_CMSSW_11_2_0_pre10",
0137 "CMSSW_11_2_0_pre10_vs_CMSSW_11_2_0_pre9",
0138 "CMSSW_11_2_0_pre9_vs_CMSSW_11_2_0_pre8",
0139 "CMSSW_11_2_0_pre8_vs_CMSSW_11_2_0_pre7",
0140 "CMSSW_11_2_0_pre7_vs_CMSSW_11_2_0_pre6",
0141 "CMSSW_11_2_0_pre6_ROOT622_vs_CMSSW_11_2_0_pre6",
0142 "CMSSW_11_2_0_pre6_vs_CMSSW_11_2_0_pre5",
0143 "CMSSW_11_2_0_pre5_GEANT106_vs_CMSSW_11_2_0_pre5",
0144 "CMSSW_11_2_0_pre5_vs_CMSSW_11_2_0_pre3",
0145 "CMSSW_11_2_0_pre3_vs_CMSSW_11_2_0_pre1",
0146 "CMSSW_11_2_0_pre1_vs_CMSSW_11_1_0_pre8"
0147 ],
0148 "CMSSW 11_1_X" : [
0149 "CMSSW_11_1_0_pre8_raw1100_vs_CMSSW_11_1_0_pre8",
0150 "CMSSW_11_1_0_pre8_raw1100_vs_CMSSW_11_1_0_pre7_raw1100",
0151 "CMSSW_11_1_0_pre8_vs_CMSSW_11_1_0_pre7",
0152 "CMSSW_11_1_0_pre7_raw1100_vs_CMSSW_11_1_0_pre7",
0153 "CMSSW_11_1_0_pre7_raw1100_vs_CMSSW_11_1_0_pre6_raw1100",
0154 "CMSSW_11_1_0_pre7_vs_CMSSW_11_1_0_pre6",
0155 "CMSSW_11_1_0_pre6_raw1100_vs_CMSSW_11_1_0_pre6",
0156 "CMSSW_11_1_0_pre6_raw1100_vs_CMSSW_11_1_0_pre5_raw1100",
0157 "CMSSW_11_1_0_pre6_vs_CMSSW_11_1_0_pre5",
0158 "CMSSW_11_1_0_pre5_vs_CMSSW_11_1_0_pre4",
0159 "CMSSW_11_1_0_pre5_raw1100_vs_CMSSW_11_1_0_pre5",
0160 "CMSSW_11_1_0_pre5_raw1100_vs_CMSSW_11_1_0_pre4_raw1100",
0161 "CMSSW_11_1_0_pre4_raw1100_vs_CMSSW_11_1_0_pre4",
0162 "CMSSW_11_1_0_pre4_raw1100_vs_CMSSW_11_1_0_pre3_raw1100",
0163 "CMSSW_11_1_0_pre4_GEANT4","CMSSW_11_1_0_pre4"
0164 ]
0165 }
0166
0167 geometryTests = OrderedDict()
0168 geometryTests = { "Material budget" : [
0169
0170 "Extended2026D49_vs_Extended2026D76",
0171 "Extended2026D76_vs_Extended2026D83",
0172 "Extended2026D83_vs_Extended2026D86",
0173 "Extended2026D77_vs_Extended2026D88"
0174 ]
0175 }
0176
0177 GeoScenario = "Extended2026D77_vs_Extended2026D88"
0178
0179 RefRelease='CMSSW_12_3_0_pre6'
0180
0181 NewRelease='CMSSW_12_3_1'
0182
0183 NotNormalRelease = "normal"
0184 NotNormalRefRelease = "normal"
0185
0186
0187 if ( os.path.isdir('%s/%s' %(opt.WWWAREA, NewRelease))) :
0188 print("The campaign you are trying to validate has already an existing validation folder in the official www area.")
0189 print("Make sure you are not overwriting anything and try again.")
0190 exit()
0191
0192 if "raw" in NotNormalRelease:
0193
0194
0195
0196
0197 appendglobaltag = "_2026D88noPU"
0198
0199
0200 else:
0201
0202
0203
0204 appendglobaltag = "_2026D88noPU"
0205
0206
0207
0208
0209 '''
0210 phase2samples_noPU_oldnaming = [
0211 # Sample("RelValCloseByParticleGun_CE_H_Fine_300um", dqmVersion="0002", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0212 Sample("RelValCloseByParticleGun_CE_H_Fine_300um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0213 Sample("RelValCloseByParticleGun_CE_H_Fine_200um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0214 Sample("RelValCloseByParticleGun_CE_H_Fine_120um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0215 Sample("RelValCloseByParticleGun_CE_H_Coarse_Scint", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0216 Sample("RelValCloseByParticleGun_CE_H_Coarse_300um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0217 Sample("RelValCloseByParticleGun_CE_E_Front_300um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0218 Sample("RelValCloseByParticleGun_CE_E_Front_200um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0219 Sample("RelValCloseByParticleGun_CE_E_Front_120um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0220 #Sample("RelValCloseByParticleGun_CE_E_Front_120um", scenario="2026D49", appendGlobalTag=appendglobaltag , version="v2"),
0221 Sample("RelValTTbar", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0222 Sample("RelValZMM", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0223 Sample("RelValSingleGammaFlatPt8To150", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0224 Sample("RelValSingleMuPt10", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0225 Sample("RelValSingleMuPt100", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0226 Sample("RelValSingleMuPt1000", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0227 Sample("RelValSingleMuFlatPt2To100", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0228 Sample("RelValSingleMuFlatPt0p7To10", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0229 Sample("RelValSingleEFlatPt2To100", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0230 Sample("RelValSingleTauFlatPt2To150", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0231 Sample("RelValSinglePiFlatPt0p7To10", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0232 Sample("RelValQCD_Pt20toInfMuEnrichPt15", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0233 Sample("RelValQCD_Pt15To7000_Flat", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0234 Sample("RelValZTT", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0235 Sample("RelValZMM", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0236 Sample("RelValZEE", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0237 Sample("RelValB0ToKstarMuMu", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0238 Sample("RelValBsToEleEle", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0239 Sample("RelValBsToMuMu", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0240 Sample("RelValBsToJpsiGamma", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0241 Sample("RelValBsToJpsiPhi_mumuKK", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0242 Sample("RelValBsToPhiPhi_KKKK", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0243 Sample("RelValDisplacedMuPt30To100", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0244 Sample("RelValDisplacedMuPt2To10", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0245 Sample("RelValDisplacedMuPt10To30", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0246 Sample("RelValTauToMuMuMu", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0247 #Sample("RelValMinBias", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0248 Sample("RelValH125GGgluonfusion", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0249 Sample("RelValNuGun", scenario="2026D49", appendGlobalTag=appendglobaltag )
0250 ]
0251 '''
0252
0253
0254 phase2samples_noPU = [
0255
0256
0257
0258
0259
0260
0261
0262
0263
0264
0265
0266
0267
0268
0269
0270
0271
0272
0273
0274
0275 Sample("RelValZpTT_1500", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0276
0277 Sample("RelValZTT", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0278 Sample("RelValZMM", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0279
0280 Sample("RelValZEE", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0281 Sample("RelValTenTau_15_500_Eta3p1", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0282
0283 Sample("RelValTTbar", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0284 Sample("RelValQCD_Pt15To7000_Flat", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0285
0286 Sample("RelValNuGun", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0287
0288 Sample("RelValMinBias", midfix="14TeV", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0289 Sample("RelValH125GGgluonfusion", midfix="14", scenario="2026D49", appendGlobalTag=appendglobaltag )
0290
0291
0292
0293 ]
0294
0295
0296
0297 phase2samples_noPU_extend = [
0298
0299
0300
0301
0302
0303 Sample("RelValSingleMuPt10", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0304 Sample("RelValSingleMuPt100", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0305 Sample("RelValSingleMuPt1000", scenario="2026D49", appendGlobalTag=appendglobaltag )
0306
0307 ]
0308
0309
0310
0311
0312 phase2samples_noPU_extend_more = [
0313
0314
0315
0316
0317
0318
0319
0320
0321
0322
0323
0324
0325
0326
0327
0328
0329
0330
0331
0332
0333
0334
0335
0336
0337
0338
0339
0340
0341
0342
0343
0344
0345
0346 Sample("RelValCloseByPGun_CE_H_Fine_300um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0347 Sample("RelValCloseByPGun_CE_H_Fine_200um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0348 Sample("RelValCloseByPGun_CE_H_Fine_120um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0349 Sample("RelValCloseByPGun_CE_H_Coarse_Scint", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0350 Sample("RelValCloseByPGun_CE_H_Coarse_300um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0351 Sample("RelValCloseByPGun_CE_E_Front_300um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0352 Sample("RelValCloseByPGun_CE_E_Front_200um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0353 Sample("RelValCloseByPGun_CE_E_Front_120um", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0354 Sample("RelValSingleGammaFlatPt8To150", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0355 Sample("RelValSingleEFlatPt2To100", scenario="2026D49", appendGlobalTag=appendglobaltag ),
0356 Sample("RelValSinglePiFlatPt0p7To10", scenario="2026D49", appendGlobalTag=appendglobaltag )
0357
0358
0359
0360
0361
0362
0363
0364
0365
0366
0367
0368
0369
0370
0371
0372
0373
0374
0375
0376
0377
0378
0379
0380
0381
0382
0383
0384
0385
0386 ]
0387
0388 phase2samples_noPU.extend(phase2samples_noPU_extend)
0389 phase2samples_noPU.extend(phase2samples_noPU_extend_more)
0390
0391
0392
0393
0394
0395
0396
0397
0398
0399 phase2samples_PU = [
0400 Sample("RelValTTbar", midfix="14TeV", scenario="2026D49", putype=putype("25ns"), punum=200, appendGlobalTag="_2026D49PU200", version="v2"),
0401 ]
0402
0403
0404 RefRepository = '%s' %(opt.INPUT)
0405 NewRepository = '%s' %(opt.INPUT)
0406
0407
0408
0409
0410
0411
0412
0413 val = Validation(
0414 fullsimSamples = phase2samples_noPU,
0415 fastsimSamples = [],
0416 refRelease=RefRelease, refRepository=RefRepository,
0417 newRelease=NewRelease, newRepository=NewRepository
0418 )
0419
0420
0421
0422 if(opt.DOWNLOAD):
0423 val.download()
0424
0425
0426 if (not os.path.isdir(RefRepository+'/'+NewRelease)) :
0427 processCmd('mkdir -p '+RefRepository+'/'+NewRelease)
0428
0429 for infi in phase2samples_noPU:
0430 if "_HGCal" in infi.filename(NewRelease):
0431 processCmd('mv ' + infi.filename(NewRelease) + ' ' + infi.filename(NewRelease).replace("_HGCal",""))
0432 processCmd('mv ' + infi.filename(NewRelease).replace("_HGCal","") + ' ' + RefRepository+'/'+NewRelease)
0433 else:
0434
0435
0436 processCmd('mv ' + infi.filename(NewRelease) + ' ' + RefRepository+'/'+NewRelease)
0437
0438
0439
0440
0441 if (opt.OBJ == 'layerClusters' or opt.OBJ == 'hitCalibration' or opt.OBJ == 'hitValidation' or opt.OBJ == 'tracksters' or opt.OBJ == 'simulation'):
0442 fragments = []
0443
0444 if opt.OBJ == 'simulation': processCmd('mkdir HGCValid_SimClusters_Plots HGCValid_CaloParticles_Plots')
0445
0446 for infi in phase2samples_noPU:
0447 samplename = infi.filename(NewRelease).replace("DQM_V0001_R000000001__","").replace("__DQMIO.root","")
0448
0449
0450 if infi.pileup() == "PU":
0451 samplename = samplename + str(infi.pileupNumber())
0452
0453
0454 print(_sampleName[infi.name()])
0455 print("="*40)
0456 print(samplename)
0457 print("="*40)
0458
0459
0460 if opt.OBJ == 'tracksters':
0461 for tracksterCollection in trackstersIters:
0462 processCmd('mkdir -p HGCValid_Tracksters_Plots/plots_%s_%s HGCValid_Test-TICL_Plots/plots_%s_%s HGCValid_TICL-patternRecognition_Plots/plots_%s_%s' %(samplename,tracksterCollection,samplename,tracksterCollection,samplename,tracksterCollection) )
0463
0464 inputpathRef = ""
0465 if RefRelease != None: inputpathRef = RefRepository +'/' + RefRelease +'/'
0466 inputpathNew = NewRepository +'/' + NewRelease+ '/'
0467
0468 if RefRelease == None:
0469 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)
0470 elif "raw" in NotNormalRelease and "normal" in NotNormalRefRelease:
0471 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)
0472
0473 elif "normal" in NotNormalRelease and "raw" in NotNormalRefRelease:
0474 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)
0475
0476 elif "raw" in NotNormalRelease and "raw" in NotNormalRefRelease:
0477
0478 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)
0479 elif "normal" in NotNormalRelease and "normal" in NotNormalRefRelease:
0480 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)
0481
0482 else:
0483
0484
0485
0486 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)
0487 print(cmd)
0488
0489 if(opt.DRYRUN):
0490 print('Dry-run: ['+cmd+']')
0491 else:
0492 output = processCmd(cmd)
0493 if opt.OBJ == 'layerClusters':
0494 processCmd('mv HGCValid_%s_Plots/plots_%s_Layer\ Clusters.html HGCValid_%s_Plots/index.html'%(opt.HTMLVALNAME,samplename,opt.HTMLVALNAME))
0495 processCmd('awk \'NR>=6&&NR<=396\' HGCValid_%s_Plots/index.html > HGCValid_%s_Plots/index_%s.html '% (opt.HTMLVALNAME,opt.HTMLVALNAME, samplename))
0496 processCmd('echo " <br/>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
0497 processCmd('echo " <hr>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
0498
0499 if opt.OBJ == 'hitCalibration':
0500
0501 processCmd('mv HGCValid_%s_Plots/plots_%s_Calibrated\ RecHits.html HGCValid_%s_Plots/index.html'%(opt.HTMLVALNAME,samplename,opt.HTMLVALNAME))
0502 processCmd('sed -i \'s/Calibrated\ RecHits//g\' HGCValid_%s_Plots/index.html'%(opt.HTMLVALNAME) )
0503 processCmd('awk \'NR>=6&&NR<=27\' HGCValid_%s_Plots/index.html > HGCValid_%s_Plots/index_%s.html '% (opt.HTMLVALNAME,opt.HTMLVALNAME, samplename))
0504 processCmd('echo " <br/>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
0505 processCmd('echo " <hr>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
0506
0507 if opt.OBJ == 'hitValidation':
0508 processCmd('mv HGCValid_%s_Plots/plots_%s_Hits.html HGCValid_%s_Plots/index.html'%(opt.HTMLVALNAME,samplename,opt.HTMLVALNAME))
0509 processCmd('awk \'NR>=6&&NR<=184\' HGCValid_%s_Plots/index.html > HGCValid_%s_Plots/index_%s.html '% (opt.HTMLVALNAME,opt.HTMLVALNAME, samplename))
0510 processCmd('echo " <br/>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
0511 processCmd('echo " <hr>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
0512
0513 if opt.OBJ == 'tracksters':
0514 processCmd('mv HGCValid_%s_Plots/plots_%s_Tracksters.html HGCValid_Tracksters_Plots/index.html'%(opt.HTMLVALNAME,samplename))
0515 processCmd('mv HGCValid_%s_Plots/plots_%s_Test-TICL.html HGCValid_Test-TICL_Plots/index.html'%(opt.HTMLVALNAME,samplename))
0516 processCmd('mv HGCValid_%s_Plots/plots_%s_TICL-patternRecognition.html HGCValid_TICL-patternRecognition_Plots/index.html'%(opt.HTMLVALNAME,samplename))
0517 processCmd('awk \'NR>=6&&NR<=135\' HGCValid_Tracksters_Plots/index.html > HGCValid_Tracksters_Plots/index_%s.html ' %(samplename))
0518 processCmd('awk \'NR>=6&&NR<=117\' HGCValid_Test-TICL_Plots/index.html > HGCValid_Test-TICL_Plots/index_%s.html '% (samplename))
0519 processCmd('awk \'NR>=6&&NR<=117\' HGCValid_TICL-patternRecognition_Plots/index.html > HGCValid_TICL-patternRecognition_Plots/index_%s.html '% (samplename))
0520 processCmd('echo " <br/>" >> HGCValid_Tracksters_Plots/index_%s.html '%(samplename) )
0521 processCmd('echo " <br/>" >> HGCValid_Test-TICL_Plots/index_%s.html '%(samplename) )
0522 processCmd('echo " <br/>" >> HGCValid_TICL-patternRecognition_Plots/index_%s.html '%(samplename) )
0523 processCmd('echo " <hr>" >> HGCValid_Tracksters_Plots/index_%s.html '%(samplename) )
0524 processCmd('echo " <hr>" >> HGCValid_Test-TICL_Plots/index_%s.html '%(samplename) )
0525 processCmd('echo " <hr>" >> HGCValid_TICL-patternRecognition_Plots/index_%s.html '%(samplename) )
0526
0527 for tracksterCollection in trackstersIters:
0528
0529 processCmd('mv HGCValid_%s_Plots/plots_%s_%s/*_Link HGCValid_Test-TICL_Plots/plots_%s_%s/.'%(opt.HTMLVALNAME,samplename,tracksterCollection,samplename,tracksterCollection))
0530 processCmd('mv HGCValid_%s_Plots/plots_%s_%s/*CaloParticle*Trackster* HGCValid_Test-TICL_Plots/plots_%s_%s/.'%(opt.HTMLVALNAME,samplename,tracksterCollection,samplename,tracksterCollection))
0531 processCmd('mv HGCValid_%s_Plots/plots_%s_%s/*Trackster*CaloParticle* HGCValid_Test-TICL_Plots/plots_%s_%s/.'%(opt.HTMLVALNAME,samplename,tracksterCollection,samplename,tracksterCollection))
0532
0533 processCmd('mv HGCValid_%s_Plots/plots_%s_%s/*_PR HGCValid_TICL-patternRecognition_Plots/plots_%s_%s/.'%(opt.HTMLVALNAME,samplename,tracksterCollection,samplename,tracksterCollection))
0534 processCmd('mv HGCValid_%s_Plots/plots_%s_%s/*SimTrackster*Trackster* HGCValid_TICL-patternRecognition_Plots/plots_%s_%s/.'%(opt.HTMLVALNAME,samplename,tracksterCollection,samplename,tracksterCollection))
0535 processCmd('mv HGCValid_%s_Plots/plots_%s_%s/*Trackster*SimTrackster* HGCValid_TICL-patternRecognition_Plots/plots_%s_%s/.'%(opt.HTMLVALNAME,samplename,tracksterCollection,samplename,tracksterCollection))
0536
0537 for gr in ['EtaPhiPtEnergy','XYZ','TotalNumberofTracksters','NumberofLayerClustersinTrackster','NumberofLayerClustersinTracksterPerLayer','NumberofLayerClustersinTracksterPerLayer_zminus_EE','NumberofLayerClustersinTracksterPerLayer_zminus_FH','NumberofLayerClustersinTracksterPerLayer_zminus_BH','NumberofLayerClustersinTracksterPerLayer_zplus_EE','NumberofLayerClustersinTracksterPerLayer_zplus_FH','NumberofLayerClustersinTracksterPerLayer_zplus_BH','LayerNumbersOfTrackster','MultiplicityofLCinTST']:
0538 processCmd('mv HGCValid_%s_Plots/plots_%s_%s/%s HGCValid_Tracksters_Plots/plots_%s_%s/.'%(opt.HTMLVALNAME,samplename,tracksterCollection,gr,samplename,tracksterCollection))
0539
0540
0541 if opt.OBJ == 'simulation':
0542
0543 processCmd('mv HGCValid_%s_Plots/plots_%s_SimClusters.html HGCValid_SimClusters_Plots/index.html'%(opt.HTMLVALNAME,samplename))
0544 processCmd('mv HGCValid_%s_Plots/plots_%s_CaloParticles.html HGCValid_CaloParticles_Plots/index.html'%(opt.HTMLVALNAME,samplename))
0545 processCmd('awk \'NR>=6&&NR<=157\' HGCValid_SimClusters_Plots/index.html > HGCValid_SimClusters_Plots/index_%s.html '% (samplename))
0546 processCmd('awk \'NR>=6&&NR<=331\' HGCValid_CaloParticles_Plots/index.html > HGCValid_CaloParticles_Plots/index_%s.html '% (samplename))
0547 processCmd('echo " <br/>" >> HGCValid_SimClusters_Plots/index_%s.html '%(samplename) )
0548 processCmd('echo " <br/>" >> HGCValid_CaloParticles_Plots/index_%s.html '%(samplename) )
0549 processCmd('echo " <hr>" >> HGCValid_SimClusters_Plots/index_%s.html '%(samplename) )
0550 processCmd('echo " <hr>" >> HGCValid_CaloParticles_Plots/index_%s.html '%(samplename) )
0551
0552 processCmd('mv HGCValid_%s_Plots/plots_%s_ClusterLevel HGCValid_SimClusters_Plots/.'%(opt.HTMLVALNAME,samplename))
0553 processCmd('mv HGCValid_%s_Plots/plots_%s_ticlSimTracksters HGCValid_SimClusters_Plots/.'%(opt.HTMLVALNAME,samplename))
0554 processCmd('mv HGCValid_%s_Plots/plots_%s_CaloParticles_* HGCValid_CaloParticles_Plots/.'%(opt.HTMLVALNAME,samplename))
0555
0556
0557 if opt.OBJ == 'simulation':
0558 fragments.append( 'HGCValid_SimClusters_Plots/index_%s.html'% (samplename) )
0559 fragments.append( 'HGCValid_CaloParticles_Plots/index_%s.html'% (samplename) )
0560 elif opt.OBJ == 'tracksters':
0561 fragments.append( 'HGCValid_Tracksters_Plots/index_%s.html'% (samplename) )
0562 fragments.append( 'HGCValid_Test-TICL_Plots/index_%s.html'% (samplename) )
0563 fragments.append( 'HGCValid_TICL-patternRecognition_Plots/index_%s.html'% (samplename) )
0564 else:
0565 fragments.append( 'HGCValid_%s_Plots/index_%s.html'% (opt.HTMLVALNAME, samplename) )
0566
0567
0568
0569 indexfiles = []
0570 if opt.OBJ == 'simulation':
0571 indexfiles = ["SimClusters","CaloParticles"]
0572 elif opt.OBJ == 'tracksters':
0573 indexfiles = ["Tracksters","Test-TICL","TICL-patternRecognition"]
0574 else:
0575 indexfiles = [opt.HTMLVALNAME]
0576
0577 for ind in indexfiles:
0578 processCmd('mv HGCValid_%s_Plots/index.html HGCValid_%s_Plots/test.html' %(ind,ind) )
0579 index_file = open('HGCValid_%s_Plots/index.html'%(ind),'w')
0580
0581 index_file.write('<html>\n')
0582 index_file.write(' <head>\n')
0583 index_file.write(' <title>HGCAL validation %s </title>\n' %(ind) )
0584 index_file.write(' </head>\n')
0585 index_file.write(' <body>\n')
0586
0587 for frag in fragments:
0588 if ind not in frag: continue
0589 with open(frag,'r') as f:
0590 lines = f.read().splitlines()
0591 for line in lines:
0592 print(line)
0593 index_file.write(line + '\n')
0594
0595
0596
0597
0598 index_file.write(' </body>\n')
0599 index_file.write('</html>\n')
0600 index_file.close()
0601
0602
0603
0604 if (opt.OBJ == 'SimHits'):
0605
0606 if (not os.path.isdir("hgcalSimHitStudy")) :
0607 processCmd('mkdir -p hgcalSimHitStudy')
0608
0609 processCmd('cp %s/../public/index.php hgcalSimHitStudy/.'%(opt.WWWAREA) )
0610
0611
0612
0613 cmd = 'root.exe -b -q Validation/HGCalValidation/macros/validationplots.C\(\\"hgcSimHit.root' + '\\",\\"'+ opt.OBJ + '\\"\)'
0614 if(opt.DRYRUN):
0615 print('Dry-run: ['+cmd+']')
0616 else:
0617 output = processCmd(cmd)
0618
0619
0620 '''
0621 if (opt.OBJ == 'hitValidation'):
0622 fragments = []
0623 #Now that we have them in eos lets produce plots
0624 #Let's loop through RelVals
0625 for infi in phase2samples_noPU:
0626 samplename = infi.filename(NewRelease).replace("DQM_V0001_R000000001__","").replace("__DQMIO.root","")
0627 #samplename = infi.filename(NewRelease).replace("DQM_V0001_R000000001__","").split("__CMSSW_10_6_0_pre4",1)[0]
0628 #samplename = samplename + infi.pileup()
0629 if infi.pileup() == "PU":
0630 samplename = samplename + str(infi.pileupNumber())
0631
0632 print("="*40)
0633 print(samplename)
0634 print("="*40)
0635
0636 inputpathRef = ""
0637 if RefRelease != None: inputpathRef = RefRepository +'/' + RefRelease +'/'
0638 inputpathNew = NewRepository +'/' + NewRelease+ '/'
0639
0640 if RefRelease == None:
0641 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)
0642 elif "raw" in NotNormalRelease and "normal" in NotNormalRefRelease:
0643 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)
0644 #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)
0645 elif "raw" in NotNormalRelease and "raw" in NotNormalRefRelease:
0646 #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)
0647 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)
0648 elif "normal" in NotNormalRelease and "normal" in NotNormalRefRelease:
0649 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)
0650 #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)
0651 else:
0652 #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)
0653 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)
0654 #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)
0655
0656
0657 if(opt.DRYRUN):
0658 print('Dry-run: ['+cmd+']')
0659 else:
0660 output = processCmd(cmd)
0661 processCmd('mv HGCValid_%s_Plots/plots_%s_Hits.html HGCValid_%s_Plots/index.html'%(opt.HTMLVALNAME,samplename,opt.HTMLVALNAME))
0662 processCmd('awk \'NR>=6&&NR<=184\' HGCValid_%s_Plots/index.html > HGCValid_%s_Plots/index_%s.html '% (opt.HTMLVALNAME,opt.HTMLVALNAME, samplename))
0663 processCmd('echo " <br/>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
0664 processCmd('echo " <hr>" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) )
0665
0666 fragments.append( 'HGCValid_%s_Plots/index_%s.html'% (opt.HTMLVALNAME, samplename) )
0667
0668
0669 #Let's also create the final index xml file.
0670 processCmd('mv HGCValid_%s_Plots/index.html HGCValid_%s_Plots/test.html' %(opt.HTMLVALNAME,opt.HTMLVALNAME) )
0671 index_file = open('HGCValid_%s_Plots/index.html'%(opt.HTMLVALNAME),'w')
0672 #Write preamble
0673 index_file.write('<html>\n')
0674 index_file.write(' <head>\n')
0675 index_file.write(' <title>HGCal validation %s </title>\n' %(opt.HTMLVALNAME) )
0676 index_file.write(' </head>\n')
0677 index_file.write(' <body>\n')
0678
0679 for frag in fragments:
0680 with open(frag,'r') as f:
0681 lines = f.read().splitlines()
0682 for line in lines:
0683 print(line)
0684 index_file.write(line + '\n')
0685 #processCmd( 'cat ' + frag + ' >> HGCalValidationPlots/index.html ' )
0686 #index_file.write(frag)
0687
0688
0689 #Writing postamble"
0690 index_file.write(' </body>\n')
0691 index_file.write('</html>\n')
0692 index_file.close()
0693 '''
0694
0695
0696
0697 if (opt.OBJ == 'Digis'):
0698
0699 if (not os.path.isdir("hgcalDigiStudy")) :
0700 processCmd('mkdir -p hgcalDigiStudy')
0701 processCmd('mkdir -p hgcalDigiStudyEE')
0702 processCmd('mkdir -p hgcalDigiStudyHEF')
0703 processCmd('mkdir -p hgcalDigiStudyHEB')
0704
0705 processCmd('cp %s/../public/index.php hgcalDigiStudy/.'%(opt.WWWAREA) )
0706 processCmd('cp %s/../public/index.php hgcalDigiStudyEE/.'%(opt.WWWAREA) )
0707 processCmd('cp %s/../public/index.php hgcalDigiStudyHEF/.'%(opt.WWWAREA) )
0708 processCmd('cp %s/../public/index.php hgcalDigiStudyHEB/.'%(opt.WWWAREA) )
0709
0710
0711
0712 cmd = 'root.exe -b -q Validation/HGCalValidation/macros/validationplots.C\(\\"hgcDigi.root' + '\\",\\"'+ opt.OBJ + '\\"\)'
0713 if(opt.DRYRUN):
0714 print('Dry-run: ['+cmd+']')
0715 else:
0716 output = processCmd(cmd)
0717
0718 processCmd('mv hgcalDigiStudyEE hgcalDigiStudy/.')
0719 processCmd('mv hgcalDigiStudyHEF hgcalDigiStudy/.')
0720 processCmd('mv hgcalDigiStudyHEB hgcalDigiStudy/.')
0721
0722
0723
0724 if (opt.OBJ == 'RecHits'):
0725
0726 if (not os.path.isdir("hgcalRecHitStudy")) :
0727 processCmd('mkdir -p hgcalRecHitStudy')
0728 processCmd('mkdir -p hgcalRecHitStudyEE')
0729 processCmd('mkdir -p hgcalRecHitStudyHEF')
0730 processCmd('mkdir -p hgcalRecHitStudyHEB')
0731
0732 processCmd('cp %s/../public/index.php hgcalRecHitStudy/.'%(opt.WWWAREA) )
0733 processCmd('cp %s/../public/index.php hgcalRecHitStudyEE/.'%(opt.WWWAREA) )
0734 processCmd('cp %s/../public/index.php hgcalRecHitStudyHEF/.'%(opt.WWWAREA) )
0735 processCmd('cp %s/../public/index.php hgcalRecHitStudyHEB/.'%(opt.WWWAREA) )
0736
0737
0738
0739 cmd = 'root.exe -b -q Validation/HGCalValidation/macros/validationplots.C\(\\"hgcRecHit.root' + '\\",\\"'+ opt.OBJ + '\\"\)'
0740 if(opt.DRYRUN):
0741 print('Dry-run: ['+cmd+']')
0742 else:
0743 output = processCmd(cmd)
0744
0745 processCmd('mv hgcalRecHitStudyEE hgcalRecHitStudy/.')
0746 processCmd('mv hgcalRecHitStudyHEF hgcalRecHitStudy/.')
0747 processCmd('mv hgcalRecHitStudyHEB hgcalRecHitStudy/.')
0748
0749
0750
0751 if (opt.OBJ == 'CaloParticles'):
0752 particletypes = ["-11","-13","-211","-321","11","111","13","211","22","321"]
0753
0754 if (not os.path.isdir("CaloParticles")) :
0755 processCmd('mkdir -p CaloParticles')
0756
0757 processCmd('cp %s/../public/index.php CaloParticles/.'%(opt.WWWAREA) )
0758
0759
0760 for infi in phase2samples_noPU:
0761
0762 samplename = infi.filename(NewRelease).replace("DQM_V0001_R000000001__","").split("__"+NewRelease,1)[0]
0763 samplename = samplename + infi.pileup()
0764 if infi.pileup() == "PU":
0765 samplename = samplename + str(infi.pileupNumber())
0766
0767 print("="*40)
0768 print(samplename)
0769 print("="*40)
0770 if (not os.path.isdir(samplename)) :
0771 processCmd('mkdir -p ' + samplename )
0772 processCmd('cp %s/RelVals/index.php '%(opt.WWWAREA) + samplename + '/.')
0773 for part in particletypes:
0774 processCmd('mkdir -p ' + samplename + '/' +part )
0775
0776 processCmd('cp %s/RelVals/index.php '%(opt.WWWAREA) + samplename + '/' +part + '/.')
0777
0778 inputpathRef = ""
0779 if RefRelease != None: inputpathRef = RefRepository +'/' + RefRelease +'/'
0780 inputpathNew = NewRepository +'/' + NewRelease+ '/'
0781 cmd = 'root.exe -b -q Validation/HGCalValidation/macros/validationplots.C\(\\"'+ inputpathNew + infi.filename(NewRelease) + '\\",\\"'+ opt.OBJ + '\\",\\"'+ samplename + '\\"\\)'
0782 if(opt.DRYRUN):
0783 print('Dry-run: ['+cmd+']')
0784 else:
0785 output = processCmd(cmd)
0786 processCmd('mv ' +samplename+ ' CaloParticles/.' )
0787
0788
0789
0790
0791
0792
0793 if (opt.GATHER != None) :
0794
0795
0796 index_file = open('index.html','w')
0797
0798 index_file.write('<html>\n')
0799 index_file.write(' <head>\n')
0800 index_file.write(' <title>HGCAL validation results </title>\n' )
0801 index_file.write(' </head>\n')
0802 index_file.write(' <body>\n')
0803 index_file.write(' <h1>\n')
0804 index_file.write(' HGCAL Validation Results \n' )
0805 index_file.write(' </h1>\n')
0806 index_file.write(' <hr/>\n' )
0807 index_file.write(' <h2>\n')
0808 index_file.write(' Release Validation Campaigns \n' )
0809 index_file.write(' </h2>\n')
0810 index_file.write(' <ul>\n' )
0811
0812 for trel in thereleases.keys():
0813 index_file.write(' <li>\n' )
0814 index_file.write(' %s\n' %(trel) )
0815 for rel in thereleases[trel]:
0816 index_file.write(' <ul>\n' )
0817 index_file.write(' <li><a href="%s/index.html">%s</a></li>\n' %(rel, rel ) )
0818 index_file.write(' </ul>\n' )
0819 index_file.write(' </li>\n' )
0820 index_file.write(' <br>\n' )
0821 index_file.write(' <br>\n' )
0822 index_file.write(' <br>\n' )
0823
0824 index_file.write(' </ul>\n' )
0825 index_file.write(' <hr/>\n' )
0826
0827
0828
0829
0830 index_file.write(' <h2>\n')
0831 index_file.write(' Geometry Validation \n' )
0832 index_file.write(' </h2>\n')
0833 index_file.write(' <ul>\n' )
0834
0835 for tgeo in geometryTests.keys():
0836 index_file.write(' <li>\n' )
0837 index_file.write(' %s\n' %(tgeo) )
0838 for geo in geometryTests[tgeo]:
0839
0840 if (not os.path.isdir(geo)):
0841 processCmd('mkdir -p %s/%s' %(opt.WWWAREA,geo) )
0842 processCmd('mkdir -p %s' %(geo) )
0843 for mats in _individualmaterials:
0844 processCmd('mkdir -p %s/%s/indimat/%s' %(opt.WWWAREA,geo,mats) )
0845 processCmd('mkdir -p %s/indimat/%s' %(geo,mats) )
0846
0847 index_file.write(' <ul>\n' )
0848 index_file.write(' <li><a href="%s/index.html">%s</a></li>\n' %(geo, geo ) )
0849 index_file.write(' </ul>\n' )
0850 index_file.write(' </li>\n' )
0851 index_file.write(' <br>\n' )
0852 index_file.write(' <br>\n' )
0853 index_file.write(' <br>\n' )
0854
0855
0856 index_file.write(' </body>\n')
0857 index_file.write('</html>\n')
0858 index_file.close()
0859
0860
0861
0862
0863 if (opt.COPYHTML) : processCmd('cp index.html %s/.' %(opt.WWWAREA) )
0864
0865
0866 if (not os.path.isdir("HGCValid_summary_Plots")):
0867 processCmd('mkdir -p HGCValid_summary_Plots')
0868
0869
0870 df = pd.DataFrame.from_dict(_summary, orient = 'index').transpose()
0871
0872 df = df[_summobj]
0873
0874 index_file = open('HGCValid_summary_Plots/index.html','w')
0875
0876 index_file.write('<html>\n')
0877 index_file.write(' <body>\n')
0878
0879
0880 for infi in phase2samples_noPU:
0881 samplename = infi.filename(NewRelease).replace("DQM_V0001_R000000001__","").replace("__DQMIO.root","")
0882 index_file.write( '<h2> %s </h2> \n' %(_sampleName[infi.name()]) )
0883
0884 index_file.write('<table> \n')
0885 index_file.write(' <tr>\n')
0886
0887 for obj in _summobj:
0888 index_file.write(' <th>%s</th>\n' %(_pageNameMap[obj]) )
0889 index_file.write(' </tr>\n')
0890
0891 for i, row in df.iterrows():
0892 index_file.write(' <tr>\n')
0893 for j, column in row.iteritems():
0894 print(column)
0895 index_file.write(' <td>\n')
0896 index_file.write(' <ul>\n')
0897
0898
0899 if column == None:
0900 index_file.write(' </ul>\n')
0901 index_file.write(' </td>\n')
0902 continue
0903
0904 else:
0905
0906 print(j)
0907
0908 if "Tracksters" in j or "Test-TICL" in j or "TICL-patternRecognition" in j:
0909 index_file.write(' <li><a href="../HGCValid_%s_Plots/plots_%s_%s">%s</a></li> \n' %(j, samplename, column, column.replace("ticlTracksters","") ))
0910 else:
0911 index_file.write(' <li><a href="../HGCValid_%s_Plots/plots_%s_%s">%s</a></li> \n' %(j, samplename, column, column.partition("/")[2] ))
0912
0913 index_file.write(' </ul>\n')
0914 index_file.write(' </td>\n')
0915
0916 index_file.write(' </tr>\n')
0917
0918 index_file.write(' </table>\n')
0919 index_file.write(' <br/>\n' )
0920 index_file.write(' <br/>\n' )
0921 index_file.write(' <br/>\n' )
0922
0923
0924 index_file.write(' </body>\n')
0925 index_file.write('</html>\n')
0926 index_file.close()
0927
0928 objects = opt.GATHER.split(",")
0929
0930 localoutputdir = ""
0931 if "raw" in NotNormalRelease and "raw" in NotNormalRefRelease:
0932 localoutputdir = NewRelease + "_raw1100" + "_vs_" + RefRelease + "_raw1100"
0933 elif "raw" in NotNormalRelease and "normal" in NotNormalRefRelease:
0934
0935 localoutputdir = NewRelease + "_D76" + "_vs_" + RefRelease
0936 elif "normal" in NotNormalRelease and "normal" in NotNormalRefRelease:
0937 localoutputdir = NewRelease + "_vs_" + RefRelease
0938 else:
0939 localoutputdir = NewRelease
0940
0941
0942 for obj in objects:
0943
0944 if (not os.path.isdir('%s/standalone' %(localoutputdir))) :
0945 processCmd('mkdir -p %s/standalone' %(localoutputdir))
0946 if (obj!="standalone"): processCmd('mv HGCValid_%s_Plots %s'%(obj, localoutputdir) )
0947 else :
0948 processCmd('mv hgcalSimHitStudy %s/standalone/.'%(localoutputdir) )
0949 processCmd('mv hgcalDigiStudy %s/standalone/.'%(localoutputdir) )
0950 processCmd('mv hgcalRecHitStudy %s/standalone/.'%(localoutputdir) )
0951 processCmd('cp %s/../public/index.php %s/standalone/.'%(opt.WWWAREA, localoutputdir) )
0952
0953 '''
0954 #Let's also copy to the summary folder what we need.
0955 for infi in phase2samples_noPU:
0956 samplename = infi.filename(NewRelease).replace("DQM_V0001_R000000001__","").replace("__DQMIO.root","")
0957 for obj in _summobj:
0958 #print obj
0959 #if obj == "hitValidation" : samplename = samplename + infi.pileup()
0960 #else : samplename = infi.filename(NewRelease).replace("DQM_V0001_R000000001__","").replace("__DQMIO.root","")
0961 for ind in df.index:
0962 if df[obj][ind] == None: continue
0963 else: processCmd('cp -r %s/HGCValid_%s_Plots/plots_%s_%s %s/HGCValid_summary_Plots ' %(NewRelease, obj, samplename, df[obj][ind].partition("/")[0], NewRelease ) )
0964 '''
0965
0966
0967 index_file = open('%s/index.html'%(localoutputdir),'w')
0968
0969 index_file.write('<html>\n')
0970 index_file.write(' <head>\n')
0971 index_file.write(' <title> <h2> HGCAL validation results for %s </h2> </title>\n' %(localoutputdir) )
0972 index_file.write(' </head>\n')
0973 index_file.write(' <body>\n')
0974 index_file.write(' <h2> HGCAL validation results for %s </h2> \n' %(localoutputdir) )
0975
0976 for obj in objects:
0977 print(obj)
0978 if (obj!="standalone"):
0979 index_file.write(' <br/>\n' )
0980 index_file.write(' <ul>\n' )
0981 index_file.write(' <li><a href="HGCValid_%s_Plots/index.html">%s</a></li>\n' %(obj, _pageNameMap[obj] ) )
0982 index_file.write(' </ul>\n' )
0983 index_file.write(' <br/>\n' )
0984 else :
0985 index_file.write(' <br/>\n' )
0986 index_file.write(' <ul>\n' )
0987 index_file.write(' <li><a href="%s/index.php">%s</a></li>\n' %(obj, _pageNameMap[obj] ) )
0988 index_file.write(' </ul>\n' )
0989 index_file.write(' <br/>\n' )
0990
0991
0992
0993 index_file.write(' </body>\n')
0994 index_file.write('</html>\n')
0995 index_file.close()
0996
0997
0998
0999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018 if (opt.GEOMETRY) :
1019
1020 index_file = open('%s/index.html'%(GeoScenario),'w')
1021
1022 index_file.write('<html>\n')
1023 index_file.write(' <head>\n')
1024 index_file.write(' <title> <h2> HGCAL material budget results for %s </h2> </title>\n' %(GeoScenario) )
1025 index_file.write(' </head>\n')
1026 index_file.write(' <body>\n')
1027 index_file.write(' <h2> HGCAL material budget results for %s </h2> \n' %(GeoScenario) )
1028
1029 for obj in _MatBudSections:
1030 print(obj)
1031
1032 if (not os.path.isdir('%s/%s/%s' %(opt.WWWAREA,GeoScenario,obj))):
1033 processCmd('mkdir -p %s/%s/%s' %(opt.WWWAREA,GeoScenario,obj) )
1034 processCmd('mkdir -p %s/%s' %(GeoScenario,obj) )
1035
1036 index_file.write(' <br/>\n' )
1037 index_file.write(' <ul>\n' )
1038 index_file.write(' <li><a href="%s/index.html">%s</a></li>\n' %(obj, _geoPageNameMap[obj] ) )
1039 index_file.write(' </ul>\n' )
1040 index_file.write(' <br/>\n' )
1041
1042
1043 index_file.write(' </body>\n')
1044 index_file.write('</html>\n')
1045 index_file.close()
1046
1047
1048 processCmd('cp %s/index.html %s/%s/.' %(GeoScenario, opt.WWWAREA,GeoScenario) )
1049
1050
1051 index_file = open('%s/indimat/index.html'%(GeoScenario),'w')
1052
1053 index_file.write('<html>\n')
1054 index_file.write(' <head>\n')
1055 index_file.write(' <title> <h2> HGCAL material budget results for individual materials for %s </h2> </title>\n' %(GeoScenario) )
1056 index_file.write(' </head>\n')
1057 index_file.write(' <body>\n')
1058 index_file.write(' <h2> HGCAL material budget results for individual materials for %s </h2> \n' %(GeoScenario) )
1059 for mats in _individualmaterials:
1060 print(mats)
1061
1062 index_file.write(' <ul>\n' )
1063 index_file.write(' <li><a href="%s/index.html">%s</a></li>\n' %(mats, _matPageNameMap[mats] ) )
1064 index_file.write(' </ul>\n' )
1065
1066
1067
1068 index_file.write(' </body>\n')
1069 index_file.write('</html>\n')
1070 index_file.close()
1071
1072
1073 processCmd('cp %s/indimat/index.html %s/%s/indimat/.' %(GeoScenario, opt.WWWAREA,GeoScenario) )
1074
1075
1076 index_file = open('%s/allhgcal/index.html'%(GeoScenario),'w')
1077
1078 index_file.write('<html>\n')
1079 index_file.write(' <head>\n')
1080
1081 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')
1082
1083 index_file.write(_hideShowFun["thestyle"])
1084
1085 index_file.write(' <title> <h2> HGCAL material budget results for all materials for %s </h2> </title>\n' %(GeoScenario) )
1086 index_file.write(' </head>\n')
1087 index_file.write(' <body>\n')
1088
1089 index_file.write(' <h2> HGCAL material budget results for : <span style="color:red;font-size:120%%" >All Materials </span></h2> \n' )
1090
1091 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]) )
1092
1093 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]) )
1094
1095 index_file.write('<hr/>\n')
1096
1097 index_file.write(_hideShowFun["divTabs"])
1098
1099 for region in ["_AllHGCAL", "_ZminusZoom", "_ZplusZoom"]:
1100
1101 index_file.write('<div id="%s" class="tabcontent"> \n' %(region))
1102 pngnamestring = ""
1103 if region == "_AllHGCAL": pngnamestring = ""
1104 else: pngnamestring = region
1105
1106 for allmatplot in _allmaterialsplots:
1107 if region == "_AllHGCAL":
1108 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]))
1109 index_file.write('<img class="Reference" src="../%s/%s%s.png" width="375"/> \n' %(GeoScenario.split("_")[0],allmatplot,pngnamestring) )
1110 index_file.write('<img class="New" src="../%s/%s%s.png" width="375"/> \n' %(GeoScenario.split("_")[2],allmatplot,pngnamestring))
1111 index_file.write('<hr/>\n')
1112 elif region != "_AllHGCAL" and "HGCal_l_vs_z_vs_R" in allmatplot:
1113 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]))
1114 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) )
1115 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))
1116 index_file.write('<hr/>\n')
1117
1118
1119 index_file.write('</div>\n')
1120
1121 index_file.write(_hideShowFun["buttonandFunction"])
1122 index_file.write(' </body>\n')
1123 index_file.write('</html>\n')
1124 index_file.close()
1125
1126
1127 processCmd('cp %s/allhgcal/index.html %s/%s/allhgcal/.' %(GeoScenario, opt.WWWAREA,GeoScenario) )
1128
1129
1130 for mats in _individualmaterials:
1131 index_file = open('%s/indimat/%s/index.html'%(GeoScenario,mats),'w')
1132
1133 index_file.write('<html>\n')
1134 index_file.write(' <head>\n')
1135
1136 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')
1137
1138 index_file.write(_hideShowFun["thestyle"])
1139
1140 index_file.write(' <title> <h2> HGCAL material budget results for individual materials for %s </h2> </title>\n' %(GeoScenario) )
1141 index_file.write(' </head>\n')
1142 index_file.write(' <body>\n')
1143 index_file.write(' <h2> HGCAL material budget results for : <span style="color:red;font-size:120%%" >%s </span></h2> \n' %(_matPageNameMap[mats]) )
1144
1145 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]) )
1146
1147 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]) )
1148
1149 index_file.write('<hr/>\n')
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169 index_file.write(_hideShowFun["divTabs"])
1170
1171
1172 for region in ["_AllHGCAL", "_ZminusZoom", "_ZplusZoom"]:
1173
1174
1175
1176 index_file.write('<div id="%s" class="tabcontent"> \n' %(region))
1177 pngnamestring = ""
1178 if region == "_AllHGCAL": pngnamestring = ""
1179 else: pngnamestring = region
1180 for indiplots in _individualmatplots:
1181 if region == "_AllHGCAL":
1182 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]))
1183 index_file.write('<img class="Reference" src="../../%s/%s/%s%s%s.png" width="375"/> \n' %(GeoScenario.split("_")[0],mats,indiplots,mats,pngnamestring) )
1184 index_file.write('<img class="New" src="../../%s/%s/%s%s%s.png" width="375"/> \n' %(GeoScenario.split("_")[2],mats,indiplots,mats,pngnamestring))
1185 index_file.write('<hr/>\n')
1186 else:
1187 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]))
1188 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) )
1189 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))
1190 index_file.write('<hr/>\n')
1191
1192
1193 index_file.write('</div>\n')
1194
1195 index_file.write(_hideShowFun["buttonandFunction"])
1196 index_file.write(' </body>\n')
1197 index_file.write('</html>\n')
1198 index_file.close()
1199
1200
1201 processCmd('cp %s/indimat/%s/index.html %s/%s/indimat/%s/.' %(GeoScenario, mats, opt.WWWAREA,GeoScenario,mats) )
1202
1203
1204 index_file = open('%s/fromvertex/index.html'%(GeoScenario),'w')
1205
1206 index_file.write('<html>\n')
1207 index_file.write(' <head>\n')
1208
1209 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')
1210
1211 index_file.write(_hideShowFun["thestyle"])
1212
1213 index_file.write(' <title> <h2> HGCAL material budget results from vertex up to in front of muon stations for %s </h2> </title>\n' %(GeoScenario) )
1214 index_file.write(' </head>\n')
1215 index_file.write(' <body>\n')
1216
1217 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' )
1218
1219 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]) )
1220
1221 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]) )
1222
1223 index_file.write('<hr/>\n')
1224
1225
1226
1227 for vertexplots in _fromvertexplots:
1228 index_file.write('<p> %s </p>\n' %(_fromVertexPlotsDesc[vertexplots]))
1229 index_file.write('<img class="Reference" src="%s/Figures/MaterialBdg_FromVertexToBackOf%s.png" width="375"/> \n' %(GeoScenario.split("_")[0],vertexplots) )
1230 index_file.write('<img class="New" src="%s/Figures/MaterialBdg_FromVertexToBackOf%s.png" width="375"/> \n' %(GeoScenario.split("_")[2],vertexplots) )
1231 index_file.write('<hr/>\n')
1232
1233
1234 index_file.write(' </body>\n')
1235 index_file.write('</html>\n')
1236 index_file.close()
1237
1238
1239 processCmd('cp %s/fromvertex/index.html %s/%s/fromvertex/.' %(GeoScenario, opt.WWWAREA,GeoScenario) )
1240