Skip to content

Commit

Permalink
Merge pull request #24071 from davidlange6/printMig_180724T4_L1Trigge…
Browse files Browse the repository at this point in the history
…r_GlobalTriggerAnalyzer

Print function migration for L1Trigger_GlobalTriggerAnalyzer
  • Loading branch information
cmsbuild committed Jul 27, 2018
2 parents 0b8b079 + 832db97 commit 048e0f5
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 35 deletions.
39 changes: 20 additions & 19 deletions L1Trigger/GlobalTriggerAnalyzer/python/UserOptions_cff.py
@@ -1,3 +1,4 @@
from __future__ import print_function
#
# configuration file fragment containing user choices
# for release to run, sample and data type to use in
Expand Down Expand Up @@ -97,10 +98,10 @@

#

print " Release: ", sampleFromRelease
print " Dataset: ", dataset
print " Data type: ", dataType
print
print(" Release: ", sampleFromRelease)
print(" Dataset: ", dataset)
print(" Data type: ", dataType)
print()

useDAS = True

Expand Down Expand Up @@ -139,7 +140,7 @@
# print datasetName

if datasetName == '' :
print "\n No dataset found."
print("\n No dataset found.")
errorUserOptions = True

if not errorUserOptions :
Expand All @@ -150,12 +151,12 @@
filePaths = data.readlines()


print '\n das_client using the query'
print ' ', myQuery
print ' retrieved the following files\n'
print('\n das_client using the query')
print(' ', myQuery)
print(' retrieved the following files\n')

for line in filePaths :
print ' ', line
print(' ', line)

readFiles.extend(filePaths);

Expand Down Expand Up @@ -329,7 +330,7 @@


else :
print 'Error: sample identifier ', sampleIdentifier, ' not defined.\n'
print('Error: sample identifier ', sampleIdentifier, ' not defined.\n')
errorUserOptions = True
runNumber = '0'
dataset = 'None'
Expand All @@ -341,9 +342,9 @@
# end of data samples
#

print " Run number: ", runNumber
print " Dataset: ", dataset
print " Data type: ", dataType
print(" Run number: ", runNumber)
print(" Dataset: ", dataset)
print(" Data type: ", dataType)

if useDAS :
import das_client
Expand All @@ -356,12 +357,12 @@
filePaths = data.readlines()


print '\n das_client using the query'
print ' ', myQuery
print ' retrieved the following files\n'
print('\n das_client using the query')
print(' ', myQuery)
print(' retrieved the following files\n')

for line in filePaths :
print ' ', line
print(' ', line)

readFiles.extend(filePaths);

Expand All @@ -385,7 +386,7 @@
secFiles.extend([
])

print 'Local file(s)', readFiles
print('Local file(s)', readFiles)

if overrideGlobalTag == True :
globalTag = myGlobalTag
Expand All @@ -396,6 +397,6 @@
else :
useGlobalTag = globalTag

print "\n Using global tag ", useGlobalTag, "\n"
print("\n Using global tag ", useGlobalTag, "\n")


5 changes: 3 additions & 2 deletions L1Trigger/GlobalTriggerAnalyzer/test/L1GtAnalyzer_cfg.py
@@ -1,3 +1,4 @@
from __future__ import print_function
#
# cfg file to run the L1 GT test analyzer according to
# the options set in "user choices"
Expand All @@ -8,10 +9,10 @@

process = cms.Process("L1GtAnalyzer")

print '\n'
print('\n')
from L1Trigger.GlobalTriggerAnalyzer.UserOptions_cff import *
if errorUserOptions == True :
print '\nError returned by UserOptions_cff. Script stops here.\n'
print('\nError returned by UserOptions_cff. Script stops here.\n')
sys.exit()


Expand Down
@@ -1,3 +1,4 @@
from __future__ import print_function
#
# cfg file to test L1GtBeamModeFilter
# it requires as input:
Expand All @@ -15,10 +16,10 @@

process = cms.Process('TestL1GtBeamModeFilter')

print '\n'
print('\n')
from L1Trigger.GlobalTriggerAnalyzer.UserOptions_cff import *
if errorUserOptions == True :
print '\nError returned by UserOptions_cff\n'
print('\nError returned by UserOptions_cff\n')
sys.exit()


Expand Down
@@ -1,3 +1,4 @@
from __future__ import print_function
#
# cfg file to run L1 Global Trigger emulator on a file containing the output of the
# GCT system and GMT system ("digi"), followed by the L1 trigger report
Expand All @@ -12,10 +13,10 @@
process = cms.Process("L1GtEmulTrigReport")

# import number of events, sample and global tag
print '\n'
print('\n')
from L1Trigger.GlobalTriggerAnalyzer.UserOptions_cff import *
if errorUserOptions == True :
print '\nError returned by UserOptions_cff\n'
print('\nError returned by UserOptions_cff\n')
sys.exit()

# L1 menu selection via L1Trigger_custom - expert choice, do it only if you know what you do
Expand Down
@@ -1,3 +1,4 @@
from __future__ import print_function
#
# cfg file to pack (DigiToRaw) a GT DAQ record, unpack (RawToDigi) it back
# and compare the two set of digis
Expand Down Expand Up @@ -75,13 +76,13 @@
secFiles.extend([
])
else :
print 'Error: Global Tag ', useGlobalTag, ' not defined.'
print('Error: Global Tag ', useGlobalTag, ' not defined.')

else :

# data
dataset = '/Cosmics/Commissioning09-v1/RAW'
print ' Running on set: '+ dataset
print(' Running on set: '+ dataset)

readFiles.extend( [
'/store/data/Commissioning09/Cosmics/RAW/v1/000/076/966/00BD9A1F-B908-DE11-8B2C-000423D94A04.root',
Expand Down
@@ -1,3 +1,4 @@
from __future__ import print_function
#
# L1 Pattern Generator
# ====================
Expand Down Expand Up @@ -302,7 +303,7 @@
L1GtTrigReport = cms.untracked.PSet( limit = cms.untracked.int32(-1) )
)

print "Setup complete."
print("Setup complete.")

## output - disabled by default, the pattern generator writes to a text file
#process.outputL1GtPatternGen = cms.OutputModule("PoolOutputModule",
Expand Down
@@ -1,3 +1,4 @@
from __future__ import print_function
#
# cfg file to run some technical trigger emulators/simulation, L1 Global Trigger emulator
# on a file containing the output of the GCT system and GMT system ("digi"), followed by
Expand Down Expand Up @@ -96,7 +97,7 @@
])

else :
print 'Error: no file list defined for release ', useRelease, ' global tag ', useGlobalTag, ' data sample ', useSample
print('Error: no file list defined for release ', useRelease, ' global tag ', useGlobalTag, ' data sample ', useSample)
sys.exit()

elif useGlobalTag.count('STARTUP') :
Expand All @@ -113,13 +114,13 @@
secFiles.extend([
])
else :
print 'Error: no file list defined for release ', useRelease, ' global tag ', useGlobalTag, ' data sample ', useSample
print('Error: no file list defined for release ', useRelease, ' global tag ', useGlobalTag, ' data sample ', useSample)
sys.exit()

else :

# CRAFT data FIXME
print 'Error: no file list defined for release ', useRelease, ' global tag ', useGlobalTag, ' data sample ', useSample
print('Error: no file list defined for release ', useRelease, ' global tag ', useGlobalTag, ' data sample ', useSample)
sys.exit()

dataset = ''
Expand Down Expand Up @@ -218,7 +219,7 @@
# explicit choice of the L1 menu

if l1Menu == '' :
print 'Using menu from global tag', useGlobalTag
print('Using menu from global tag', useGlobalTag)

elif l1Menu == 'L1Menu_Commissioning2009_v5' :
process.load('L1Trigger.Configuration.L1StartupConfig_cff')
Expand All @@ -242,7 +243,7 @@
#process.load("L1TriggerConfig.L1GtConfigProducers.Luminosity.startup.L1Menu_startup2_v2_Unprescaled_cff")
process.load("L1TriggerConfig.L1GtConfigProducers.Luminosity.startup.L1Menu_startup2_v3_Unprescaled_cff")
else :
print 'No such L1 menu: ', l1Menu
print('No such L1 menu: ', l1Menu)


#
Expand Down
5 changes: 3 additions & 2 deletions L1Trigger/GlobalTriggerAnalyzer/test/L1GtTrigReport_cfg.py
@@ -1,3 +1,4 @@
from __future__ import print_function
#
# cfg file to run L1GtTrigReport on GT output file containing
# the readout record L1GlobalTriggerReadoutRecord
Expand All @@ -13,10 +14,10 @@
# process
process = cms.Process('L1GtTrigReport')

print '\n'
print('\n')
from L1Trigger.GlobalTriggerAnalyzer.UserOptions_cff import *
if errorUserOptions == True :
print '\nError returned by UserOptions_cff\n'
print('\nError returned by UserOptions_cff\n')
sys.exit()


Expand Down

0 comments on commit 048e0f5

Please sign in to comment.