File indexing completed on 2024-11-25 02:29:34
0001 import FWCore.ParameterSet.Config as cms
0002 import FWCore.ParameterSet.VarParsing as VarParsing
0003 import os
0004
0005 options = VarParsing.VarParsing ('analysis')
0006
0007 options.register ('runNumber',
0008 100101,
0009 VarParsing.VarParsing.multiplicity.singleton,
0010 VarParsing.VarParsing.varType.int,
0011 "Run Number")
0012
0013 options.register ('buBaseDir',
0014 'ramdisk',
0015 VarParsing.VarParsing.multiplicity.singleton,
0016 VarParsing.VarParsing.varType.string,
0017 "BU base directory")
0018
0019 options.register ('fuBaseDir',
0020 'data',
0021 VarParsing.VarParsing.multiplicity.singleton,
0022 VarParsing.VarParsing.varType.string,
0023 "BU base directory")
0024
0025 options.register ('fffBaseDir',
0026 '.',
0027 VarParsing.VarParsing.multiplicity.singleton,
0028 VarParsing.VarParsing.varType.string,
0029 "FFF base directory")
0030
0031 options.register ('numThreads',
0032 3,
0033 VarParsing.VarParsing.multiplicity.singleton,
0034 VarParsing.VarParsing.varType.int,
0035 "Number of CMSSW threads")
0036
0037 options.register ('numFwkStreams',
0038 2,
0039 VarParsing.VarParsing.multiplicity.singleton,
0040 VarParsing.VarParsing.varType.int,
0041 "Number of CMSSW streams")
0042
0043 options.register ('numEventsToWrite',
0044 -1,
0045 VarParsing.VarParsing.multiplicity.singleton,
0046 VarParsing.VarParsing.varType.int,
0047 "Number of Events to process. -1 means all.")
0048
0049
0050 options.parseArguments()
0051
0052 cmsswbase = os.path.expandvars("$CMSSW_BASE/")
0053
0054 process = cms.Process("TESTFU")
0055 process.maxEvents = cms.untracked.PSet(
0056 input = cms.untracked.int32(options.numEventsToWrite)
0057 )
0058 if options.numEventsToWrite == 0:
0059 process.maxEvents.input = 1
0060
0061 process.options = cms.untracked.PSet(
0062 numberOfThreads = cms.untracked.uint32(options.numThreads),
0063 numberOfStreams = cms.untracked.uint32(options.numFwkStreams),
0064 numberOfConcurrentLuminosityBlocks = cms.untracked.uint32(2)
0065 )
0066 process.MessageLogger = cms.Service("MessageLogger",
0067 cout = cms.untracked.PSet(threshold = cms.untracked.string( "ERROR" )),
0068 destinations = cms.untracked.vstring( 'cout' )
0069 )
0070
0071 process.FastMonitoringService = cms.Service("FastMonitoringService",
0072 sleepTime = cms.untracked.int32(1)
0073 )
0074
0075 process.EvFDaqDirector = cms.Service("EvFDaqDirector",
0076 useFileBroker = cms.untracked.bool(False),
0077 fileBrokerHostFromCfg = cms.untracked.bool(True),
0078 fileBrokerHost = cms.untracked.string("htcp40.cern.ch"),
0079 runNumber = cms.untracked.uint32(options.runNumber),
0080 baseDir = cms.untracked.string(options.fffBaseDir+"/"+options.fuBaseDir),
0081 buBaseDir = cms.untracked.string(options.fffBaseDir+"/"+options.buBaseDir),
0082 directorIsBU = cms.untracked.bool(False),
0083 )
0084
0085 try:
0086 os.makedirs(options.fffBaseDir+"/"+options.fuBaseDir+"/run"+str(options.runNumber).zfill(6))
0087 except Exception as ex:
0088 print(str(ex))
0089 pass
0090
0091 ram_dir_path=options.buBaseDir+"/run"+str(options.runNumber).zfill(6)+"/"
0092
0093 process.source = cms.Source("FedRawDataInputSource",
0094 getLSFromFilename = cms.untracked.bool(True),
0095 verifyChecksum = cms.untracked.bool(True),
0096 useL1EventID = cms.untracked.bool(False),
0097 eventChunkSize = cms.untracked.uint32(8),
0098 eventChunkBlock = cms.untracked.uint32(8),
0099 numBuffers = cms.untracked.uint32(2),
0100 maxBufferedFiles = cms.untracked.uint32(2),
0101 fileListMode = cms.untracked.bool(True),
0102 fileNames = cms.untracked.vstring(
0103 ram_dir_path+"run100101_ls0001_index000000.raw",
0104 ram_dir_path+"run100101_ls0001_index000001.raw",
0105 ram_dir_path+"run100101_ls0002_index000000.raw",
0106 ram_dir_path+"run100101_ls0002_index000001.raw"
0107 )
0108
0109 )
0110
0111 process.PrescaleService = cms.Service( "PrescaleService",
0112 forceDefault = cms.bool( False ),
0113 prescaleTable = cms.VPSet(
0114 cms.PSet( pathName = cms.string( "HLT_Physics" ),
0115 prescales = cms.vuint32( 10)
0116 ),
0117 cms.PSet( pathName = cms.string( "HLT_Muon" ),
0118 prescales = cms.vuint32( 100 )
0119 )
0120 ),
0121 lvl1DefaultLabel = cms.string( "Default" ),
0122 lvl1Labels = cms.vstring( 'Default' )
0123 )
0124
0125
0126 process.pre = cms.EDFilter("PrescaleEventFilter", offset = cms.uint32(0), prescale=cms.uint32(1))
0127 if options.numEventsToWrite:
0128 process.pre.offset = 2
0129 process.pre.prescale = 4
0130
0131 process.filter1 = cms.EDFilter("HLTPrescaler",
0132 L1GtReadoutRecordTag = cms.InputTag( "hltGtDigis" )
0133 )
0134 process.filter2 = cms.EDFilter("HLTPrescaler",
0135 L1GtReadoutRecordTag = cms.InputTag( "hltGtDigis" )
0136 )
0137
0138 process.a = cms.EDAnalyzer("ExceptionGenerator",
0139 defaultAction = cms.untracked.int32(0),
0140 defaultQualifier = cms.untracked.int32(58))
0141
0142 process.b = cms.EDAnalyzer("ExceptionGenerator",
0143 defaultAction = cms.untracked.int32(0),
0144 defaultQualifier = cms.untracked.int32(5))
0145
0146
0147 import EventFilter.OnlineMetaDataRawToDigi.tcdsRawToDigi_cfi
0148 process.tcdsRawToDigi = EventFilter.OnlineMetaDataRawToDigi.tcdsRawToDigi_cfi.tcdsRawToDigi.clone()
0149 process.tcdsRawToDigi.InputLabel = cms.InputTag("rawDataCollector")
0150
0151 process.HLT_Physics = cms.Path(process.a*process.tcdsRawToDigi*process.filter1*process.pre)
0152 process.HLT_Muon = cms.Path(process.b*process.filter2*process.pre)
0153
0154 process.streamA = cms.OutputModule("GlobalEvFOutputModule",
0155 SelectEvents = cms.untracked.PSet(SelectEvents = cms.vstring( 'HLT_Physics' ))
0156 )
0157
0158 process.streamB = cms.OutputModule("GlobalEvFOutputModule",
0159 SelectEvents = cms.untracked.PSet(SelectEvents = cms.vstring( 'HLT_Muon' ))
0160 )
0161
0162 process.streamDQM = cms.OutputModule("GlobalEvFOutputModule",
0163 SelectEvents = cms.untracked.PSet(SelectEvents = cms.vstring( 'HLT_Physics', 'HLT_Muon' ))
0164 )
0165
0166 process.streamD = cms.OutputModule("EventStreamFileWriter",
0167 SelectEvents = cms.untracked.PSet(SelectEvents = cms.vstring( 'HLT_Muon' ))
0168 )
0169
0170 process.hltJson = cms.EDAnalyzer("HLTriggerJSONMonitoring")
0171
0172 process.DQMStore = cms.Service( "DQMStore",
0173 verbose = cms.untracked.int32( 0 ),
0174 saveByLumi = cms.untracked.bool( False ),
0175 )
0176
0177 from DQMServices.FileIO.DQMFileSaverPB_cfi import dqmSaver
0178 process.hltDQMFileSaver = dqmSaver
0179
0180 process.daqHistoTest = cms.EDProducer("DaqTestHistograms",
0181 numberOfHistograms = cms.untracked.uint32(50),
0182 lumisectionRange = cms.untracked.uint32(20)
0183 )
0184
0185 process.ep = cms.EndPath(
0186 process.streamA
0187 + process.streamB
0188 + process.streamDQM
0189
0190 + process.hltJson
0191 + process.daqHistoTest
0192 + process.hltDQMFileSaver
0193 )