Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:55:01

0001 import sys
0002 import FWCore.ParameterSet.Config as cms
0003 from FWCore.ParameterSet.VarParsing import VarParsing
0004 from Configuration.Eras.Era_Run3_cff import Run3
0005 
0006 options = VarParsing('analysis')
0007 options.register ("dataVsEmulation", False, VarParsing.multiplicity.singleton, VarParsing.varType.bool)
0008 options.register ("dataVsEmulationFile", "empty", VarParsing.multiplicity.singleton, VarParsing.varType.string)
0009 """
0010 - For CMS runs, use the actual run number. Set B904Setup to False
0011 - For B904 runs, set B904Setup to True and set runNumber >= 341761.
0012   Set B904RunNumber to when the data was taken, e.g. 210519_162820.
0013 """
0014 options.register ("runNumber", 0, VarParsing.multiplicity.singleton, VarParsing.varType.int)
0015 options.register ("B904Setup", False, VarParsing.multiplicity.singleton, VarParsing.varType.bool)
0016 options.register ("B904RunNumber", "YYMMDD_HHMMSS", VarParsing.multiplicity.singleton, VarParsing.varType.string)
0017 options.parseArguments()
0018 
0019 if options.B904Setup and options.B904RunNumber == "YYMMDD_HHMMSS":
0020     sys.exit("B904 setup was selected. Please provide a valid Run Number")
0021 
0022 process = cms.Process("ANALYSIS", Run3)
0023 process.load("FWCore.MessageService.MessageLogger_cfi")
0024 
0025 process.source = cms.Source(
0026       "PoolSource",
0027       fileNames = cms.untracked.vstring(options.inputFiles)
0028 )
0029 
0030 if options.dataVsEmulation:
0031     options.maxEvents = 1
0032     process.source = cms.Source("EmptySource")
0033 
0034 
0035 process.maxEvents = cms.untracked.PSet(
0036       input = cms.untracked.int32(options.maxEvents)
0037 )
0038 
0039 ## customize the data vs emulator module
0040 from DQM.L1TMonitor.L1TdeGEMTPG_cfi import l1tdeGEMTPGCommon
0041 process.gemTriggerPrimitivesAnalyzer = cms.EDAnalyzer(
0042     "GEMTriggerPrimitivesAnalyzer",
0043     l1tdeGEMTPGCommon,
0044     ## file of the form "DQM_V0001_L1TEMU_R000334393"
0045     rootFileName = cms.string(options.dataVsEmulationFile),
0046     ## e.g. 334393
0047     runNumber = cms.uint32(options.runNumber),
0048     dataVsEmulatorPlots = cms.bool(options.dataVsEmulation),
0049     B904RunNumber = cms.string(options.B904RunNumber)
0050 )
0051 
0052 # this needs to be set here, otherwise we duplicate the B904Setup parameter
0053 process.gemTriggerPrimitivesAnalyzer.B904Setup = options.B904Setup
0054 
0055 process.p = cms.Path(process.gemTriggerPrimitivesAnalyzer)