7 #include <boost/format.hpp> 34 struct RunBasedHistograms {
59 std::vector<dqm::reco::MonitorElement*> tcds_bx;
60 std::vector<dqm::reco::MonitorElement*> l1t_bx;
61 std::vector<dqm::reco::MonitorElement*> hlt_bx;
62 std::vector<dqm::reco::MonitorElement*> tcds_bx_2d;
63 std::vector<dqm::reco::MonitorElement*> l1t_bx_2d;
64 std::vector<dqm::reco::MonitorElement*> hlt_bx_2d;
82 static const unsigned int s_bx_range = 3564;
86 static constexpr const char* s_tcds_trigger_types[] = {
125 descriptions.
add(
"triggerBxMonitor", desc);
132 m_dqm_path(config.getUntrackedParameter<
std::
string>(
"dqmPath")),
133 m_make_1d_plots(config.getUntrackedParameter<
bool>(
"make1DPlots")),
134 m_make_2d_plots(config.getUntrackedParameter<
bool>(
"make2DPlots")),
135 m_ls_range(config.getUntrackedParameter<uint32_t>(
"lsRange")) {}
142 histograms.tcds_bx.clear();
146 histograms.tcds_bx_2d.clear();
152 histograms.l1t_bx.clear();
156 histograms.l1t_bx_2d.clear();
164 if (histograms.hltConfig.init(run, setup, labels.
process, changed)) {
166 histograms.hlt_bx.clear();
167 histograms.hlt_bx.resize(histograms.hltConfig.size());
170 histograms.hlt_bx_2d.clear();
171 histograms.hlt_bx_2d.resize(histograms.hltConfig.size());
176 <<
"failed to initialise HLTConfigProvider, the HLT bx distribution will not be monitored";
190 histograms.tcds_bx_all = booker.
book2D(
"TCDS Trigger Types",
191 "TCDS Trigger Types vs. bunch crossing",
201 for (
unsigned int i = 0;
i <
size; ++
i) {
204 histograms.tcds_bx.at(i) =
209 histograms.tcds_bx_2d.at(i) = booker.
book2D(
221 histograms.l1t_bx_all = booker.
book2D(
"Level 1 Triggers",
222 "Level 1 Triggers vs. bunch crossing",
232 auto const& l1tMenu = edm::get<L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd>(
setup);
233 for (
auto const& keyval : l1tMenu.getAlgorithmMap()) {
234 unsigned int bit = keyval.second.getIndex();
241 histograms.l1t_bx_2d.at(bit) =
244 histograms.l1t_bx_all->setBinLabel(bit + 1, keyval.first, 2);
249 if (histograms.hltConfig.inited()) {
252 histograms.hlt_bx_all = booker.
book2D(
"High Level Triggers",
253 "High Level Triggers vs. bunch crossing",
257 histograms.hltConfig.size(),
259 histograms.hltConfig.size() - 0.5);
263 for (
unsigned int i = 0;
i < histograms.hltConfig.size(); ++
i) {
270 histograms.hlt_bx_2d[
i] =
273 histograms.hlt_bx_all->setBinLabel(
i + 1, name, 2);
281 unsigned int bx =
event.bunchCrossing();
282 unsigned int ls =
event.luminosityBlock();
287 unsigned int type =
event.experimentType();
290 histograms.tcds_bx[type]->Fill(bx);
292 histograms.tcds_bx_2d[type]->Fill(bx, ls);
294 histograms.tcds_bx_all->Fill(bx, type);
300 if (not bxvector.isEmpty(0)) {
301 auto const&
results = bxvector.at(0, 0);
303 if (
results.getAlgoDecisionFinal(
i)) {
305 histograms.l1t_bx[
i]->Fill(bx);
307 histograms.l1t_bx_2d[
i]->Fill(bx, ls);
308 histograms.l1t_bx_all->Fill(bx,
i);
314 if (histograms.hltConfig.inited()) {
319 histograms.hlt_bx[
i]->Fill(bx);
321 histograms.hlt_bx_2d[
i]->Fill(bx, ls);
322 histograms.hlt_bx_all->Fill(bx,
i);
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void dqmBeginRun(edm::Run const &, edm::EventSetup const &, RunBasedHistograms &) const override
void setCurrentFolder(std::string const &fullpath)
const edm::EDGetTokenT< GlobalAlgBlkBxCollection > m_l1t_results
const edm::EDGetTokenT< edm::TriggerResults > m_hlt_results
static const char * s_tcds_trigger_types[]
#define DEFINE_FWK_MODULE(type)
example_global void dqmAnalyze(edm::Event const &,@example_global edm::EventSetup const &,@example_global Histograms___class__ const &) const override
const uint32_t m_ls_range
const std::string m_dqm_path
TriggerBxMonitor(edm::ParameterSet const &)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
static unsigned int maxPhysicsTriggers
dqm::legacy::MonitorElement MonitorElement
T const & get(Event const &event, InputTag const &tag)(false)
const bool m_make_1d_plots
example_stream void bookHistograms(DQMStore::IBooker &,@example_stream edm::Run const &,@example_stream edm::EventSetup const &) override
static const unsigned int s_bx_range
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void labelsForToken(EDGetToken iToken, Labels &oLabels) const
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, RunBasedHistograms &) const override
const bool m_make_2d_plots
void dqmAnalyze(edm::Event const &, edm::EventSetup const &, RunBasedHistograms const &) const override