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 
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 process.MessageLogger = cms.Service("MessageLogger",
0060     cout = cms.untracked.PSet(threshold = cms.untracked.string( "ERROR" )),
0061     destinations = cms.untracked.vstring( 'cout' )
0062 )
0063 
0064 process.FastMonitoringService = cms.Service("FastMonitoringService",
0065     sleepTime = cms.untracked.int32(1)
0066 )
0067 
0068 process.EvFDaqDirector = cms.Service("EvFDaqDirector",
0069     useFileBroker = cms.untracked.bool(False),
0070     fileBrokerHostFromCfg = cms.untracked.bool(True),
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 ram_dir_path=options.buBaseDir+"/run"+str(options.runNumber).zfill(6)+"/"
0085 
0086 process.source = cms.Source("FedRawDataInputSource",
0087     getLSFromFilename = cms.untracked.bool(True),
0088     verifyChecksum = cms.untracked.bool(True),
0089     useL1EventID = cms.untracked.bool(False),
0090     eventChunkSize = cms.untracked.uint32(8),
0091     eventChunkBlock = cms.untracked.uint32(8),
0092     numBuffers = cms.untracked.uint32(2),
0093     maxBufferedFiles = cms.untracked.uint32(2),
0094     fileListMode = cms.untracked.bool(True),
0095     fileNames = cms.untracked.vstring(
0096         ram_dir_path+"run100101_ls0001_index000000.raw",
0097         ram_dir_path+"run100101_ls0001_index000001.raw",
0098         ram_dir_path+"run100101_ls0002_index000000.raw",
0099         ram_dir_path+"run100101_ls0002_index000001.raw"
0100     )
0101 
0102 )
0103 
0104 process.PrescaleService = cms.Service( "PrescaleService",
0105                                        forceDefault = cms.bool( False ),
0106                                        prescaleTable = cms.VPSet( 
0107                                          cms.PSet(  pathName = cms.string( "HLT_Physics" ),
0108                                          prescales = cms.vuint32( 10)
0109                                          ),
0110                                          cms.PSet(  pathName = cms.string( "HLT_Muon" ),
0111                                          prescales = cms.vuint32( 100 )
0112                                          )
0113                                        ),
0114                                        lvl1DefaultLabel = cms.string( "Default" ),
0115                                        lvl1Labels = cms.vstring( 'Default' )
0116                                        )
0117 
0118 process.filter1 = cms.EDFilter("HLTPrescaler",
0119                                L1GtReadoutRecordTag = cms.InputTag( "hltGtDigis" )
0120                                )
0121 process.filter2 = cms.EDFilter("HLTPrescaler",
0122                                L1GtReadoutRecordTag = cms.InputTag( "hltGtDigis" )
0123                                )
0124 
0125 process.a = cms.EDAnalyzer("ExceptionGenerator",
0126     defaultAction = cms.untracked.int32(0),
0127     defaultQualifier = cms.untracked.int32(58))
0128 
0129 process.b = cms.EDAnalyzer("ExceptionGenerator",
0130     defaultAction = cms.untracked.int32(0),
0131     defaultQualifier = cms.untracked.int32(5))
0132 
0133 
0134 import EventFilter.OnlineMetaDataRawToDigi.tcdsRawToDigi_cfi
0135 process.tcdsRawToDigi = EventFilter.OnlineMetaDataRawToDigi.tcdsRawToDigi_cfi.tcdsRawToDigi.clone()
0136 process.tcdsRawToDigi.InputLabel = cms.InputTag("rawDataCollector")
0137 
0138 process.HLT_Physics = cms.Path(process.a*process.tcdsRawToDigi*process.filter1)
0139 process.HLT_Muon = cms.Path(process.b*process.filter2)
0140 
0141 process.streamA = cms.OutputModule("EvFOutputModule",
0142     SelectEvents = cms.untracked.PSet(SelectEvents = cms.vstring( 'HLT_Physics' ))
0143 )
0144 
0145 process.streamB = cms.OutputModule("GlobalEvFOutputModule",
0146     SelectEvents = cms.untracked.PSet(SelectEvents = cms.vstring( 'HLT_Muon' ))
0147 )
0148 
0149 process.streamDQM = cms.OutputModule("GlobalEvFOutputModule",
0150     SelectEvents = cms.untracked.PSet(SelectEvents = cms.vstring( 'HLT_Physics', 'HLT_Muon' ))
0151 )
0152 
0153 process.streamD = cms.OutputModule("EventStreamFileWriter",
0154     SelectEvents = cms.untracked.PSet(SelectEvents = cms.vstring( 'HLT_Muon' ))
0155 )
0156 
0157 process.hltJson = cms.EDAnalyzer("HLTriggerJSONMonitoring")
0158 
0159 process.DQMStore = cms.Service( "DQMStore",
0160     verbose = cms.untracked.int32( 0 ),
0161     saveByLumi = cms.untracked.bool( False ),
0162 )
0163 
0164 from DQMServices.FileIO.DQMFileSaverPB_cfi import dqmSaver
0165 process.hltDQMFileSaver = dqmSaver
0166 
0167 process.daqHistoTest = cms.EDProducer("DaqTestHistograms",
0168     numberOfHistograms = cms.untracked.uint32(50),
0169     lumisectionRange =  cms.untracked.uint32(20)
0170 )
0171 
0172 process.ep = cms.EndPath(
0173   process.streamA
0174   + process.streamB
0175   + process.streamDQM
0176 # + process.streamD
0177   + process.hltJson
0178   + process.daqHistoTest
0179   + process.hltDQMFileSaver
0180 )