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;
121 desc.addUntracked<
bool>(
"make1DPlots",
true);
122 desc.addUntracked<
bool>(
"make2DPlots",
false);
123 desc.addUntracked<uint32_t>(
"lsRange", 4000);
124 descriptions.
add(
"triggerBxMonitor",
desc);
129 m_l1tMenu_token{esConsumes<edm::Transition::BeginRun>()},
131 m_l1t_results_token{consumes(m_l1t_results_inputTag)},
134 m_make_1d_plots{
config.getUntrackedParameter<
bool>(
"make1DPlots")},
135 m_make_2d_plots{
config.getUntrackedParameter<
bool>(
"make2DPlots")},
136 m_ls_range{
config.getUntrackedParameter<uint32_t>(
"lsRange")} {}
177 <<
"failed to initialise HLTConfigProvider, the HLT bx distribution will not be monitored";
192 "TCDS Trigger Types vs. bunch crossing",
202 for (
unsigned int i = 0;
i <
size; ++
i) {
223 "Level 1 Triggers vs. bunch crossing",
234 for (
auto const& keyval : l1tMenu.getAlgorithmMap()) {
235 unsigned int bit = keyval.second.getIndex();
245 histograms.l1t_bx_all->setBinLabel(
bit + 1, keyval.first, 2);
254 "High Level Triggers vs. bunch crossing",
264 for (
unsigned int i = 0;
i <
histograms.hltConfig.size(); ++
i) {
282 unsigned int bx =
event.bunchCrossing();
283 unsigned int ls =
event.luminosityBlock();
288 unsigned int type =
event.experimentType();
301 if (not algBlkBxVecHandle.isValid()) {
304 <<
"] not present or invalid. MonitorElements of L1T results not filled for this event.";
305 }
else if (algBlkBxVecHandle->isEmpty(0)) {
308 <<
"] empty for BX=0. MonitorElements of L1T results not filled for this event.";
310 auto const&
results = algBlkBxVecHandle->at(0, 0);
312 if (
results.getAlgoDecisionFinal(
i)) {
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void dqmAnalyze(edm::Event const &, edm::EventSetup const &, RunBasedHistograms const &) const override
const edm::EDGetTokenT< edm::TriggerResults > m_hlt_results_token
virtual void setCurrentFolder(std::string const &fullpath)
~TriggerBxMonitor() override=default
void dqmBeginRun(edm::Run const &, edm::EventSetup const &, RunBasedHistograms &) const override
Log< level::Error, false > LogError
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, RunBasedHistograms &) const override
const edm::ESGetToken< L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd > m_l1tMenu_token
#define DEFINE_FWK_MODULE(type)
static constexpr const char * s_tcds_trigger_types[]
const uint32_t m_ls_range
const edm::InputTag m_l1t_results_inputTag
const edm::EDGetTokenT< GlobalAlgBlkBxCollection > m_l1t_results_token
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