diff --git a/Utilities/ReleaseScripts/python/cmsCodeRules/Formatter.py b/Utilities/ReleaseScripts/python/cmsCodeRules/Formatter.py index 92bb10537fd91..46624b8e0810f 100644 --- a/Utilities/ReleaseScripts/python/cmsCodeRules/Formatter.py +++ b/Utilities/ReleaseScripts/python/cmsCodeRules/Formatter.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import os, sys, string diff --git a/Utilities/ReleaseScripts/python/cmsCodeRules/showPage.py b/Utilities/ReleaseScripts/python/cmsCodeRules/showPage.py index 531b79088e5b0..58ad0b9b11edf 100755 --- a/Utilities/ReleaseScripts/python/cmsCodeRules/showPage.py +++ b/Utilities/ReleaseScripts/python/cmsCodeRules/showPage.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function from builtins import range diff --git a/Utilities/ReleaseScripts/scripts/MakeBuildSet b/Utilities/ReleaseScripts/scripts/MakeBuildSet index 8a59c768877fe..3fe59469acb5c 100755 --- a/Utilities/ReleaseScripts/scripts/MakeBuildSet +++ b/Utilities/ReleaseScripts/scripts/MakeBuildSet @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 from __future__ import print_function #pylint: disable-msg=W0403 """ diff --git a/Utilities/ReleaseScripts/scripts/addOnTests.py b/Utilities/ReleaseScripts/scripts/addOnTests.py index 821568178e61c..17ddf286bef7a 100755 --- a/Utilities/ReleaseScripts/scripts/addOnTests.py +++ b/Utilities/ReleaseScripts/scripts/addOnTests.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 from __future__ import print_function from builtins import range diff --git a/Utilities/ReleaseScripts/scripts/cernsso b/Utilities/ReleaseScripts/scripts/cernsso index f5fac7b76d222..de234a98f2580 100755 --- a/Utilities/ReleaseScripts/scripts/cernsso +++ b/Utilities/ReleaseScripts/scripts/cernsso @@ -1,4 +1,4 @@ -#!/usr/bin/env python2.6 +#!/usr/bin/env python3 from ctypes import * from optparse import OptionParser diff --git a/Utilities/ReleaseScripts/scripts/cmsCodeRulesChecker.py b/Utilities/ReleaseScripts/scripts/cmsCodeRulesChecker.py index d643291af9e6e..78730f0b05969 100755 --- a/Utilities/ReleaseScripts/scripts/cmsCodeRulesChecker.py +++ b/Utilities/ReleaseScripts/scripts/cmsCodeRulesChecker.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function from builtins import range diff --git a/Utilities/ReleaseScripts/scripts/cmssw_fix_interface.py b/Utilities/ReleaseScripts/scripts/cmssw_fix_interface.py index 52466a0ce8b32..adeead5e1b193 100755 --- a/Utilities/ReleaseScripts/scripts/cmssw_fix_interface.py +++ b/Utilities/ReleaseScripts/scripts/cmssw_fix_interface.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import os import sys diff --git a/Utilities/ReleaseScripts/scripts/duplicateReflexLibrarySearch.py b/Utilities/ReleaseScripts/scripts/duplicateReflexLibrarySearch.py index a2c9b132d1232..3d62361eb02fa 100755 --- a/Utilities/ReleaseScripts/scripts/duplicateReflexLibrarySearch.py +++ b/Utilities/ReleaseScripts/scripts/duplicateReflexLibrarySearch.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 from __future__ import print_function import optparse diff --git a/Utilities/ReleaseScripts/scripts/storeTreeInfo.py b/Utilities/ReleaseScripts/scripts/storeTreeInfo.py index 9437cd3d7dace..0ed2223e236f1 100755 --- a/Utilities/ReleaseScripts/scripts/storeTreeInfo.py +++ b/Utilities/ReleaseScripts/scripts/storeTreeInfo.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function from builtins import range diff --git a/Utilities/ReleaseScripts/scripts/ws_sso_content_reader.py b/Utilities/ReleaseScripts/scripts/ws_sso_content_reader.py index 7f84559b0e025..3fbb334381735 100755 --- a/Utilities/ReleaseScripts/scripts/ws_sso_content_reader.py +++ b/Utilities/ReleaseScripts/scripts/ws_sso_content_reader.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ###Description: The tool reads cern web services behind SSO using user certificates from __future__ import print_function import os, urllib, urllib2, httplib, cookielib, sys, HTMLParser, re diff --git a/Validation/HGCalValidation/scripts/harvestHGCalValidationPlots.py b/Validation/HGCalValidation/scripts/harvestHGCalValidationPlots.py index 830fb47c3dac1..c4d023b23b4da 100755 --- a/Validation/HGCalValidation/scripts/harvestHGCalValidationPlots.py +++ b/Validation/HGCalValidation/scripts/harvestHGCalValidationPlots.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import sys,os,tempfile,shutil,subprocess,glob diff --git a/Validation/HGCalValidation/scripts/hgcalPerformanceValidation.py b/Validation/HGCalValidation/scripts/hgcalPerformanceValidation.py index 6170daddc7ef0..8bd31f25ffc7a 100755 --- a/Validation/HGCalValidation/scripts/hgcalPerformanceValidation.py +++ b/Validation/HGCalValidation/scripts/hgcalPerformanceValidation.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 #------------------------------------------------------------------------------------------ # Description: This script is used to produce the results of the regurarly announced RelVal campaings. @@ -50,11 +50,11 @@ def parseOptions(): #Some helpful functions #Processing the external os commands def processCmd(cmd, quite = 0): - print cmd + print(cmd) status, output = commands.getstatusoutput(cmd) if (status !=0 and not quite): - print 'Error in processing command:\n ['+cmd+']' - print 'Output:\n ['+output+'] \n' + print('Error in processing command:\n ['+cmd+']') + print('Output:\n ['+output+'] \n') return output #PUtype @@ -89,8 +89,8 @@ def putype(t): "CMSSW_11_3_0_pre3_vs_CMSSW_11_3_0_pre2", "CMSSW_11_3_0_pre2_vs_CMSSW_11_3_0_pre1", "CMSSW_11_3_0_pre1_vs_CMSSW_11_2_0_pre10", - ], - "CMSSW 11_2_X" : [ + ], + "CMSSW 11_2_X" : [ "CMSSW_11_2_0_vs_CMSSW_11_2_0_pre10", "CMSSW_11_2_0_pre10_vs_CMSSW_11_2_0_pre9", "CMSSW_11_2_0_pre9_vs_CMSSW_11_2_0_pre8", @@ -144,12 +144,12 @@ def putype(t): exit() if "raw" in NotNormalRelease: -# appendglobaltag = "_2026D49noPU_raw1100_rsb" -# appendglobaltag = "_2026D49noPU_raw1100" -# appendglobaltag = "_2026D49noPU_gcc900" - appendglobaltag = "_2026D76noPU" + # appendglobaltag = "_2026D49noPU_raw1100_rsb" + # appendglobaltag = "_2026D49noPU_raw1100" + # appendglobaltag = "_2026D49noPU_gcc900" + appendglobaltag = "_2026D76noPU" else: - appendglobaltag = "_2026D49noPU" + appendglobaltag = "_2026D49noPU" #Until the final list of RelVals settles down the following sample list is under constant review ''' @@ -273,7 +273,7 @@ def putype(t): Sample("RelValSinglePiFlatPt0p7To10", scenario="2026D49", appendGlobalTag=appendglobaltag, version="v2" ) - + #------------------------------ #NORMAL version v1 campaign #Sample("RelValCloseByPGun_CE_H_Fine_300um", scenario="2026D49", appendGlobalTag=appendglobaltag ), @@ -360,12 +360,12 @@ def putype(t): for infi in phase2samples_noPU: if "_HGCal" in infi.filename(NewRelease): - processCmd('mv ' + infi.filename(NewRelease) + ' ' + infi.filename(NewRelease).replace("_HGCal","")) - processCmd('mv ' + infi.filename(NewRelease).replace("_HGCal","") + ' ' + RefRepository+'/'+NewRelease) + processCmd('mv ' + infi.filename(NewRelease) + ' ' + infi.filename(NewRelease).replace("_HGCal","")) + processCmd('mv ' + infi.filename(NewRelease).replace("_HGCal","") + ' ' + RefRepository+'/'+NewRelease) else: - #processCmd('mv ' + infi.filename(NewRelease) + ' ' + infi.filename(NewRelease).replace("2026D49noPU-v2","2026D49noPU-v1")) - #processCmd('mv ' + infi.filename(NewRelease).replace("2026D49noPU-v2","2026D49noPU-v1") + ' ' + RefRepository+'/'+NewRelease) - processCmd('mv ' + infi.filename(NewRelease) + ' ' + RefRepository+'/'+NewRelease) + #processCmd('mv ' + infi.filename(NewRelease) + ' ' + infi.filename(NewRelease).replace("2026D49noPU-v2","2026D49noPU-v1")) + #processCmd('mv ' + infi.filename(NewRelease).replace("2026D49noPU-v2","2026D49noPU-v1") + ' ' + RefRepository+'/'+NewRelease) + processCmd('mv ' + infi.filename(NewRelease) + ' ' + RefRepository+'/'+NewRelease) #------------------------------------------------------------------------------------------ #Objects processing section: The objects defined in --Obj are analyzed here. @@ -409,10 +409,10 @@ def putype(t): #YOU SHOULD INSPECT EACH TIME THIS COMMAND AND THE REPLACE #cmd = 'python 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) .replace("v2__", "v1__") cmd = 'python Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease).replace("mcRun4_realistic_v2-v1", "mcRun4_realistic_v2_2026D49noPU-v1") + ' ' + inputpathNew + infi.filename(NewRelease) + ' --outputDir HGCValid_%s_Plots --no-ratio --png --separate --html-sample "%s" ' %(opt.HTMLVALNAME, _sampleName[infi.name()] ) + ' --html-validation-name %s --subdirprefix ' %(opt.HTMLVALNAME) + ' plots_%s' % (samplename) + ' --collection %s' %(opt.HTMLVALNAME) - print cmd + print(cmd) if(opt.DRYRUN): - print 'Dry-run: ['+cmd+']' + print('Dry-run: ['+cmd+']') else: output = processCmd(cmd) if opt.OBJ == 'hgcalLayerClusters': @@ -435,10 +435,10 @@ def putype(t): processCmd('echo "
" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) ) processCmd('echo "
" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) ) - + fragments.append( 'HGCValid_%s_Plots/index_%s.html'% (opt.HTMLVALNAME, samplename) ) - - + + #Let's also create the final index xml file. processCmd('mv HGCValid_%s_Plots/index.html HGCValid_%s_Plots/test.html' %(opt.HTMLVALNAME,opt.HTMLVALNAME) ) index_file = open('HGCValid_%s_Plots/index.html'%(opt.HTMLVALNAME),'w') @@ -448,22 +448,22 @@ def putype(t): index_file.write(' HGCal validation %s \n' %(opt.HTMLVALNAME) ) index_file.write(' \n') index_file.write(' \n') - + for frag in fragments: with open(frag,'r') as f: lines = f.read().splitlines() for line in lines: - print line + print(line) index_file.write(line + '\n') #processCmd( 'cat ' + frag + ' >> HGCalValidationPlots/index.html ' ) #index_file.write(frag) - + #Writing postamble" index_file.write(' \n') index_file.write('\n') index_file.close() - + #------------------------------------------------------------------------------------------ #This is the SimHits part if (opt.OBJ == 'SimHits'): @@ -477,7 +477,7 @@ def putype(t): #Input: hgcSimHits.root cmd = 'root.exe -b -q Validation/HGCalValidation/macros/validationplots.C\(\\"hgcSimHit.root' + '\\",\\"'+ opt.OBJ + '\\"\)' if(opt.DRYRUN): - print 'Dry-run: ['+cmd+']' + print('Dry-run: ['+cmd+']') else: output = processCmd(cmd) @@ -516,20 +516,20 @@ def putype(t): #cmd = 'python 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) cmd = 'python Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py ' + inputpathRef + infi.filename(RefRelease).replace("mcRun4_realistic_v2-v1", "mcRun4_realistic_v2_2026D49noPU-v1") + ' ' + inputpathNew + infi.filename(NewRelease) + ' --outputDir HGCValid_%s_Plots --no-ratio --png --separate --html-sample "%s" ' %(opt.HTMLVALNAME, _sampleName[infi.name()] ) + ' --html-validation-name %s --subdirprefix ' %(opt.HTMLVALNAME) + ' plots_%s' % (samplename) + ' --collection %s' %(opt.HTMLVALNAME) #cmd = 'python 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) - + if(opt.DRYRUN): - print 'Dry-run: ['+cmd+']' + print('Dry-run: ['+cmd+']') else: output = processCmd(cmd) processCmd('mv HGCValid_%s_Plots/plots_%s_Hits.html HGCValid_%s_Plots/index.html'%(opt.HTMLVALNAME,samplename,opt.HTMLVALNAME)) processCmd('awk \'NR>=6&&NR<=184\' HGCValid_%s_Plots/index.html > HGCValid_%s_Plots/index_%s.html '% (opt.HTMLVALNAME,opt.HTMLVALNAME, samplename)) processCmd('echo "
" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) ) processCmd('echo "
" >> HGCValid_%s_Plots/index_%s.html '%(opt.HTMLVALNAME, samplename) ) - + fragments.append( 'HGCValid_%s_Plots/index_%s.html'% (opt.HTMLVALNAME, samplename) ) - - + + #Let's also create the final index xml file. processCmd('mv HGCValid_%s_Plots/index.html HGCValid_%s_Plots/test.html' %(opt.HTMLVALNAME,opt.HTMLVALNAME) ) index_file = open('HGCValid_%s_Plots/index.html'%(opt.HTMLVALNAME),'w') @@ -539,17 +539,17 @@ def putype(t): index_file.write(' HGCal validation %s \n' %(opt.HTMLVALNAME) ) index_file.write(' \n') index_file.write(' \n') - + for frag in fragments: with open(frag,'r') as f: lines = f.read().splitlines() for line in lines: - print line + print(line) index_file.write(line + '\n') #processCmd( 'cat ' + frag + ' >> HGCalValidationPlots/index.html ' ) #index_file.write(frag) - + #Writing postamble" index_file.write(' \n') index_file.write('\n') @@ -574,7 +574,7 @@ def putype(t): #Input: hgcDigi.root cmd = 'root.exe -b -q Validation/HGCalValidation/macros/validationplots.C\(\\"hgcDigi.root' + '\\",\\"'+ opt.OBJ + '\\"\)' if(opt.DRYRUN): - print 'Dry-run: ['+cmd+']' + print('Dry-run: ['+cmd+']') else: output = processCmd(cmd) #mv the output under the main directory @@ -601,7 +601,7 @@ def putype(t): #Input: hgcRecHit.root cmd = 'root.exe -b -q Validation/HGCalValidation/macros/validationplots.C\(\\"hgcRecHit.root' + '\\",\\"'+ opt.OBJ + '\\"\)' if(opt.DRYRUN): - print 'Dry-run: ['+cmd+']' + print('Dry-run: ['+cmd+']') else: output = processCmd(cmd) #mv the output under the main directory @@ -643,7 +643,7 @@ def putype(t): inputpathNew = NewRepository +'/' + NewRelease+ '/' cmd = 'root.exe -b -q Validation/HGCalValidation/macros/validationplots.C\(\\"'+ inputpathNew + infi.filename(NewRelease) + '\\",\\"'+ opt.OBJ + '\\",\\"'+ samplename + '\\"\\)' if(opt.DRYRUN): - print 'Dry-run: ['+cmd+']' + print('Dry-run: ['+cmd+']') else: output = processCmd(cmd) processCmd('mv ' +samplename+ ' CaloParticles/.' ) @@ -706,7 +706,7 @@ def putype(t): for mats in _individualmaterials: processCmd('mkdir -p %s/%s/indimat/%s' %(opt.WWWAREA,geo,mats) ) processCmd('mkdir -p %s/indimat/%s' %(geo,mats) ) - + index_file.write(' \n' ) @@ -724,7 +724,7 @@ def putype(t): #surprises when experimenting, in order to copy it automatically to the #www area you should have activated the relevant flag: if (opt.COPYHTML) : processCmd('cp index.html %s/.' %(opt.WWWAREA) ) - + #Let's make also the summary folder if (not os.path.isdir("HGCValid_summary_Plots")): processCmd('mkdir -p HGCValid_summary_Plots') @@ -760,18 +760,18 @@ def putype(t): # if df[obj][ind] == None: if column == None: - index_file.write(' \n') - index_file.write(' \n') - continue - #index_file.write(' \n') + index_file.write(' \n') + index_file.write(' \n') + continue + #index_file.write(' \n') else: - #print(df[obj][ind]) - print(j) - #index_file.write('
  • %s
  • \n' %(samplename, df[obj][ind], df[obj][ind].partition("/")[2] )) - if "Ticl" in j: - index_file.write('
  • %s
  • \n' %(j, samplename, column, column.replace("ticlMultiClustersFromTracksters","") )) - else: - index_file.write('
  • %s
  • \n' %(j, samplename, column, column.partition("/")[2] )) + #print(df[obj][ind]) + print(j) + #index_file.write('
  • %s
  • \n' %(samplename, df[obj][ind], df[obj][ind].partition("/")[2] )) + if "Ticl" in j: + index_file.write('
  • %s
  • \n' %(j, samplename, column, column.replace("ticlMultiClustersFromTracksters","") )) + else: + index_file.write('
  • %s
  • \n' %(j, samplename, column, column.partition("/")[2] )) index_file.write(' \n') index_file.write(' \n') @@ -782,34 +782,34 @@ def putype(t): index_file.write('
    \n' ) index_file.write('
    \n' ) index_file.write('
    \n' ) - + #Writing postamble" index_file.write(' \n') index_file.write('\n') index_file.close() objects = opt.GATHER.split(",") - + localoutputdir = "" if "raw" in NotNormalRelease and "raw" in NotNormalRefRelease: - localoutputdir = NewRelease + "_raw1100" + "_vs_" + RefRelease + "_raw1100" + localoutputdir = NewRelease + "_raw1100" + "_vs_" + RefRelease + "_raw1100" elif "raw" in NotNormalRelease and "normal" in NotNormalRefRelease: - #localoutputdir = NewRelease + "_raw1100" + "_vs_" + RefRelease - localoutputdir = NewRelease + "_D76" + "_vs_" + RefRelease + #localoutputdir = NewRelease + "_raw1100" + "_vs_" + RefRelease + localoutputdir = NewRelease + "_D76" + "_vs_" + RefRelease elif "normal" in NotNormalRelease and "normal" in NotNormalRefRelease: - localoutputdir = NewRelease + "_vs_" + RefRelease + localoutputdir = NewRelease + "_vs_" + RefRelease else: - localoutputdir = NewRelease - + localoutputdir = NewRelease + #make the structure to hold the objects for obj in objects: #This is where we will save the final output per campaing: if (not os.path.isdir('%s/standalone' %(localoutputdir))) : processCmd('mkdir -p %s/standalone' %(localoutputdir)) if (obj!="standalone"): processCmd('mv HGCValid_%s_Plots %s'%(obj, localoutputdir) ) - else : - processCmd('mv hgcalSimHitStudy %s/standalone/.'%(localoutputdir) ) - processCmd('mv hgcalDigiStudy %s/standalone/.'%(localoutputdir) ) + else : + processCmd('mv hgcalSimHitStudy %s/standalone/.'%(localoutputdir) ) + processCmd('mv hgcalDigiStudy %s/standalone/.'%(localoutputdir) ) processCmd('mv hgcalRecHitStudy %s/standalone/.'%(localoutputdir) ) processCmd('cp %s/../public/index.php %s/standalone/.'%(opt.WWWAREA, localoutputdir) ) @@ -839,24 +839,24 @@ def putype(t): for obj in objects: print(obj) if (obj!="standalone"): - index_file.write('
    \n' ) - index_file.write(' \n' ) - index_file.write('
    \n' ) + index_file.write('
    \n' ) + index_file.write(' \n' ) + index_file.write('
    \n' ) else : - index_file.write('
    \n' ) - index_file.write(' \n' ) - index_file.write('
    \n' ) + index_file.write('
    \n' ) + index_file.write(' \n' ) + index_file.write('
    \n' ) #Writing postamble index_file.write(' \n') index_file.write('\n') index_file.close() - + #We choose to zip in uncompressed form all the files for two reasons: #1. Copying to eos so many files is really slow. It is faster to # create one uncompressed file, copy that and unzip there. @@ -958,18 +958,18 @@ def putype(t): index_file.write(_hideShowFun["divTabs"]) for region in ["_AllHGCAL", "_ZminusZoom", "_ZplusZoom"]: - + index_file.write('
    \n' %(region)) pngnamestring = "" if region == "_AllHGCAL": pngnamestring = "" else: pngnamestring = region - + for allmatplot in _allmaterialsplots: if region == "_AllHGCAL": index_file.write('

    %s Click to enlarge %s plot

    \n' %(_allmaterialsPlotsDesc[allmatplot], GeoScenario.split("_")[2],allmatplot,pngnamestring,GeoScenario.split("_")[2])) - index_file.write(' \n' %(GeoScenario.split("_")[0],allmatplot,pngnamestring) ) - index_file.write(' \n' %(GeoScenario.split("_")[2],allmatplot,pngnamestring)) - index_file.write('
    \n') + index_file.write(' \n' %(GeoScenario.split("_")[0],allmatplot,pngnamestring) ) + index_file.write(' \n' %(GeoScenario.split("_")[2],allmatplot,pngnamestring)) + index_file.write('
    \n') elif region != "_AllHGCAL" and "HGCal_l_vs_z_vs_R" in allmatplot: index_file.write('

    %s Click to enlarge %s plot

    \n' %(_allmaterialsPlotsDesc[allmatplot], GeoScenario.split("_")[2],region.replace("_Zminus","ZMinus").replace("_Zplus","ZPlus"),allmatplot,pngnamestring,GeoScenario.split("_")[2])) index_file.write(' \n' %(GeoScenario.split("_")[0],region.replace("_Zminus","ZMinus").replace("_Zplus","ZPlus"),allmatplot,pngnamestring) ) @@ -1022,14 +1022,14 @@ def putype(t): # index_file.write(' \n' %(GeoScenario.split("_")[2],mats,indiplots,mats)) # index_file.write(' %s Click to enlarge %s plot\n' %(_individualMatPlotsDesc[indiplots].replace("THEMAT",_matPageNameMap[mats]), GeoScenario.split("_")[2],mats,indiplots,mats,GeoScenario.split("_")[2])) # index_file.write('\n') - + #Writing postamble #index_file.write('\n') #index_file.write('\n') #-------------------------------------------------------------- index_file.write(_hideShowFun["divTabs"]) - #Individual material here for: All HGCAL, Zminus, Zplus + #Individual material here for: All HGCAL, Zminus, Zplus for region in ["_AllHGCAL", "_ZminusZoom", "_ZplusZoom"]: #The hide/show button #index_file.write(_hideShowFun["buttonandFunction%s"%(region)]) @@ -1037,7 +1037,7 @@ def putype(t): index_file.write('
    \n' %(region)) pngnamestring = "" if region == "_AllHGCAL": pngnamestring = "" - else: pngnamestring = region + else: pngnamestring = region for indiplots in _individualmatplots: if region == "_AllHGCAL": index_file.write('

    %s Click to enlarge %s plot

    \n' %(_individualMatPlotsDesc[indiplots].replace("THEMAT",_matPageNameMap[mats]), GeoScenario.split("_")[2],mats,indiplots,mats,pngnamestring,GeoScenario.split("_")[2])) @@ -1049,7 +1049,7 @@ def putype(t): index_file.write(' \n' %(GeoScenario.split("_")[0],mats,region.replace("_Zminus","ZMinus").replace("_Zplus","ZPlus"),indiplots,mats,pngnamestring) ) index_file.write(' \n' %(GeoScenario.split("_")[2],mats,region.replace("_Zminus","ZMinus").replace("_Zplus","ZPlus"),indiplots,mats,pngnamestring)) index_file.write('
    \n') - + index_file.write('
    \n') @@ -1098,4 +1098,4 @@ def putype(t): #Copy all materials budget file processCmd('cp %s/fromvertex/index.html %s/%s/fromvertex/.' %(GeoScenario, opt.WWWAREA,GeoScenario) ) - + diff --git a/Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py b/Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py index 37755c97b6bc5..5f89042a14cf2 100755 --- a/Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py +++ b/Validation/HGCalValidation/scripts/makeHGCalValidationPlots.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import os diff --git a/Validation/RecoTrack/scripts/diffTrackingNtuple.py b/Validation/RecoTrack/scripts/diffTrackingNtuple.py index 73f2c7e5e4c77..aab8997e50fea 100755 --- a/Validation/RecoTrack/scripts/diffTrackingNtuple.py +++ b/Validation/RecoTrack/scripts/diffTrackingNtuple.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import argparse diff --git a/Validation/RecoTrack/scripts/harvestTrackValidationPlots.py b/Validation/RecoTrack/scripts/harvestTrackValidationPlots.py index 9f33b8562a316..9a0936fc66047 100755 --- a/Validation/RecoTrack/scripts/harvestTrackValidationPlots.py +++ b/Validation/RecoTrack/scripts/harvestTrackValidationPlots.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import sys,os,tempfile,shutil,subprocess,glob diff --git a/Validation/RecoTrack/scripts/makeTrackValidationPlots.py b/Validation/RecoTrack/scripts/makeTrackValidationPlots.py index 52d29cafc3648..1549d2ed31221 100755 --- a/Validation/RecoTrack/scripts/makeTrackValidationPlots.py +++ b/Validation/RecoTrack/scripts/makeTrackValidationPlots.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import os diff --git a/Validation/RecoTrack/scripts/printTrackingNtuple.py b/Validation/RecoTrack/scripts/printTrackingNtuple.py index 57c43d9f35ab3..8c5b477b35710 100755 --- a/Validation/RecoTrack/scripts/printTrackingNtuple.py +++ b/Validation/RecoTrack/scripts/printTrackingNtuple.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import argparse diff --git a/Validation/RecoTrack/test/analyseDuplicateFake.py b/Validation/RecoTrack/test/analyseDuplicateFake.py index 6611a40572e0a..98d9489261164 100755 --- a/Validation/RecoTrack/test/analyseDuplicateFake.py +++ b/Validation/RecoTrack/test/analyseDuplicateFake.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import ROOT diff --git a/Validation/RecoTrack/test/analyseMVA.py b/Validation/RecoTrack/test/analyseMVA.py index a5ae0fc0bbd2c..aeb4d3c19ea8a 100755 --- a/Validation/RecoTrack/test/analyseMVA.py +++ b/Validation/RecoTrack/test/analyseMVA.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from builtins import range import array diff --git a/Validation/RecoTrack/test/fakeAnalysis/analysis.py b/Validation/RecoTrack/test/fakeAnalysis/analysis.py index 53dc79c6e7618..115429ac785b2 100644 --- a/Validation/RecoTrack/test/fakeAnalysis/analysis.py +++ b/Validation/RecoTrack/test/fakeAnalysis/analysis.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function from builtins import range @@ -411,7 +411,7 @@ def FindEndOfTracking(fake, particle, end_criterion = ["nMissing", 2], real_crit print particle_end.index() print end_class print "*****" - raw_input() + input() ''' return last, fake_end, particle_end, end_class diff --git a/Validation/RecoTrack/test/fakeAnalysis/graphics.py b/Validation/RecoTrack/test/fakeAnalysis/graphics.py index 636935d6db542..70ce9e270b817 100644 --- a/Validation/RecoTrack/test/fakeAnalysis/graphics.py +++ b/Validation/RecoTrack/test/fakeAnalysis/graphics.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function from builtins import range @@ -646,7 +646,7 @@ def ClassHistogram(self, data, name = "Histogram", labels = False, ready = False #hist.GetXaxis().SetRange(0,10) hist.Draw() - raw_input("Press any key to continue") + input("Press any key to continue") def EndOfTrackingHistogram(self, end_list, hist_type="end_class", end_mask = [], fake_mask = [], normalised = False, BPix3mask = False): ''' Plots several types of histograms related to end of tracking analysis ''' @@ -784,7 +784,7 @@ def ResolutionHistograms(self, res_data, tracks = "fake", fake_mask = [], draw = #c1.SetLogy() if draw: c1.Draw() - raw_input("Press enter to continue") + input("Press enter to continue") return histograms @@ -815,7 +815,7 @@ def ResolutionHistogramsCombine(self, res_data_trues, res_data_fakes, fake_mask if draw: c1.Draw() - raw_input("Press enter to continue") + input("Press enter to continue") return histograms @@ -853,7 +853,7 @@ def ResolutionHistogramsNormalised(self, res_data_trues, res_data_fakes, fake_ma if draw: c1.Draw() - raw_input("Press enter to continue") + input("Press enter to continue") #return histograms @@ -902,7 +902,7 @@ def ResolutionHistogramsNormalisedCumulative(self, res_data_trues, res_data_fake if draw: c1.Draw() - raw_input("Press enter to continue") + input("Press enter to continue") def Histogram1D(self, data, name = "Histogram", nbins = 100, xmin = -1, xmax = 1, xlabel = "", color = 38, draw = True, normalised = False): ''' Creates a single histogram of resolutions for one parameter list ''' @@ -927,7 +927,7 @@ def Histogram1D(self, data, name = "Histogram", nbins = 100, xmin = -1, xmax = 1 if draw: hist.Draw() return hist - #raw_input("Press any key to continue") + #input("Press any key to continue") def HistogramSigmaPt(self, data, name = "Sigma(Pt) vs Pt"): # Old function @@ -948,7 +948,7 @@ def HistogramSigmaPt(self, data, name = "Sigma(Pt) vs Pt"): # Old function hist_2.Draw() - raw_input("Press enter to continue") + input("Press enter to continue") def HistogramSigmaPtCombined(self, data1, data2, name = "Sigma(Pt) vs Pt"): # Old function @@ -971,7 +971,7 @@ def HistogramSigmaPtCombined(self, data1, data2, name = "Sigma(Pt) vs Pt"): # Ol hist_2.Draw() - raw_input("Press enter to continue") + input("Press enter to continue") def HistogramSigmaPtDual(self, data1, data2, parameter = "pt", pad = None, name = "Sigma(parameter) vs Pt"): ''' @@ -1061,7 +1061,7 @@ def HistogramSigmaPtDual(self, data1, data2, parameter = "pt", pad = None, name leg.AddEntry(hist3_2, "Both", "L") leg.Draw() - raw_input("Press enter to continue") + input("Press enter to continue") ''' return [hist1_2, hist2_2, hist3_2] @@ -1097,7 +1097,7 @@ def ResolutionsSigmaVsPt(self, res_data_trues, res_data_fakes, fake_mask = [], d if draw: c1.Draw() - raw_input("Press enter to continue") + input("Press enter to continue") @@ -1162,6 +1162,6 @@ def Draw(self): plots.Draw("A") ''' - raw_input("Press any key to continue") + input("Press any key to continue") diff --git a/Validation/RecoTrack/test/fakeAnalysis/graphics_vertical.py b/Validation/RecoTrack/test/fakeAnalysis/graphics_vertical.py index 918cfa90e78ed..db81bd2593fb8 100644 --- a/Validation/RecoTrack/test/fakeAnalysis/graphics_vertical.py +++ b/Validation/RecoTrack/test/fakeAnalysis/graphics_vertical.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function from builtins import range @@ -542,7 +542,7 @@ def DrawTrackTest_old(self, track): if hit.isValid(): point = ROOT.TPolyMarker3D(1, array('f', [hit.x(), hit.y(), hit.z()]), 2) point.Draw() - raw_input("continue") + input("continue") #axis.SetAxisRange(-278,278,"Z") axis.ToggleZoom() @@ -633,7 +633,7 @@ def ClassHistogram(self, data, name = "Histogram", labels = False, ready = False #hist.SetLabelSize(0.05) hist.Draw() - raw_input("Press any key to continue") + input("Press any key to continue") def Draw(self): @@ -664,6 +664,6 @@ def Draw(self): for plot in self.plots_2D: plot.Draw("A") - raw_input("Press any key to continue") + input("Press any key to continue") diff --git a/Validation/RecoTrack/test/fakeAnalysis/main.py b/Validation/RecoTrack/test/fakeAnalysis/main.py index 7a17856213251..d6fb287282150 100644 --- a/Validation/RecoTrack/test/fakeAnalysis/main.py +++ b/Validation/RecoTrack/test/fakeAnalysis/main.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import ROOT from array import array diff --git a/Validation/RecoTrack/test/publicPlots/plot.py b/Validation/RecoTrack/test/publicPlots/plot.py index 19ae2a58cac72..aaece04b2f5dd 100755 --- a/Validation/RecoTrack/test/publicPlots/plot.py +++ b/Validation/RecoTrack/test/publicPlots/plot.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function from builtins import range diff --git a/Validation/RecoTrack/test/trackingCompare.py b/Validation/RecoTrack/test/trackingCompare.py index 7cc1e283db121..145088d16aacf 100755 --- a/Validation/RecoTrack/test/trackingCompare.py +++ b/Validation/RecoTrack/test/trackingCompare.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # This is an example of plotting the standard tracking validation # plots from an explicit set of DQM root files. diff --git a/Validation/RecoTrack/test/trackingNtupleExample.py b/Validation/RecoTrack/test/trackingNtupleExample.py index c9831d49b2390..75cd3625bee50 100755 --- a/Validation/RecoTrack/test/trackingNtupleExample.py +++ b/Validation/RecoTrack/test/trackingNtupleExample.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import ROOT diff --git a/Validation/RecoTrack/test/trackingPerformanceValidation.py b/Validation/RecoTrack/test/trackingPerformanceValidation.py index afc3e34858050..5741b5674f691 100755 --- a/Validation/RecoTrack/test/trackingPerformanceValidation.py +++ b/Validation/RecoTrack/test/trackingPerformanceValidation.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 from Validation.RecoTrack.plotting.validation import Sample, Validation import Validation.RecoTrack.plotting.validation as validation