CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
TriggerRatesMonitor Class Reference
Inheritance diagram for TriggerRatesMonitor:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Classes

struct  HLTIndices
 
struct  HLTRatesPlots
 

Public Member Functions

 TriggerRatesMonitor (edm::ParameterSet const &)
 
 ~TriggerRatesMonitor ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

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

Private Attributes

std::vector< TH1F * > m_dataset_counts
 
std::vector< std::vector
< unsigned int > > 
m_datasets
 
std::string m_dqm_path
 
TH1F * m_events_processed
 
std::vector< HLTRatesPlotsm_hlt_counts
 
const edm::EDGetTokenT
< edm::TriggerResults
m_hlt_results
 
HLTConfigProvider m_hltConfig
 
std::vector< HLTIndicesm_hltIndices
 
std::vector< TH1F * > m_l1t_counts
 
const edm::EDGetTokenT
< GlobalAlgBlkBxCollection
m_l1t_results
 
L1TUtmTriggerMenu const * m_l1tMenu
 
uint32_t m_lumisections_range
 
std::vector< TH1F * > m_stream_counts
 
std::vector< std::vector
< unsigned int > > 
m_streams
 
std::vector< TH1F * > m_tcds_counts
 

Static Private Attributes

static const char *const s_tcds_trigger_types []
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 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)
 

Detailed Description

Definition at line 61 of file TriggerRatesMonitor.cc.

Constructor & Destructor Documentation

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

Definition at line 163 of file TriggerRatesMonitor.cc.

163  :
164  // module configuration
165  m_l1t_results(consumes<GlobalAlgBlkBxCollection>( config.getUntrackedParameter<edm::InputTag>( "l1tResults" ) )),
166  m_hlt_results(consumes<edm::TriggerResults>( config.getUntrackedParameter<edm::InputTag>( "hltResults" ) )),
167  m_dqm_path( config.getUntrackedParameter<std::string>( "dqmPath" ) ),
168  m_lumisections_range( config.getUntrackedParameter<uint32_t>( "lumisectionRange" ) ),
169  // L1T and HLT configuration
170  m_l1tMenu(nullptr),
171  m_hltConfig(),
172  m_hltIndices(),
173  m_datasets(),
174  m_streams(),
175  // overall event count and event types
176  m_events_processed(nullptr),
177  m_tcds_counts(),
178  // L1T triggers
179  m_l1t_counts(),
180  // HLT triggers
181  m_hlt_counts(),
182  // datasets
184  // streams
186 {
187 }
const edm::EDGetTokenT< GlobalAlgBlkBxCollection > m_l1t_results
const edm::EDGetTokenT< edm::TriggerResults > m_hlt_results
std::vector< std::vector< unsigned int > > m_streams
std::vector< TH1F * > m_dataset_counts
std::vector< std::vector< unsigned int > > m_datasets
L1TUtmTriggerMenu const * m_l1tMenu
HLTConfigProvider m_hltConfig
std::vector< HLTRatesPlots > m_hlt_counts
std::vector< TH1F * > m_stream_counts
std::vector< TH1F * > m_l1t_counts
std::vector< HLTIndices > m_hltIndices
std::vector< TH1F * > m_tcds_counts
TriggerRatesMonitor::~TriggerRatesMonitor ( )

Definition at line 189 of file TriggerRatesMonitor.cc.

190 {
191 }

Member Function Documentation

void TriggerRatesMonitor::analyze ( edm::Event const &  event,
edm::EventSetup const &  setup 
)
overrideprivatevirtual

Implements edm::stream::EDAnalyzerBase.

Definition at line 318 of file TriggerRatesMonitor.cc.

References accept(), edm::HLTPathStatus::accept(), edm::HLTGlobalStatus::at(), relativeConstraints::error, edm::HLTPathStatus::error(), event(), edm::EventBase::experimentType(), HcalObjRepresent::Fill(), JetPDSkim_cfg::hltResults, i, edm::HLTPathStatus::index(), HLTConfigProvider::inited(), j, m_dataset_counts, m_datasets, m_events_processed, m_hlt_counts, m_hlt_results, m_hltConfig, m_hltIndices, m_l1t_counts, m_l1t_results, m_l1tMenu, m_stream_counts, m_streams, m_tcds_counts, GlobalAlgBlk::maxPhysicsTriggers, fed_dqm_sourceclient-live_cfg::path, mps_update::results, and edm::HLTGlobalStatus::size().

319 {
320  unsigned int lumisection = event.luminosityBlock();
321 
322  // monitor the overall event count and event types rates
323  m_events_processed->Fill(lumisection);
324  if (m_tcds_counts[event.experimentType()])
325  m_tcds_counts[event.experimentType()]->Fill(lumisection);
326 
327  // monitor the L1 triggers rates
328  if (m_l1tMenu) {
329  auto const & bxvector = get<GlobalAlgBlkBxCollection>(event, m_l1t_results);
330  if (not bxvector.isEmpty(0)) {
331  auto const & results = bxvector.at(0, 0);
332  for (unsigned int i = 0; i < GlobalAlgBlk::maxPhysicsTriggers; ++i)
333  if (results.getAlgoDecisionFinal(i))
334  if (m_l1t_counts[i])
335  m_l1t_counts[i]->Fill(lumisection);
336  }
337  }
338 
339  // monitor the HLT triggers and datsets rates
340  if (m_hltConfig.inited()) {
341  edm::TriggerResults const & hltResults = get<edm::TriggerResults>(event, m_hlt_results);
342  if (hltResults.size() == m_hlt_counts.size()) {
343  for (unsigned int i = 0; i < m_hlt_counts.size(); ++i) {
344  edm::HLTPathStatus const & path = hltResults.at(i);
345  if (path.index() > m_hltIndices[i].index_l1_seed)
346  m_hlt_counts[i].pass_l1_seed->Fill(lumisection);
347  if (path.index() > m_hltIndices[i].index_prescale)
348  m_hlt_counts[i].pass_prescale->Fill(lumisection);
349  if (path.accept())
350  m_hlt_counts[i].accept->Fill(lumisection);
351  else if (path.error())
352  m_hlt_counts[i].error ->Fill(lumisection);
353  else
354  m_hlt_counts[i].reject->Fill(lumisection);
355  }
356  } else {
357  edm::LogWarning("TriggerRatesMonitor") << "This should never happen: the number of HLT paths has changed since the beginning of the run";
358  }
359 
360  for (unsigned int i = 0; i < m_datasets.size(); ++i)
361  for (unsigned int j: m_datasets[i])
362  if (hltResults.at(j).accept()) {
363  m_dataset_counts[i]->Fill(lumisection);
364  // ensure each dataset is incremented only once per event
365  break;
366  }
367 
368  for (unsigned int i = 0; i < m_streams.size(); ++i)
369  for (unsigned int j: m_streams[i])
370  if (hltResults.at(j).accept()) {
371  m_stream_counts[i]->Fill(lumisection);
372  // ensure each stream is incremented only once per event
373  break;
374  }
375  }
376 }
int i
Definition: DBlmapReader.cc:9
const edm::EDGetTokenT< GlobalAlgBlkBxCollection > m_l1t_results
const edm::EDGetTokenT< edm::TriggerResults > m_hlt_results
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
static const unsigned int maxPhysicsTriggers
Definition: GlobalAlgBlk.h:52
bool inited() const
Accessors (const methods)
std::vector< std::vector< unsigned int > > m_streams
std::vector< TH1F * > m_dataset_counts
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
unsigned int size() const
Get number of paths stored.
std::vector< std::vector< unsigned int > > m_datasets
tuple results
Definition: mps_update.py:44
int j
Definition: DBlmapReader.cc:9
L1TUtmTriggerMenu const * m_l1tMenu
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
const HLTPathStatus & at(const unsigned int i) const
HLTConfigProvider m_hltConfig
bool error() const
has this path encountered an error (exception)?
Definition: HLTPathStatus.h:64
std::vector< HLTRatesPlots > m_hlt_counts
std::vector< TH1F * > m_stream_counts
bool accept() const
has this path accepted the event?
Definition: HLTPathStatus.h:62
std::vector< TH1F * > m_l1t_counts
std::vector< HLTIndices > m_hltIndices
std::vector< TH1F * > m_tcds_counts
unsigned int index() const
Definition: HLTPathStatus.h:55
void TriggerRatesMonitor::bookHistograms ( DQMStore::IBooker booker,
edm::Run const &  run,
edm::EventSetup const &  setup 
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 250 of file TriggerRatesMonitor.cc.

References DQMStore::IBooker::book1D(), HLTConfigProvider::datasetNames(), contentValuesFiles::datasets, cmsPerfStripChart::format, L1TUtmTriggerMenu::getAlgorithmMap(), MonitorElement::getTH1F(), i, HLTConfigProvider::inited(), j, diffTwoXMLs::label, m_dataset_counts, m_dqm_path, m_events_processed, m_hlt_counts, m_hltConfig, m_hltIndices, m_l1t_counts, m_l1tMenu, m_lumisections_range, m_stream_counts, m_tcds_counts, HLTConfigProvider::moduleLabel(), HLTConfigProvider::moduleType(), mergeVDriftHistosByStation::name, or, s_tcds_trigger_types, DQMStore::IBooker::setCurrentFolder(), HLTConfigProvider::size(), HLTConfigProvider::streamNames(), hcal_dqm_sourceclient-file_cfg::streams, AlCaHLTBitMon_QueryRunRegistry::string, indexGen::title, and HLTConfigProvider::triggerName().

251 {
252  // book the overall event count and event types histograms
253  booker.setCurrentFolder( m_dqm_path );
254  m_events_processed = booker.book1D("events", "Processed events vs. lumisection", m_lumisections_range + 1, -0.5, m_lumisections_range + 0.5)->getTH1F();
255  booker.setCurrentFolder( m_dqm_path + "/TCDS" );
256  for (unsigned int i = 0; i < sizeof(s_tcds_trigger_types)/sizeof(const char *); ++i)
257  if (s_tcds_trigger_types[i]) {
258  std::string const & title = (boost::format("%s events vs. lumisection") % s_tcds_trigger_types[i]).str();
260  }
261 
262  if (m_l1tMenu) {
263  // book the rate histograms for the L1 triggers that are included in the L1 menu
264  booker.setCurrentFolder( m_dqm_path + "/L1T" );
265  for (auto const & keyval: m_l1tMenu->getAlgorithmMap()) {
266  unsigned int bit = keyval.second.getIndex();
267  bool masked = false; // FIXME read L1 masks once they will be avaiable in the EventSetup
268  std::string const & name = (boost::format("%s (bit %d)") % keyval.first % bit).str();
269  std::string const & title = (boost::format("%s (bit %d)%s vs. lumisection") % keyval.first % bit % (masked ? " (masked)" : "")).str();
270  m_l1t_counts.at(bit) = booker.book1D(name, title, m_lumisections_range + 1, -0.5, m_lumisections_range + 0.5)->getTH1F();
271  }
272  }
273 
274  if (m_hltConfig.inited()) {
275  // book the rate histograms for the HLT triggers
276  booker.setCurrentFolder( m_dqm_path + "/HLT" );
277  for (unsigned int i = 0; i < m_hltConfig.size(); ++i) {
278  std::string const & name = m_hltConfig.triggerName(i);
279  m_hlt_counts[i].pass_l1_seed = booker.book1D(name + " pass L1 seed", name + " pass L1 seed, vs. lumisection", m_lumisections_range + 1, -0.5, m_lumisections_range + 0.5)->getTH1F();
280  m_hlt_counts[i].pass_prescale = booker.book1D(name + " pass prescaler", name + " pass prescaler, vs. lumisection", m_lumisections_range + 1, -0.5, m_lumisections_range + 0.5)->getTH1F();
281  m_hlt_counts[i].accept = booker.book1D(name + " accept", name + " accept, vs. lumisection", m_lumisections_range + 1, -0.5, m_lumisections_range + 0.5)->getTH1F();
282  m_hlt_counts[i].reject = booker.book1D(name + " reject", name + " reject, vs. lumisection", m_lumisections_range + 1, -0.5, m_lumisections_range + 0.5)->getTH1F();
283  m_hlt_counts[i].error = booker.book1D(name + " error", name + " error, vs. lumisection", m_lumisections_range + 1, -0.5, m_lumisections_range + 0.5)->getTH1F();
284  // look for the index of the (last) L1 seed and prescale module in each path
285  m_hltIndices[i].index_l1_seed = m_hltConfig.size(i);
286  m_hltIndices[i].index_prescale = m_hltConfig.size(i);
287  for (unsigned int j = 0; j < m_hltConfig.size(i); ++j) {
288  std::string const & label = m_hltConfig.moduleLabel(i, j);
289  std::string const & type = m_hltConfig.moduleType(label);
290  if (type == "HLTL1TSeed" or type == "HLTLevel1GTSeed" or type == "HLTLevel1Activity" or type == "HLTLevel1Pattern") {
291  // there might be more L1 seed filters in sequence
292  // keep looking and store the index of the last one
293  m_hltIndices[i].index_l1_seed = j;
294  } else if (type == "HLTPrescaler") {
295  // there should be only one prescaler in a path, and it should follow all L1 seed filters
296  m_hltIndices[i].index_prescale = j;
297  break;
298  }
299 
300  }
301  }
302 
303  // book the HLT datasets rate histograms
304  booker.setCurrentFolder( m_dqm_path + "/Datasets" );
305  auto const & datasets = m_hltConfig.datasetNames();
306  for (unsigned int i = 0; i < datasets.size(); ++i)
308 
309  // book the HLT streams rate histograms
310  booker.setCurrentFolder( m_dqm_path + "/Streams" );
311  auto const & streams = m_hltConfig.streamNames();
312  for (unsigned int i = 0; i < streams.size(); ++i)
313  m_stream_counts[i] = booker.book1D(streams[i], streams[i], m_lumisections_range + 1, -0.5, m_lumisections_range + 0.5)->getTH1F();
314  }
315 }
unsigned int size() const
number of trigger paths in trigger table
type
Definition: HCALResponse.h:21
int i
Definition: DBlmapReader.cc:9
const std::string moduleType(const std::string &module) const
C++ class name of module.
const std::string & triggerName(unsigned int triggerIndex) const
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
string format
Some error handling for the usage.
const std::string & moduleLabel(unsigned int trigger, unsigned int module) const
bool inited() const
Accessors (const methods)
static const char *const s_tcds_trigger_types[]
const std::vector< std::string > & streamNames() const
std::vector< TH1F * > m_dataset_counts
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
int j
Definition: DBlmapReader.cc:9
L1TUtmTriggerMenu const * m_l1tMenu
HLTConfigProvider m_hltConfig
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
TH1F * getTH1F(void) const
std::vector< HLTRatesPlots > m_hlt_counts
std::vector< TH1F * > m_stream_counts
const std::map< std::string, L1TUtmAlgorithm > & getAlgorithmMap() const
std::vector< TH1F * > m_l1t_counts
std::vector< HLTIndices > m_hltIndices
std::vector< TH1F * > m_tcds_counts
const std::vector< std::string > & datasetNames() const
void TriggerRatesMonitor::dqmBeginRun ( edm::Run const &  run,
edm::EventSetup const &  setup 
)
overrideprivatevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 193 of file TriggerRatesMonitor.cc.

References begin, dataset::dataset, HLTConfigProvider::datasetContent(), HLTConfigProvider::datasetNames(), contentValuesFiles::datasets, end, i, HLTConfigProvider::init(), HLT_25ns10e33_v2_cff::labels, edm::EDConsumerBase::labelsForToken(), m_dataset_counts, m_datasets, m_events_processed, m_hlt_counts, m_hlt_results, m_hltConfig, m_hltIndices, m_l1t_counts, m_l1tMenu, m_stream_counts, m_streams, m_tcds_counts, GlobalAlgBlk::maxPhysicsTriggers, fed_dqm_sourceclient-live_cfg::path, mergeAndRegister::paths, edm::ProductLabels::process, s_tcds_trigger_types, GeneralSetup::setup(), HLTConfigProvider::size(), HLTConfigProvider::streamContent(), HLTConfigProvider::streamNames(), hcal_dqm_sourceclient-file_cfg::streams, HLTConfigProvider::triggerIndex(), and FrontierCondition_GT_autoExpress_cfi::unique().

194 {
195  m_events_processed = nullptr;
196  m_tcds_counts.clear();
197  m_tcds_counts.resize(sizeof(s_tcds_trigger_types)/sizeof(const char *), nullptr);
198 
199  // cache the L1 trigger menu
200  m_l1tMenu = & get<L1TUtmTriggerMenuRcd, L1TUtmTriggerMenu>(setup);
201  if (m_l1tMenu) {
202  m_l1t_counts.clear();
204  } else {
205  edm::LogError("TriggerRatesMonitor") << "failed to read the L1 menu from the EventSetup, the L1 trigger rates will not be monitored";
206  }
207 
208  // initialise the HLTConfigProvider
209  bool changed = true;
211  labelsForToken(m_hlt_results, labels);
212  if (m_hltConfig.init(run, setup, labels.process, changed)) {
213  m_hlt_counts.clear();
214  m_hlt_counts.resize( m_hltConfig.size(), HLTRatesPlots() );
215  m_hltIndices.resize( m_hltConfig.size(), HLTIndices() );
216 
217  unsigned int datasets = m_hltConfig.datasetNames().size();
218  m_datasets.clear();
219  m_datasets.resize( datasets, {} );
220  for (unsigned int i = 0; i < datasets; ++i) {
221  auto const & paths = m_hltConfig.datasetContent(i);
222  m_datasets[i].reserve(paths.size());
223  for (auto const & path: paths)
225  }
226  m_dataset_counts.clear();
227  m_dataset_counts.resize( datasets, nullptr );
228 
229  unsigned int streams = m_hltConfig.streamNames().size();
230  m_streams.clear();
231  m_streams.resize( streams, {} );
232  for (unsigned int i = 0; i < streams; ++i) {
233  for (auto const & dataset : m_hltConfig.streamContent(i)) {
234  for (auto const & path : m_hltConfig.datasetContent(dataset))
235  m_streams[i].push_back(m_hltConfig.triggerIndex(path));
236  }
237  std::sort(m_streams[i].begin(), m_streams[i].end());
238  auto unique_end = std::unique(m_streams[i].begin(), m_streams[i].end());
239  m_streams[i].resize(unique_end - m_streams[i].begin());
240  m_streams[i].shrink_to_fit();
241  }
242  m_stream_counts.clear();
243  m_stream_counts.resize( streams, nullptr );
244  } else {
245  // HLTConfigProvider not initialised, skip the the HLT monitoring
246  edm::LogError("TriggerRatesMonitor") << "failed to initialise HLTConfigProvider, the HLT trigger and datasets rates will not be monitored";
247  }
248 }
unsigned int size() const
number of trigger paths in trigger table
int i
Definition: DBlmapReader.cc:9
const edm::EDGetTokenT< edm::TriggerResults > m_hlt_results
static const unsigned int maxPhysicsTriggers
Definition: GlobalAlgBlk.h:52
char const * process
Definition: ProductLabels.h:7
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
static const char *const s_tcds_trigger_types[]
std::vector< std::vector< unsigned int > > m_streams
const std::vector< std::string > & streamNames() const
std::vector< TH1F * > m_dataset_counts
const std::vector< std::string > & streamContent(unsigned int stream) const
names of datasets in stream with index i
std::vector< std::vector< unsigned int > > m_datasets
#define end
Definition: vmac.h:37
L1TUtmTriggerMenu const * m_l1tMenu
HLTConfigProvider m_hltConfig
const std::vector< std::string > & datasetContent(unsigned int dataset) const
names of trigger paths in dataset with index i
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
tuple dataset
Definition: dataset.py:859
std::vector< HLTRatesPlots > m_hlt_counts
std::vector< TH1F * > m_stream_counts
void labelsForToken(EDGetToken iToken, Labels &oLabels) const
#define begin
Definition: vmac.h:30
std::vector< TH1F * > m_l1t_counts
std::vector< HLTIndices > m_hltIndices
std::vector< TH1F * > m_tcds_counts
const std::vector< std::string > & datasetNames() const
void TriggerRatesMonitor::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 152 of file TriggerRatesMonitor.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::addUntracked(), HLT_25ns10e33_v2_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

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

Member Data Documentation

std::vector<TH1F *> TriggerRatesMonitor::m_dataset_counts
private

Definition at line 141 of file TriggerRatesMonitor.cc.

Referenced by analyze(), bookHistograms(), and dqmBeginRun().

std::vector<std::vector<unsigned int> > TriggerRatesMonitor::m_datasets
private

Definition at line 117 of file TriggerRatesMonitor.cc.

Referenced by analyze(), and dqmBeginRun().

std::string TriggerRatesMonitor::m_dqm_path
private

Definition at line 97 of file TriggerRatesMonitor.cc.

Referenced by bookHistograms().

TH1F* TriggerRatesMonitor::m_events_processed
private

Definition at line 131 of file TriggerRatesMonitor.cc.

Referenced by analyze(), bookHistograms(), and dqmBeginRun().

std::vector<HLTRatesPlots> TriggerRatesMonitor::m_hlt_counts
private

Definition at line 138 of file TriggerRatesMonitor.cc.

Referenced by analyze(), bookHistograms(), and dqmBeginRun().

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

Definition at line 96 of file TriggerRatesMonitor.cc.

Referenced by analyze(), and dqmBeginRun().

HLTConfigProvider TriggerRatesMonitor::m_hltConfig
private

Definition at line 114 of file TriggerRatesMonitor.cc.

Referenced by analyze(), bookHistograms(), and dqmBeginRun().

std::vector<HLTIndices> TriggerRatesMonitor::m_hltIndices
private

Definition at line 115 of file TriggerRatesMonitor.cc.

Referenced by analyze(), bookHistograms(), and dqmBeginRun().

std::vector<TH1F *> TriggerRatesMonitor::m_l1t_counts
private

Definition at line 135 of file TriggerRatesMonitor.cc.

Referenced by analyze(), bookHistograms(), and dqmBeginRun().

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

Definition at line 95 of file TriggerRatesMonitor.cc.

Referenced by analyze().

L1TUtmTriggerMenu const* TriggerRatesMonitor::m_l1tMenu
private

Definition at line 102 of file TriggerRatesMonitor.cc.

Referenced by analyze(), bookHistograms(), and dqmBeginRun().

uint32_t TriggerRatesMonitor::m_lumisections_range
private

Definition at line 98 of file TriggerRatesMonitor.cc.

Referenced by bookHistograms().

std::vector<TH1F *> TriggerRatesMonitor::m_stream_counts
private

Definition at line 144 of file TriggerRatesMonitor.cc.

Referenced by analyze(), bookHistograms(), and dqmBeginRun().

std::vector<std::vector<unsigned int> > TriggerRatesMonitor::m_streams
private

Definition at line 118 of file TriggerRatesMonitor.cc.

Referenced by analyze(), and dqmBeginRun().

std::vector<TH1F *> TriggerRatesMonitor::m_tcds_counts
private

Definition at line 132 of file TriggerRatesMonitor.cc.

Referenced by analyze(), bookHistograms(), and dqmBeginRun().

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

Definition at line 75 of file TriggerRatesMonitor.cc.

Referenced by bookHistograms(), and dqmBeginRun().