diff --git a/CalibCalorimetry/CaloMiscalibTools/test/make_ecal_miscaplibration.py b/CalibCalorimetry/CaloMiscalibTools/test/make_ecal_miscaplibration.py index ee10e8773cc83..928ad34c9fe3b 100755 --- a/CalibCalorimetry/CaloMiscalibTools/test/make_ecal_miscaplibration.py +++ b/CalibCalorimetry/CaloMiscalibTools/test/make_ecal_miscaplibration.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +from __future__ import print_function import commands,string,time,thread,random,math,sys #global variables @@ -75,8 +76,8 @@ def miscalib(lumi,endcap,z,etaindex,phiindex,randval): #main if len(sys.argv)==1: - print 'Usage: '+sys.argv[0]+' [MINRES=0.02] [SEED=random]' - print ' put lumi=0 for precalibration values (random at MINRES)' + print('Usage: '+sys.argv[0]+' [MINRES=0.02] [SEED=random]') + print(' put lumi=0 for precalibration values (random at MINRES)') sys.exit(1) if sys.argv[1]=='barrel': @@ -84,7 +85,7 @@ def miscalib(lumi,endcap,z,etaindex,phiindex,randval): elif sys.argv[1]=='endcap': endcap=1 else: - print 'please specify one of ' + print('please specify one of ') sys.exit(1) if endcap==1: @@ -109,7 +110,7 @@ def miscalib(lumi,endcap,z,etaindex,phiindex,randval): lumi=string.atof(sys.argv[2]) if lumi<0: - print 'lumi = '+str(lumi)+' not valid' + print('lumi = '+str(lumi)+' not valid') sys.exit(1) fileout=sys.argv[3] @@ -117,11 +118,11 @@ def miscalib(lumi,endcap,z,etaindex,phiindex,randval): if len(sys.argv)>=5: MINRES=string.atof(sys.argv[4]) -print 'Using minimal resolution: '+str(MINRES) +print('Using minimal resolution: '+str(MINRES)) if len(sys.argv)>=6: SEED=string.atoi(sys.argv[5]) - print 'Using fixed seed for random generation: '+str(SEED) + print('Using fixed seed for random generation: '+str(SEED)) random.seed(SEED) # now open file @@ -188,7 +189,7 @@ def miscalib(lumi,endcap,z,etaindex,phiindex,randval): xmlfile.write(' \n') xmlfile.write('\n') xmlfile.close() -print 'File '+fileout+' written with '+str(count)+' lines' +print('File '+fileout+' written with '+str(count)+' lines') #print miscalib(5,0,1,85,1,0) #print miscalib(5,1,-1,10,1,0) #print miscalib(5,1,-1,10,1,1) diff --git a/CalibCalorimetry/CaloMiscalibTools/test/make_miscalibration.py b/CalibCalorimetry/CaloMiscalibTools/test/make_miscalibration.py index cb7c98e7987aa..7dd3f5622cfd5 100755 --- a/CalibCalorimetry/CaloMiscalibTools/test/make_miscalibration.py +++ b/CalibCalorimetry/CaloMiscalibTools/test/make_miscalibration.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +from __future__ import print_function import commands,string,time,thread,random,math,sys #global variables @@ -129,13 +130,13 @@ def miscalibhcal(lumi,det,etaindex,phiindex,depth,randval): else: return 0.02 else: - print 'lumi must be 0, 1 or 10' + print('lumi must be 0, 1 or 10') #main if len(sys.argv)==1: - print 'Usage: '+sys.argv[0]+' [MINRES=0.02] [SEED=random]' - print ' put lumi=0 for precalibration values (CSA07)' + print('Usage: '+sys.argv[0]+' [MINRES=0.02] [SEED=random]') + print(' put lumi=0 for precalibration values (CSA07)') sys.exit(1) ecalbarrel=0 @@ -151,13 +152,13 @@ def miscalibhcal(lumi,det,etaindex,phiindex,depth,randval): elif sys.argv[1]=='HCAL': hcal=1 else: - print 'please specify one of ' + print('please specify one of ') sys.exit(1) lumi=string.atof(sys.argv[2]) if lumi<0: - print 'lumi = '+str(lumi)+' not valid' + print('lumi = '+str(lumi)+' not valid') sys.exit(1) fileout=sys.argv[3] @@ -193,7 +194,7 @@ def miscalibhcal(lumi,det,etaindex,phiindex,depth,randval): hcalcells=hcalcells+1 hcalcell.close() - print 'Read ',hcalcells,' valid cells for hcal' + print('Read ',hcalcells,' valid cells for hcal') # read non existing cells file, not needed anymore # necell=open('non_existing_cell_endcap','r') @@ -213,11 +214,11 @@ def miscalibhcal(lumi,det,etaindex,phiindex,depth,randval): MINRES=string.atof(sys.argv[5]) if (hcal==0) or (lumi==0): - print 'Using minimal resolution: '+str(MINRES) + print('Using minimal resolution: '+str(MINRES)) if len(sys.argv)>=7: SEED=string.atoi(sys.argv[6]) - print 'Using fixed seed for random generation: '+str(SEED) + print('Using fixed seed for random generation: '+str(SEED)) random.seed(SEED) # now open file @@ -350,9 +351,9 @@ def miscalibhcal(lumi,det,etaindex,phiindex,depth,randval): xmlfile.close() xmlfileinv.close() txtfile.close() -print 'File '+fileout+'.xml'+' written with '+str(count)+' lines' -print 'File inv_'+fileout+'.xml'+' written with '+str(count)+' lines' -print 'File '+fileout+'.txt'+' written with '+str(count)+' lines' +print('File '+fileout+'.xml'+' written with '+str(count)+' lines') +print('File inv_'+fileout+'.xml'+' written with '+str(count)+' lines') +print('File '+fileout+'.txt'+' written with '+str(count)+' lines') #print miscalibecal(5,0,1,85,1,0) #print miscalibecal(5,1,-1,10,1,0) #print miscalibecal(5,1,-1,10,1,1)