Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:26:31

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                   100, # 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 
0045 options.parseArguments()
0046 
0047 cmsswbase = os.path.expandvars("$CMSSW_BASE/")
0048 
0049 process = cms.Process("TESTFU")
0050 process.maxEvents = cms.untracked.PSet(
0051     input = cms.untracked.int32(-1)
0052 )
0053 
0054 process.options = cms.untracked.PSet(
0055     numberOfThreads = cms.untracked.uint32(options.numThreads),
0056     numberOfStreams = cms.untracked.uint32(options.numFwkStreams),
0057     numberOfConcurrentLuminosityBlocks = cms.untracked.uint32(2)
0058 )
0059 
0060 process.MessageLogger = cms.Service("MessageLogger",
0061     cout = cms.untracked.PSet(threshold = cms.untracked.string( "INFO" )),
0062     destinations = cms.untracked.vstring( 'cout' )
0063 )
0064 
0065 process.FastMonitoringService = cms.Service("FastMonitoringService",
0066     sleepTime = cms.untracked.int32(1)
0067 )
0068 
0069 process.EvFDaqDirector = cms.Service("EvFDaqDirector",
0070     useFileBroker = cms.untracked.bool(False),
0071     fileBrokerHost = cms.untracked.string("htcp40.cern.ch"),
0072     runNumber = cms.untracked.uint32(options.runNumber),
0073     baseDir = cms.untracked.string(options.fffBaseDir+"/"+options.fuBaseDir),
0074     buBaseDir = cms.untracked.string(options.fffBaseDir+"/"+options.buBaseDir),
0075     directorIsBU = cms.untracked.bool(False)
0076 )
0077 
0078 try:
0079   os.makedirs(options.fffBaseDir+"/"+options.fuBaseDir+"/run"+str(options.runNumber).zfill(6))
0080 except Exception as ex:
0081   print(str(ex))
0082   pass
0083 
0084 process.source = cms.Source("FedRawDataInputSource",
0085     getLSFromFilename = cms.untracked.bool(True),
0086     verifyChecksum = cms.untracked.bool(True),
0087     useL1EventID = cms.untracked.bool(True),
0088     eventChunkSize = cms.untracked.uint32(32),
0089     eventChunkBlock = cms.untracked.uint32(32),
0090     numBuffers = cms.untracked.uint32(2),
0091     maxBufferedFiles = cms.untracked.uint32(2)
0092 ) 
0093 
0094 process.PrescaleService = cms.Service( "PrescaleService",
0095                                        forceDefault = cms.bool( False ),
0096                                        prescaleTable = cms.VPSet( 
0097                                          cms.PSet(  pathName = cms.string( "p1" ),
0098                                          prescales = cms.vuint32( 10)
0099                                          ),
0100                                          cms.PSet(  pathName = cms.string( "p2" ),
0101                                          prescales = cms.vuint32( 100 )
0102                                          )
0103                                        ),
0104                                        lvl1DefaultLabel = cms.string( "Default" ),
0105                                        lvl1Labels = cms.vstring( 'Default' )
0106                                        )
0107 
0108 process.filter1 = cms.EDFilter("HLTPrescaler",
0109                                L1GtReadoutRecordTag = cms.InputTag( "hltGtDigis" )
0110                                )
0111 process.filter2 = cms.EDFilter("HLTPrescaler",
0112                                L1GtReadoutRecordTag = cms.InputTag( "hltGtDigis" )
0113                                )
0114 
0115 process.a = cms.EDAnalyzer("ExceptionGenerator",
0116     defaultAction = cms.untracked.int32(0),
0117     defaultQualifier = cms.untracked.int32(1000))
0118 
0119 process.b = cms.EDAnalyzer("ExceptionGenerator",
0120     defaultAction = cms.untracked.int32(0),
0121     defaultQualifier = cms.untracked.int32(5))
0122 
0123 process.p1 = cms.Path(process.a*process.filter1)
0124 process.p2 = cms.Path(process.b*process.filter2)
0125 
0126 process.streamA = cms.OutputModule("EvFOutputModule",
0127     SelectEvents = cms.untracked.PSet(SelectEvents = cms.vstring( 'p1' ))
0128 )
0129 
0130 process.streamB = cms.OutputModule("EvFOutputModule",
0131     SelectEvents = cms.untracked.PSet(SelectEvents = cms.vstring( 'p2' ))
0132 )
0133 
0134 process.ep = cms.EndPath(process.streamA+process.streamB)