test
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
FWL1TriggerTableView Class Reference

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

Inheritance diagram for FWL1TriggerTableView:
FWTriggerTableView FWViewBase FWConfigurableParameterizable FWParameterizable FWConfigurable

Public Member Functions

 FWL1TriggerTableView (TEveWindowSlot *)
 
virtual ~FWL1TriggerTableView ()
 
- 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 ()
 

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 25 of file FWL1TriggerTableView.h.

Constructor & Destructor Documentation

FWL1TriggerTableView::FWL1TriggerTableView ( TEveWindowSlot *  iParent)

Definition at line 27 of file FWL1TriggerTableView.cc.

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

29 {
30  m_columns[0].title = "Algorithm Name";
31  m_columns.push_back( Column( "Result" ) );
32  m_columns.push_back( Column( "Bit Number" ) );
33  m_columns.push_back( Column( "Prescale" ) );
34 
35  dataChanged();
36 }
std::vector< Column > m_columns
FWTriggerTableView(TEveWindowSlot *, FWViewType::EType)
virtual FWL1TriggerTableView::~FWL1TriggerTableView ( )
inlinevirtual

Definition at line 29 of file FWL1TriggerTableView.h.

29 {}

Member Function Documentation

void FWL1TriggerTableView::fillTable ( fwlite::Event event)
protectedvirtual

prescale factors

Implements FWTriggerTableView.

Definition at line 39 of file FWL1TriggerTableView.cc.

References L1GlobalTriggerReadoutRecord::decisionWord(), alcazmumu_cfi::filter, fwLog, fwlite::Handle< T >::getByLabel(), fwlite::Event::getRun(), L1GtTriggerMenuLite::gtAlgorithmMap(), L1GlobalTriggerReadoutRecord::gtFdlWord(), L1GtTriggerMenuLite::gtPrescaleFactorsAlgoTrig(), L1GtTriggerMenuLite::gtPrescaleFactorsTechTrig(), L1GtTriggerMenuLite::gtTriggerResult(), fwlite::Handle< T >::isValid(), fwlog::kError, fwlog::kWarning, FWTriggerTableView::m_columns, FWTriggerTableView::m_regex, mps_fire::result, AlCaHLTBitMon_QueryRunRegistry::string, L1GlobalTriggerReadoutRecord::technicalTriggerWord(), and FWGenericParameter< T >::value().

40 {
43 
44  try
45  {
46  // FIXME: Replace magic strings with configurable ones
47  triggerMenuLite.getByLabel( event->getRun(), "l1GtTriggerMenuLite", "", "" );
48  triggerRecord.getByLabel( *event, "gtDigis", "", "" );
49  }
50  catch( cms::Exception& )
51  {
52  fwLog( fwlog::kWarning ) << "FWL1TriggerTableView: no L1Trigger menu is available." << std::endl;
53  return;
54  }
55 
56  if( triggerMenuLite.isValid() && triggerRecord.isValid() )
57  {
58  const L1GtTriggerMenuLite::L1TriggerMap& algorithmMap = triggerMenuLite->gtAlgorithmMap();
59 
60  int pfIndexTechTrig = -1;
61  int pfIndexAlgoTrig = -1;
62 
63  boost::regex filter(m_regex.value());
64 
66  std::vector<std::vector<int> > prescaleFactorsAlgoTrig = triggerMenuLite->gtPrescaleFactorsAlgoTrig();
67  std::vector<std::vector<int> > prescaleFactorsTechTrig = triggerMenuLite->gtPrescaleFactorsTechTrig();
68  pfIndexAlgoTrig = ( triggerRecord->gtFdlWord()).gtPrescaleFactorIndexAlgo();
69  pfIndexTechTrig = ( triggerRecord->gtFdlWord()).gtPrescaleFactorIndexTech();
70 
71  int pfIndexTechTrigValidSize = static_cast<int>(prescaleFactorsTechTrig.size());
72  if( pfIndexTechTrigValidSize <= pfIndexTechTrig )
73  fwLog( fwlog::kError) << Form( "FWL1TriggerTableView: Can't get Technical Trigger pre-scale factors. Index [%d] larger that table size [%d]\n",
74  pfIndexTechTrig, (int)prescaleFactorsTechTrig.size());
75  int pfIndexAlgoTrigValidSize = static_cast<int>(prescaleFactorsAlgoTrig.size());
76  if( pfIndexAlgoTrigValidSize <= pfIndexAlgoTrig )
77  fwLog( fwlog::kError) << Form( "FWL1TriggerTableView: Can't get L1 Algo pre-scale factors. Index [%d] larger that table size [%d]\n",
78  pfIndexAlgoTrig, (int)prescaleFactorsAlgoTrig.size());
79 
80  const DecisionWord dWord = triggerRecord->decisionWord();
81  for( L1GtTriggerMenuLite::CItL1Trig itTrig = algorithmMap.begin(), itTrigEnd = algorithmMap.end();
82  itTrig != itTrigEnd; ++itTrig )
83  {
84  const unsigned int bitNumber = itTrig->first;
85  const std::string& aName = itTrig->second;
86  int errorCode = 0;
87  const bool result = triggerMenuLite->gtTriggerResult( aName, dWord, errorCode );
88 
89  if ( !boost::regex_search(aName, filter) ) continue;
90 
91  m_columns.at(0).values.push_back( aName );
92  m_columns.at(1).values.push_back( Form( "%d", result ));
93  m_columns.at(2).values.push_back( Form( "%d", bitNumber ));
94 
95  if(( pfIndexAlgoTrig < pfIndexAlgoTrigValidSize )
96  && static_cast<unsigned int>(prescaleFactorsAlgoTrig.at(pfIndexAlgoTrig).size()) > bitNumber )
97  {
98  m_columns.at(3).values.push_back( Form( "%d", prescaleFactorsAlgoTrig.at( pfIndexAlgoTrig ).at( bitNumber )));
99  }
100  else
101  m_columns.at(3).values.push_back( "invalid");
102  }
103 
104  const static std::string kTechTriggerName = "TechTrigger";
105  const TechnicalTriggerWord ttWord = triggerRecord->technicalTriggerWord();
106 
107  int tBitNumber = 0;
108  int tBitResult = 0;
109  if(boost::regex_search(kTechTriggerName, filter))
110  {
111  for( TechnicalTriggerWord::const_iterator tBitIt = ttWord.begin(), tBitEnd = ttWord.end();
112  tBitIt != tBitEnd; ++tBitIt, ++tBitNumber )
113  {
114  if( *tBitIt )
115  tBitResult = 1;
116  else
117  tBitResult = 0;
118 
119  m_columns.at(0).values.push_back( kTechTriggerName );
120  m_columns.at(1).values.push_back( Form( "%d", tBitResult ));
121  m_columns.at(2).values.push_back( Form( "%d", tBitNumber ));
122 
123  if (( pfIndexTechTrig < pfIndexTechTrigValidSize )
124  && static_cast<int>(prescaleFactorsTechTrig.at(pfIndexTechTrig).size()) > tBitNumber )
125  {
126  m_columns.at(3).values.push_back( Form( "%d", prescaleFactorsTechTrig.at( pfIndexTechTrig ).at( tBitNumber )));
127  }
128  else
129  m_columns.at(3).values.push_back( Form( "invalid" ));
130  }
131  }
132  } // trigger valid
133  else
134  {
135  m_columns.at(0).values.push_back( "No L1Trigger menu available." );
136  m_columns.at(1).values.push_back( " " );
137  m_columns.at(2).values.push_back( " " );
138  m_columns.at(3).values.push_back( " " );
139  }
140 }
std::vector< Column > m_columns
const TechnicalTriggerWord & technicalTriggerWord(int bxInEventValue) const
bool isValid() const
Definition: Handle.h:61
FWStringParameter m_regex
const std::vector< std::vector< int > > & gtPrescaleFactorsAlgoTrig() const
get the prescale factors by reference / set the prescale factors
fwlite::Run const & getRun() const
Definition: Event.cc:538
tuple result
Definition: mps_fire.py:84
std::map< unsigned int, std::string > L1TriggerMap
map containing the physics algorithms or the technical triggers
void getByLabel(const P &iP, const char *iModuleLabel, const char *iProductInstanceLabel=0, const char *iProcessLabel=0)
Definition: Handle.h:91
std::vector< bool > DecisionWord
typedefs
std::vector< bool > TechnicalTriggerWord
technical trigger bits (64 bits)
const bool gtTriggerResult(const std::string &trigName, const std::vector< bool > &decWord, int &errorCode) const
const std::vector< std::vector< int > > & gtPrescaleFactorsTechTrig() const
const DecisionWord & decisionWord(int bxInEventValue) const
L1TriggerMap::const_iterator CItL1Trig
iterators through map containing the physics algorithms or the technical triggers ...
const L1GtFdlWord gtFdlWord(int bxInEventValue) const
get / set FDL word (record) in the GT readout record
#define fwLog(_level_)
Definition: fwLog.h:50
const L1TriggerMap & gtAlgorithmMap() const
get / set the algorithm map (by name)