CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
TriggerRatesMonitor Class Reference
Inheritance diagram for TriggerRatesMonitor:
DQMGlobalEDAnalyzer< RunBasedHistograms > DQMGlobalEDAnalyzerBase< RunBasedHistograms, Args...> edm::global::EDProducer< T > edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 TriggerRatesMonitor (edm::ParameterSet const &)
 
 ~TriggerRatesMonitor () override=default
 
- Public Member Functions inherited from DQMGlobalEDAnalyzer< RunBasedHistograms >
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &, RunBasedHistogramsconst &) const
 
void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup) const final
 
- Public Member Functions inherited from DQMGlobalEDAnalyzerBase< RunBasedHistograms, Args...>
void accumulate (edm::StreamID id, edm::Event const &event, edm::EventSetup const &setup) const final
 
 DQMGlobalEDAnalyzerBase ()
 
std::shared_ptr
< RunBasedHistograms > 
globalBeginRun (edm::Run const &run, edm::EventSetup const &setup) const final
 
void globalEndRun (edm::Run const &, edm::EventSetup const &) const final
 
- Public Member Functions inherited from edm::global::EDProducer< T >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector
< edm::ProductResolverIndex >
const & 
indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector
< edm::ProductResolverIndex >
const & 
putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex >
const & 
esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector
< ProductResolverIndexAndSkipBit >
const & 
itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, RunBasedHistograms &) const override
 
void dqmAnalyze (edm::Event const &, edm::EventSetup const &, RunBasedHistograms const &) const override
 
void dqmBeginRun (edm::Run const &, edm::EventSetup const &, RunBasedHistograms &) const override
 

Private Attributes

const std::string m_dqm_path
 
const edm::EDGetTokenT
< edm::TriggerResults
m_hlt_results
 
const edm::EDGetTokenT
< GlobalAlgBlkBxCollection
m_l1t_results
 
const edm::ESGetToken
< L1TUtmTriggerMenu,
L1TUtmTriggerMenuRcd
m_l1tMenuToken
 
const uint32_t m_lumisections_range
 

Static Private Attributes

static constexpr const char *const s_tcds_trigger_types []
 

Additional Inherited Members

- Public Types inherited from DQMGlobalEDAnalyzerBase< RunBasedHistograms, Args...>
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from DQMGlobalEDAnalyzerBase< RunBasedHistograms, Args...>
uint64_t meId (edm::Run const &run) const
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 
- Protected Attributes inherited from DQMGlobalEDAnalyzerBase< RunBasedHistograms, Args...>
DQMStoredqmstore_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 102 of file TriggerRatesMonitor.cc.

Constructor & Destructor Documentation

TriggerRatesMonitor::TriggerRatesMonitor ( edm::ParameterSet const &  config)
explicit

Definition at line 158 of file TriggerRatesMonitor.cc.

References edm::ParameterSet::getUntrackedParameter(), m_dqm_path, m_hlt_results, m_l1t_results, m_lumisections_range, and AlCaHLTBitMon_QueryRunRegistry::string.

159  : // module configuration
160  m_l1tMenuToken{esConsumes<edm::Transition::BeginRun>()},
161  m_l1t_results(consumes<GlobalAlgBlkBxCollection>(config.getUntrackedParameter<edm::InputTag>("l1tResults"))),
162  m_hlt_results(consumes<edm::TriggerResults>(config.getUntrackedParameter<edm::InputTag>("hltResults"))),
163  m_dqm_path(config.getUntrackedParameter<std::string>("dqmPath")),
164  m_lumisections_range(config.getUntrackedParameter<uint32_t>("lumisectionRange")) {}
const std::string m_dqm_path
const edm::EDGetTokenT< GlobalAlgBlkBxCollection > m_l1t_results
const edm::EDGetTokenT< edm::TriggerResults > m_hlt_results
const uint32_t m_lumisections_range
const edm::ESGetToken< L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd > m_l1tMenuToken
TriggerRatesMonitor::~TriggerRatesMonitor ( )
overridedefault

Member Function Documentation

void TriggerRatesMonitor::bookHistograms ( DQMStore::IBooker booker,
edm::Run const &  run,
edm::EventSetup const &  setup,
RunBasedHistograms &  histograms 
) const
overrideprivatevirtual

Implements DQMGlobalEDAnalyzerBase< RunBasedHistograms, Args...>.

Definition at line 222 of file TriggerRatesMonitor.cc.

References dqm::implementation::IBooker::book1D(), ztail::d, contentValuesFiles::datasets, edm::EventSetup::getData(), mps_fire::i, dqmiolumiharvest::j, label, m_dqm_path, m_l1tMenuToken, m_lumisections_range, mergeVDriftHistosByStation::name, or, s_tcds_trigger_types, dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, and runGCPTkAlMap::title.

225  {
226  // book the overall event count and event types histograms
228  histograms.events_processed = booker.book1D(
229  "events", "Processed events vs. lumisection", m_lumisections_range + 1, -0.5, m_lumisections_range + 0.5);
230  booker.setCurrentFolder(m_dqm_path + "/TCDS");
231  for (unsigned int i = 0; i < sizeof(s_tcds_trigger_types) / sizeof(const char *); ++i)
232  if (s_tcds_trigger_types[i]) {
233  std::string const &title = fmt::sprintf("%s events vs. lumisection", s_tcds_trigger_types[i]);
234  histograms.tcds_counts[i] =
235  booker.book1D(s_tcds_trigger_types[i], title, m_lumisections_range + 1, -0.5, m_lumisections_range + 0.5);
236  }
237 
238  // book the rate histograms for the L1 triggers that are included in the L1 menu
239  booker.setCurrentFolder(m_dqm_path + "/L1T");
240  auto const &l1tMenu = setup.getData(m_l1tMenuToken);
241  for (auto const &keyval : l1tMenu.getAlgorithmMap()) {
242  unsigned int bit = keyval.second.getIndex();
243  bool masked = false; // FIXME read L1 masks once they will be avaiable in the EventSetup
244  std::string const &name = fmt::sprintf("%s (bit %d)", keyval.first, bit);
245  std::string const &title =
246  fmt::sprintf("%s (bit %d)%s vs. lumisection", keyval.first, bit, (masked ? " (masked)" : ""));
247  histograms.l1t_counts.at(bit) =
248  booker.book1D(name, title, m_lumisections_range + 1, -0.5, m_lumisections_range + 0.5);
249  }
250 
251  if (histograms.hltConfig.inited()) {
252  auto const &datasets = histograms.hltConfig.datasetNames();
253 
254  // book the rate histograms for the HLT triggers
255  for (unsigned int d = 0; d < datasets.size(); ++d) {
256  booker.setCurrentFolder(m_dqm_path + "/HLT/" + datasets[d]);
257  for (unsigned int i = 0; i < histograms.datasets[d].size(); ++i) {
258  unsigned int index = histograms.datasets[d][i];
259  std::string const &name = histograms.hltConfig.triggerName(index);
260  histograms.hlt_by_dataset_counts[d][i].pass_l1_seed = booker.book1D(name + "_pass_L1_seed",
261  name + " pass L1 seed, vs. lumisection",
263  -0.5,
264  m_lumisections_range + 0.5);
265  histograms.hlt_by_dataset_counts[d][i].pass_prescale = booker.book1D(name + "_pass_prescaler",
266  name + " pass prescaler, vs. lumisection",
268  -0.5,
269  m_lumisections_range + 0.5);
270  histograms.hlt_by_dataset_counts[d][i].accept = booker.book1D(name + "_accept",
271  name + " accept, vs. lumisection",
273  -0.5,
274  m_lumisections_range + 0.5);
275  histograms.hlt_by_dataset_counts[d][i].reject = booker.book1D(name + "_reject",
276  name + " reject, vs. lumisection",
278  -0.5,
279  m_lumisections_range + 0.5);
280  histograms.hlt_by_dataset_counts[d][i].error = booker.book1D(name + "_error",
281  name + " error, vs. lumisection",
283  -0.5,
284  m_lumisections_range + 0.5);
285  }
286 
287  // booker.setCurrentFolder( m_dqm_path + "/HLT/" + datasets[d]);
288  for (unsigned int i : histograms.datasets[d]) {
289  // look for the index of the (last) L1 seed and prescale module in each path
290  histograms.hltIndices[i].index_l1_seed = histograms.hltConfig.size(i);
291  histograms.hltIndices[i].index_prescale = histograms.hltConfig.size(i);
292  for (unsigned int j = 0; j < histograms.hltConfig.size(i); ++j) {
293  std::string const &label = histograms.hltConfig.moduleLabel(i, j);
294  std::string const &type = histograms.hltConfig.moduleType(label);
295  if (type == "HLTL1TSeed" or type == "HLTLevel1GTSeed" or type == "HLTLevel1Activity" or
296  type == "HLTLevel1Pattern") {
297  // there might be more L1 seed filters in sequence
298  // keep looking and store the index of the last one
299  histograms.hltIndices[i].index_l1_seed = j;
300  } else if (type == "HLTPrescaler") {
301  // there should be only one prescaler in a path, and it should follow all L1 seed filters
302  histograms.hltIndices[i].index_prescale = j;
303  break;
304  }
305  }
306  }
307  }
308 
309  // book the HLT datasets rate histograms
310  booker.setCurrentFolder(m_dqm_path + "/Datasets");
311  for (unsigned int i = 0; i < datasets.size(); ++i)
312  histograms.dataset_counts[i] =
313  booker.book1D(datasets[i], datasets[i], m_lumisections_range + 1, -0.5, m_lumisections_range + 0.5);
314 
315  // book the HLT streams rate histograms
316  booker.setCurrentFolder(m_dqm_path + "/Streams");
317  auto const &streams = histograms.hltConfig.streamNames();
318  for (unsigned int i = 0; i < streams.size(); ++i)
319  histograms.stream_counts[i] =
320  booker.book1D(streams[i], streams[i], m_lumisections_range + 1, -0.5, m_lumisections_range + 0.5);
321  }
322 }
const std::string m_dqm_path
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
const uint32_t m_lumisections_range
tuple d
Definition: ztail.py:151
static constexpr const char *const s_tcds_trigger_types[]
char const * label
const edm::ESGetToken< L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd > m_l1tMenuToken
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
void TriggerRatesMonitor::dqmAnalyze ( edm::Event const &  event,
edm::EventSetup const &  setup,
RunBasedHistograms const &  histograms 
) const
overrideprivatevirtual

Implements DQMGlobalEDAnalyzerBase< RunBasedHistograms, Args...>.

Definition at line 324 of file TriggerRatesMonitor.cc.

References edm::HLTPathStatus::accept(), ztail::d, edm::HLTPathStatus::error(), edm::EventBase::experimentType(), JetPDSkim_cfg::hltResults, mps_fire::i, edm::HLTPathStatus::index(), dqmiolumiharvest::j, m_hlt_results, m_l1t_results, GlobalAlgBlk::maxPhysicsTriggers, fed_dqm_sourceclient-live_cfg::path, and bookConverter::results.

326  {
327  unsigned int lumisection = event.luminosityBlock();
328 
329  // monitor the overall event count and event types rates
330  histograms.events_processed->Fill(lumisection);
331  if (histograms.tcds_counts[event.experimentType()])
332  histograms.tcds_counts[event.experimentType()]->Fill(lumisection);
333 
334  // monitor the L1 triggers rates
335  auto const &bxvector = event.get(m_l1t_results);
336  if (not bxvector.isEmpty(0)) {
337  auto const &results = bxvector.at(0, 0);
338  for (unsigned int i = 0; i < GlobalAlgBlk::maxPhysicsTriggers; ++i)
339  if (results.getAlgoDecisionFinal(i))
340  if (histograms.l1t_counts[i])
341  histograms.l1t_counts[i]->Fill(lumisection);
342  }
343 
344  // monitor the HLT triggers and datsets rates
345  if (histograms.hltConfig.inited()) {
346  auto const &hltResults = event.get(m_hlt_results);
347  if (hltResults.size() != histograms.hltIndices.size()) {
348  edm::LogWarning("TriggerRatesMonitor")
349  << "This should never happen: the number of HLT paths has changed since the beginning of the run";
350  }
351 
352  for (unsigned int d = 0; d < histograms.datasets.size(); ++d) {
353  for (unsigned int i : histograms.datasets[d])
354  if (hltResults.at(i).accept()) {
355  histograms.dataset_counts[d]->Fill(lumisection);
356  // ensure each dataset is incremented only once per event
357  break;
358  }
359  for (unsigned int i = 0; i < histograms.datasets[d].size(); ++i) {
360  unsigned int index = histograms.datasets[d][i];
361  edm::HLTPathStatus const &path = hltResults.at(index);
362 
363  if (path.index() > histograms.hltIndices[index].index_l1_seed)
364  histograms.hlt_by_dataset_counts[d][i].pass_l1_seed->Fill(lumisection);
365  if (path.index() > histograms.hltIndices[index].index_prescale)
366  histograms.hlt_by_dataset_counts[d][i].pass_prescale->Fill(lumisection);
367  if (path.accept())
368  histograms.hlt_by_dataset_counts[d][i].accept->Fill(lumisection);
369  else if (path.error())
370  histograms.hlt_by_dataset_counts[d][i].error->Fill(lumisection);
371  else
372  histograms.hlt_by_dataset_counts[d][i].reject->Fill(lumisection);
373  }
374  }
375 
376  for (unsigned int i = 0; i < histograms.streams.size(); ++i)
377  for (unsigned int j : histograms.streams[i])
378  if (hltResults.at(j).accept()) {
379  histograms.stream_counts[i]->Fill(lumisection);
380  // ensure each stream is incremented only once per event
381  break;
382  }
383  }
384 }
const edm::EDGetTokenT< GlobalAlgBlkBxCollection > m_l1t_results
const edm::EDGetTokenT< edm::TriggerResults > m_hlt_results
dictionary results
tuple d
Definition: ztail.py:151
bool error() const
has this path encountered an error (exception)?
Definition: HLTPathStatus.h:61
bool accept() const
has this path accepted the event?
Definition: HLTPathStatus.h:59
static constexpr unsigned int maxPhysicsTriggers
Definition: GlobalAlgBlk.h:52
Log< level::Warning, false > LogWarning
unsigned int index() const
Definition: HLTPathStatus.h:52
void TriggerRatesMonitor::dqmBeginRun ( edm::Run const &  run,
edm::EventSetup const &  setup,
RunBasedHistograms &  histograms 
) const
overrideprivatevirtual

Reimplemented from DQMGlobalEDAnalyzerBase< RunBasedHistograms, Args...>.

Definition at line 166 of file TriggerRatesMonitor.cc.

References writedatasetfile::dataset, contentValuesFiles::datasets, mps_fire::i, HLT_FULL_cff::labels, edm::EDConsumerBase::labelsForToken(), m_hlt_results, GlobalAlgBlk::maxPhysicsTriggers, fed_dqm_sourceclient-live_cfg::path, mergeAndRegister::paths, edm::ProductLabels::process, s_tcds_trigger_types, and tier0::unique().

168  {
169  histograms.tcds_counts.clear();
170  histograms.tcds_counts.resize(sizeof(s_tcds_trigger_types) / sizeof(const char *));
171 
172  // cache the L1 trigger menu
173  histograms.l1t_counts.clear();
174  histograms.l1t_counts.resize(GlobalAlgBlk::maxPhysicsTriggers);
175 
176  // initialise the HLTConfigProvider
177  bool changed = true;
179  labelsForToken(m_hlt_results, labels);
180  if (histograms.hltConfig.init(run, setup, labels.process, changed)) {
181  histograms.hltIndices.resize(histograms.hltConfig.size());
182 
183  unsigned int datasets = histograms.hltConfig.datasetNames().size();
184  histograms.hlt_by_dataset_counts.clear();
185  histograms.hlt_by_dataset_counts.resize(datasets);
186 
187  histograms.datasets.clear();
188  histograms.datasets.resize(datasets);
189  for (unsigned int i = 0; i < datasets; ++i) {
190  auto const &paths = histograms.hltConfig.datasetContent(i);
191  histograms.hlt_by_dataset_counts[i].resize(paths.size());
192  histograms.datasets[i].reserve(paths.size());
193  for (auto const &path : paths) {
194  histograms.datasets[i].push_back(histograms.hltConfig.triggerIndex(path));
195  }
196  }
197  histograms.dataset_counts.clear();
198  histograms.dataset_counts.resize(datasets);
199 
200  unsigned int streams = histograms.hltConfig.streamNames().size();
201  histograms.streams.clear();
202  histograms.streams.resize(streams);
203  for (unsigned int i = 0; i < streams; ++i) {
204  for (auto const &dataset : histograms.hltConfig.streamContent(i)) {
205  for (auto const &path : histograms.hltConfig.datasetContent(dataset))
206  histograms.streams[i].push_back(histograms.hltConfig.triggerIndex(path));
207  }
208  std::sort(histograms.streams[i].begin(), histograms.streams[i].end());
209  auto unique_end = std::unique(histograms.streams[i].begin(), histograms.streams[i].end());
210  histograms.streams[i].resize(unique_end - histograms.streams[i].begin());
211  histograms.streams[i].shrink_to_fit();
212  }
213  histograms.stream_counts.clear();
214  histograms.stream_counts.resize(streams);
215  } else {
216  // HLTConfigProvider not initialised, skip the the HLT monitoring
217  edm::LogError("TriggerRatesMonitor")
218  << "failed to initialise HLTConfigProvider, the HLT trigger and datasets rates will not be monitored";
219  }
220 }
const edm::EDGetTokenT< edm::TriggerResults > m_hlt_results
def unique
Definition: tier0.py:24
Log< level::Error, false > LogError
char const * process
Definition: ProductLabels.h:7
static constexpr const char *const s_tcds_trigger_types[]
void labelsForToken(EDGetToken iToken, Labels &oLabels) const
static constexpr unsigned int maxPhysicsTriggers
Definition: GlobalAlgBlk.h:52
void TriggerRatesMonitor::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 149 of file TriggerRatesMonitor.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::addUntracked(), submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

149  {
151  desc.addUntracked<edm::InputTag>("l1tResults", edm::InputTag("gtStage2Digis"));
152  desc.addUntracked<edm::InputTag>("hltResults", edm::InputTag("TriggerResults"));
153  desc.addUntracked<std::string>("dqmPath", "HLT/TriggerRates");
154  desc.addUntracked<uint32_t>("lumisectionRange", 2500); // ~16 hours
155  descriptions.add("triggerRatesMonitor", desc);
156 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)

Member Data Documentation

const std::string TriggerRatesMonitor::m_dqm_path
private

Definition at line 142 of file TriggerRatesMonitor.cc.

Referenced by bookHistograms(), and TriggerRatesMonitor().

const edm::EDGetTokenT<edm::TriggerResults> TriggerRatesMonitor::m_hlt_results
private

Definition at line 141 of file TriggerRatesMonitor.cc.

Referenced by dqmAnalyze(), dqmBeginRun(), and TriggerRatesMonitor().

const edm::EDGetTokenT<GlobalAlgBlkBxCollection> TriggerRatesMonitor::m_l1t_results
private

Definition at line 140 of file TriggerRatesMonitor.cc.

Referenced by dqmAnalyze(), and TriggerRatesMonitor().

const edm::ESGetToken<L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd> TriggerRatesMonitor::m_l1tMenuToken
private

Definition at line 139 of file TriggerRatesMonitor.cc.

Referenced by bookHistograms().

const uint32_t TriggerRatesMonitor::m_lumisections_range
private

Definition at line 143 of file TriggerRatesMonitor.cc.

Referenced by bookHistograms(), and TriggerRatesMonitor().

constexpr const char *const TriggerRatesMonitor::s_tcds_trigger_types
staticprivate
Initial value:
= {
"Empty",
"Physics",
"Calibration",
"Random",
"Auxiliary",
nullptr,
nullptr,
nullptr,
"Cyclic",
"Bunch-pattern",
"Software",
"TTS",
nullptr,
nullptr,
nullptr,
nullptr
}

Definition at line 119 of file TriggerRatesMonitor.cc.

Referenced by bookHistograms(), and dqmBeginRun().