diff --git a/DQM/BeamMonitor/test/BuildFile.xml b/DQM/BeamMonitor/test/BuildFile.xml
index 251c19af39115..32131ce1cbfd0 100644
--- a/DQM/BeamMonitor/test/BuildFile.xml
+++ b/DQM/BeamMonitor/test/BuildFile.xml
@@ -2,3 +2,7 @@
+
+
+
+
diff --git a/DQM/BeamMonitor/test/Online_BeamMonitor_file.py b/DQM/BeamMonitor/test/Online_BeamMonitor_file.py
index 84f9419dea393..516374aceb762 100644
--- a/DQM/BeamMonitor/test/Online_BeamMonitor_file.py
+++ b/DQM/BeamMonitor/test/Online_BeamMonitor_file.py
@@ -1,12 +1,25 @@
import FWCore.ParameterSet.Config as cms
-process = cms.Process("DQM")
-process.load("FWCore.MessageLogger.MessageLogger_cfi")
+import FWCore.ParameterSet.VarParsing as VarParsing
+options = VarParsing.VarParsing()
+options.register("runNumber",
+ 326479,
+ VarParsing.VarParsing.multiplicity.singleton,
+ VarParsing.VarParsing.varType.int,
+ "")
+options.register("maxEvents",
+ -1,
+ VarParsing.VarParsing.multiplicity.singleton,
+ VarParsing.VarParsing.varType.int,
+ "number of events to run")
+options.parseArguments()
+process = cms.Process("DQM")
process.load("CondCore.CondDB.CondDB_cfi")
process.BeamSpotDBSource = cms.ESSource("PoolDBESSource",
process.CondDB,
+ DumpStat = cms.untracked.bool(True),
toGet = cms.VPSet(
cms.PSet(
record = cms.string('BeamSpotOnlineLegacyObjectsRcd'),
@@ -19,9 +32,10 @@
refreshTime = cms.uint64(2)
),
- ),
+ ),
)
process.BeamSpotDBSource.connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS')
+
import RecoVertex.BeamSpotProducer.onlineBeamSpotESProducer_cfi as _mod
process.BeamSpotESProducer = _mod.onlineBeamSpotESProducer.clone(
timeThreshold = 999999 # for express allow >48h old payloads for replays. DO NOT CHANGE
@@ -29,35 +43,32 @@
# initialize MessageLogger
process.load("FWCore.MessageLogger.MessageLogger_cfi")
+#process.MessageLogger.cout.enableStatistics = cms.untracked.bool(True)
+# process.MessageLogger.cerr = cms.untracked.PSet(enable = cms.untracked.bool(False))
-process.MessageLogger.cerr = cms.untracked.PSet(enable = cms.untracked.bool(False))
process.MessageLogger.cout = cms.untracked.PSet(
threshold = cms.untracked.string('INFO'),
default = cms.untracked.PSet(
- limit = cms.untracked.int32(0)
+ limit = cms.untracked.int32(1)
),
OnlineBeamMonitor = cms.untracked.PSet(
reportEvery = cms.untracked.int32(1), # every 1000th only
- limit = cms.untracked.int32(0)
- )
-)
-#process.MessageLogger.cout.enableStatistics = cms.untracked.bool(True)
+ limit = cms.untracked.int32(0)
+ ))
+
process.source = cms.Source("EmptySource")
process.source.numberEventsInRun=cms.untracked.uint32(100)
-process.source.firstRun = cms.untracked.uint32(346512)
-process.source.firstLuminosityBlock = cms.untracked.uint32(614)
+process.source.firstRun = cms.untracked.uint32(options.runNumber)
+process.source.firstLuminosityBlock = cms.untracked.uint32(1)
process.source.numberEventsInLuminosityBlock = cms.untracked.uint32(1)
-process.maxEvents = cms.untracked.PSet(
- input = cms.untracked.int32(100)
-)
+process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(options.maxEvents))
#process.load("DQMServices.Core.DQMEDAnalyzer")
process.onlineBeamMonitor = cms.EDProducer("OnlineBeamMonitor",
-MonitorName = cms.untracked.string("onlineBeamMonitor"),
-AppendRunToFileName = cms.untracked.bool(False),
-WriteDIPAscii = cms.untracked.bool(True),
-DIPFileName = cms.untracked.string("BeamFitResultsForDIP.txt")
-)
+ MonitorName = cms.untracked.string("onlineBeamMonitor"),
+ AppendRunToFileName = cms.untracked.bool(False),
+ WriteDIPAscii = cms.untracked.bool(True),
+ DIPFileName = cms.untracked.string("BeamFitResultsForDIP.txt"))
# DQM Live Environment
@@ -68,8 +79,6 @@
process.dqmEnvPixelLess = process.dqmEnv.clone()
process.dqmEnvPixelLess.subSystemFolder = 'BeamMonitor_PixelLess'
-
-
#import RecoVertex.BeamSpotProducer.BeamSpotOnline_cfi
#process.offlineBeamSpotForDQM = RecoVertex.BeamSpotProducer.BeamSpotOnline_cfi.onlineBeamSpotProducer.clone()
@@ -82,5 +91,8 @@
)
-process.pp = cms.Path(process.onlineBeamMonitor+process.dqmSaver)
+#process.Tracer = cms.Service("Tracer")
+
+process.dqmcommon = cms.Sequence(process.dqmEnv*process.dqmSaver*process.dqmSaverPB)
+process.pp = cms.Path(process.onlineBeamMonitor+process.dqmcommon)
process.schedule = cms.Schedule(process.pp)
diff --git a/DQM/BeamMonitor/test/runTest.cpp b/DQM/BeamMonitor/test/runTest.cpp
new file mode 100644
index 0000000000000..2f0e0c40064da
--- /dev/null
+++ b/DQM/BeamMonitor/test/runTest.cpp
@@ -0,0 +1,2 @@
+#include "FWCore/Utilities/interface/TestHelper.h"
+RUNTEST()
diff --git a/DQM/BeamMonitor/test/testOnlineBeamMonitor.sh b/DQM/BeamMonitor/test/testOnlineBeamMonitor.sh
new file mode 100755
index 0000000000000..da9d3c8280fcd
--- /dev/null
+++ b/DQM/BeamMonitor/test/testOnlineBeamMonitor.sh
@@ -0,0 +1,6 @@
+#! /bin/bash
+
+function die { echo $1: status $2 ; exit $2; }
+
+echo "TESTING OnlineBeamMonitor ..."
+cmsRun ${LOCAL_TEST_DIR}/Online_BeamMonitor_file.py maxEvents=10 || die "Failure running Online_BeamMonitor_file.py" $?