Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-03-22 06:24:59

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