31 scalertag_{consumes<BeamSpotOnlineCollection>(ps.getUntrackedParameter<
InputTag>(
"scalarBSCollection"))},
32 trkSrc_{consumes<reco::TrackCollection>(ps.getUntrackedParameter<
InputTag>(
"pixelTracks"))},
34 nCosmicTrk_{ps.getUntrackedParameter<
int>(
"nCosmicTrk")},
36 debug_{ps.getUntrackedParameter<
bool>(
"Debug")},
37 onlineMode_{ps.getUntrackedParameter<
bool>(
"OnlineMode")},
38 doTest_{ps.getUntrackedParameter<
bool>(
"doTest")},
39 alarmONThreshold_{ps.getUntrackedParameter<
int>(
"AlarmONThreshold")},
40 alarmOFFThreshold_{ps.getUntrackedParameter<
int>(
"AlarmOFFThreshold")},
47 monitorName_ = ps.getUntrackedParameter<
string>(
"monitorName");
49 if (not monitorName_.empty())
55 desc.addUntracked<
string>(
"monitorName",
"BeamSpotProblemMonitor");
59 desc.addUntracked<
int>(
"nCosmicTrk", 10);
60 desc.addUntracked<
bool>(
"Debug",
false);
61 desc.addUntracked<
bool>(
"OnlineMode",
true);
62 desc.addUntracked<
bool>(
"doTest",
false);
63 desc.addUntracked<
int>(
"AlarmONThreshold", 10);
64 desc.addUntracked<
int>(
"AlarmOFFThreshold", 40);
66 oDesc.
add(
"dqmBeamSpotProblemMonitor",
desc);
74 const string coord{
"BeamSpotStatus"};
76 string histName(coord +
"_lumi");
78 const string ytitle(
"Problem (-1) / OK (1)");
79 const string xtitle(
"Lumisection");
95 beamSpotError_ = iB.
book1D(
"BeamSpotError",
"ERROR: Beamspot missing from scalars", 20, 0.5, 20.5);
108 edm::LogInfo(
"BeamSpotProblemMonitor") <<
"dqmBeginLuminosityBlock:: Next Lumi to Fit: " <<
nextlumi_ << endl;
114 edm::LogInfo(
"BeamSpotProblemMonitor") <<
" dqmBeginLuminosityBlock:: Next Lumi to Fit: " <<
nextlumi_ << endl;
119 edm::LogInfo(
"BeamSpotProblemMonitor") <<
" dqmBeginLuminosityBlock:: Begin of Lumi: " << nthlumi << endl;
124 const int nthlumi =
iEvent.luminosityBlock();
127 edm::LogInfo(
"BeamSpotProblemMonitor") <<
"analyze:: Spilt event from previous lumi section!" << std::endl;
131 edm::LogInfo(
"BeamSpotProblemMonitor") <<
"analyze:: Spilt event from next lumi section!!!" << std::endl;
140 std::array<bool, 6> dcsTk;
141 for (
auto&
e : dcsTk) {
144 for (
auto const&
status : *dcsStatus) {
160 for (
auto status : dcsTk) {
171 if (
track.pt() > 1.0)
184 bool fallBackToDB =
false;
187 if (!handleScaler->empty()) {
188 spotOnline = *(handleScaler->begin());
191 if (spotOnline.
x() == 0. && spotOnline.
y() == 0. && spotOnline.
z() == 0. && spotOnline.
width_x() == 0. &&
202 if (allTkOn && fallBackToDB) {
205 if (allTkOn && (!fallBackToDB)) {
221 int currentlumi = nextlumi;
222 lastlumi = currentlumi;
243 int LSgap_bs = currentlumi /
fitNLumi_ - countLS_bs;
248 for (
int ig = 0; ig < LSgap_bs; ig++) {
270 if (beamSpotQReport) {
283 <<
"dqmEndLuminosityBlock:: Lumi of the last event before dqmEndLuminosityBlock: " << nthlumi << endl;
289 edm::LogInfo(
"BeamSpotProblemMonitor") <<
"dqmEndRun:: Clearing all the Maps " << endl;
const edm::EDGetTokenT< BeamSpotOnlineCollection > scalertag_
LuminosityBlockNumber_t luminosityBlock() const
void dqmEndRun(const edm::Run &r, const edm::EventSetup &c) override
virtual void setCurrentFolder(std::string const &fullpath)
MonitorElement * beamSpotStatusLumi_
static void fillDescriptions(edm::ConfigurationDescriptions &)
void fillPlots(int &, int &, int)
#define DEFINE_FWK_MODULE(type)
MonitorElement * beamSpotStatusLumiAll_
T getUntrackedParameter(std::string const &, T const &) const
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
DQM_DEPRECATED void ShiftFillLast(double y, double ye=0., int32_t xscale=1)
BeamSpotProblemMonitor(const edm::ParameterSet &)
void bookHistograms(DQMStore::IBooker &i, const edm::Run &r, const edm::EventSetup &c) override
void analyze(const edm::Event &e, const edm::EventSetup &c) override
const MonitorElementData::QReport * getQReport(const std::string &qtname) const
get QReport corresponding to <qtname> (null pointer if QReport does not exist)
const int alarmONThreshold_
Log< level::Info, false > LogInfo
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
LuminosityBlockID id() const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const edm::EDGetTokenT< DcsStatusCollection > dcsStatus_
void dqmEndLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c) override
void dqmBeginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context) override
const edm::EDGetTokenT< reco::TrackCollection > trkSrc_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
LuminosityBlockNumber_t luminosityBlock() const
MonitorElement * beamSpotError_
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
const int alarmOFFThreshold_