Skip to content

Commit

Permalink
Merge pull request #24038 from davidlange6/printMig_180724T4_Alignmen…
Browse files Browse the repository at this point in the history
…t_TrackerAlignment

Print function migration for Alignment_TrackerAlignment
  • Loading branch information
cmsbuild committed Jul 27, 2018
2 parents f084b85 + 1a960e6 commit 0a5582e
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 23 deletions.
25 changes: 13 additions & 12 deletions Alignment/TrackerAlignment/scripts/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"""
DBS data discovery command line interface
"""
from __future__ import print_function

import httplib, urllib, types, string, os, sys
from optparse import OptionParser
Expand Down Expand Up @@ -59,7 +60,7 @@ def sendMessage(host,port,dbsInst,userInput,page,limit,xml=0,case='on',iface='dd
input=urllib.quote(userInput)
if debug:
httplib.HTTPConnection.debuglevel = 1
print "Contact",host,port
print("Contact",host,port)
_port=443
if host.find("http://")!=-1:
_port=80
Expand Down Expand Up @@ -96,15 +97,15 @@ def sendMessage(host,port,dbsInst,userInput,page,limit,xml=0,case='on',iface='dd
(status_code,msg,reply)=http_conn.getreply()
data=http_conn.getfile().read()
if debug or msg!="OK":
print
print http_conn.headers
print "*** Send message ***"
print input
print "************************************************************************"
print "status code:",status_code
print "message:",msg
print "************************************************************************"
print reply
print()
print(http_conn.headers)
print("*** Send message ***")
print(input)
print("************************************************************************")
print("status code:",status_code)
print("message:",msg)
print("************************************************************************")
print(reply)
return data

#
Expand Down Expand Up @@ -132,7 +133,7 @@ def sendMessage(host,port,dbsInst,userInput,page,limit,xml=0,case='on',iface='dd
else:
input=opts.input
else:
print "\nUsage: %s --help"%sys.argv[0]
print("\nUsage: %s --help"%sys.argv[0])
sys.exit(0)
result = sendMessage(host,port,dbsInst,input,opts.page,opts.limit,opts.xml,opts.case,opts.iface,opts.details,opts.cff,opts.verbose)
print result
print(result)
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import print_function
import FWCore.ParameterSet.Config as cms
import FWCore.ParameterSet.VarParsing as VarParsing
import copy, sys, os
Expand Down Expand Up @@ -54,7 +55,7 @@
from Configuration.AlCa.GlobalTag import GlobalTag
# process.GlobalTag = GlobalTag(process.GlobalTag, "auto:run2_design", "")
process.GlobalTag = GlobalTag(process.GlobalTag, "auto:phase1_2017_design", "")
print "Using global tag:", process.GlobalTag.globaltag.value()
print("Using global tag:", process.GlobalTag.globaltag.value())

###################################################################
# This uses the object from the tag and applies the misalignment scenario on top of that object
Expand All @@ -66,15 +67,15 @@
import Alignment.TrackerAlignment.Scenarios_cff as scenarios

if hasattr(scenarios, options.myScenario):
print "Using scenario:", options.myScenario
print " with sigma:", options.mySigma
print
print("Using scenario:", options.myScenario)
print(" with sigma:", options.mySigma)
print()
process.AlignmentProducer.MisalignmentScenario = getattr(scenarios, options.myScenario)
else:
print "----- Begin Fatal Exception -----------------------------------------------"
print "Unrecognized",options.myScenario,"misalignment scenario !!!!"
print "Aborting cmsRun now, please check your input"
print "----- End Fatal Exception -------------------------------------------------"
print("----- Begin Fatal Exception -----------------------------------------------")
print("Unrecognized",options.myScenario,"misalignment scenario !!!!")
print("Aborting cmsRun now, please check your input")
print("----- End Fatal Exception -------------------------------------------------")
sys.exit(1)

sigma = options.mySigma
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import print_function
import FWCore.ParameterSet.Config as cms
process = cms.Process("Alignment")

Expand All @@ -17,7 +18,7 @@


usedGlobalTag = process.GlobalTag.globaltag.value()
print "Using Global Tag:", usedGlobalTag
print("Using Global Tag:", usedGlobalTag)

from CondCore.CondDB.CondDB_cfi import *
process.PoolDBOutputService = cms.Service("PoolDBOutputService",
Expand Down
3 changes: 2 additions & 1 deletion Alignment/TrackerAlignment/test/mcMisalignmentScaler_cfg.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import print_function
import FWCore.ParameterSet.Config as cms
process = cms.Process("MCMisalignmentScaler")

Expand Down Expand Up @@ -30,7 +31,7 @@


usedGlobalTag = process.GlobalTag.globaltag.value()
print "Using Global Tag:", usedGlobalTag
print("Using Global Tag:", usedGlobalTag)

from CondCore.CondDB.CondDB_cfi import CondDB
process.PoolDBOutputService = cms.Service("PoolDBOutputService",
Expand Down
3 changes: 2 additions & 1 deletion Alignment/TrackerAlignment/test/trackerTreeGenerator_cfg.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import print_function
import FWCore.ParameterSet.Config as cms

import os
Expand Down Expand Up @@ -59,7 +60,7 @@
from Configuration.AlCa.GlobalTag import GlobalTag
#~ process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_design', '')
process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2017_design', '')
print "Using global tag "+process.GlobalTag.globaltag._value
print("Using global tag "+process.GlobalTag.globaltag._value)


##
Expand Down

0 comments on commit 0a5582e

Please sign in to comment.