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("Reader")
0006 
0007 options = VarParsing.VarParsing("analysis")
0008 
0009 options.register ('logDestination',
0010                   "",
0011                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0012                   VarParsing.VarParsing.varType.string,          # string, int, or float
0013                   "log file")
0014 options.register ('qualityLogDestination',
0015                   "",
0016                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0017                   VarParsing.VarParsing.varType.string,          # string, int, or float
0018                   "quality log file")
0019 options.register ('cablingLogDestination',
0020                   "",
0021                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0022                   VarParsing.VarParsing.varType.string,          # string, int, or float
0023                   "cabling log file")
0024 options.register ('condLogDestination',
0025                   "",
0026                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0027                   VarParsing.VarParsing.varType.string,          # string, int, or float
0028                   "conditions log file")
0029 options.register ('outputRootFile',
0030                   "",
0031                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0032                   VarParsing.VarParsing.varType.string,          # string, int, or float
0033                   "output root file")
0034 options.register ('connectionString',
0035                   "",
0036                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0037                   VarParsing.VarParsing.varType.string,          # string, int, or float
0038                   "connection string")
0039 options.register ('recordName',
0040                   "",
0041                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0042                   VarParsing.VarParsing.varType.string,          # string, int, or float
0043                   "record name")
0044 options.register ('recordForQualityName',
0045                   "SiStripDetCablingRcd",
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 ('LatencyMon',
0060                   False,
0061                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0062                   VarParsing.VarParsing.varType.bool,          # string, int, or float
0063                   "Monitor latency?")
0064 options.register ('ALCARecoTriggerBitsMon',
0065                   False,
0066                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0067                   VarParsing.VarParsing.varType.bool,          # string, int, or float
0068                   "Monitor ALCAReco trigger bits")
0069 options.register ('ShiftAndCrosstalkMon',
0070                   False,
0071                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0072                   VarParsing.VarParsing.varType.bool,          # string, int, or float
0073                   "Monitor shift and crosstalk?")
0074 options.register ('APVPhaseOffsetsMon',
0075                   False,
0076                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0077                   VarParsing.VarParsing.varType.bool,          # string, int, or float
0078                   "Monitor APV phase offsets?")
0079 options.register ('PedestalMon',
0080                   False,
0081                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0082                   VarParsing.VarParsing.varType.bool,          # string, int, or float
0083                   "Monitor pedestals?")
0084 options.register ('NoiseMon',
0085                   False,
0086                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0087                   VarParsing.VarParsing.varType.bool,          # string, int, or float
0088                   "Monitor noise?")
0089 options.register ('QualityMon',
0090                   False,
0091                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0092                   VarParsing.VarParsing.varType.bool,          # string, int, or float
0093                   "Monitor quality?")
0094 options.register ('CablingMon',
0095                   False,
0096                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0097                   VarParsing.VarParsing.varType.bool,          # string, int, or float
0098                   "Monitor cabling?")
0099 options.register ('GainMon',
0100                   False,
0101                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0102                   VarParsing.VarParsing.varType.bool,          # string, int, or float
0103                   "Monitor gain?")
0104 options.register ('LorentzAngleMon',
0105                   False,
0106                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0107                   VarParsing.VarParsing.varType.bool,          # string, int, or float
0108                   "Monitor LA?")
0109 options.register ('BackPlaneCorrectionMon',
0110                   False,
0111                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0112                   VarParsing.VarParsing.varType.bool,          # string, int, or float
0113                   "Monitor BP correction?")
0114 options.register ('ThresholdMon',
0115                   False,
0116                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0117                   VarParsing.VarParsing.varType.bool,          # string, int, or float
0118                   "Monitor thresholds?")
0119 options.register ('MonitorCumulative',
0120                   False,
0121                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0122                   VarParsing.VarParsing.varType.bool,          # string, int, or float
0123                   "Cumulative Monitoring?")
0124 options.register ('ActiveDetId',
0125                   False,
0126                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0127                   VarParsing.VarParsing.varType.bool,          # string, int, or float
0128                   "Active detid?")
0129 
0130 options.parseArguments()
0131 
0132 
0133 process.MessageLogger = cms.Service("MessageLogger",
0134                                     debugModules = cms.untracked.vstring(''),
0135                                     destinations = cms.untracked.vstring(options.logDestination,
0136                                                                          options.qualityLogDestination,
0137                                                                          options.cablingLogDestination,
0138                                                                          options.condLogDestination,
0139                                                                          'cerr'
0140                                                                          ), #Reader, cout
0141                                     categories = cms.untracked.vstring('SiStripQualityStatistics',
0142                                                                        'SiStripQualityDQM',
0143                                                                        'SiStripFedCablingReader',
0144                                                                        'DummyCondObjContentPrinter',
0145                                                                        ),
0146                                     cerr = cms.untracked.PSet(threshold = cms.untracked.string('WARNING'))
0147 )
0148 setattr(process.MessageLogger,options.logDestination,cms.untracked.PSet(threshold = cms.untracked.string('INFO')))
0149 setattr(process.MessageLogger,options.qualityLogDestination,cms.untracked.PSet(
0150     threshold = cms.untracked.string('INFO'),
0151     default = cms.untracked.PSet(limit=cms.untracked.int32(0)),
0152     SiStripQualityStatistics = cms.untracked.PSet(limit=cms.untracked.int32(100000))
0153 #    SiStripQualityDQM = cms.untracked.PSet(limit=cms.untracked.int32(100000))
0154     )
0155         )
0156 setattr(process.MessageLogger,options.cablingLogDestination,cms.untracked.PSet(
0157     threshold = cms.untracked.string('INFO'),
0158     default = cms.untracked.PSet(limit=cms.untracked.int32(0)),
0159     SiStripFedCablingReader = cms.untracked.PSet(limit=cms.untracked.int32(100000))
0160     )
0161         )
0162 setattr(process.MessageLogger,options.condLogDestination,cms.untracked.PSet(
0163     threshold = cms.untracked.string('INFO'),
0164     default = cms.untracked.PSet(limit=cms.untracked.int32(0)),
0165     DummyCondObjContentPrinter = cms.untracked.PSet(limit=cms.untracked.int32(100000))
0166     )
0167         )
0168 
0169 process.maxEvents = cms.untracked.PSet(
0170     input = cms.untracked.int32(-1)
0171 )
0172 
0173 process.source = cms.Source("EmptyIOVSource",
0174     firstValue = cms.uint64(options.runNumber),
0175     lastValue = cms.uint64(options.runNumber),
0176     timetype = cms.string('runnumber'),
0177     interval = cms.uint64(1)
0178 )
0179 
0180 #process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi")
0181 process.load('Configuration.Geometry.GeometryExtended2018_cff')
0182 process.TrackerTopologyEP = cms.ESProducer("TrackerTopologyEP")
0183 process.load("Geometry.TrackerGeometryBuilder.trackerParameters_cfi")
0184 
0185 process.poolDBESSource = cms.ESSource("PoolDBESSource",
0186    BlobStreamerName = cms.untracked.string('TBufferBlobStreamingService'),
0187    DBParameters = cms.PSet(
0188         messageLevel = cms.untracked.int32(1),  # it used to be 2
0189         authenticationPath = cms.untracked.string('/afs/cern.ch/cms/DB/conddb')
0190     ),
0191     timetype = cms.untracked.string('runnumber'),
0192     connect = cms.string(options.connectionString),
0193     toGet = cms.VPSet(cms.PSet(
0194         record = cms.string(options.recordName),
0195         tag = cms.string(options.tagName)
0196     ))
0197 )
0198 
0199 if options.LatencyMon == True:
0200     process.reader = cms.EDAnalyzer("SiStripLatencyDummyPrinter")
0201     process.p1 = cms.Path(process.reader)
0202 
0203 elif options.ShiftAndCrosstalkMon == True:
0204     process.reader = cms.EDAnalyzer("SiStripConfObjectDummyPrinter")
0205     process.p1 = cms.Path(process.reader)
0206 
0207 elif options.APVPhaseOffsetsMon == True:
0208     process.reader = cms.EDAnalyzer("SiStripConfObjectDummyPrinter")
0209     process.p1 = cms.Path(process.reader)
0210 
0211 elif options.ALCARecoTriggerBitsMon == True:
0212     process.AlCaRecoTriggerBitsRcdRead = cms.EDAnalyzer( "AlCaRecoTriggerBitsRcdRead"
0213                                                          , outputType  = cms.untracked.string( 'text' )
0214                                                          , rawFileName = cms.untracked.string( 'AlCaRecoTriggerBitsInfo_RuninsertRun' )
0215                                                          )
0216     process.p = cms.Path(process.AlCaRecoTriggerBitsRcdRead)
0217 
0218 else:
0219 
0220     process.DQMStore = cms.Service("DQMStore",
0221                                    verbose = cms.untracked.int32(1)
0222                                    )
0223 
0224     process.load("DQM.SiStripMonitorSummary.SiStripMonitorCondData_cfi")
0225 
0226     process.CondDataMonitoring.OutputFileName = options.outputRootFile
0227     process.CondDataMonitoring.MonitorSiStripPedestal      = options.PedestalMon
0228     process.CondDataMonitoring.MonitorSiStripNoise         = options.NoiseMon
0229     process.CondDataMonitoring.MonitorSiStripQuality       = options.QualityMon
0230     process.CondDataMonitoring.MonitorSiStripCabling       = options.CablingMon
0231     process.CondDataMonitoring.MonitorSiStripApvGain       = options.GainMon
0232     process.CondDataMonitoring.MonitorSiStripLorentzAngle  = options.LorentzAngleMon
0233     process.CondDataMonitoring.MonitorSiStripBackPlaneCorrection  = options.BackPlaneCorrectionMon
0234     process.CondDataMonitoring.MonitorSiStripLowThreshold  = options.ThresholdMon
0235     process.CondDataMonitoring.MonitorSiStripHighThreshold = options.ThresholdMon
0236     process.CondDataMonitoring.OutputMEsInRootFile         = True
0237     process.CondDataMonitoring.FillConditions_PSet.OutputSummaryAtLayerLevelAsImage           = True
0238     process.CondDataMonitoring.FillConditions_PSet.OutputSummaryProfileAtLayerLevelAsImage    = options.LorentzAngleMon or options.BackPlaneCorrectionMon # This should be saved only in case of LA (because for LA no SummaryAtLayerLevel is available)
0239     process.CondDataMonitoring.FillConditions_PSet.OutputCumulativeSummaryAtLayerLevelAsImage = options.MonitorCumulative
0240     process.CondDataMonitoring.FillConditions_PSet.HistoMaps_On     = False
0241     process.CondDataMonitoring.FillConditions_PSet.TkMap_On         = True # This is just for test until TkMap is included in all classes!!! Uncomment!!!!
0242     process.CondDataMonitoring.FillConditions_PSet.ActiveDetIds_On  = options.ActiveDetId # This should be set to False only for Lorentz Angle
0243     process.CondDataMonitoring.FillConditions_PSet.Mod_On           = False # Set to True if you want to have single module histograms
0244     
0245     process.CondDataMonitoring.SiStripPedestalsDQM_PSet.FillSummaryAtLayerLevel     = True
0246     process.CondDataMonitoring.SiStripNoisesDQM_PSet.FillSummaryAtLayerLevel        = True
0247     process.CondDataMonitoring.SiStripQualityDQM_PSet.FillSummaryAtLayerLevel       = True
0248     process.CondDataMonitoring.SiStripApvGainsDQM_PSet.FillSummaryAtLayerLevel      = True
0249     process.CondDataMonitoring.SiStripLowThresholdDQM_PSet.FillSummaryAtLayerLevel  = True
0250     process.CondDataMonitoring.SiStripHighThresholdDQM_PSet.FillSummaryAtLayerLevel = True
0251     
0252     process.CondDataMonitoring.SiStripCablingDQM_PSet.CondObj_fillId       = 'ProfileAndCumul'
0253     process.CondDataMonitoring.SiStripPedestalsDQM_PSet.CondObj_fillId     = 'onlyProfile'    # Use 'ProfileAndCumul' if you want to have single module histograms
0254     process.CondDataMonitoring.SiStripNoisesDQM_PSet.CondObj_fillId        = 'onlyCumul'      # Use 'ProfileAndCumul' if you want to have single module histograms
0255     process.CondDataMonitoring.SiStripQualityDQM_PSet.CondObj_fillId       = 'onlyProfile'
0256     process.CondDataMonitoring.SiStripApvGainsDQM_PSet.CondObj_fillId      = 'ProfileAndCumul'
0257     process.CondDataMonitoring.SiStripLorentzAngleDQM_PSet.CondObj_fillId  = 'ProfileAndCumul'
0258     process.CondDataMonitoring.SiStripBackPlaneCorrectionDQM_PSet.CondObj_fillId  = 'ProfileAndCumul'
0259     process.CondDataMonitoring.SiStripLowThresholdDQM_PSet.CondObj_fillId  = 'onlyProfile'
0260     process.CondDataMonitoring.SiStripHighThresholdDQM_PSet.CondObj_fillId = 'onlyProfile'
0261     
0262 ## --- TkMap specific Configurable options:
0263     
0264     process.CondDataMonitoring.SiStripQualityDQM_PSet.TkMap_On     = True
0265     process.CondDataMonitoring.SiStripQualityDQM_PSet.TkMapName    = 'QualityTkMap.png'
0266     process.CondDataMonitoring.SiStripQualityDQM_PSet.minValue     = 0.
0267     process.CondDataMonitoring.SiStripQualityDQM_PSet.maxValue     = 100. 
0268     
0269     process.CondDataMonitoring.SiStripCablingDQM_PSet.TkMap_On     = True
0270     process.CondDataMonitoring.SiStripCablingDQM_PSet.TkMapName    = 'CablingTkMap.png'
0271     process.CondDataMonitoring.SiStripCablingDQM_PSet.minValue     = 0.
0272     process.CondDataMonitoring.SiStripCablingDQM_PSet.maxValue     = 6.
0273     
0274     process.CondDataMonitoring.SiStripPedestalsDQM_PSet.TkMap_On     = True
0275     process.CondDataMonitoring.SiStripPedestalsDQM_PSet.TkMapName    = 'PedestalTkMap.png'
0276     process.CondDataMonitoring.SiStripPedestalsDQM_PSet.minValue     = 0.
0277     process.CondDataMonitoring.SiStripPedestalsDQM_PSet.maxValue     = 400.
0278     
0279     process.CondDataMonitoring.SiStripNoisesDQM_PSet.TkMap_On     = True
0280     process.CondDataMonitoring.SiStripNoisesDQM_PSet.TkMapName    = 'NoiseTkMap.png'
0281     process.CondDataMonitoring.SiStripNoisesDQM_PSet.minValue     = 3.
0282     process.CondDataMonitoring.SiStripNoisesDQM_PSet.maxValue     = 9.
0283     
0284     process.CondDataMonitoring.SiStripApvGainsDQM_PSet.TkMap_On     = True
0285     process.CondDataMonitoring.SiStripApvGainsDQM_PSet.TkMapName    = 'GainTkMap.png'
0286     process.CondDataMonitoring.SiStripApvGainsDQM_PSet.minValue     = 0.
0287     process.CondDataMonitoring.SiStripApvGainsDQM_PSet.maxValue     = 1.5
0288     
0289     process.CondDataMonitoring.SiStripLorentzAngleDQM_PSet.TkMap_On     = True
0290     process.CondDataMonitoring.SiStripLorentzAngleDQM_PSet.TkMapName    = 'LorentzAngleTkMap.png'
0291     process.CondDataMonitoring.SiStripLorentzAngleDQM_PSet.minValue     = 0.01
0292     process.CondDataMonitoring.SiStripLorentzAngleDQM_PSet.maxValue     = 0.03
0293     
0294     process.CondDataMonitoring.SiStripBackPlaneCorrectionDQM_PSet.TkMap_On     = True
0295     process.CondDataMonitoring.SiStripBackPlaneCorrectionDQM_PSet.TkMapName    = 'BackPlaneCorrectionTkMap.png'
0296     process.CondDataMonitoring.SiStripBackPlaneCorrectionDQM_PSet.minValue     = 0.00
0297     process.CondDataMonitoring.SiStripBackPlaneCorrectionDQM_PSet.maxValue     = 0.10
0298     
0299     process.CondDataMonitoring.SiStripLowThresholdDQM_PSet.TkMap_On     = True
0300     process.CondDataMonitoring.SiStripLowThresholdDQM_PSet.TkMapName     = 'LowThresholdTkMap.png'
0301     process.CondDataMonitoring.SiStripLowThresholdDQM_PSet.minValue     = 0.
0302     process.CondDataMonitoring.SiStripLowThresholdDQM_PSet.maxValue     = 10.
0303     
0304     process.CondDataMonitoring.SiStripHighThresholdDQM_PSet.TkMap_On     = True
0305     process.CondDataMonitoring.SiStripHighThresholdDQM_PSet.TkMapName     = 'HighThresholdTkMap.png'
0306     process.CondDataMonitoring.SiStripHighThresholdDQM_PSet.minValue     = 0.
0307     process.CondDataMonitoring.SiStripHighThresholdDQM_PSet.maxValue     = 10.
0308     
0309     
0310     process.p1 = cms.Path(process.CondDataMonitoring)
0311 
0312 # Additional analyzer if a bad channel tag has to be monitored
0313 if options.QualityMon == True:
0314     process.SiStripQualityESProducer = cms.ESProducer("SiStripQualityESProducer",
0315                                                       ReduceGranularity = cms.bool(False),
0316                                                       PrintDebugOutput = cms.bool(False),
0317                                                       UseEmptyRunInfo = cms.bool(False),
0318                                                       ListOfRecordToMerge = cms.VPSet(cms.PSet(
0319         record = cms.string(options.recordName),
0320         tag = cms.string('')
0321         ))
0322                                                       )
0323 
0324 # this module is almost useless since SiStripQualityDQM does all the job. If we want to remove it the log file has to be filled with SiStripQualityDQM
0325     from CalibTracker.SiStripQuality.siStripQualityStatistics_cfi import siStripQualityStatistics
0326     process.stat = siStripQualityStatistics.clone()
0327 
0328     process.e = cms.EndPath(process.stat)
0329 
0330 if options.CablingMon == True:
0331     process.SiStripQualityESProducer = cms.ESProducer("SiStripQualityESProducer",
0332                                                       ReduceGranularity = cms.bool(False),
0333                                                       PrintDebugOutput = cms.bool(False),
0334                                                       UseEmptyRunInfo = cms.bool(False),
0335                                                       ListOfRecordToMerge = cms.VPSet(cms.PSet(
0336         record = cms.string(options.recordForQualityName),
0337         tag = cms.string('')
0338         ))
0339                                                       )
0340 
0341     process.sistripconn = cms.ESProducer("SiStripConnectivity")
0342 
0343 
0344     from CalibTracker.SiStripQuality.siStripQualityStatistics_cfi import siStripQualityStatistics
0345     process.stat = siStripQualityStatistics.clone()
0346     
0347     process.reader = cms.EDAnalyzer("SiStripFedCablingReader")
0348     
0349     process.e = cms.EndPath(process.stat*process.reader)