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