Skip to content

Commit

Permalink
Backport: extend the functionality of the hltGetConfiguration --hilto…
Browse files Browse the repository at this point in the history
…n option (cms-sw#32961)
  • Loading branch information
fwyzard committed Mar 12, 2021
1 parent 7b4358f commit d489f31
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
29 changes: 20 additions & 9 deletions HLTrigger/Configuration/python/Tools/confdb.py
Expand Up @@ -86,7 +86,9 @@ def getRawConfigurationFromDB(self):
args = ['--runNumber', self.config.menu.run]
else:
args = ['--configName', self.config.menu.name ]
args.append('--noedsources')
if not self.config.hilton:
# keep the original Source when running on Hilton
args.append('--noedsources')
for key, vals in six.iteritems(self.options):
if vals:
args.extend(('--'+key, ','.join(vals)))
Expand Down Expand Up @@ -181,6 +183,9 @@ def specificCustomize(self):
from HLTrigger.Configuration.customizeHLTforALL import customizeHLTforAll
fragment = customizeHLTforAll(fragment,"%s")
""" % (self.config.type)
elif self.config.hilton:
# do not apply the STORM-specific customisation
pass
else:
if self.config.type=="Fake":
prefix = "run1"
Expand Down Expand Up @@ -232,6 +237,7 @@ def specificCustomize(self):
self.data += "from "+customiseValues[0]+" import "+customiseValues[1]+"\n"
self.data += "process = "+customiseValues[1]+"(process)\n"


# customize the configuration according to the options
def customize(self):

Expand Down Expand Up @@ -268,7 +274,7 @@ def customize(self):

if self.config.fragment:
self.data += """
# dummyfy hltGetConditions in cff's
# dummify hltGetConditions in cff's
if 'hltGetConditions' in %(dict)s and 'HLTriggerFirstPath' in %(dict)s :
%(process)s.hltDummyConditions = cms.EDFilter( "HLTBool",
result = cms.bool( True )
Expand Down Expand Up @@ -326,7 +332,6 @@ def addGlobalOptions(self):
wantSummary = cms.untracked.bool( True ),
numberOfThreads = cms.untracked.uint32( 4 ),
numberOfStreams = cms.untracked.uint32( 0 ),
sizeOfStackForThreadsInKB = cms.untracked.uint32( 10*1024 )
)
"""

Expand Down Expand Up @@ -460,12 +465,13 @@ def runL1Emulator(self):
self.data += text

def overrideOutput(self):
# override the "online" ShmStreamConsumer output modules with "offline" PoolOutputModule's
self.data = re.sub(
r'\b(process\.)?hltOutput(\w+) *= *cms\.OutputModule\( *"ShmStreamConsumer" *,',
r'%(process)s.hltOutput\2 = cms.OutputModule( "PoolOutputModule",\n fileName = cms.untracked.string( "output\2.root" ),\n fastCloning = cms.untracked.bool( False ),\n dataset = cms.untracked.PSet(\n filterName = cms.untracked.string( "" ),\n dataTier = cms.untracked.string( "RAW" )\n ),',
self.data
)
# if not runnign on Hilton, override the "online" ShmStreamConsumer output modules with "offline" PoolOutputModule's
if not self.config.hilton:
self.data = re.sub(
r'\b(process\.)?hltOutput(\w+) *= *cms\.OutputModule\( *"ShmStreamConsumer" *,',
r'%(process)s.hltOutput\2 = cms.OutputModule( "PoolOutputModule",\n fileName = cms.untracked.string( "output\2.root" ),\n fastCloning = cms.untracked.bool( False ),\n dataset = cms.untracked.PSet(\n filterName = cms.untracked.string( "" ),\n dataTier = cms.untracked.string( "RAW" )\n ),',
self.data
)

if not self.config.fragment and self.config.output == 'minimal':
# add a single output to keep the TriggerResults and TriggerEvent
Expand Down Expand Up @@ -546,6 +552,7 @@ def updateMessageLogger(self):
%(process)s.MessageLogger.categories.append('L1TGlobalSummary')
%(process)s.MessageLogger.categories.append('HLTrigReport')
%(process)s.MessageLogger.categories.append('FastReport')
%(process)s.MessageLogger.categories.append('ThroughputService')
"""


Expand Down Expand Up @@ -852,6 +859,10 @@ def expand_filenames(self, input):
return files

def build_source(self):
if self.config.hilton:
# use the DAQ source
return

if self.config.input:
# if a dataset or a list of input files was given, use it
self.source = self.expand_filenames(self.config.input)
Expand Down
2 changes: 2 additions & 0 deletions HLTrigger/Configuration/python/customizeHLTforCMSSW.py
Expand Up @@ -202,6 +202,8 @@ def customiseFor2018Input(process):
process = customisePixelGainForRun2Input(process)
process = synchronizeHCALHLTofflineRun3on2018data(process)

return process


# CMSSW version specific customizations
def customizeHLTforCMSSW(process, menuType="GRun"):
Expand Down

0 comments on commit d489f31

Please sign in to comment.