Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-04-06 03:10:52

0001 #! /usr/bin/env cmsRun
0002 # Author: Marco Musich (Feb 2022)
0003 import FWCore.ParameterSet.Config as cms
0004 import FWCore.ParameterSet.VarParsing as VarParsing
0005 
0006 process = cms.Process("TEST")
0007 options = VarParsing.VarParsing('analysis')
0008 options.register('fromESSource',
0009                  False, # default value
0010                  VarParsing.VarParsing.multiplicity.singleton,
0011                  VarParsing.VarParsing.varType.bool,
0012                  "Populate SiPhase2OuterTrackerBadStripRcd from the ESSource")
0013 options.parseArguments()
0014 
0015 ###################################################################
0016 # Messages
0017 ###################################################################
0018 process.load('FWCore.MessageService.MessageLogger_cfi')   
0019 process.MessageLogger.cerr.enable = False
0020 process.MessageLogger.SiPhase2BadStripChannelReader=dict()  
0021 process.MessageLogger.SiStripBadStrip=dict()
0022 process.MessageLogger.SiPhase2BadStripConfigurableFakeESSource=dict()
0023 process.MessageLogger.cout = cms.untracked.PSet(
0024     enable    = cms.untracked.bool(True),
0025     enableStatistics = cms.untracked.bool(True),
0026     threshold = cms.untracked.string("INFO"),
0027     default   = cms.untracked.PSet(limit = cms.untracked.int32(0)),                       
0028     FwkReport = cms.untracked.PSet(limit = cms.untracked.int32(-1),
0029                                    reportEvery = cms.untracked.int32(1000)
0030                                    ),                                                      
0031     SiPhase2BadStripChannelReader = cms.untracked.PSet( limit = cms.untracked.int32(-1)),
0032     SiStripBadStrip = cms.untracked.PSet( limit = cms.untracked.int32(-1)),
0033     SiPhase2BadStripConfigurableFakeESSource = cms.untracked.PSet( limit = cms.untracked.int32(-1))
0034 )
0035 
0036 ###################################################################
0037 # A data source must always be defined.
0038 # We don't need it, so here's a dummy one.
0039 ###################################################################
0040 process.source = cms.Source("EmptyIOVSource",
0041     timetype = cms.string('runnumber'),
0042     firstValue = cms.uint64(1),
0043     lastValue = cms.uint64(1),
0044     interval = cms.uint64(1)
0045 )
0046 
0047 ###################################################################
0048 # Input data
0049 ###################################################################
0050 if(options.fromESSource): 
0051     process.load("Configuration.Geometry.GeometryExtended2026D49_cff")
0052     process.load('Configuration.Geometry.GeometryExtended2026D49Reco_cff')
0053     #process.load("SLHCUpgradeSimulations.Geometry.fakePhase2OuterTrackerConditions_cff") # already included
0054     #process.SiPhase2OTFakeBadStripsESSource.printDebug = cms.untracked.bool(True)    # this makes it verbose 
0055     process.SiPhase2OTFakeBadStripsESSource.badComponentsFraction = cms.double(0.05)   # bad components fraction is 5%
0056 else:
0057     tag = 'SiStripBadStripPhase2_T15'
0058     suffix = 'v0'
0059     inFile = tag+'_'+suffix+'.db'
0060     inDB = 'sqlite_file:'+inFile
0061     
0062     process.load("CondCore.CondDB.CondDB_cfi")
0063     # input database (in this case the local sqlite file)
0064     process.CondDB.connect = inDB
0065     
0066     process.PoolDBESSource = cms.ESSource("PoolDBESSource",
0067                                           process.CondDB,
0068                                           DumpStat=cms.untracked.bool(True),
0069                                           toGet = cms.VPSet(cms.PSet(#record = cms.string("SiStripBadStripRcd"),
0070                                                                      record = cms.string("SiPhase2OuterTrackerBadStripRcd"),
0071                                                                      tag = cms.string(tag))))
0072     
0073 ###################################################################
0074 # check the ES data getter
0075 ###################################################################
0076 process.get = cms.EDAnalyzer("EventSetupRecordDataGetter",
0077     toGet = cms.VPSet(cms.PSet(
0078         #record = cms.string('SiStripBadStripRcd'),
0079         record = cms.string('SiPhase2OuterTrackerBadStripRcd'),
0080         data = cms.vstring('SiStripBadStrip')
0081     )),
0082     verbose = cms.untracked.bool(True)
0083 )
0084 
0085 ###################################################################
0086 # Payload reader
0087 ###################################################################
0088 import CondTools.SiPhase2Tracker.siPhase2BadStripChannelReader_cfi as _mod
0089 process.BadStripPayloadReader = _mod.siPhase2BadStripChannelReader.clone(printDebug = 1,
0090                                                                          printVerbose = False,
0091                                                                          label = "")
0092 
0093 ###################################################################
0094 # Path
0095 ###################################################################
0096 process.p = cms.Path(process.get+process.BadStripPayloadReader)