Skip to content

Instantly share code, notes, and snippets.

@mmusich
Last active April 9, 2024 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmusich/23cf664d7c60105f60ed02d268295368 to your computer and use it in GitHub Desktop.
Save mmusich/23cf664d7c60105f60ed02d268295368 to your computer and use it in GitHub Desktop.
import FWCore.ParameterSet.Config as cms
process = cms.Process('TEST')
import FWCore.ParameterSet.VarParsing as VarParsing
options = VarParsing.VarParsing('analysis')
options.setDefault('inputFiles', [
'root://eoscms.cern.ch//eos/cms/store/data/Run2023D/EphemeralHLTPhysics0/RAW/v1/000/370/293/00000/2ef73d2a-1fb7-4dac-9961-149525f9e887.root'
])
options.setDefault('maxEvents', 100)
options.parseArguments()
# set max number of input events
process.maxEvents.input = options.maxEvents
# initialize MessageLogger and output report
process.options.wantSummary = False
process.load('FWCore.MessageService.MessageLogger_cfi')
process.MessageLogger.cerr.FwkReport.reportEvery = 100 # only report every 100th event start
process.MessageLogger.cerr.enableStatistics = False # enable "MessageLogger Summary" message
process.MessageLogger.cerr.threshold = 'INFO' # change to 'WARNING' not to show INFO-level messages
## enable reporting of INFO-level messages (default is limit=0, i.e. no messages reported)
#process.MessageLogger.cerr.INFO = cms.untracked.PSet(
# reportEvery = cms.untracked.int32(1), # every event!
# limit = cms.untracked.int32(-1) # no limit!
#)
###
### Source (input file)
###
process.source = cms.Source('PoolSource',
fileNames = cms.untracked.vstring(options.inputFiles)
)
print('process.source.fileNames =', process.source.fileNames)
###
### Path (FEDRAWData producers)
###
_siPixelFEDs = [foo for foo in range(1200, 1349)]
_ECALFEDs = [foo for foo in range(600, 670)]
_HCALFEDs = [foo for foo in range(1100, 1199)]
from EventFilter.Utilities.EvFFEDExcluder_cfi import EvFFEDExcluder as _EvFFEDExcluder
process.rawDataNoPixel = _EvFFEDExcluder.clone(
src = 'rawDataCollector',
fedsToExclude = _siPixelFEDs,
)
process.rawDataNoECAL = _EvFFEDExcluder.clone(
src = 'rawDataCollector',
fedsToExclude = _ECALFEDs,
)
process.rawDataNoHCAL = _EvFFEDExcluder.clone(
src = 'rawDataCollector',
fedsToExclude = _HCALFEDs,
)
process.rawDataSelectionPath = cms.Path(
process.rawDataNoPixel+
process.rawDataNoECAL+
process.rawDataNoHCAL
)
###
### EndPath (output file)
###
process.rawDataOutputModule = cms.OutputModule('PoolOutputModule',
fileName = cms.untracked.string('file:tmp.root'),
outputCommands = cms.untracked.vstring(
'drop *',
'keep FEDRawDataCollection_*_*_*',
'keep edmTriggerResults_*_*_*',
'keep triggerTriggerEvent_*_*_*',
)
)
process.outputEndPath = cms.EndPath( process.rawDataOutputModule )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment