11 #include <boost/regex.hpp>
12 #include <boost/format.hpp>
51 event.getByToken(token, handle);
57 template <
typename R,
typename T>
61 setup.get<
R>().
get(handle);
143 desc.
addUntracked<uint32_t>(
"lumisectionRange", 2500 );
144 descriptions.
add(
"triggerRatesMonitor", desc);
151 m_hlt_results( consumes<edm::
TriggerResults>( config.getUntrackedParameter<edm::InputTag>(
"hltResults" ) ) ),
152 m_dqm_path( config.getUntrackedParameter<std::
string>(
"dqmPath" ) ),
153 m_lumisections_range( config.getUntrackedParameter<uint32_t>(
"lumisectionRange" ) ),
165 m_events_calibration(
nullptr ),
196 if (
m_l1tMenu and m_l1tAlgoMask and m_l1tTechMask) {
203 edm::LogError(
"TriggerRatesMonitor") <<
"failed to read the L1 menu or masks from the EventSetup, the L1 trigger rates will not be monitored";
244 edm::LogError(
"TriggerRatesMonitor") <<
"failed to initialise HLTConfigProvider, the HLT trigger and datasets rates will not be monitored";
263 int bit = keyval.second.algoBitNumber();
265 bool masked = ((m_l1tAlgoMask->gtTriggerMask().at(bit) & 0xff) == 0xff);
271 for (
unsigned int bit = 0; bit < m_l1tAlgoMask->gtTriggerMask().size(); ++bit)
if (not
m_l1t_algo_counts.at(bit)) {
273 bool masked = ((m_l1tAlgoMask->gtTriggerMask().at(bit) & 0xff) == 0xff);
286 int bit = keyval.second.algoBitNumber();
288 bool masked = ((m_l1tTechMask->gtTriggerMask().at(bit) & 0xff) == 0xff);
294 for (
unsigned int bit = 0; bit < m_l1tTechMask->gtTriggerMask().size(); ++bit)
if (not
m_l1t_tech_counts.at(bit)) {
296 bool masked = ((m_l1tTechMask->gtTriggerMask().at(bit) & 0xff) == 0xff);
321 if (type ==
"HLTLevel1GTSeed" or type ==
"HLTLevel1Activity" or type ==
"HLTLevel1Pattern") {
325 }
else if (type ==
"HLTPrescaler") {
343 for (
unsigned int i = 0; i <
streams.size(); ++
i)
351 unsigned int lumisection =
event.luminosityBlock();
378 const std::vector<bool> & algoword = l1tResults.
decisionWord();
384 edm::LogWarning(
"TriggerRatesMonitor") <<
"This should never happen: the size of the L1 Algo Trigger mask does not match the number of L1 Algo Triggers";
393 edm::LogWarning(
"TriggerRatesMonitor") <<
"This should never happen: the size of the L1 Tech Trigger mask does not match the number of L1 Tech Triggers";
411 else if (path.
error())
417 edm::LogWarning(
"TriggerRatesMonitor") <<
"This should never happen: the number of HLT paths has changed since the beginning of the run";
428 for (
unsigned int i = 0; i <
m_streams.size(); ++
i)
unsigned int size() const
number of trigger paths in trigger table
const std::string moduleType(const std::string &module) const
C++ class name of module.
const TechnicalTriggerWord & technicalTriggerWord(int bxInEventValue) const
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
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
bool wasrun() const
was this path run?
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1t_results
uint32_t m_lumisections_range
#define DEFINE_FWK_MODULE(type)
std::vector< TH1F * > m_l1t_algo_counts
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
string format
Some error handling for the usage.
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
L1GtTriggerMask const * m_l1tAlgoMask
const std::string & moduleLabel(unsigned int trigger, unsigned int module) const
bool inited() const
Accessors (const methods)
unsigned int index_prescale
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
std::vector< std::vector< unsigned int > > m_streams
virtual void analyze(edm::Event const &, edm::EventSetup const &) override
const std::vector< std::string > & streamNames() const
tuple path
else: Piece not in the list, fine.
std::vector< TH1F * > m_dataset_counts
TH1F * m_events_processed
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
unsigned int size() const
Get number of paths stored.
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
std::vector< TH1F * > m_l1t_tech_counts
virtual void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
MonitorElement * book1D(Args &&...args)
L1GtTriggerMask const * m_l1tTechMask
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
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 DecisionWord & decisionWord(int bxInEventValue) const
const HLTPathStatus & at(const unsigned int i) const
HLTConfigProvider m_hltConfig
const std::vector< std::string > & datasetContent(unsigned int dataset) const
names of trigger paths in dataset with index i
TH1F * m_events_calibration
bool error() const
has this path encountered an error (exception)?
void setCurrentFolder(const std::string &fullpath)
T const * product() const
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
T const * product() const
TH1F * getTH1F(void) const
std::vector< HLTRatesPlots > m_hlt_counts
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::vector< TH1F * > m_stream_counts
bool accept() const
has this path accepted the event?
void labelsForToken(EDGetToken iToken, Labels &oLabels) const
L1GtTriggerMenu const * m_l1tMenu
edm::EDGetTokenT< edm::TriggerResults > m_hlt_results
TriggerRatesMonitor(edm::ParameterSet const &)
edm::EventAuxiliary::ExperimentType experimentType() const
static const double SECS_PER_LUMI
unsigned int index_l1_seed
std::shared_ptr< cms::Exception > whyFailed() const
std::vector< HLTIndices > m_hltIndices
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
const std::vector< std::string > & datasetNames() const
unsigned int index() const