CMS 3D CMS Logo

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

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::FWL1TriggerTableView ( TEveWindowSlot *  iParent)

Definition at line 26 of file FWL1TriggerTableView.cc.

28  m_columns[0].title = "Algorithm Name";
29  m_columns.push_back(Column("Result"));
30  m_columns.push_back(Column("Bit Number"));
31  m_columns.push_back(Column("Prescale"));
32 
33  dataChanged();
34 }

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

◆ ~FWL1TriggerTableView()

FWL1TriggerTableView::~FWL1TriggerTableView ( )
inlineoverride

Definition at line 28 of file FWL1TriggerTableView.h.

28 {}

Member Function Documentation

◆ fillTable()

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

prescale factors

Implements FWTriggerTableView.

Definition at line 36 of file FWL1TriggerTableView.cc.

36  {
39 
40  try {
41  // FIXME: Replace magic strings with configurable ones
42  triggerMenuLite.getByLabel(event->getRun(), "l1GtTriggerMenuLite", "", "");
43  triggerRecord.getByLabel(*event, "gtDigis", "", "");
44  } catch (cms::Exception&) {
45  fwLog(fwlog::kWarning) << "FWL1TriggerTableView: no L1Trigger menu is available." << std::endl;
46  return;
47  }
48 
49  if (triggerMenuLite.isValid() && triggerRecord.isValid()) {
50  const L1GtTriggerMenuLite::L1TriggerMap& algorithmMap = triggerMenuLite->gtAlgorithmMap();
51 
52  int pfIndexTechTrig = -1;
53  int pfIndexAlgoTrig = -1;
54 
55  boost::regex filter(m_regex.value());
56 
58  std::vector<std::vector<int> > prescaleFactorsAlgoTrig = triggerMenuLite->gtPrescaleFactorsAlgoTrig();
59  std::vector<std::vector<int> > prescaleFactorsTechTrig = triggerMenuLite->gtPrescaleFactorsTechTrig();
60  pfIndexAlgoTrig = (triggerRecord->gtFdlWord()).gtPrescaleFactorIndexAlgo();
61  pfIndexTechTrig = (triggerRecord->gtFdlWord()).gtPrescaleFactorIndexTech();
62 
63  int pfIndexTechTrigValidSize = static_cast<int>(prescaleFactorsTechTrig.size());
64  if (pfIndexTechTrigValidSize <= pfIndexTechTrig)
65  fwLog(fwlog::kError) << Form(
66  "FWL1TriggerTableView: Can't get Technical Trigger pre-scale factors. Index [%d] larger that table size "
67  "[%d]\n",
68  pfIndexTechTrig,
69  (int)prescaleFactorsTechTrig.size());
70  int pfIndexAlgoTrigValidSize = static_cast<int>(prescaleFactorsAlgoTrig.size());
71  if (pfIndexAlgoTrigValidSize <= pfIndexAlgoTrig)
72  fwLog(fwlog::kError) << Form(
73  "FWL1TriggerTableView: Can't get L1 Algo pre-scale factors. Index [%d] larger that table size [%d]\n",
74  pfIndexAlgoTrig,
75  (int)prescaleFactorsAlgoTrig.size());
76 
77  const DecisionWord dWord = triggerRecord->decisionWord();
78  for (L1GtTriggerMenuLite::CItL1Trig itTrig = algorithmMap.begin(), itTrigEnd = algorithmMap.end();
79  itTrig != itTrigEnd;
80  ++itTrig) {
81  const unsigned int bitNumber = itTrig->first;
82  const std::string& aName = itTrig->second;
83  int errorCode = 0;
84  const bool result = triggerMenuLite->gtTriggerResult(aName, dWord, errorCode);
85 
86  if (!boost::regex_search(aName, filter))
87  continue;
88 
89  m_columns.at(0).values.push_back(aName);
90  m_columns.at(1).values.push_back(Form("%d", result));
91  m_columns.at(2).values.push_back(Form("%d", bitNumber));
92 
93  if ((pfIndexAlgoTrig < pfIndexAlgoTrigValidSize) &&
94  static_cast<unsigned int>(prescaleFactorsAlgoTrig.at(pfIndexAlgoTrig).size()) > bitNumber) {
95  m_columns.at(3).values.push_back(Form("%d", prescaleFactorsAlgoTrig.at(pfIndexAlgoTrig).at(bitNumber)));
96  } else
97  m_columns.at(3).values.push_back("invalid");
98  }
99 
100  const static std::string kTechTriggerName = "TechTrigger";
101  const TechnicalTriggerWord ttWord = triggerRecord->technicalTriggerWord();
102 
103  int tBitNumber = 0;
104  int tBitResult = 0;
105  if (boost::regex_search(kTechTriggerName, filter)) {
106  for (TechnicalTriggerWord::const_iterator tBitIt = ttWord.begin(), tBitEnd = ttWord.end(); tBitIt != tBitEnd;
107  ++tBitIt, ++tBitNumber) {
108  if (*tBitIt)
109  tBitResult = 1;
110  else
111  tBitResult = 0;
112 
113  m_columns.at(0).values.push_back(kTechTriggerName);
114  m_columns.at(1).values.push_back(Form("%d", tBitResult));
115  m_columns.at(2).values.push_back(Form("%d", tBitNumber));
116 
117  if ((pfIndexTechTrig < pfIndexTechTrigValidSize) &&
118  static_cast<int>(prescaleFactorsTechTrig.at(pfIndexTechTrig).size()) > tBitNumber) {
119  m_columns.at(3).values.push_back(Form("%d", prescaleFactorsTechTrig.at(pfIndexTechTrig).at(tBitNumber)));
120  } else
121  m_columns.at(3).values.push_back(Form("invalid"));
122  }
123  }
124  } // trigger valid
125  else {
126  m_columns.at(0).values.push_back("No L1Trigger menu available.");
127  m_columns.at(1).values.push_back(" ");
128  m_columns.at(2).values.push_back(" ");
129  m_columns.at(3).values.push_back(" ");
130  }
131 }

References L1TBPTX_cfi::bitNumber, L1GlobalTriggerReadoutRecord::decisionWord(), ALCARECOTkAlBeamHalo_cff::filter, fwLog, fwlite::Handle< T >::getByLabel(), 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().

L1GtTriggerMenuLite::gtPrescaleFactorsAlgoTrig
const std::vector< std::vector< int > > & gtPrescaleFactorsAlgoTrig() const
get the prescale factors by reference / set the prescale factors
Definition: L1GtTriggerMenuLite.h:128
fwLog
#define fwLog(_level_)
Definition: fwLog.h:45
FWTriggerTableView::m_regex
FWStringParameter m_regex
Definition: FWTriggerTableView.h:64
L1GtTriggerMenuLite::gtTriggerResult
const bool gtTriggerResult(const std::string &trigName, const std::vector< bool > &decWord, int &errorCode) const
Definition: L1GtTriggerMenuLite.cc:401
Column
L1GtTriggerMenuLite::CItL1Trig
L1TriggerMap::const_iterator CItL1Trig
iterators through map containing the physics algorithms or the technical triggers
Definition: L1GtTriggerMenuLite.h:45
FWViewType::kTableL1
Definition: FWViewType.h:40
fwlite::Handle
Definition: Handle.h:39
ALCARECOTkAlBeamHalo_cff.filter
filter
Definition: ALCARECOTkAlBeamHalo_cff.py:27
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
L1GtTriggerMenuLite::gtAlgorithmMap
const L1TriggerMap & gtAlgorithmMap() const
get / set the algorithm map (by name)
Definition: L1GtTriggerMenuLite.h:101
FWTriggerTableView::m_columns
std::vector< Column > m_columns
Definition: FWTriggerTableView.h:67
L1GlobalTriggerReadoutRecord::decisionWord
const DecisionWord & decisionWord(int bxInEventValue) const
Definition: L1GlobalTriggerReadoutRecord.cc:186
fwlite::Handle::isValid
bool isValid() const
Definition: Handle.h:60
fwlog::kWarning
Definition: fwLog.h:35
L1GtTriggerMenuLite::gtPrescaleFactorsTechTrig
const std::vector< std::vector< int > > & gtPrescaleFactorsTechTrig() const
Definition: L1GtTriggerMenuLite.h:132
DecisionWord
std::vector< bool > DecisionWord
typedefs
Definition: L1GlobalTriggerReadoutSetupFwd.h:34
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
FWTriggerTableView::dataChanged
void dataChanged(void)
Definition: FWTriggerTableView.cc:111
fwlog::kError
Definition: fwLog.h:35
L1TBPTX_cfi.bitNumber
bitNumber
Definition: L1TBPTX_cfi.py:26
mps_fire.result
result
Definition: mps_fire.py:311
cms::Exception
Definition: Exception.h:70
FWTriggerTableView::FWTriggerTableView
FWTriggerTableView(TEveWindowSlot *, FWViewType::EType)
Definition: FWTriggerTableView.cc:44
L1GlobalTriggerReadoutRecord::technicalTriggerWord
const TechnicalTriggerWord & technicalTriggerWord(int bxInEventValue) const
Definition: L1GlobalTriggerReadoutRecord.cc:212
TechnicalTriggerWord
std::vector< bool > TechnicalTriggerWord
technical trigger bits (64 bits)
Definition: L1GlobalTriggerReadoutSetupFwd.h:41
event
Definition: event.py:1
L1GtTriggerMenuLite::L1TriggerMap
std::map< unsigned int, std::string > L1TriggerMap
map containing the physics algorithms or the technical triggers
Definition: L1GtTriggerMenuLite.h:42
L1GlobalTriggerReadoutRecord::gtFdlWord
const L1GtFdlWord gtFdlWord(int bxInEventValue) const
get / set FDL word (record) in the GT readout record
Definition: L1GlobalTriggerReadoutRecord.cc:372