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 options = VarParsing.VarParsing("analysis")
0008 
0009 options.register ('globalTag',
0010                   "auto:run2_data",
0011                   VarParsing.VarParsing.multiplicity.singleton,  # singleton or list
0012                   VarParsing.VarParsing.varType.string,          # string, int, or float
0013                   "GlobalTag")
0014 
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 ###################################################################
0024 # Messages
0025 ###################################################################
0026 process.load('FWCore.MessageService.MessageLogger_cfi')   
0027 process.MessageLogger.cerr.enable = False
0028 process.MessageLogger.SiStripQualityStatistics=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("WARNING"),
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     SiStripQualityStatistics = cms.untracked.PSet( limit = cms.untracked.int32(-1)),
0038     )
0039 
0040 # process.MessageLogger = cms.Service("MessageLogger",
0041 #                                     cout = cms.untracked.PSet(threshold = cms.untracked.string('WARNING')),
0042 #                                     SiStripQualityStatSummary = cms.untracked.PSet(threshold = cms.untracked.string('INFO'),
0043 #                                                                                    default = cms.untracked.PSet(limit=cms.untracked.int32(0)),
0044 #                                                                                    SiStripQualityStatistics = cms.untracked.PSet(limit=cms.untracked.int32(100000))
0045 #                                                                                    ),
0046 #                                     destinations = cms.untracked.vstring('cout','SiStripQualityStatSummary'),                                    
0047 #                                     categories = cms.untracked.vstring('SiStripQualityStatistics')
0048 #                                     )
0049 
0050 process.source = cms.Source("EmptyIOVSource",
0051                             timetype = cms.string('runnumber'),
0052                             # The RunInfo for this run is NOT in the globalTag
0053                             firstValue = cms.uint64(options.runNumber),
0054                             lastValue = cms.uint64(options.runNumber),
0055                             interval = cms.uint64(1)
0056                             )
0057 
0058 process.maxEvents = cms.untracked.PSet(
0059     input = cms.untracked.int32(1)
0060     )
0061 
0062 # You can get the bad channel records from a GlobalTag or from specific tags using a PoolDBESSource and an ESPrefer
0063 
0064 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0065 from Configuration.AlCa.GlobalTag import GlobalTag
0066 process.GlobalTag = GlobalTag(process.GlobalTag, options.globalTag, '')
0067 
0068 process.load("Configuration.Geometry.GeometryRecoDB_cff")
0069 
0070 # Include masking #
0071 
0072 #configure the SiStripQualityESProducer according to your needs. You can change the configuration of the existing one or create a new one with a label
0073 
0074 process.siStripQualityESProducer.ListOfRecordToMerge=cms.VPSet(
0075     cms.PSet(record=cms.string('SiStripDetCablingRcd'),tag=cms.string(''))
0076     , cms.PSet(record=cms.string('SiStripBadChannelRcd'),tag=cms.string(''))
0077     , cms.PSet(record=cms.string('SiStripBadModuleRcd' ),tag=cms.string(''))
0078     , cms.PSet(record=cms.string('SiStripBadFiberRcd'),tag=cms.string(''))
0079     , cms.PSet(record=cms.string('SiStripBadStripRcd' ),tag=cms.string(''))
0080     , cms.PSet(record=cms.string('RunInfoRcd'),tag=cms.string(''))
0081     )
0082 
0083 process.siStripQualityESProducer.ReduceGranularity = cms.bool(False)
0084 # True means all the debug output from adding the RunInfo (default is False)
0085 process.siStripQualityESProducer.PrintDebugOutput = cms.bool(True)
0086 # "True" means that the RunInfo is used even if all the feds are off (including other subdetectors).
0087 # This means that if the RunInfo was filled with a fake empty object we will still set the full tracker as bad.
0088 # With "False", instead, in that case the RunInfo information is discarded.
0089 # Default is "False".
0090 process.siStripQualityESProducer.UseEmptyRunInfo = cms.bool(False)
0091 
0092 #-------------------------------------------------
0093 # Services for the TkHistoMap
0094 #-------------------------------------------------
0095 process.load("DQM.SiStripCommon.TkHistoMap_cff")
0096 #-------------------------------------------------
0097 
0098 # be sure that the dataLabel parameter matches with the label of the SiStripQuality object you want to explore
0099 from CalibTracker.SiStripQuality.siStripQualityStatistics_cfi import siStripQualityStatistics
0100 process.stat = siStripQualityStatistics.clone(
0101         StripQualityLabel=cms.string(""),
0102         SaveTkHistoMap=cms.untracked.bool(False),
0103         TkMapFileName=cms.untracked.string("TkMapBadComponents.pdf")  #available filetypes: .pdf .png .jpg .svg
0104         )
0105 
0106 process.p = cms.Path(process.stat)