Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:08:55

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 import FWCore.ParameterSet.VarParsing as VarParsing
0004 
0005 process = cms.Process("Reader")
0006 
0007 options = VarParsing.VarParsing("analysis")
0008 
0009 options.register ('moduleList',
0010                   '',
0011                   VarParsing.VarParsing.multiplicity.list, # singleton or list
0012                   VarParsing.VarParsing.varType.int,          # string, int, or float
0013                   "List of modules to monitor")
0014 options.register ('gainNorm',
0015                   False,
0016                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0017                   VarParsing.VarParsing.varType.bool,          # string, int, or float
0018                   "has gain normalization to be applied?")
0019 options.register ('simGainNorm',
0020                   False,
0021                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0022                   VarParsing.VarParsing.varType.bool,          # string, int, or float
0023                   "has SIM gain normalization to be applied?")
0024 options.register ('globalTag',
0025                   "DONOTEXIST",
0026                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0027                   VarParsing.VarParsing.varType.string,          # string, int, or float
0028                   "GlobalTag")
0029 options.register ('logDestination',
0030                   "",
0031                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0032                   VarParsing.VarParsing.varType.string,          # string, int, or float
0033                   "log file")
0034 options.register ('outputRootFile',
0035                   "",
0036                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0037                   VarParsing.VarParsing.varType.string,          # string, int, or float
0038                   "output root file")
0039 options.register ('connectionString',
0040                   "",
0041                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0042                   VarParsing.VarParsing.varType.string,          # string, int, or float
0043                   "connection string")
0044 options.register ('recordName',
0045                   "",
0046                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0047                   VarParsing.VarParsing.varType.string,          # string, int, or float
0048                   "record name")
0049 options.register ('tagName',
0050                   "",
0051                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0052                   VarParsing.VarParsing.varType.string,          # string, int, or float
0053                   "tag name")
0054 options.register ('runNumber',
0055                   0,
0056                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0057                   VarParsing.VarParsing.varType.int,          # string, int, or float
0058                   "run number")
0059 options.register ('PedestalMon',
0060                   False,
0061                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0062                   VarParsing.VarParsing.varType.bool,          # string, int, or float
0063                   "Monitor pedestals?")
0064 options.register ('NoiseMon',
0065                   False,
0066                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0067                   VarParsing.VarParsing.varType.bool,          # string, int, or float
0068                   "Monitor noise?")
0069 
0070 options.parseArguments()
0071 
0072 
0073 process.MessageLogger = cms.Service("MessageLogger",
0074                                     debugModules = cms.untracked.vstring(''),
0075                                     destinations = cms.untracked.vstring(options.logDestination,
0076                                                                          'cerr'
0077                                                                          ), #Reader, cout
0078                                     categories = cms.untracked.vstring('SiStripBaseCondObjDQM',
0079                                                                        'SiStripNoisesDQM',
0080                                                                        'SiStripPedestalsDQM'
0081                                                                        ),
0082                                     cerr = cms.untracked.PSet(threshold = cms.untracked.string('WARNING'))
0083 )
0084 setattr(process.MessageLogger,options.logDestination,cms.untracked.PSet(
0085         threshold = cms.untracked.string('INFO'),
0086         default = cms.untracked.PSet(limit=cms.untracked.int32(0)),
0087         SiStripBaseCondObjDQM = cms.untracked.PSet(limit=cms.untracked.int32(100000)),
0088         SiStripNoisesDQM = cms.untracked.PSet(limit=cms.untracked.int32(100000)),
0089         SiStripPedestalsDQM = cms.untracked.PSet(limit=cms.untracked.int32(100000))
0090 ))
0091 
0092 process.maxEvents = cms.untracked.PSet(
0093     input = cms.untracked.int32(-1)
0094 )
0095 
0096 process.source = cms.Source("EmptyIOVSource",
0097     firstValue = cms.uint64(options.runNumber),
0098     lastValue = cms.uint64(options.runNumber),
0099     timetype = cms.string('runnumber'),
0100     interval = cms.uint64(1)
0101 )
0102 
0103 if options.globalTag == "DONOTEXIST":
0104     process.load('Configuration.Geometry.GeometryExtended_cff')
0105     process.TrackerTopologyEP = cms.ESProducer("TrackerTopologyEP")
0106     process.load("Geometry.TrackerGeometryBuilder.trackerParameters_cfi")
0107 
0108     process.poolDBESSource = cms.ESSource("PoolDBESSource",
0109                                           BlobStreamerName = cms.untracked.string('TBufferBlobStreamingService'),
0110                                           DBParameters = cms.PSet(
0111             messageLevel = cms.untracked.int32(1),  # it used to be 2
0112             authenticationPath = cms.untracked.string('/afs/cern.ch/cms/DB/conddb')
0113             ),
0114                                           timetype = cms.untracked.string('runnumber'),
0115                                           connect = cms.string(options.connectionString),
0116                                           toGet = cms.VPSet(cms.PSet(
0117                 record = cms.string(options.recordName),
0118                 tag = cms.string(options.tagName)
0119                 ))
0120                                           )
0121 else:
0122     process.load("Configuration.StandardSequences.GeometryDB_cff")
0123     process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0124     from Configuration.AlCa.GlobalTag import GlobalTag
0125     process.GlobalTag = GlobalTag(process.GlobalTag, options.globalTag, '')
0126 
0127 process.DQMStore = cms.Service("DQMStore",
0128                                verbose = cms.untracked.int32(1)
0129                                )
0130 
0131 process.load("DQM.SiStripMonitorSummary.SiStripMonitorCondData_cfi")
0132 
0133 process.CondDataMonitoring.OutputFileName = options.outputRootFile
0134 process.CondDataMonitoring.MonitorSiStripPedestal      = options.PedestalMon
0135 process.CondDataMonitoring.MonitorSiStripNoise         = options.NoiseMon
0136 process.CondDataMonitoring.MonitorSiStripQuality       = False
0137 process.CondDataMonitoring.MonitorSiStripCabling       = False
0138 process.CondDataMonitoring.MonitorSiStripApvGain       = False
0139 process.CondDataMonitoring.MonitorSiStripLorentzAngle  = False
0140 process.CondDataMonitoring.MonitorSiStripBackPlaneCorrection  = False 
0141 process.CondDataMonitoring.MonitorSiStripLowThreshold  = False
0142 process.CondDataMonitoring.MonitorSiStripHighThreshold = False
0143 process.CondDataMonitoring.OutputMEsInRootFile         = True
0144 process.CondDataMonitoring.FillConditions_PSet.OutputSummaryAtLayerLevelAsImage           = False
0145 process.CondDataMonitoring.FillConditions_PSet.OutputSummaryProfileAtLayerLevelAsImage    = False
0146 process.CondDataMonitoring.FillConditions_PSet.OutputCumulativeSummaryAtLayerLevelAsImage = False
0147 process.CondDataMonitoring.FillConditions_PSet.HistoMaps_On     = False
0148 process.CondDataMonitoring.FillConditions_PSet.TkMap_On         = False
0149 process.CondDataMonitoring.FillConditions_PSet.ActiveDetIds_On  = True
0150 process.CondDataMonitoring.FillConditions_PSet.Mod_On           = True # Set to True if you want to have single module histograms
0151 process.CondDataMonitoring.FillConditions_PSet.restrictModules  = True 
0152 process.CondDataMonitoring.FillConditions_PSet.ModulesToBeIncluded = cms.vuint32(options.moduleList)
0153 
0154     
0155 process.CondDataMonitoring.SiStripPedestalsDQM_PSet.FillSummaryAtLayerLevel     = True
0156 process.CondDataMonitoring.SiStripNoisesDQM_PSet.FillSummaryAtLayerLevel        = True
0157     
0158 process.CondDataMonitoring.SiStripPedestalsDQM_PSet.CondObj_fillId     = 'ProfileAndCumul'    # Use 'ProfileAndCumul' if you want to have single module histograms
0159 process.CondDataMonitoring.SiStripNoisesDQM_PSet.CondObj_fillId        = 'ProfileAndCumul'      # Use 'ProfileAndCumul' if you want to have single module histograms
0160     
0161     
0162 process.CondDataMonitoring.SiStripPedestalsDQM_PSet.TkMap_On     = False
0163 process.CondDataMonitoring.SiStripPedestalsDQM_PSet.TkMapName    = 'PedestalTkMap.png'
0164 
0165 process.CondDataMonitoring.SiStripNoisesDQM_PSet.TkMap_On     = False
0166 process.CondDataMonitoring.SiStripNoisesDQM_PSet.TkMapName    = 'NoiseTkMap.png'
0167 process.CondDataMonitoring.SiStripNoisesDQM_PSet.Cumul_NchX        = cms.int32(150)
0168 process.CondDataMonitoring.SiStripNoisesDQM_PSet.Cumul_LowX        = cms.double(0.0)
0169 process.CondDataMonitoring.SiStripNoisesDQM_PSet.Cumul_HighX       = cms.double(15.0)
0170 process.CondDataMonitoring.SiStripNoisesDQM_PSet.GainRenormalisation               = cms.bool(options.gainNorm)
0171 process.CondDataMonitoring.SiStripNoisesDQM_PSet.SimGainRenormalisation               = cms.bool(options.simGainNorm)
0172 
0173 process.p1 = cms.Path(process.CondDataMonitoring)