CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
TriggerBxMonitor Class Reference
Inheritance diagram for TriggerBxMonitor:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 TriggerBxMonitor (edm::ParameterSet const &)
 
 ~TriggerBxMonitor ()
 
- 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
 
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
 
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::vector< ModuleDescription const * > &modules, 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 updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr< dqmDetails::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (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

const std::string m_dqm_path
 
std::vector< TH1F * > m_hlt_bx
 
TH2F * m_hlt_bx_all
 
const edm::EDGetTokenT< edm::TriggerResultsm_hlt_results
 
HLTConfigProvider m_hltConfig
 
std::vector< TH1F * > m_l1t_bx
 
TH2F * m_l1t_bx_all
 
const edm::EDGetTokenT< GlobalAlgBlkBxCollectionm_l1t_results
 
L1TUtmTriggerMenu const * m_l1tMenu
 
std::vector< TH1F * > m_tcds_bx
 
TH2F * m_tcds_bx_all
 

Static Private Attributes

static const unsigned int s_bx_range = 3564
 
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, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
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 56 of file TriggerBxMonitor.cc.

Constructor & Destructor Documentation

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

Definition at line 124 of file TriggerBxMonitor.cc.

124  :
125  // module configuration
126  m_l1t_results( consumes<GlobalAlgBlkBxCollection>( config.getUntrackedParameter<edm::InputTag>( "l1tResults" ) ) ),
127  m_hlt_results( consumes<edm::TriggerResults>( config.getUntrackedParameter<edm::InputTag>( "hltResults" ) ) ),
128  m_dqm_path( config.getUntrackedParameter<std::string>( "dqmPath" ) ),
129  // L1T and HLT configuration
130  m_l1tMenu(nullptr),
131  m_hltConfig(),
132  // L1T and HLT results
133  m_tcds_bx_all(nullptr),
134  m_l1t_bx_all(nullptr),
135  m_hlt_bx_all(nullptr),
136  m_tcds_bx(),
137  m_l1t_bx(),
138  m_hlt_bx()
139 {
140 }
HLTConfigProvider m_hltConfig
const edm::EDGetTokenT< GlobalAlgBlkBxCollection > m_l1t_results
Definition: config.py:1
const edm::EDGetTokenT< edm::TriggerResults > m_hlt_results
std::vector< TH1F * > m_tcds_bx
std::vector< TH1F * > m_l1t_bx
const std::string m_dqm_path
L1TUtmTriggerMenu const * m_l1tMenu
std::vector< TH1F * > m_hlt_bx
TriggerBxMonitor::~TriggerBxMonitor ( )

Definition at line 142 of file TriggerBxMonitor.cc.

143 {
144 }

Member Function Documentation

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

Implements edm::stream::EDAnalyzerBase.

Definition at line 227 of file TriggerBxMonitor.cc.

References DEFINE_FWK_MODULE, event(), SelectingProcedure_cff::hltResults, mps_fire::i, HLTConfigProvider::inited(), m_hlt_bx, m_hlt_bx_all, m_hlt_results, m_hltConfig, m_l1t_bx, m_l1t_bx_all, m_l1t_results, m_l1tMenu, m_tcds_bx, m_tcds_bx_all, GlobalAlgBlk::maxPhysicsTriggers, mps_update::results, s_tcds_trigger_types, and findQualityFiles::size.

228 {
229  unsigned int bx = event.bunchCrossing();
230 
231  // monitor the bx distribution for the TCDS trigger types
232  {
233  size_t size = sizeof(s_tcds_trigger_types) / sizeof(const char *);
234  unsigned int type = event.experimentType();
235  if (type < size and m_tcds_bx[type])
236  m_tcds_bx[type]->Fill(bx);
237  m_tcds_bx_all->Fill(bx, type);
238  }
239 
240  // monitor the bx distribution for the L1 triggers
241  if (m_l1tMenu) {
242  auto const & bxvector = get<GlobalAlgBlkBxCollection>(event, m_l1t_results);
243  if (not bxvector.isEmpty(0)) {
244  auto const & results = bxvector.at(0, 0);
245  for (unsigned int i = 0; i < GlobalAlgBlk::maxPhysicsTriggers; ++i)
246  if (results.getAlgoDecisionFinal(i)) {
247  if (m_l1t_bx[i])
248  m_l1t_bx[i]->Fill(bx);
249  m_l1t_bx_all->Fill(bx, i);
250  }
251  }
252  }
253 
254  // monitor the bx distribution for the HLT triggers
255  if (m_hltConfig.inited()) {
256  auto const & hltResults = get<edm::TriggerResults>(event, m_hlt_results);
257  if (hltResults.size() == m_hlt_bx.size()) {
258  for (unsigned int i = 0; i < m_hlt_bx.size(); ++i) {
259  if (hltResults.at(i).accept()) {
260  m_hlt_bx[i]->Fill(bx);
261  m_hlt_bx_all->Fill(bx, i);
262  }
263  }
264  } else {
265  edm::LogWarning("TriggerBxMonitor") << "This should never happen: the number of HLT paths has changed since the beginning of the run";
266  }
267  }
268 }
size
Write out results.
static const char *const s_tcds_trigger_types[]
HLTConfigProvider m_hltConfig
type
Definition: HCALResponse.h:21
const edm::EDGetTokenT< GlobalAlgBlkBxCollection > m_l1t_results
const edm::EDGetTokenT< edm::TriggerResults > m_hlt_results
static const unsigned int maxPhysicsTriggers
Definition: GlobalAlgBlk.h:52
bool inited() const
Accessors (const methods)
std::vector< TH1F * > m_tcds_bx
std::vector< TH1F * > m_l1t_bx
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
L1TUtmTriggerMenu const * m_l1tMenu
std::vector< TH1F * > m_hlt_bx
void TriggerBxMonitor::bookHistograms ( DQMStore::IBooker booker,
edm::Run const &  run,
edm::EventSetup const &  setup 
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 174 of file TriggerBxMonitor.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), cmsPerfStripChart::format, L1TUtmTriggerMenu::getAlgorithmMap(), MonitorElement::getTH1F(), MonitorElement::getTH2F(), mps_fire::i, HLTConfigProvider::inited(), m_dqm_path, m_hlt_bx, m_hlt_bx_all, m_hltConfig, m_l1t_bx, m_l1t_bx_all, m_l1tMenu, m_tcds_bx, m_tcds_bx_all, dataset::name, s_bx_range, s_tcds_trigger_types, DQMStore::IBooker::setCurrentFolder(), HLTConfigProvider::size(), findQualityFiles::size, harvestTrackValidationPlots::str, AlCaHLTBitMon_QueryRunRegistry::string, and HLTConfigProvider::triggerName().

175 {
176  // TCDS trigger type plots
177  {
178  size_t size = sizeof(s_tcds_trigger_types) / sizeof(const char *);
179 
180  // book 2D histogram to monitor all TCDS trigger types in a single plot
181  booker.setCurrentFolder( m_dqm_path );
182  m_tcds_bx_all = booker.book2D("TCDS Trigger Types", "TCDS Trigger Types vs. bunch crossing", s_bx_range + 1, -0.5, s_bx_range + 0.5, size, -0.5, size - 0.5)->getTH2F();
183 
184  // book the individual histograms for the known TCDS trigger types
185  booker.setCurrentFolder( m_dqm_path + "/TCDS" );
186  for (unsigned int i = 0; i < size; ++i) {
187  if (s_tcds_trigger_types[i]) {
188  m_tcds_bx.at(i) = booker.book1D(s_tcds_trigger_types[i], s_tcds_trigger_types[i], s_bx_range + 1, -0.5, s_bx_range + 0.5)->getTH1F();
189  m_tcds_bx_all->GetYaxis()->SetBinLabel(i+1, s_tcds_trigger_types[i]);
190  }
191  }
192  }
193 
194  // L1T plots
195  if (m_l1tMenu) {
196  // book 2D histogram to monitor all L1 triggers in a single plot
197  booker.setCurrentFolder( m_dqm_path );
198  m_l1t_bx_all = booker.book2D("Level 1 Triggers", "Level 1 Triggers vs. bunch crossing", s_bx_range + 1, -0.5, s_bx_range + 0.5, m_l1t_bx.size(), -0.5, m_l1t_bx.size() - 0.5)->getTH2F();
199 
200  // book the individual histograms for the L1 triggers that are included in the L1 menu
201  booker.setCurrentFolder( m_dqm_path + "/L1T" );
202  for (auto const & keyval: m_l1tMenu->getAlgorithmMap()) {
203  unsigned int bit = keyval.second.getIndex();
204  std::string const & name = (boost::format("%s (bit %d)") % keyval.first % bit).str();
205  m_l1t_bx.at(bit) = booker.book1D(name, name, s_bx_range + 1, -0.5, s_bx_range + 0.5)->getTH1F();
206  m_l1t_bx_all->GetYaxis()->SetBinLabel(bit+1, keyval.first.c_str());
207  }
208  }
209 
210  // HLT plots
211  if (m_hltConfig.inited()) {
212  // book 2D histogram to monitor all HLT paths in a single plot
213  booker.setCurrentFolder( m_dqm_path );
214  m_hlt_bx_all = booker.book2D("High Level Triggers", "High Level Triggers vs. bunch crossing", s_bx_range + 1, -0.5, s_bx_range + 0.5, m_hltConfig.size(), -0.5, m_hltConfig.size() - 0.5)->getTH2F();
215 
216  // book the individual HLT triggers histograms
217  booker.setCurrentFolder( m_dqm_path + "/HLT" );
218  for (unsigned int i = 0; i < m_hltConfig.size(); ++i) {
219  std::string const & name = m_hltConfig.triggerName(i);
220  m_hlt_bx[i] = booker.book1D(name, name, s_bx_range + 1, -0.5, s_bx_range + 0.5)->getTH1F();
221  m_hlt_bx_all->GetYaxis()->SetBinLabel(i+1, name.c_str());
222  }
223  }
224 }
unsigned int size() const
number of trigger paths in trigger table
size
Write out results.
static const char *const s_tcds_trigger_types[]
HLTConfigProvider m_hltConfig
const std::string & triggerName(unsigned int triggerIndex) const
bool inited() const
Accessors (const methods)
std::vector< TH1F * > m_tcds_bx
std::vector< TH1F * > m_l1t_bx
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
format
Some error handling for the usage.
const std::string m_dqm_path
L1TUtmTriggerMenu const * m_l1tMenu
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
static const unsigned int s_bx_range
TH1F * getTH1F(void) const
std::vector< TH1F * > m_hlt_bx
const std::map< std::string, L1TUtmAlgorithm > & getAlgorithmMap() const
TH2F * getTH2F(void) const
void TriggerBxMonitor::dqmBeginRun ( edm::Run const &  run,
edm::EventSetup const &  setup 
)
overrideprivatevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 146 of file TriggerBxMonitor.cc.

References HLTConfigProvider::init(), tablePrinter::labels, edm::EDConsumerBase::labelsForToken(), m_hlt_bx, m_hlt_results, m_hltConfig, m_l1t_bx, m_l1tMenu, m_tcds_bx, GlobalAlgBlk::maxPhysicsTriggers, nullptr, edm::ProductLabels::process, s_tcds_trigger_types, GeneralSetup::setup(), and HLTConfigProvider::size().

147 {
148  // initialise the TCDS vector
149  m_tcds_bx.clear();
150  m_tcds_bx.resize(sizeof(s_tcds_trigger_types) / sizeof(const char *), nullptr);
151 
152  // cache the L1 trigger menu
153  m_l1tMenu = & get<L1TUtmTriggerMenuRcd, L1TUtmTriggerMenu>(setup);
154  if (m_l1tMenu) {
155  m_l1t_bx.clear();
157  } else {
158  edm::LogError("TriggerBxMonitor") << "failed to read the L1 menu from the EventSetup, the L1 trigger bx distribution will not be monitored";
159  }
160 
161  // initialise the HLTConfigProvider
162  bool changed = true;
164  labelsForToken(m_hlt_results, labels);
165  if (m_hltConfig.init(run, setup, labels.process, changed)) {
166  m_hlt_bx.clear();
167  m_hlt_bx.resize( m_hltConfig.size(), nullptr );
168  } else {
169  // HLTConfigProvider not initialised, skip the the HLT monitoring
170  edm::LogError("TriggerBxMonitor") << "failed to initialise HLTConfigProvider, the HLT bx distribution will not be monitored";
171  }
172 }
unsigned int size() const
number of trigger paths in trigger table
static const char *const s_tcds_trigger_types[]
HLTConfigProvider m_hltConfig
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:1
const edm::EDGetTokenT< edm::TriggerResults > m_hlt_results
#define nullptr
static const unsigned int maxPhysicsTriggers
Definition: GlobalAlgBlk.h:52
char const * process
Definition: ProductLabels.h:7
std::vector< TH1F * > m_tcds_bx
std::vector< TH1F * > m_l1t_bx
L1TUtmTriggerMenu const * m_l1tMenu
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
std::vector< TH1F * > m_hlt_bx
void labelsForToken(EDGetToken iToken, Labels &oLabels) const
void TriggerBxMonitor::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 114 of file TriggerBxMonitor.cc.

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

115 {
117  desc.addUntracked<edm::InputTag>( "l1tResults", edm::InputTag("gtStage2Digis"));
118  desc.addUntracked<edm::InputTag>( "hltResults", edm::InputTag("TriggerResults"));
119  desc.addUntracked<std::string>( "dqmPath", "HLT/TriggerBx" );
120  descriptions.add("triggerBxMonitor", desc);
121 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)

Member Data Documentation

const std::string TriggerBxMonitor::m_dqm_path
private

Definition at line 95 of file TriggerBxMonitor.cc.

Referenced by bookHistograms().

std::vector<TH1F *> TriggerBxMonitor::m_hlt_bx
private

Definition at line 107 of file TriggerBxMonitor.cc.

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

TH2F* TriggerBxMonitor::m_hlt_bx_all
private

Definition at line 104 of file TriggerBxMonitor.cc.

Referenced by analyze(), and bookHistograms().

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

Definition at line 94 of file TriggerBxMonitor.cc.

Referenced by analyze(), and dqmBeginRun().

HLTConfigProvider TriggerBxMonitor::m_hltConfig
private

Definition at line 99 of file TriggerBxMonitor.cc.

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

std::vector<TH1F *> TriggerBxMonitor::m_l1t_bx
private

Definition at line 106 of file TriggerBxMonitor.cc.

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

TH2F* TriggerBxMonitor::m_l1t_bx_all
private

Definition at line 103 of file TriggerBxMonitor.cc.

Referenced by analyze(), and bookHistograms().

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

Definition at line 93 of file TriggerBxMonitor.cc.

Referenced by analyze().

L1TUtmTriggerMenu const* TriggerBxMonitor::m_l1tMenu
private

Definition at line 98 of file TriggerBxMonitor.cc.

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

std::vector<TH1F *> TriggerBxMonitor::m_tcds_bx
private

Definition at line 105 of file TriggerBxMonitor.cc.

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

TH2F* TriggerBxMonitor::m_tcds_bx_all
private

Definition at line 102 of file TriggerBxMonitor.cc.

Referenced by analyze(), and bookHistograms().

const unsigned int TriggerBxMonitor::s_bx_range = 3564
staticprivate

Definition at line 69 of file TriggerBxMonitor.cc.

Referenced by bookHistograms().

const char *const TriggerBxMonitor::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 73 of file TriggerBxMonitor.cc.

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