File indexing completed on 2024-11-06 06:06:23
0001
0002
0003 import FWCore.ParameterSet.Config as cms
0004 import FWCore.ParameterSet.VarParsing as VarParsing
0005
0006
0007
0008
0009 import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings
0010 _PH2_GLOBAL_TAG, _PH2_ERA = _settings.get_era_and_conditions(_settings.DEFAULT_VERSION)
0011
0012 process = cms.Process("TEST", _PH2_ERA)
0013 options = VarParsing.VarParsing('analysis')
0014 options.register('fromESSource',
0015 False,
0016 VarParsing.VarParsing.multiplicity.singleton,
0017 VarParsing.VarParsing.varType.bool,
0018 "Populate SiPhase2OuterTrackerBadStripRcd from the ESSource")
0019 options.parseArguments()
0020
0021
0022
0023
0024 process.load('FWCore.MessageService.MessageLogger_cfi')
0025 process.MessageLogger.cerr.enable = False
0026 process.MessageLogger.SiPhase2BadStripChannelReader=dict()
0027 process.MessageLogger.SiStripBadStrip=dict()
0028 process.MessageLogger.SiPhase2BadStripConfigurableFakeESSource=dict()
0029 process.MessageLogger.cout = cms.untracked.PSet(
0030 enable = cms.untracked.bool(True),
0031 enableStatistics = cms.untracked.bool(True),
0032 threshold = cms.untracked.string("INFO"),
0033 default = cms.untracked.PSet(limit = cms.untracked.int32(0)),
0034 FwkReport = cms.untracked.PSet(limit = cms.untracked.int32(-1),
0035 reportEvery = cms.untracked.int32(1000)
0036 ),
0037 SiPhase2BadStripChannelReader = cms.untracked.PSet( limit = cms.untracked.int32(-1)),
0038 SiStripBadStrip = cms.untracked.PSet( limit = cms.untracked.int32(-1)),
0039 SiPhase2BadStripConfigurableFakeESSource = cms.untracked.PSet( limit = cms.untracked.int32(-1))
0040 )
0041
0042
0043
0044
0045
0046 process.source = cms.Source("EmptyIOVSource",
0047 timetype = cms.string('runnumber'),
0048 firstValue = cms.uint64(1),
0049 lastValue = cms.uint64(1),
0050 interval = cms.uint64(1)
0051 )
0052
0053
0054
0055
0056 if(options.fromESSource):
0057 process.load("Configuration.Geometry.GeometryExtendedRun4Default_cff")
0058 process.load('Configuration.Geometry.GeometryExtendedRun4DefaultReco_cff')
0059 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0060 from Configuration.AlCa.GlobalTag import GlobalTag
0061 process.GlobalTag = GlobalTag(process.GlobalTag, _PH2_GLOBAL_TAG, '')
0062
0063
0064 process.SiPhase2OTFakeBadStripsESSource.badComponentsFraction = cms.double(0.05)
0065 else:
0066 tag = 'SiStripBadStripPhase2_T33'
0067 suffix = 'v0'
0068 inFile = tag+'_'+suffix+'.db'
0069 inDB = 'sqlite_file:'+inFile
0070
0071 process.load("CondCore.CondDB.CondDB_cfi")
0072
0073 process.CondDB.connect = inDB
0074
0075 process.PoolDBESSource = cms.ESSource("PoolDBESSource",
0076 process.CondDB,
0077 DumpStat=cms.untracked.bool(True),
0078 toGet = cms.VPSet(cms.PSet(
0079 record = cms.string("SiPhase2OuterTrackerBadStripRcd"),
0080 tag = cms.string(tag))))
0081
0082
0083
0084
0085 process.get = cms.EDAnalyzer("EventSetupRecordDataGetter",
0086 toGet = cms.VPSet(cms.PSet(
0087
0088 record = cms.string('SiPhase2OuterTrackerBadStripRcd'),
0089 data = cms.vstring('SiStripBadStrip')
0090 )),
0091 verbose = cms.untracked.bool(True)
0092 )
0093
0094
0095
0096
0097 import CondTools.SiPhase2Tracker.siPhase2BadStripChannelReader_cfi as _mod
0098 process.BadStripPayloadReader = _mod.siPhase2BadStripChannelReader.clone(printDebug = 1,
0099 printVerbose = False,
0100 label = "")
0101
0102
0103
0104
0105 process.p = cms.Path(process.get+process.BadStripPayloadReader)