Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-06-07 22:22:33

0001 from __future__ import print_function
0002 
0003 import FWCore.ParameterSet.Config as cms
0004 from FWCore.ParameterSet.VarParsing import VarParsing
0005 from Configuration.Eras.Era_Run3_cff import Run3
0006 
0007 options = VarParsing('analysis')
0008 options.register ("pack", True, VarParsing.multiplicity.singleton, VarParsing.varType.bool)
0009 options.register ("unpack", True, VarParsing.multiplicity.singleton, VarParsing.varType.bool)
0010 options.register ("reconstruct", False, VarParsing.multiplicity.singleton, VarParsing.varType.bool)
0011 options.register ("view", True, VarParsing.multiplicity.singleton, VarParsing.varType.bool)
0012 options.register ("validate", False, VarParsing.multiplicity.singleton, VarParsing.varType.bool)
0013 options.register ("mc", False, VarParsing.multiplicity.singleton, VarParsing.varType.bool)
0014 options.register ("useB904Data", False, VarParsing.multiplicity.singleton, VarParsing.varType.bool)
0015 options.register ("usePreTriggers", True, VarParsing.multiplicity.singleton, VarParsing.varType.bool)
0016 options.register ("useGEMs", True, VarParsing.multiplicity.singleton, VarParsing.varType.bool)
0017 options.register ("useCSCShowers", True, VarParsing.multiplicity.singleton, VarParsing.varType.bool)
0018 options.parseArguments()
0019 
0020 ## process def
0021 process = cms.Process("TEST", Run3)
0022 process.load("FWCore.MessageService.MessageLogger_cfi")
0023 process.load("Configuration/StandardSequences/GeometryRecoDB_cff")
0024 process.load("Configuration/StandardSequences/MagneticField_cff")
0025 process.load("Configuration/StandardSequences/FrontierConditions_GlobalTag_cff")
0026 process.load("Configuration.StandardSequences.Reconstruction_cff")
0027 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0028 process.load("EventFilter.CSCRawToDigi.cscUnpacker_cfi")
0029 process.load("EventFilter.CSCRawToDigi.cscPacker_cfi")
0030 process.load("EventFilter.CSCRawToDigi.viewDigi_cfi")
0031 
0032 process.maxEvents = cms.untracked.PSet(
0033       input = cms.untracked.int32(options.maxEvents)
0034 )
0035 
0036 process.options = cms.untracked.PSet(
0037       SkipEvent = cms.untracked.vstring('ProductNotFound')
0038 )
0039 
0040 process.source = cms.Source(
0041       "PoolSource",
0042       fileNames = cms.untracked.vstring(options.inputFiles)
0043 )
0044 
0045 ## global tag
0046 from Configuration.AlCa.GlobalTag import GlobalTag
0047 if options.mc:
0048       process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2022_realistic', '')
0049 else:
0050       process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run3_data', '')
0051 
0052 process.DQMStore = cms.Service("DQMStore")
0053 
0054 # customize messagelogger
0055 process.MessageLogger.cerr.enable = False
0056 process.MessageLogger.debugModules = cms.untracked.vstring('muonCSCDigis')
0057 ## categories: 'CSCDCCUnpacker|CSCRawToDigi', 'StatusDigis', 'StatusDigi', 'CSCRawToDigi', 'CSCDCCUnpacker', 'EventInfo',
0058 process.MessageLogger.CSCDDUEventData = dict()
0059 process.MessageLogger.CSCRawToDigi = dict()
0060 process.MessageLogger.badData = dict()
0061 process.MessageLogger.cout = cms.untracked.PSet(
0062       enable = cms.untracked.bool(True),
0063       INFO = cms.untracked.PSet(
0064             limit = cms.untracked.int32(0)
0065       ),
0066       #TRACE = cms.untracked.PSet(limit = cms.untracked.int32(0) ),
0067       noTimeStamps = cms.untracked.bool(False),
0068       #FwkReport = cms.untracked.PSet(
0069       #    reportEvery = cms.untracked.int32(1),
0070       #    limit = cms.untracked.int32(10000000)
0071       #),
0072       #CSCRawToDigi = cms.untracked.PSet(limit = cms.untracked.int32(10000000)),
0073       #StatusDigi = cms.untracked.PSet(limit = cms.untracked.int32(10000000)),
0074       #EventInfo = cms.untracked.PSet(limit = cms.untracked.int32(10000000)),
0075       default = cms.untracked.PSet(limit = cms.untracked.int32(10000000)),
0076       #Root_NoDictionary = cms.untracked.PSet(limit = cms.untracked.int32(0)),
0077       DEBUG = cms.untracked.PSet(limit = cms.untracked.int32(0)),
0078       #FwkJob = cms.untracked.PSet(limit = cms.untracked.int32(0)),
0079       #FwkSummary = cms.untracked.PSet(reportEvery = cms.untracked.int32(1), limit = cms.untracked.int32(10000000) ),
0080       threshold = cms.untracked.string('DEBUG')
0081 )
0082 
0083 ## modules
0084 process.cscValidation = cms.EDAnalyzer(
0085       "CSCValidation",
0086       rootFileName = cms.untracked.string('cscv_RAW.root'),
0087       isSimulation = cms.untracked.bool(False),
0088       writeTreeToFile = cms.untracked.bool(True),
0089       useDigis = cms.untracked.bool(True),
0090       detailedAnalysis = cms.untracked.bool(False),
0091       useTriggerFilter = cms.untracked.bool(False),
0092       useQualityFilter = cms.untracked.bool(False),
0093       makeStandalonePlots = cms.untracked.bool(False),
0094       makeTimeMonitorPlots = cms.untracked.bool(True),
0095       rawDataTag = cms.InputTag("rawDataCollector"),
0096       alctDigiTag = cms.InputTag("muonCSCDigis","MuonCSCALCTDigi"),
0097       clctDigiTag = cms.InputTag("muonCSCDigis","MuonCSCCLCTDigi"),
0098       corrlctDigiTag = cms.InputTag("muonCSCDigis","MuonCSCCorrelatedLCTDigi"),
0099       stripDigiTag = cms.InputTag("muonCSCDigis","MuonCSCStripDigi"),
0100       wireDigiTag = cms.InputTag("muonCSCDigis","MuonCSCWireDigi"),
0101       compDigiTag = cms.InputTag("muonCSCDigis","MuonCSCComparatorDigi"),
0102       cscRecHitTag = cms.InputTag("csc2DRecHits"),
0103       cscSegTag = cms.InputTag("cscSegments"),
0104       saMuonTag = cms.InputTag("standAloneMuons"),
0105       l1aTag = cms.InputTag("gtDigis"),
0106       hltTag = cms.InputTag("TriggerResults::HLT"),
0107       makeHLTPlots = cms.untracked.bool(True),
0108       simHitTag = cms.InputTag("g4SimHits", "MuonCSCHits")
0109 )
0110 
0111 process.cscValidation.isSimulation = options.mc
0112 
0113 process.analyzer = cms.EDAnalyzer("CSCDigiAnalyzer")
0114 
0115 ## customizations
0116 if options.mc:
0117       val = process.cscValidation
0118       val.alctDigiTag = cms.InputTag("simCscTriggerPimitiveDigis")
0119       val.clctDigiTag = cms.InputTag("simCscTriggerPimitiveDigis")
0120       val.corrlctDigiTag = cms.InputTag("simCscTriggerPimitiveDigis")
0121       val.stripDigiTag = cms.InputTag("simMuonCSCDigis","MuonCSCStripDigi")
0122       val.wireDigiTag = cms.InputTag("simMuonCSCDigis","MuonCSCWireDigi")
0123       val.compDigiTag = cms.InputTag("simMuonCSCDigis","MuonCSCComparatorDigi")
0124 else:
0125       pack = process.cscpacker
0126       pack.wireDigiTag = cms.InputTag("muonCSCDigis","MuonCSCWireDigi")
0127       pack.stripDigiTag = cms.InputTag("muonCSCDigis","MuonCSCStripDigi")
0128       pack.comparatorDigiTag = cms.InputTag("muonCSCDigis","MuonCSCComparatorDigi")
0129       pack.alctDigiTag = cms.InputTag("muonCSCDigis","MuonCSCALCTDigi")
0130       pack.clctDigiTag = cms.InputTag("muonCSCDigis","MuonCSCCLCTDigi")
0131       pack.correlatedLCTDigiTag = cms.InputTag("muonCSCDigis","MuonCSCCorrelatedLCTDigi")
0132 
0133 ## Use specific b904 test setups configurations
0134 if options.useB904Data:
0135       process.muonCSCDigis.DisableMappingCheck = True
0136       process.muonCSCDigis.B904Setup = True
0137 
0138 ## Use preTriggers from trigger simulation for packing
0139 if options.usePreTriggers:
0140       pack.preTriggerTag = cms.InputTag("simCscTriggerPrimitiveDigis")
0141       pack.usePreTriggers = True
0142 else:
0143       pack.usePreTriggers = False
0144       pack.packEverything = True
0145 
0146 ## Pack Run3 GEM data
0147 if options.useGEMs:
0148       pack.useGEMs = True
0149       pack.padDigiClusterTag = cms.InputTag("muonCSCDigis","MuonGEMPadDigiCluster")
0150 else:
0151       pack.useGEMs = False
0152 
0153 ## Pack Run3 CSC Shower data
0154 if options.useCSCShowers:
0155       pack.useCSCShowers = True
0156       pack.showerDigiTag = cms.InputTag("muonCSCDigis","MuonCSCShowerDigi")
0157       pack.anodeShowerDigiTag = cms.InputTag("muonCSCDigis","MuonCSCShowerDigiAnode")
0158       pack.cathodeShowerDigiTag = cms.InputTag("muonCSCDigis","MuonCSCShowerDigiCathode")
0159       pack.anodeALCTShowerDigiTag = cms.InputTag("muonCSCDigis","MuonCSCShowerDigiAnodeALCT")
0160 else:
0161       pack.useCSCShowers = False
0162 
0163 process.out = cms.OutputModule(
0164       "PoolOutputModule",
0165       fileName = cms.untracked.string('output.root'),
0166       outputCommands = cms.untracked.vstring("keep *")
0167 )
0168 
0169 ## schedule and path definition
0170 process.p1 = cms.Path(process.cscpacker)
0171 process.p2 = cms.Path(process.muonCSCDigis)
0172 process.p3 = cms.Path(process.csc2DRecHits * process.cscSegments)
0173 process.p4 = cms.Path(process.cscValidation)
0174 process.p5 = cms.Path(process.viewDigi)
0175 process.endjob_step = cms.EndPath(process.out * process.endOfProcess)
0176 
0177 process.schedule = cms.Schedule()
0178 if options.pack:
0179       process.schedule.extend([process.p1])
0180 if options.unpack:
0181       process.schedule.extend([process.p2])
0182 if options.reconstruct:
0183       process.schedule.extend([process.p3])
0184 if options.validate:
0185       process.schedule.extend([process.p4])
0186 if options.view:
0187       process.schedule.extend([process.p5])
0188 
0189 process.schedule.extend([process.endjob_step])