File indexing completed on 2024-09-07 04:36:02
0001 from __future__ import print_function
0002 import FWCore.ParameterSet.Config as cms
0003
0004
0005
0006 BSOnlineRecordName = 'BeamSpotOnlineLegacyObjectsRcd'
0007 BSOnlineTag = 'BeamSpotOnlineLegacy'
0008 BSOnlineJobName = 'BeamSpotOnlineLegacy'
0009 BSOnlineOmsServiceUrl = 'http://cmsoms-eventing.cms:9949/urn:xdaq-application:lid=100/getRunAndLumiSection'
0010 useLockRecords = True
0011
0012 import sys
0013 if 'runkey=hi_run' in sys.argv:
0014 from Configuration.Eras.Era_Run3_pp_on_PbPb_approxSiStripClusters_cff import Run3_pp_on_PbPb_approxSiStripClusters
0015 process = cms.Process("BeamMonitorLegacy", Run3_pp_on_PbPb_approxSiStripClusters)
0016 else:
0017 from Configuration.Eras.Era_Run3_cff import Run3
0018 process = cms.Process("BeamMonitorLegacy", Run3)
0019
0020 process.load('FWCore.MessageService.MessageLogger_cfi')
0021 process.MessageLogger.debugModules = cms.untracked.vstring('*')
0022 process.MessageLogger.cerr = cms.untracked.PSet(
0023 threshold = cms.untracked.string('WARNING')
0024 )
0025
0026
0027 live = True
0028 unitTest = False
0029
0030 if 'unitTest=True' in sys.argv:
0031 live=False
0032 unitTest=True
0033 useLockRecords = False
0034
0035
0036
0037 if unitTest:
0038 process.load("DQM.Integration.config.unittestinputsource_cfi")
0039 from DQM.Integration.config.unittestinputsource_cfi import options
0040 elif live:
0041 process.load("DQM.Integration.config.inputsource_cfi")
0042 from DQM.Integration.config.inputsource_cfi import options
0043 else:
0044 process.load("DQM.Integration.config.fileinputsource_cfi")
0045 from DQM.Integration.config.fileinputsource_cfi import options
0046
0047
0048
0049 process.hltTriggerTypeFilter = cms.EDFilter("HLTTriggerTypeFilter",
0050 SelectedTriggerType = cms.int32(1)
0051 )
0052
0053
0054
0055 process.load("DQM.Integration.config.environment_cfi")
0056 process.dqmEnv.subSystemFolder = 'BeamMonitorLegacy'
0057 process.dqmSaver.tag = 'BeamMonitorLegacy'
0058 process.dqmSaver.runNumber = options.runNumber
0059 process.dqmSaverPB.tag = 'BeamMonitorLegacy'
0060 process.dqmSaverPB.runNumber = options.runNumber
0061
0062 process.dqmEnvPixelLess = process.dqmEnv.clone(
0063 subSystemFolder = 'BeamMonitor_PixelLess'
0064 )
0065
0066
0067 if process.isDqmPlayback.value :
0068 BSOnlineTag = BSOnlineTag + 'Playback'
0069 BSOnlineJobName = BSOnlineJobName + 'Playback'
0070 BSOnlineOmsServiceUrl = ''
0071 useLockRecords = False
0072
0073
0074
0075
0076 if (live):
0077 process.load("DQM.Integration.config.FrontierCondition_GT_cfi")
0078 process.GlobalTag.DBParameters.authenticationPath = '.'
0079 else:
0080 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0081 from Configuration.AlCa.GlobalTag import GlobalTag as gtCustomise
0082 process.GlobalTag = gtCustomise(process.GlobalTag, 'auto:run3_data', '')
0083 process.GlobalTag.DBParameters.authenticationPath = '.'
0084
0085
0086
0087
0088
0089
0090 import RecoVertex.BeamSpotProducer.onlineBeamSpotESProducer_cfi as _mod
0091 process.BeamSpotESProducer = _mod.onlineBeamSpotESProducer.clone()
0092
0093
0094 if ((not live) or process.isDqmPlayback.value):
0095 process.BeamSpotESProducer.timeThreshold = cms.int32(int(1e6))
0096
0097 import RecoVertex.BeamSpotProducer.BeamSpotOnline_cfi
0098 process.offlineBeamSpot = RecoVertex.BeamSpotProducer.BeamSpotOnline_cfi.onlineBeamSpotProducer.clone()
0099
0100
0101
0102 process.load("DQM.BeamMonitor.BeamMonitor_Pixel_cff")
0103 process.load("DQM.BeamMonitor.BeamSpotProblemMonitor_cff")
0104 process.load("DQM.BeamMonitor.BeamConditionsMonitor_cff")
0105
0106 if process.dqmRunConfig.type.value() == "production":
0107 process.dqmBeamMonitor.BeamFitter.WriteAscii = True
0108 process.dqmBeamMonitor.BeamFitter.AsciiFileName = '/nfshome0/yumiceva/BeamMonitorDQM/BeamFitResultsOld.txt'
0109 process.dqmBeamMonitor.BeamFitter.WriteDIPAscii = True
0110 process.dqmBeamMonitor.BeamFitter.DIPFileName = '/nfshome0/dqmpro/BeamMonitorDQM/BeamFitResultsOld.txt'
0111 else:
0112 process.dqmBeamMonitor.BeamFitter.WriteAscii = False
0113 process.dqmBeamMonitor.BeamFitter.AsciiFileName = '/nfshome0/yumiceva/BeamMonitorDQM/BeamFitResultsOld.txt'
0114 process.dqmBeamMonitor.BeamFitter.WriteDIPAscii = True
0115 if (live):
0116 process.dqmBeamMonitor.BeamFitter.DIPFileName = '/nfshome0/dqmdev/BeamMonitorDQM/BeamFitResultsOld.txt'
0117 else:
0118 process.dqmBeamMonitor.BeamFitter.DIPFileName = 'BeamFitResultsOld.txt'
0119
0120
0121
0122 process.load("Configuration.StandardSequences.GeometryRecoDB_cff")
0123 process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff')
0124 process.load("Configuration.StandardSequences.RawToDigi_Data_cff")
0125 process.load("RecoLocalTracker.Configuration.RecoLocalTracker_cff")
0126 process.load("TrackingTools.TransientTrack.TransientTrackBuilder_cfi")
0127 from RecoTracker.PixelLowPtUtilities.siPixelClusterShapeCache_cfi import *
0128 process.siPixelClusterShapeCachePreSplitting = siPixelClusterShapeCache.clone(
0129 src = 'siPixelClustersPreSplitting'
0130 )
0131 process.load("RecoLocalTracker.SiPixelRecHits.PixelCPEGeneric_cfi")
0132
0133
0134
0135
0136 process.pixelTracksCutClassifier = cms.EDProducer( "TrackCutClassifier",
0137 src = cms.InputTag( "pixelTracks" ),
0138 beamspot = cms.InputTag( "offlineBeamSpot" ),
0139 vertices = cms.InputTag( "" ),
0140 qualityCuts = cms.vdouble( -0.7, 0.1, 0.7 ),
0141 mva = cms.PSet(
0142 minPixelHits = cms.vint32( 0, 3, 3 ),
0143 maxDzWrtBS = cms.vdouble( 3.40282346639E38, 3.40282346639E38, 60.0 ),
0144 dr_par = cms.PSet(
0145 d0err = cms.vdouble( 0.003, 0.003, 3.40282346639E38 ),
0146 dr_par2 = cms.vdouble( 0.3, 0.3, 3.40282346639E38 ),
0147 dr_par1 = cms.vdouble( 0.4, 0.4, 3.40282346639E38 ),
0148 dr_exp = cms.vint32( 4, 4, 4 ),
0149 d0err_par = cms.vdouble( 0.001, 0.001, 3.40282346639E38 )
0150 ),
0151 maxLostLayers = cms.vint32( 99, 99, 99 ),
0152 min3DLayers = cms.vint32( 0, 2, 3 ),
0153 dz_par = cms.PSet(
0154 dz_par1 = cms.vdouble( 0.4, 0.4, 3.40282346639E38 ),
0155 dz_par2 = cms.vdouble( 0.35, 0.35, 3.40282346639E38 ),
0156 dz_exp = cms.vint32( 4, 4, 4 )
0157 ),
0158 minNVtxTrk = cms.int32( 3 ),
0159 maxDz = cms.vdouble( 3.40282346639E38, 3.40282346639E38, 3.40282346639E38 ),
0160 minNdof = cms.vdouble( 1.0E-5, 1.0E-5, 1.0E-5 ),
0161 maxChi2 = cms.vdouble( 9999., 9999., 30.0 ),
0162 maxDr = cms.vdouble( 99., 99., 1. ),
0163 minLayers = cms.vint32( 0, 2, 3 )
0164 ),
0165 ignoreVertices = cms.bool( True ),
0166 )
0167
0168
0169 process.pixelTracksHP = cms.EDProducer( "TrackCollectionFilterCloner",
0170 minQuality = cms.string( "highPurity" ),
0171 copyExtras = cms.untracked.bool( True ),
0172 copyTrajectories = cms.untracked.bool( False ),
0173 originalSource = cms.InputTag( "pixelTracks" ),
0174 originalQualVals = cms.InputTag( 'pixelTracksCutClassifier','QualityMasks' ),
0175 originalMVAVals = cms.InputTag( 'pixelTracksCutClassifier','MVAValues' )
0176 )
0177
0178
0179
0180
0181 import DQM.TrackingMonitor.TrackerCollisionTrackingMonitor_cfi
0182 process.pixelTracksMonitor = DQM.TrackingMonitor.TrackerCollisionTrackingMonitor_cfi.TrackerCollisionTrackMon.clone(
0183 FolderName = 'BeamMonitorLegacy/Tracking/pixelTracks',
0184 TrackProducer = 'pixelTracks',
0185 allTrackProducer = 'pixelTracks',
0186 beamSpot = "offlineBeamSpot",
0187 primaryVertex = "pixelVertices",
0188
0189 doAllPlots = False,
0190 doLumiAnalysis = False,
0191 doProfilesVsLS = True,
0192 doDCAPlots = True,
0193 doPlotsVsGoodPVtx = True,
0194
0195 doEffFromHitPatternVsPU = False,
0196 doEffFromHitPatternVsBX = True,
0197 doEffFromHitPatternVsLUMI = False,
0198 doPlotsVsLUMI = True,
0199 doPlotsVsBX = True,
0200
0201 AbsDxyMax = 1.2,
0202 AbsDxyBin = 12,
0203 DxyMin = -1.2,
0204 DxyMax = 1.2,
0205 DxyBin = 60,
0206
0207 Chi2NDFMax = 35.,
0208 Chi2NDFMin = 0.,
0209 Chi2NDFBin = 70,
0210
0211 VZBin = 124,
0212 VZMin = -62.,
0213 VZMax = 62.,
0214
0215 TrackPtMin = 0.,
0216 TrackPtMax = 50.,
0217 TrackPtBin = 250
0218 )
0219
0220 process.tracks2monitor = cms.EDFilter('TrackSelector',
0221 src = cms.InputTag('pixelTracks'),
0222 cut = cms.string("")
0223 )
0224 process.tracks2monitor.src = 'pixelTracksHP'
0225 process.tracks2monitor.cut = 'pt > 1 & abs(eta) < 2.4'
0226
0227
0228
0229 process.selectedPixelTracksMonitor = process.pixelTracksMonitor.clone(
0230 FolderName = 'BeamMonitorLegacy/Tracking/selectedPixelTracks',
0231 TrackProducer = 'tracks2monitor',
0232 allTrackProducer = 'tracks2monitor'
0233 )
0234
0235 process.selectedPixelTracksMonitorSequence = cms.Sequence(
0236 process.pixelTracksCutClassifier
0237 + process.pixelTracksHP
0238 + process.tracks2monitor
0239 + process.selectedPixelTracksMonitor
0240 )
0241
0242
0243
0244
0245
0246
0247 process.dqmTKStatus = cms.EDAnalyzer("TKStatus",
0248 BeamFitter = cms.PSet(
0249 DIPFileName = process.dqmBeamMonitor.BeamFitter.DIPFileName
0250 )
0251 )
0252
0253
0254 process.dqmcommon = cms.Sequence(process.dqmEnv
0255 * process.dqmSaver*process.dqmSaverPB)
0256
0257
0258 process.monitor = cms.Sequence(process.dqmBeamMonitor
0259 + process.selectedPixelTracksMonitorSequence)
0260
0261
0262
0263
0264
0265 process.dqmBeamSpotProblemMonitor.monitorName = "BeamMonitorLegacy/BeamSpotProblemMonitor"
0266 process.dqmBeamSpotProblemMonitor.AlarmONThreshold = 15
0267 process.dqmBeamSpotProblemMonitor.AlarmOFFThreshold = 17
0268 process.dqmBeamSpotProblemMonitor.nCosmicTrk = 10
0269 process.dqmBeamSpotProblemMonitor.doTest = False
0270 process.dqmBeamSpotProblemMonitor.pixelTracks = 'pixelTracks'
0271
0272
0273 from DQMServices.Core.DQMQualityTester import DQMQualityTester
0274 process.qTester = DQMQualityTester(
0275 qtList = cms.untracked.FileInPath('DQM/BeamMonitor/test/BeamSpotAvailableTest.xml'),
0276 prescaleFactor = cms.untracked.int32(1),
0277 qtestOnEndLumi = cms.untracked.bool(True),
0278 testInEventloop = cms.untracked.bool(False),
0279 verboseQT = cms.untracked.bool(True)
0280 )
0281
0282
0283 process.BeamSpotProblemModule = cms.Sequence(process.qTester
0284 * process.dqmBeamSpotProblemMonitor)
0285
0286
0287 if ( process.runType.getRunType() == process.runType.cosmic_run or
0288 process.runType.getRunType() == process.runType.cosmic_run_stage1):
0289 process.dqmBeamSpotProblemMonitor.AlarmOFFThreshold = 5
0290
0291
0292
0293 from DQM.Integration.config.online_customizations_cfi import *
0294 process = customise(process)
0295
0296
0297 from EventFilter.OnlineMetaDataRawToDigi.tcdsRawToDigi_cfi import *
0298 process.tcdsDigis = tcdsRawToDigi.clone()
0299
0300
0301
0302 if (process.runType.getRunType() == process.runType.hi_run and live):
0303 rawDataInputTag = "rawDataRepacker"
0304 else:
0305 rawDataInputTag = "rawDataCollector"
0306
0307 process.castorDigis.InputLabel = rawDataInputTag
0308 process.csctfDigis.producer = rawDataInputTag
0309 process.dttfDigis.DTTF_FED_Source = rawDataInputTag
0310 process.ecalDigisCPU.InputLabel = rawDataInputTag
0311 process.ecalPreshowerDigis.sourceTag = rawDataInputTag
0312 process.gctDigis.inputLabel = rawDataInputTag
0313 process.gtDigis.DaqGtInputTag = rawDataInputTag
0314 process.hcalDigis.InputLabel = rawDataInputTag
0315 process.muonCSCDigis.InputObjects = rawDataInputTag
0316 process.muonDTDigis.inputLabel = rawDataInputTag
0317 process.muonRPCDigis.InputLabel = rawDataInputTag
0318 process.scalersRawToDigi.scalersInputTag = rawDataInputTag
0319 process.siPixelDigis.cpu.InputLabel = rawDataInputTag
0320 process.siStripDigis.ProductLabel = rawDataInputTag
0321 process.tcdsDigis.InputLabel = rawDataInputTag
0322
0323 process.load("RecoVertex.BeamSpotProducer.BeamSpot_cfi")
0324
0325 process.dqmBeamMonitor.OnlineMode = True
0326 process.dqmBeamMonitor.monitorName = "BeamMonitorLegacy"
0327 process.dqmBeamMonitor.recordName = BSOnlineRecordName
0328 process.dqmBeamMonitor.useLockRecords = useLockRecords
0329
0330 process.dqmBeamMonitor.resetEveryNLumi = 5
0331 process.dqmBeamMonitor.resetPVEveryNLumi = 5
0332
0333 process.dqmBeamMonitor.PVFitter.minNrVerticesForFit = 20
0334 process.dqmBeamMonitor.PVFitter.minVertexNdf = 10
0335 process.dqmBeamMonitor.PVFitter.errorScale = 1.2
0336
0337
0338
0339 process.load("RecoVertex.Configuration.RecoPixelVertexing_cff")
0340 from RecoVertex.PrimaryVertexProducer.OfflinePixel3DPrimaryVertices_cfi import *
0341 process.pixelVertices = pixelVertices.clone(
0342 TkFilterParameters = dict( minPt = process.pixelTracksTrackingRegions.RegionPSet.ptMin)
0343 )
0344
0345 process.pixelTracksTrackingRegions.RegionPSet.originRadius = 0.4
0346
0347
0348
0349
0350
0351
0352 process.tracking_FirstStep = cms.Sequence(
0353 process.siPixelDigis
0354 * process.siStripDigis
0355 * process.striptrackerlocalreco
0356 * process.offlineBeamSpot
0357 * process.siPixelClustersPreSplitting
0358 * process.siPixelRecHitsPreSplitting
0359 * process.siPixelClusterShapeCachePreSplitting
0360 * process.recopixelvertexing)
0361
0362
0363
0364 process.dqmBeamMonitor.jetTrigger = [
0365 "HLT_PAZeroBias_v", "HLT_ZeroBias_v", "HLT_QuadJet",
0366 "HLT_ZeroBias_",
0367 "HLT_HI",
0368 "HLT_PixelClusters"]
0369
0370
0371 if (process.runType.getRunType() == process.runType.hi_run):
0372 import HLTrigger.special.hltPixelActivityFilter_cfi
0373 process.multFilter = HLTrigger.special.hltPixelActivityFilter_cfi.hltPixelActivityFilter.clone(
0374 inputTag = 'siPixelClustersPreSplitting',
0375 minClusters = 150,
0376 maxClusters = 50000
0377 )
0378
0379 process.filter_step = cms.Sequence( process.siPixelDigis
0380 * process.siPixelClustersPreSplitting
0381 * process.multFilter
0382 )
0383
0384 process.dqmBeamMonitor.hltResults = "TriggerResults::HLT"
0385
0386
0387
0388 if unitTest == False:
0389 process.OnlineDBOutputService = cms.Service("OnlineDBOutputService",
0390
0391 DBParameters = cms.PSet(
0392 messageLevel = cms.untracked.int32(0),
0393 authenticationPath = cms.untracked.string('.')
0394 ),
0395
0396
0397 connect = cms.string('oracle://cms_orcon_prod/CMS_CONDITIONS'),
0398 preLoadConnectionString = cms.untracked.string('frontier://FrontierProd/CMS_CONDITIONS'),
0399
0400 runNumber = cms.untracked.uint64(options.runNumber),
0401 omsServiceUrl = cms.untracked.string(BSOnlineOmsServiceUrl),
0402 latency = cms.untracked.uint32(2),
0403 autoCommit = cms.untracked.bool(True),
0404 saveLogsOnDB = cms.untracked.bool(True),
0405 jobName = cms.untracked.string(BSOnlineJobName),
0406 toPut = cms.VPSet(cms.PSet(
0407 record = cms.string(BSOnlineRecordName),
0408 tag = cms.string(BSOnlineTag),
0409 timetype = cms.untracked.string('Lumi'),
0410 onlyAppendUpdatePolicy = cms.untracked.bool(True)
0411 )),
0412 frontierKey = cms.untracked.string(options.runUniqueKey)
0413 )
0414
0415 else:
0416 process.OnlineDBOutputService = cms.Service("OnlineDBOutputService",
0417
0418 DBParameters = cms.PSet(
0419 messageLevel = cms.untracked.int32(0),
0420 authenticationPath = cms.untracked.string('.')
0421 ),
0422
0423
0424 connect = cms.string('sqlite_file:BeamSpotOnlineLegacy.db'),
0425 preLoadConnectionString = cms.untracked.string('sqlite_file:BeamSpotOnlineLegacy.db'),
0426 runNumber = cms.untracked.uint64(options.runNumber),
0427 lastLumiFile = cms.untracked.string('last_lumi.txt'),
0428 latency = cms.untracked.uint32(2),
0429 autoCommit = cms.untracked.bool(True),
0430 toPut = cms.VPSet(cms.PSet(
0431 record = cms.string(BSOnlineRecordName),
0432 tag = cms.string(BSOnlineTag),
0433 timetype = cms.untracked.string('Lumi'),
0434 onlyAppendUpdatePolicy = cms.untracked.bool(True)
0435 )),
0436 frontierKey = cms.untracked.string(options.runUniqueKey)
0437 )
0438 print("Configured frontierKey", options.runUniqueKey)
0439
0440
0441
0442
0443 process.pixelTrackerHVOn = cms.EDFilter( "DetectorStateFilter",
0444 DCSRecordLabel = cms.untracked.InputTag( "onlineMetaDataDigis" ),
0445 DcsStatusLabel = cms.untracked.InputTag( "scalersRawToDigi" ),
0446 DebugOn = cms.untracked.bool( False ),
0447 DetectorType = cms.untracked.string( "pixel" )
0448 )
0449
0450
0451
0452 if (not process.runType.getRunType() == process.runType.hi_run):
0453 process.p = cms.Path(process.scalersRawToDigi
0454 * process.tcdsDigis
0455 * process.onlineMetaDataDigis
0456 * process.pixelTrackerHVOn
0457 * process.dqmTKStatus
0458 * process.hltTriggerTypeFilter
0459 * process.dqmcommon
0460 * process.tracking_FirstStep
0461 * process.monitor
0462 * process.BeamSpotProblemModule)
0463 else:
0464 process.p = cms.Path(process.scalersRawToDigi
0465 * process.tcdsDigis
0466 * process.onlineMetaDataDigis
0467 * process.pixelTrackerHVOn
0468 * process.dqmTKStatus
0469 * process.hltTriggerTypeFilter
0470 * process.filter_step
0471 * process.dqmcommon
0472 * process.tracking_FirstStep
0473 * process.monitor
0474 * process.BeamSpotProblemModule)
0475
0476 print("Global Tag used:", process.GlobalTag.globaltag.value())
0477 print("Final Source settings:", process.source)
0478