7 #include <fmt/printf.h> 31 struct RunBasedHistograms {
56 std::vector<dqm::reco::MonitorElement*> tcds_bx;
57 std::vector<dqm::reco::MonitorElement*> l1t_bx;
58 std::vector<dqm::reco::MonitorElement*> hlt_bx;
59 std::vector<dqm::reco::MonitorElement*> tcds_bx_2d;
60 std::vector<dqm::reco::MonitorElement*> l1t_bx_2d;
61 std::vector<dqm::reco::MonitorElement*> hlt_bx_2d;
120 desc.addUntracked<
bool>(
"make1DPlots",
true);
121 desc.addUntracked<
bool>(
"make2DPlots",
false);
122 desc.addUntracked<uint32_t>(
"lsRange", 4000);
123 descriptions.
add(
"triggerBxMonitor",
desc);
128 m_l1tMenuToken{esConsumes<edm::Transition::BeginRun>()},
129 m_l1t_results(consumes<GlobalAlgBlkBxCollection>(
config.getUntrackedParameter<
edm::InputTag>(
"l1tResults"))),
130 m_hlt_results(consumes<edm::TriggerResults>(
config.getUntrackedParameter<
edm::InputTag>(
"hltResults"))),
132 m_make_1d_plots(
config.getUntrackedParameter<
bool>(
"make1DPlots")),
133 m_make_2d_plots(
config.getUntrackedParameter<
bool>(
"make2DPlots")),
134 m_ls_range(
config.getUntrackedParameter<uint32_t>(
"lsRange")) {}
175 <<
"failed to initialise HLTConfigProvider, the HLT bx distribution will not be monitored";
190 "TCDS Trigger Types vs. bunch crossing",
200 for (
unsigned int i = 0;
i <
size; ++
i) {
221 "Level 1 Triggers vs. bunch crossing",
232 for (
auto const& keyval : l1tMenu.getAlgorithmMap()) {
233 unsigned int bit = keyval.second.getIndex();
234 std::string const&
name = fmt::sprintf(
"%s (bit %d)", keyval.first, bit);
243 histograms.l1t_bx_all->setBinLabel(bit + 1, keyval.first, 2);
252 "High Level Triggers vs. bunch crossing",
262 for (
unsigned int i = 0;
i <
histograms.hltConfig.size(); ++
i) {
280 unsigned int bx =
event.bunchCrossing();
281 unsigned int ls =
event.luminosityBlock();
286 unsigned int type =
event.experimentType();
299 if (not bxvector.isEmpty(0)) {
300 auto const&
results = bxvector.at(0, 0);
302 if (
results.getAlgoDecisionFinal(
i)) {
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void dqmAnalyze(edm::Event const &, edm::EventSetup const &, RunBasedHistograms const &) const override
virtual void setCurrentFolder(std::string const &fullpath)
#define DEFINE_FWK_MODULE(type)
~TriggerBxMonitor() override=default
const edm::EDGetTokenT< GlobalAlgBlkBxCollection > m_l1t_results
void dqmBeginRun(edm::Run const &, edm::EventSetup const &, RunBasedHistograms &) const override
Log< level::Error, false > LogError
const edm::EDGetTokenT< edm::TriggerResults > m_hlt_results
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, RunBasedHistograms &) const override
static constexpr const char * s_tcds_trigger_types[]
const uint32_t m_ls_range
const std::string m_dqm_path
TriggerBxMonitor(edm::ParameterSet const &)
dqm::legacy::MonitorElement MonitorElement
const bool m_make_1d_plots
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
static const unsigned int s_bx_range
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static constexpr unsigned int maxPhysicsTriggers
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
const bool m_make_2d_plots
void labelsForToken(EDGetToken iToken, Labels &oLabels) const
const edm::ESGetToken< L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd > m_l1tMenuToken