Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 import FWCore.ParameterSet.VarParsing as VarParsing
0004 
0005 process = cms.Process("BadChannelMerge")
0006 
0007 #prepare options
0008 
0009 options = VarParsing.VarParsing("analysis")
0010 
0011 options.register ('globalTag',
0012                                     "DONOTEXIST",
0013                                     VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0014                                     VarParsing.VarParsing.varType.string,          # string, int, or float
0015                                     "GlobalTag")
0016 options.register ('dqmFile',
0017                                     "",
0018                                     VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0019                                     VarParsing.VarParsing.varType.string,          # string, int, or float
0020                                     "DQM root file")
0021 options.register ('runNumber',
0022                                     1,
0023                                     VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0024                                     VarParsing.VarParsing.varType.int,          # string, int, or float
0025                                     "run number")
0026 options.parseArguments()
0027 
0028 
0029 process.MessageLogger = cms.Service("MessageLogger",
0030     destinations = cms.untracked.vstring('cout','cerr','MergedBadComponents'), #Reader, cout
0031     categories = cms.untracked.vstring('SiStripQualityStatistics'),
0032 
0033     debugModules = cms.untracked.vstring('siStripDigis', 
0034                                          'siStripClusters', 
0035                                          'siStripZeroSuppression', 
0036                                          'SiStripClusterizer',
0037                                          'siStripOfflineAnalyser'),
0038     cerr = cms.untracked.PSet(threshold = cms.untracked.string('ERROR')
0039                               ),
0040     cout = cms.untracked.PSet(threshold = cms.untracked.string('INFO'),
0041                                 default = cms.untracked.PSet(limit=cms.untracked.int32(0))
0042                               ),
0043     MergedBadComponents = cms.untracked.PSet(threshold = cms.untracked.string('INFO'),
0044                                 default = cms.untracked.PSet(limit=cms.untracked.int32(0)),
0045                                 SiStripQualityStatistics = cms.untracked.PSet(limit=cms.untracked.int32(100000))
0046                                 )
0047                                     
0048 )
0049 process.load("Configuration.Geometry.GeometryRecoDB_cff")
0050 
0051 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0052 from Configuration.AlCa.GlobalTag import GlobalTag
0053 process.GlobalTag = GlobalTag(process.GlobalTag, options.globalTag, '')
0054 
0055 process.source = cms.Source("EmptyIOVSource",
0056     firstValue = cms.uint64(options.runNumber),
0057     lastValue = cms.uint64(options.runNumber),
0058     timetype = cms.string('runnumber'),
0059     interval = cms.uint64(1)
0060 )
0061 
0062 process.maxEvents = cms.untracked.PSet(
0063     input = cms.untracked.int32(-1)
0064 )
0065 
0066 # DQMStore service
0067 process.load('DQMServices.Core.DQMStore_cfi')
0068 
0069 process.siStripQualityESProducer.ListOfRecordToMerge = cms.VPSet(
0070        cms.PSet(record = cms.string('SiStripDetCablingRcd'), tag = cms.string('')), # Use Detector cabling information to exclude detectors not connected            
0071        cms.PSet(record = cms.string('SiStripBadChannelRcd'), tag = cms.string('')), # Online Bad components
0072        cms.PSet(record = cms.string('RunInfoRcd'), tag = cms.string('')),            # List of FEDs exluded during data taking          
0073        cms.PSet(record = cms.string('SiStripBadFiberRcd'), tag = cms.string('')),   # Bad Channel list from the selected IOV as done at PCL
0074        # BadChannel list from FED errors is added below
0075        )
0076 process.siStripQualityESProducer.ReduceGranularity = cms.bool(False)
0077 process.siStripQualityESProducer.ThresholdForReducedGranularity = cms.double(0.3)
0078 
0079 from CalibTracker.SiStripQuality.siStripQualityStatistics_cfi import siStripQualityStatistics
0080 process.stat = siStripQualityStatistics.clone(
0081         TkMapFileName = cms.untracked.string('MergedBadComponentsTkMap.png')
0082         )
0083 process.stat.BadComponentsFromFedErrors = siStripQualityStatistics.BadComponentsFromFedErrors.clone(Add=cms.bool(True))
0084 
0085 #### Add these lines to produce a tracker map
0086 process.load("DQM.SiStripCommon.TkHistoMap_cff")
0087 
0088 
0089 process.p = cms.Path(process.stat)
0090