CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 *)
 
virtual ~FWHLTTriggerTableView ()
 
- Public Member Functions inherited from FWTriggerTableView
virtual void addTo (FWConfiguration &) const
 
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
 
virtual void saveImageTo (const std::string &iName) const
 
void setBackgroundColor (Color_t)
 
virtual void setFrom (const FWConfiguration &)
 
void setProcessList (std::vector< std::string > *x)
 
virtual ~FWTriggerTableView (void)
 
- Public Member Functions inherited from FWViewBase
virtual
FWViewContextMenuHandlerBase
contextMenuHandler () 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
 
virtual ~FWConfigurableParameterizable ()
 
- 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

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

Private Types

typedef boost::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 28 of file FWHLTTriggerTableView.h.

Member Typedef Documentation

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

Definition at line 38 of file FWHLTTriggerTableView.h.

Constructor & Destructor Documentation

FWHLTTriggerTableView::FWHLTTriggerTableView ( TEveWindowSlot *  iParent)

Definition at line 26 of file FWHLTTriggerTableView.cc.

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

28  m_event(0)
29 {
30 
31  m_columns[0].title = "Filter Name";
32  m_columns.push_back(Column("Accept"));
33  m_columns.push_back(Column("Average Accept"));
34  dataChanged();
35 }
std::vector< Column > m_columns
FWTriggerTableView(TEveWindowSlot *, FWViewType::EType)
virtual FWHLTTriggerTableView::~FWHLTTriggerTableView ( )
inlinevirtual

Definition at line 32 of file FWHLTTriggerTableView.h.

32 {}

Member Function Documentation

void FWHLTTriggerTableView::fillAverageAcceptFractions ( )
private

Definition at line 64 of file FWHLTTriggerTableView.cc.

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

Referenced by fillTable().

65 {
66  edm::EventID currentEvent = m_event->id();
67  // better to keep the keys and just set to zero the values
68  for (acceptmap_t::iterator it = m_averageAccept.begin(), ed = m_averageAccept.end(); it != ed; ++it) {
69  it->second = 0;
70  }
71 
72  // loop over events
74  for (m_event->toBegin(); !m_event->atEnd(); ++(*m_event)) {
75  hTriggerResults.getByLabel(*m_event,"TriggerResults","","HLT");
76  edm::TriggerNames const* triggerNames(0);
77  try{
78  triggerNames = &m_event->triggerNames(*hTriggerResults);
79  } catch (cms::Exception&) {
80  fwLog(fwlog::kError) <<" exception caught while trying to get trigger info"<<std::endl;
81  break;
82  }
83 
84  for(unsigned int i=0; i<triggerNames->size(); ++i) {
85  if ( hTriggerResults->accept(i) ) {
86  m_averageAccept[triggerNames->triggerName(i)]++;
87  }
88  }
89  }
90  m_event->to(currentEvent);
91 
92  double denominator = 1.0/m_event->size();
93  for (acceptmap_t::iterator it = m_averageAccept.begin(), ed = m_averageAccept.end(); it != ed; ++it) {
94  it->second *= denominator;
95  }
96 }
int i
Definition: DBlmapReader.cc:9
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:400
bool accept() const
Has at least one path accepted the event?
Long64_t size() const
Returns number of events in the file.
Definition: Event.cc:240
void getByLabel(const P &iP, const char *iModuleLabel, const char *iProductInstanceLabel=0, const char *iProcessLabel=0)
Definition: Handle.h:94
Event const & toBegin()
Go to the very first Event.
Definition: Event.cc:213
list denominator
Definition: cuy.py:484
bool to(Long64_t iIndex)
Go to the event at index iIndex.
Definition: Event.cc:183
virtual bool atEnd() const
Definition: Event.cc:256
#define fwLog(_level_)
Definition: fwLog.h:50
edm::EventID id() const
Definition: EventBase.h:56
void FWHLTTriggerTableView::fillTable ( fwlite::Event event)
protectedvirtual

Implements FWTriggerTableView.

Definition at line 38 of file FWHLTTriggerTableView.cc.

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

39 {
40  if ( event != m_event ) {
41  m_event = event;
43  }
45  edm::TriggerNames const* triggerNames(0);
46  try{
47  hTriggerResults.getByLabel(*event,"TriggerResults","",m_process.value().c_str());
48  triggerNames = &event->triggerNames(*hTriggerResults);
49  } catch (cms::Exception&) {
50  fwLog(fwlog::kWarning) << " no trigger results with process name HLT is available" << std::endl;
52  return;
53  }
54  boost::regex filter(m_regex.value());
55  for(unsigned int i=0; i<triggerNames->size(); ++i) {
56  if ( !boost::regex_search(triggerNames->triggerName(i),filter) ) continue;
57  m_columns.at(0).values.push_back(triggerNames->triggerName(i));
58  m_columns.at(1).values.push_back(Form("%d",hTriggerResults->accept(i)));
59  m_columns.at(2).values.push_back(Form("%6.1f%%",m_averageAccept[triggerNames->triggerName(i)]*100));
60  }
61 }
int i
Definition: DBlmapReader.cc:9
std::vector< Column > m_columns
FWStringParameter m_regex
bool accept() const
Has at least one path accepted the event?
void getByLabel(const P &iP, const char *iModuleLabel, const char *iProductInstanceLabel=0, const char *iProcessLabel=0)
Definition: Handle.h:94
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
#define fwLog(_level_)
Definition: fwLog.h:50
FWStringParameter m_process
FWTriggerTableViewTableManager * m_tableManager

Member Data Documentation

acceptmap_t FWHLTTriggerTableView::m_averageAccept
private

Definition at line 41 of file FWHLTTriggerTableView.h.

Referenced by fillAverageAcceptFractions(), and fillTable().

fwlite::Event* FWHLTTriggerTableView::m_event
private

Definition at line 40 of file FWHLTTriggerTableView.h.

Referenced by fillAverageAcceptFractions(), and fillTable().