CMS 3D CMS Logo

customizeHLTforNewDatasetDefinition.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
4  # Loop over streams
5  for stream in process.streams.parameterNames_():
6  streamPaths = cms.vstring()
7  # Loop over datasets
8  for dataset in getattr( process.streams, stream ):
9  # Define dataset prescaler
10  setattr( process, 'hltPreDataset'+dataset, cms.EDFilter( "HLTPrescaler", L1GtReadoutRecordTag = cms.InputTag( "hltGtStage2Digis" ), offset = cms.uint32( 0 ) ) )
11  # Define dataset selection
12  paths = getattr( process.datasets, dataset )
13  setattr( process, 'hltDataset'+dataset, cms.EDFilter( "PathStatusFilter" , verbose = cms.untracked.bool( False ), logicalExpression = cms.string( ' or '.join(paths) ) ) )
14  # Create dataset path
15  datasetPath = 'Dataset_'+dataset+'_v1'
16  setattr( process, datasetPath, cms.Path( process.hltGtStage2Digis + getattr( process , 'hltPreDataset'+dataset ) + getattr( process, 'hltDataset'+dataset ) + process.HLTEndSequence ) )
17  # Append dataset path
18  process.schedule.insert( process.schedule.index( process.HLTriggerFinalPath ), getattr( process, datasetPath ) )
19  setattr( process.datasets, dataset, cms.vstring( datasetPath ) )
20  streamPaths.append( datasetPath )
21  # Set stream paths
22  getattr( process, 'hltOutput'+stream ).SelectEvents.SelectEvents = streamPaths
23 
24  return process
static std::string join(char **cmd)
Definition: RemoteFile.cc:21