CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes
FWHLTTriggerTableView Class Reference

#include <Fireworks/Core/interface/FWHLTTriggerTableView.h>

Inheritance diagram for FWHLTTriggerTableView:
FWTriggerTableView FWViewBase FWConfigurableParameterizable FWParameterizable FWConfigurable

Public Member Functions

 FWHLTTriggerTableView (TEveWindowSlot *)
 
 ~FWHLTTriggerTableView () override
 
- Public Member Functions inherited from FWTriggerTableView
void addTo (FWConfiguration &) const override
 
Color_t backgroundColor () const
 
void columnSelected (Int_t iCol, Int_t iButton, Int_t iKeyMod)
 
void dataChanged (void)
 
 FWTriggerTableView (TEveWindowSlot *, FWViewType::EType)
 
void processChanged (const char *)
 
void resetCombo () const
 
void saveImageTo (const std::string &iName) const override
 
void setBackgroundColor (Color_t)
 
void setFrom (const FWConfiguration &) override
 
void setProcessList (std::vector< std::string > *x)
 
 ~FWTriggerTableView (void) override
 
- Public Member Functions inherited from FWViewBase
virtual FWViewContextMenuHandlerBasecontextMenuHandler () const
 
void destroy ()
 
 FWViewBase (FWViewType::EType, unsigned int iVersion=1)
 
void promptForSaveImageTo (TGFrame *) const
 
FWViewType::EType typeId () const
 
const std::string & typeName () const
 
- Public Member Functions inherited from FWConfigurableParameterizable
 FWConfigurableParameterizable (unsigned int iVersion=1)
 
unsigned int version () const
 
 ~FWConfigurableParameterizable () override
 
- Public Member Functions inherited from FWParameterizable
void add (FWParameterBase *)
 
const_iterator begin () const
 
const_iterator end () const
 
 FWParameterizable ()
 
virtual ~FWParameterizable ()
 
- Public Member Functions inherited from FWConfigurable
 FWConfigurable ()
 
virtual ~FWConfigurable ()
 

Protected Member Functions

void fillTable (fwlite::Event *event) override
 
- Protected Member Functions inherited from FWViewBase
 ~FWViewBase () override
 

Private Types

typedef std::unordered_map< std::string, double > acceptmap_t
 

Private Member Functions

void fillAverageAcceptFractions ()
 

Private Attributes

acceptmap_t m_averageAccept
 
fwlite::Eventm_event
 

Additional Inherited Members

- Public Types inherited from FWParameterizable
typedef std::vector< FWParameterBase * >::const_iterator const_iterator
 
- Public Attributes inherited from FWViewBase
sigc::signal< void, const FWViewBase * > beingDestroyed_
 
sigc::signal< void, Int_t, Int_t > openSelectedModelContextMenu_
 
- Protected Attributes inherited from FWTriggerTableView
std::vector< Columnm_columns
 
FWStringParameter m_process
 
FWStringParameter m_regex
 
FWTriggerTableViewTableManagerm_tableManager
 
- Protected Attributes inherited from FWViewBase
FWViewType m_type
 

Detailed Description

Description: [one line class summary]

Usage: <usage>

Definition at line 30 of file FWHLTTriggerTableView.h.

Member Typedef Documentation

◆ acceptmap_t

typedef std::unordered_map<std::string, double> FWHLTTriggerTableView::acceptmap_t
private

Definition at line 39 of file FWHLTTriggerTableView.h.

Constructor & Destructor Documentation

◆ FWHLTTriggerTableView()

FWHLTTriggerTableView::FWHLTTriggerTableView ( TEveWindowSlot *  iParent)

Definition at line 25 of file FWHLTTriggerTableView.cc.

26  : FWTriggerTableView(iParent, FWViewType::kTableHLT), m_event(nullptr) {
27  m_columns[0].title = "Filter Name";
28  m_columns.push_back(Column("Accept"));
29  m_columns.push_back(Column("Average Accept"));
30  dataChanged();
31 }

References FWTriggerTableView::dataChanged(), and FWTriggerTableView::m_columns.

◆ ~FWHLTTriggerTableView()

FWHLTTriggerTableView::~FWHLTTriggerTableView ( )
inlineoverride

Definition at line 33 of file FWHLTTriggerTableView.h.

33 {}

Member Function Documentation

◆ fillAverageAcceptFractions()

void FWHLTTriggerTableView::fillAverageAcceptFractions ( )
private

Definition at line 58 of file FWHLTTriggerTableView.cc.

58  {
59  edm::EventID currentEvent = m_event->id();
60  // better to keep the keys and just set to zero the values
61  for (acceptmap_t::iterator it = m_averageAccept.begin(), ed = m_averageAccept.end(); it != ed; ++it) {
62  it->second = 0;
63  }
64 
65  // loop over events
67  for (m_event->toBegin(); !m_event->atEnd(); ++(*m_event)) {
68  hTriggerResults.getByLabel(*m_event, "TriggerResults", "", "HLT");
69  edm::TriggerNames const* triggerNames(nullptr);
70  try {
71  triggerNames = &m_event->triggerNames(*hTriggerResults);
72  } catch (cms::Exception&) {
73  fwLog(fwlog::kError) << " exception caught while trying to get trigger info" << std::endl;
74  break;
75  }
76 
77  for (unsigned int i = 0; i < triggerNames->size(); ++i) {
78  if (hTriggerResults->accept(i)) {
79  m_averageAccept[triggerNames->triggerName(i)]++;
80  }
81  }
82  }
83  m_event->to(currentEvent);
84 
85  double denominator = 1.0 / m_event->size();
86  for (acceptmap_t::iterator it = m_averageAccept.begin(), ed = m_averageAccept.end(); it != ed; ++it) {
87  it->second *= denominator;
88  }
89 }

References edm::HLTGlobalStatus::accept(), fwlite::Event::atEnd(), HLTTauDQMOffline_cfi::denominator, fwLog, fwlite::Handle< T >::getByLabel(), mps_fire::i, edm::EventBase::id(), fwlog::kError, m_averageAccept, m_event, fwlite::Event::size(), fwlite::Event::to(), fwlite::Event::toBegin(), L1TEGammaOffline_cfi::triggerNames, and fwlite::Event::triggerNames().

Referenced by fillTable().

◆ fillTable()

void FWHLTTriggerTableView::fillTable ( fwlite::Event event)
overrideprotectedvirtual

Implements FWTriggerTableView.

Definition at line 33 of file FWHLTTriggerTableView.cc.

33  {
34  if (event != m_event) {
35  m_event = event;
37  }
39  edm::TriggerNames const* triggerNames(nullptr);
40  try {
41  hTriggerResults.getByLabel(*event, "TriggerResults", "", m_process.value().c_str());
42  triggerNames = &event->triggerNames(*hTriggerResults);
43  } catch (cms::Exception&) {
44  fwLog(fwlog::kWarning) << " no trigger results with process name HLT is available" << std::endl;
46  return;
47  }
48  boost::regex filter(m_regex.value());
49  for (unsigned int i = 0; i < triggerNames->size(); ++i) {
50  if (!boost::regex_search(triggerNames->triggerName(i), filter))
51  continue;
52  m_columns.at(0).values.push_back(triggerNames->triggerName(i));
53  m_columns.at(1).values.push_back(Form("%d", hTriggerResults->accept(i)));
54  m_columns.at(2).values.push_back(Form("%6.1f%%", m_averageAccept[triggerNames->triggerName(i)] * 100));
55  }
56 }

References edm::HLTGlobalStatus::accept(), FWTriggerTableViewTableManager::dataChanged(), edmPickEvents::event, fillAverageAcceptFractions(), ALCARECOTkAlBeamHalo_cff::filter, fwLog, fwlite::Handle< T >::getByLabel(), mps_fire::i, fwlog::kWarning, m_averageAccept, FWTriggerTableView::m_columns, m_event, FWTriggerTableView::m_process, FWTriggerTableView::m_regex, FWTriggerTableView::m_tableManager, L1TEGammaOffline_cfi::triggerNames, and FWGenericParameter< T >::value().

Member Data Documentation

◆ m_averageAccept

acceptmap_t FWHLTTriggerTableView::m_averageAccept
private

Definition at line 42 of file FWHLTTriggerTableView.h.

Referenced by fillAverageAcceptFractions(), and fillTable().

◆ m_event

fwlite::Event* FWHLTTriggerTableView::m_event
private

Definition at line 41 of file FWHLTTriggerTableView.h.

Referenced by fillAverageAcceptFractions(), and fillTable().

FWHLTTriggerTableView::m_averageAccept
acceptmap_t m_averageAccept
Definition: FWHLTTriggerTableView.h:42
fwLog
#define fwLog(_level_)
Definition: fwLog.h:45
mps_fire.i
i
Definition: mps_fire.py:428
fwlite::Event::toBegin
Event const & toBegin() override
Go to the very first Event.
Definition: Event.cc:230
fwlite::Event::to
bool to(Long64_t iIndex)
Go to the event at index iIndex.
Definition: Event.cc:208
FWTriggerTableView::m_regex
FWStringParameter m_regex
Definition: FWTriggerTableView.h:64
Column
FWTriggerTableViewTableManager::dataChanged
void dataChanged()
Definition: FWTriggerTableViewTableManager.cc:60
fwlite::Event::size
Long64_t size() const
Returns number of events in the file.
Definition: Event.cc:258
fwlite::Handle
Definition: Handle.h:39
FWTriggerTableView::m_process
FWStringParameter m_process
Definition: FWTriggerTableView.h:65
FWHLTTriggerTableView::fillAverageAcceptFractions
void fillAverageAcceptFractions()
Definition: FWHLTTriggerTableView.cc:58
L1TEGammaOffline_cfi.triggerNames
triggerNames
Definition: L1TEGammaOffline_cfi.py:40
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
FWTriggerTableView::m_columns
std::vector< Column > m_columns
Definition: FWTriggerTableView.h:67
edmPickEvents.event
event
Definition: edmPickEvents.py:273
fwlog::kWarning
Definition: fwLog.h:35
FWViewType::kTableHLT
Definition: FWViewType.h:41
fwlite::Event::atEnd
bool atEnd() const override
Definition: Event.cc:267
FWGenericParameter::value
T value() const
Definition: FWGenericParameter.h:50
fwlite::Handle::getByLabel
void getByLabel(const P &iP, const char *iModuleLabel, const char *iProductInstanceLabel=nullptr, const char *iProcessLabel=nullptr)
Definition: Handle.h:100
fwlite::Event::triggerNames
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:402
HLTTauDQMOffline_cfi.denominator
denominator
Definition: HLTTauDQMOffline_cfi.py:180
FWTriggerTableView::dataChanged
void dataChanged(void)
Definition: FWTriggerTableView.cc:111
edm::EventBase::id
edm::EventID id() const
Definition: EventBase.h:59
edm::TriggerNames
Definition: TriggerNames.h:55
edm::HLTGlobalStatus::accept
bool accept() const
Has at least one path accepted the event?
Definition: HLTGlobalStatus.h:49
fwlog::kError
Definition: fwLog.h:35
cms::Exception
Definition: Exception.h:70
FWTriggerTableView::FWTriggerTableView
FWTriggerTableView(TEveWindowSlot *, FWViewType::EType)
Definition: FWTriggerTableView.cc:44
FWHLTTriggerTableView::m_event
fwlite::Event * m_event
Definition: FWHLTTriggerTableView.h:41
FWTriggerTableView::m_tableManager
FWTriggerTableViewTableManager * m_tableManager
Definition: FWTriggerTableView.h:68
event
Definition: event.py:1
edm::EventID
Definition: EventID.h:31