Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-11-06 04:13:47

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 def customizeHLTforNewDatasetDefinition(process):
0004     # Loop over streams
0005     for stream in process.streams.parameterNames_():
0006         streamPaths = cms.vstring()
0007         # Loop over datasets
0008         for dataset in getattr( process.streams, stream ):
0009             # Define dataset prescaler
0010             setattr( process, 'hltPreDataset'+dataset, cms.EDFilter( "HLTPrescaler", L1GtReadoutRecordTag = cms.InputTag( "hltGtStage2Digis" ), offset = cms.uint32( 0 ) ) )
0011             # Define dataset selection
0012             paths = getattr( process.datasets, dataset )
0013             setattr( process, 'hltDataset'+dataset, cms.EDFilter( "PathStatusFilter" , verbose = cms.untracked.bool( False ), logicalExpression = cms.string( ' or '.join(paths) ) ) )
0014             # Create dataset path
0015             datasetPath = 'Dataset_'+dataset+'_v1'
0016             setattr( process, datasetPath, cms.Path( process.hltGtStage2Digis + getattr( process , 'hltPreDataset'+dataset ) +  getattr( process, 'hltDataset'+dataset ) + process.HLTEndSequence ) )
0017             # Append dataset path
0018             process.schedule.insert( process.schedule.index( process.HLTriggerFinalPath ), getattr( process, datasetPath ) )
0019             setattr( process.datasets, dataset, cms.vstring( datasetPath ) )
0020             streamPaths.append( datasetPath )
0021         # Set stream paths
0022         getattr( process, 'hltOutput'+stream ).SelectEvents.SelectEvents = streamPaths
0023 
0024     return process