Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-06-30 04:13:22

0001 import FWCore.ParameterSet.Config as cms
0002 import FWCore.ParameterSet.VarParsing as VarParsing
0003 
0004 process = cms.Process("SiStripQualityStatJob")
0005 
0006 #prepare options
0007 
0008 options = VarParsing.VarParsing("analysis")
0009 
0010 options.register ('globalTag',
0011                   "DONOTEXIST",
0012                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0013                   VarParsing.VarParsing.varType.string,          # string, int, or float
0014                   "GlobalTag")
0015 options.register ('runNumber',
0016                   1,
0017                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0018                   VarParsing.VarParsing.varType.int,          # string, int, or float
0019                   "Run Number")
0020 
0021 options.parseArguments()
0022 
0023 process.MessageLogger = cms.Service("MessageLogger",
0024     cout = cms.untracked.PSet(
0025         threshold = cms.untracked.string('WARNING')
0026     ),
0027     SiStripQualityStatSummary = cms.untracked.PSet(
0028         threshold = cms.untracked.string('INFO'),
0029         default = cms.untracked.PSet(limit=cms.untracked.int32(0)),
0030         SiStripQualityStatistics = cms.untracked.PSet(limit=cms.untracked.int32(100000))
0031     ),
0032     destinations = cms.untracked.vstring('cout','SiStripQualityStatSummary'),
0033     categories = cms.untracked.vstring('SiStripQualityStatistics')
0034 )
0035 
0036 process.source = cms.Source("EmptyIOVSource",
0037     timetype = cms.string('runnumber'),
0038     # The RunInfo for this run is NOT in the globalTag
0039     firstValue = cms.uint64(options.runNumber),
0040     lastValue = cms.uint64(options.runNumber),
0041     interval = cms.uint64(1)
0042 )
0043 
0044 process.maxEvents = cms.untracked.PSet(
0045     input = cms.untracked.int32(1)
0046 )
0047 
0048 # You can get the bad channel records from a GlobalTag or from specific tags using a PoolDBESSource and an ESPrefer
0049 
0050 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0051 from Configuration.AlCa.GlobalTag import GlobalTag
0052 process.GlobalTag = GlobalTag(process.GlobalTag, options.globalTag, '')
0053 
0054 # process.poolDBESSource = cms.ESSource("PoolDBESSource",
0055 #                                       BlobStreamerName = cms.untracked.string('TBufferBlobStreamingService'),
0056 #                                       DBParameters = cms.PSet(
0057 #     messageLevel = cms.untracked.int32(0),
0058 #     authenticationPath = cms.untracked.string('/afs/cern.ch/cms/DB/conddb')
0059 #     ),
0060 #                                       timetype = cms.untracked.string('runnumber'),
0061 #                                       connect = cms.string('oracle://cms_orcon_prod/cms_cond_31x_run_info'),
0062 #                                       toGet = cms.VPSet(
0063 #     cms.PSet(
0064 #     record = cms.string('RunInfoRcd'),
0065 #     tag = cms.string('runinfo_start_31X_hlt')
0066 #     ),
0067 #     )
0068 # )
0069 # process.es_prefer = cms.ESPrefer("PoolDBESSource", "poolDBESSource")
0070 
0071 process.load("Configuration.Geometry.GeometryRecoDB_cff")
0072 
0073 # Include masking #
0074 
0075 #configure the SiStripQualityESProducer according to your needs. You can change the configuration of the existing one or create a new one with a label
0076 
0077 process.siStripQualityESProducer.ListOfRecordToMerge=cms.VPSet(
0078     cms.PSet(record=cms.string('SiStripDetCablingRcd'),tag=cms.string(''))
0079     , cms.PSet(record=cms.string('SiStripBadChannelRcd'),tag=cms.string(''))
0080     , cms.PSet(record=cms.string('SiStripBadModuleRcd' ),tag=cms.string(''))
0081     , cms.PSet(record=cms.string('SiStripBadFiberRcd'),tag=cms.string(''))
0082     , cms.PSet(record=cms.string('SiStripBadStripRcd' ),tag=cms.string(''))
0083     , cms.PSet(record=cms.string('RunInfoRcd'),tag=cms.string(''))
0084 )
0085 
0086 process.siStripQualityESProducer.ReduceGranularity = cms.bool(False)
0087 # True means all the debug output from adding the RunInfo (default is False)
0088 process.siStripQualityESProducer.PrintDebugOutput = cms.bool(True)
0089 # "True" means that the RunInfo is used even if all the feds are off (including other subdetectors).
0090 # This means that if the RunInfo was filled with a fake empty object we will still set the full tracker as bad.
0091 # With "False", instead, in that case the RunInfo information is discarded.
0092 # Default is "False".
0093 process.siStripQualityESProducer.UseEmptyRunInfo = cms.bool(False)
0094 
0095 #process.onlineSiStripQualityProducer = cms.ESProducer("SiStripQualityESProducer",
0096 #   appendToDataLabel = cms.string('OnlineMasking'),
0097 #   PrintDebugOutput = cms.bool(False),
0098 #   PrintDebug = cms.untracked.bool(True),
0099 #   ListOfRecordToMerge = cms.VPSet(cms.PSet(
0100 #       record = cms.string('SiStripBadChannelRcd'),
0101 #       tag = cms.string('')
0102 #   ), 
0103 #       cms.PSet(
0104 #           record = cms.string('SiStripDetCablingRcd'),
0105 #           tag = cms.string('')
0106 #       ), 
0107 #       cms.PSet(
0108 #           record = cms.string('RunInfoRcd'),
0109 #           tag = cms.string('')
0110 #       )),
0111 #   UseEmptyRunInfo = cms.bool(False),
0112 #   ReduceGranularity = cms.bool(True),
0113 #   ThresholdForReducedGranularity = cms.double(0.3)
0114 #)
0115 
0116 
0117 #-------------------------------------------------
0118 # Services for the TkHistoMap
0119 #-------------------------------------------------
0120 process.load("DQM.SiStripCommon.TkHistoMap_cff")
0121 #-------------------------------------------------
0122 
0123 # be sure that the dataLabel parameter matches with the label of the SiStripQuality object you want to explore
0124 from CalibTracker.SiStripQuality.siStripQualityStatistics_cfi import siStripQualityStatistics
0125 process.stat = siStripQualityStatistics.clone(
0126         TkMapFileName=cms.untracked.string("TkMapBadComponents.pdf")  #available filetypes: .pdf .png .jpg .svg
0127         )
0128 
0129 process.p = cms.Path(process.stat)