CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends
FWTriggerTableView Class Referenceabstract

#include <FWTriggerTableView.h>

Inheritance diagram for FWTriggerTableView:
FWViewBase FWConfigurableParameterizable FWParameterizable FWConfigurable FWHLTTriggerTableView FWL1TriggerTableView

Classes

struct  Column
 

Public Member Functions

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)=0
 
- Protected Member Functions inherited from FWViewBase
virtual ~FWViewBase ()
 

Protected Attributes

std::vector< Columnm_columns
 
FWStringParameter m_process
 
FWStringParameter m_regex
 
FWTriggerTableViewTableManagerm_tableManager
 
- Protected Attributes inherited from FWViewBase
FWViewType m_type
 

Private Member Functions

 FWTriggerTableView (const FWTriggerTableView &)
 
bool isProcessValid () const
 
const FWTriggerTableViewoperator= (const FWTriggerTableView &)
 
virtual void populateController (ViewerParameterGUI &) const
 

Private Attributes

Color_t m_backgroundColor
 
TGComboBox * m_combo
 
TEveWindowFrame * m_eveWindow
 
std::vector< std::string > * m_processList
 
FWTableWidgetm_tableWidget
 
TGCompositeFrame * m_vert
 

Friends

class FWTriggerTableViewTableManager
 

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_
 

Detailed Description

Definition at line 39 of file FWTriggerTableView.h.

Constructor & Destructor Documentation

FWTriggerTableView::FWTriggerTableView ( TEveWindowSlot *  iParent,
FWViewType::EType  id 
)

Definition at line 43 of file FWTriggerTableView.cc.

References FWGenericParameter< T >::changed_, dataChanged(), m_columns, m_eveWindow, m_regex, m_tableManager, m_tableWidget, m_vert, and FWTableWidget::SetHeaderBackgroundColor().

44  : FWViewBase(id, 2),
45  m_regex(this,"Filter",std::string()),
46  m_process(this,"Process",std::string((id == FWViewType::FWViewType::kTableHLT) ? "HLT" : "")),
48  m_combo(0),
49  m_eveWindow(0),
50  m_vert(0),
51  m_tableWidget(0),
52  m_processList(0)
53 {
54  m_regex.changed_.connect(boost::bind(&FWTriggerTableView::dataChanged,this));
55 
56 
57  m_eveWindow = iParent->MakeFrame(0);
58  TGCompositeFrame *frame = m_eveWindow->GetGUICompositeFrame();
59 
60  m_vert = new TGVerticalFrame(frame);
61  frame->AddFrame(m_vert, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
62 
63  // have to have at least one column when call FWTableWidget constructor
64  m_columns.push_back( Column( "Name" ));
65 
67  m_tableWidget->SetHeaderBackgroundColor( gVirtualX->GetPixel( kWhite ));
68 
69  m_tableWidget->Connect("columnClicked(Int_t,Int_t,Int_t)", "FWTriggerTableView",
70  this, "columnSelected(Int_t,Int_t,Int_t)");
71  m_vert->AddFrame(m_tableWidget, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
72 
73  frame->MapSubwindows();
74  frame->Layout();
75  frame->MapWindow();
76 }
std::vector< Column > m_columns
FWStringParameter m_regex
void SetHeaderBackgroundColor(Pixel_t)
sigc::signal< void, T > changed_
TGCompositeFrame * m_vert
FWTableWidget * m_tableWidget
TEveWindowFrame * m_eveWindow
FWStringParameter m_process
friend class FWTriggerTableViewTableManager
std::vector< std::string > * m_processList
FWTriggerTableViewTableManager * m_tableManager
FWViewBase(FWViewType::EType, unsigned int iVersion=1)
Definition: FWViewBase.cc:34
FWTriggerTableView::~FWTriggerTableView ( void  )
virtual

Definition at line 78 of file FWTriggerTableView.cc.

References m_eveWindow, m_tableManager, and m_vert.

79 {
80  // take out composite frame and delete it directly (without the timeout)
81  TGCompositeFrame *frame = m_eveWindow->GetGUICompositeFrame();
82  frame->RemoveFrame( m_vert );
83  delete m_vert;
84 
85  m_eveWindow->DestroyWindowAndSlot();
86  delete m_tableManager;
87 }
TGCompositeFrame * m_vert
TEveWindowFrame * m_eveWindow
FWTriggerTableViewTableManager * m_tableManager
FWTriggerTableView::FWTriggerTableView ( const FWTriggerTableView )
private

Member Function Documentation

void FWTriggerTableView::addTo ( FWConfiguration iTo) const
virtual

Reimplemented from FWConfigurableParameterizable.

Definition at line 137 of file FWTriggerTableView.cc.

References FWConfiguration::addKeyValue(), FWConfigurableParameterizable::addTo(), FWTableWidget::descendingSort(), kDescendingSort, kSortColumn, m_tableWidget, and FWTableWidget::sortedColumn().

138 {
141  iTo.addKeyValue( kSortColumn, sortColumn );
142  FWConfiguration descendingSort( m_tableWidget->descendingSort());
143  iTo.addKeyValue( kDescendingSort, descendingSort );
144 }
FWTableWidget * m_tableWidget
bool descendingSort() const
Definition: FWTableWidget.h:91
static const std::string kDescendingSort
FWConfiguration & addKeyValue(const std::string &, const FWConfiguration &)
static const std::string kSortColumn
int sortedColumn() const
Definition: FWTableWidget.h:90
virtual void addTo(FWConfiguration &) const
Color_t FWTriggerTableView::backgroundColor ( ) const
inline

Definition at line 56 of file FWTriggerTableView.h.

References m_backgroundColor.

Referenced by FWTriggerTableViewTableManager::cellRenderer().

56 { return m_backgroundColor; }
void FWTriggerTableView::columnSelected ( Int_t  iCol,
Int_t  iButton,
Int_t  iKeyMod 
)

Definition at line 129 of file FWTriggerTableView.cc.

130 {
131 }
void FWTriggerTableView::dataChanged ( void  )

Definition at line 116 of file FWTriggerTableView.cc.

References newFWLiteAna::base, FWTriggerTableViewTableManager::dataChanged(), event(), fillTable(), FWGUIManager::getCurrentEvent(), FWGUIManager::getGUIManager(), i, m_columns, and m_tableManager.

Referenced by FWHLTTriggerTableView::FWHLTTriggerTableView(), FWL1TriggerTableView::FWL1TriggerTableView(), FWTriggerTableView(), and processChanged().

117 {
118  for(std::vector<Column>::iterator i = m_columns.begin(); i!= m_columns.end(); ++i)
119  (*i).values.clear();
120 
122  if (fwlite::Event* event = dynamic_cast<fwlite::Event*>(base))
123  fillTable(event);
124 
126 }
tuple base
Main Program
Definition: newFWLiteAna.py:92
int i
Definition: DBlmapReader.cc:9
std::vector< Column > m_columns
virtual void fillTable(fwlite::Event *event)=0
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
const edm::EventBase * getCurrentEvent() const
static FWGUIManager * getGUIManager()
FWTriggerTableViewTableManager * m_tableManager
virtual void FWTriggerTableView::fillTable ( fwlite::Event event)
protectedpure virtual

Implemented in FWHLTTriggerTableView, and FWL1TriggerTableView.

Referenced by dataChanged().

bool FWTriggerTableView::isProcessValid ( ) const
private

Definition at line 222 of file FWTriggerTableView.cc.

References i, m_process, m_processList, and FWGenericParameter< T >::value().

223 {
224  for (std::vector<std::string>::iterator i = m_processList->begin(); i!= m_processList->end(); ++i)
225  {
226  if (*i == m_process.value())
227  return true;
228  }
229  return false;
230 }
int i
Definition: DBlmapReader.cc:9
FWStringParameter m_process
std::vector< std::string > * m_processList
const FWTriggerTableView& FWTriggerTableView::operator= ( const FWTriggerTableView )
private
void FWTriggerTableView::populateController ( ViewerParameterGUI gui) const
privatevirtual

Reimplemented from FWViewBase.

Definition at line 233 of file FWTriggerTableView.cc.

References ViewerParameterGUI::addParam(), f, ViewerParameterGUI::getTabContainer(), FWViewType::kTableHLT, m_combo, m_regex, dbtoconf::parent, ViewerParameterGUI::requestTab(), resetCombo(), groupFilesInBlocks::tt, and FWViewBase::typeId().

234 {
235  gui.requestTab("Style").addParam(&m_regex);
236 
237  // resize filter frame
238  TGCompositeFrame* parent = gui.getTabContainer();
239  TGFrameElement* el = (TGFrameElement*) parent->GetList()->Last();
240  el->fLayout->SetLayoutHints(kLHintsNormal);
241  el->fFrame->Resize(180);
242 
243  // add combo for processes
244  if (typeId() == FWViewType::kTableHLT)
245  {
246  TGHorizontalFrame* f = new TGHorizontalFrame(gui.getTabContainer());
247  gui.getTabContainer()->AddFrame(f, new TGLayoutHints(kLHintsNormal, 2, 2,2,2 ));
248 
249  m_combo = new TGComboBox(f);
250  f->AddFrame(m_combo);
251  m_combo->Resize(140, 20);
252  f->AddFrame(new TGLabel(f, "Process"), new TGLayoutHints(kLHintsLeft, 8,2,2,2));
253 
254  resetCombo();
256  m_combo->Connect("Selected(const char*)", "FWTriggerTableView", tt, "processChanged(const char*)");
257  }
258 }
list parent
Definition: dbtoconf.py:74
FWStringParameter m_regex
ViewerParameterGUI & requestTab(const char *)
double f[11][100]
ViewerParameterGUI & addParam(const FWParameterBase *)
TGCompositeFrame * getTabContainer()
FWViewType::EType typeId() const
Definition: FWViewBase.h:42
void FWTriggerTableView::processChanged ( const char *  x)

Definition at line 215 of file FWTriggerTableView.cc.

References dataChanged(), m_process, and FWGenericParameter< T >::set().

216 {
217  m_process.set(x);
218  dataChanged();
219 }
FWStringParameter m_process
Definition: DDAxes.h:10
void FWTriggerTableView::resetCombo ( ) const

Definition at line 187 of file FWTriggerTableView.cc.

References i, m_combo, m_process, m_processList, and FWGenericParameter< T >::value().

Referenced by populateController().

188 {
189  if (m_combo && m_processList)
190  {
191  m_combo->RemoveAll();
192  int cnt = 0;
193  int id = -1;
194  for (std::vector<std::string>::iterator i = m_processList->begin(); i != m_processList->end(); ++i)
195  {
196  if (m_process.value() == *i ) id = cnt;
197 
198  m_combo->AddEntry((*i).c_str(), cnt);
199  cnt++;
200  }
201 
202  if(id < 0)
203  {
204  // fwLog(fwlog::kWarning) << "FWTriggerTableView: no trigger results with process name "<< m_process.value() << " is available" << std::endl;
205  m_combo->AddEntry(m_process.value().c_str(), cnt);
206  id = cnt;
207  }
208 
209  m_combo->SortByName();
210  m_combo->Select(id, false);
211  }
212 }
int i
Definition: DBlmapReader.cc:9
FWStringParameter m_process
std::vector< std::string > * m_processList
void FWTriggerTableView::saveImageTo ( const std::string &  iName) const
virtual

Implements FWViewBase.

Definition at line 261 of file FWTriggerTableView.cc.

References trackerHits::c, FWTriggerTableViewTableManager::cellRenderer(), gather_cfg::cout, FWTextTableCellRenderer::data(), data, cfg-viewer::format(), m_columns, m_tableManager, FWTriggerTableViewTableManager::numberOfColumns(), FWTriggerTableViewTableManager::numberOfRows(), alignCSCRings::r, confdb::splitter(), AlCaHLTBitMon_QueryRunRegistry::string, and indexGen::title.

262 {
263  TString format;
264  TString data;
265  FWTextTableCellRenderer* textRenderer;
266 
267  // calculate widths
268  std::vector<size_t> widths(m_tableManager->numberOfColumns());
269 
270  for (int c = 0; c < m_tableManager->numberOfColumns(); ++c )
271  widths[c] = m_columns[c].title.size();
272 
273  for (int c = 0; c < m_tableManager->numberOfColumns(); ++c )
274  {
275  for (int r = 0; r < m_tableManager->numberOfRows(); r++ )
276  {
277  textRenderer = (FWTextTableCellRenderer*) m_tableManager->cellRenderer(r, c); // setup cell renderer
278  size_t ss = textRenderer->data().size();
279  if (widths[c] < ss) widths[c] = ss;
280  }
281  }
282 
283  int rlen = 0;
284  for (size_t c = 0; c < (size_t)m_tableManager->numberOfColumns(); ++c )
285  rlen += widths[c];
286  rlen += (m_tableManager->numberOfColumns() -1 )*3 ;
287  rlen++;
288 
289 
290  printf("\n");
291  int lastCol = m_tableManager->numberOfColumns() -1;
292 
293  for (int c = 0; c < m_tableManager->numberOfColumns(); ++c )
294  {
295  format.Form("%%%ds", (int)widths[c]);
296  data.Form(format,m_columns[c].title.c_str());
297  if (c == lastCol)
298  printf("%s", data.Data());
299  else
300  printf("%s | ", data.Data());
301  }
302  printf("\n");
303 
304  std::string splitter(rlen, '-');
305  std::cout << splitter << std::endl;
306 
307  for (int r = 0; r < m_tableManager->numberOfRows(); r++ )
308  {
309  for (int c = 0; c < m_tableManager->numberOfColumns(); ++c )
310  {
311  format.Form("%%%ds", (int)widths[c]);
312  textRenderer = (FWTextTableCellRenderer*) m_tableManager->cellRenderer(r, c); // setup cell renderer
313  data.Form(format, textRenderer->data().c_str());
314  if (c == lastCol)
315  printf("%s", data.Data());
316  else
317  printf("%s | ", data.Data());
318  }
319  printf("\n");
320  }
321 }
std::vector< Column > m_columns
virtual int numberOfColumns() const
Number of columns in the table.
def splitter
Definition: confdb.py:11
const std::string & data()
virtual FWTableCellRendererBase * cellRenderer(int iSortedRowNumber, int iCol) const
virtual int numberOfRows() const
Number of rows in the table.
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
tuple cout
Definition: gather_cfg.py:121
FWTriggerTableViewTableManager * m_tableManager
void FWTriggerTableView::setBackgroundColor ( Color_t  iColor)

Definition at line 90 of file FWTriggerTableView.cc.

References m_backgroundColor, m_tableWidget, FWTableWidget::SetBackgroundColor(), and FWTableWidget::SetLineSeparatorColor().

Referenced by Vispa.Plugins.EdmBrowser.EventContentView.LabelItem::__init__().

91 {
92  m_backgroundColor = iColor;
93  m_tableWidget->SetBackgroundColor(gVirtualX->GetPixel(iColor));
94  m_tableWidget->SetLineSeparatorColor( gVirtualX->GetPixel(iColor == kWhite ? kBlack : kWhite));
95 }
void SetBackgroundColor(Pixel_t)
void SetLineSeparatorColor(Pixel_t)
FWTableWidget * m_tableWidget
void FWTriggerTableView::setFrom ( const FWConfiguration iFrom)
virtual

Reimplemented from FWConfigurableParameterizable.

Definition at line 147 of file FWTriggerTableView.cc.

References kDescendingSort, kSortColumn, FWViewType::kTableHLT, m_process, m_regex, m_tableManager, m_tableWidget, main(), FWTriggerTableViewTableManager::numberOfColumns(), FWGenericParameter< T >::setFrom(), FWTableWidget::sort(), python.multivaluedict::sort(), FWViewBase::typeId(), FWConfiguration::value(), FWGenericParameter< T >::value(), FWConfiguration::valueForKey(), FWConfigurableParameterizable::version(), and FWConfiguration::version().

148 {
149  const FWConfiguration *main = &iFrom;
150 
151  // unnecessary nesting for old version
152  if (version() < 2)
153  {
154  if (typeId() == FWViewType::kTableHLT)
155  main = iFrom.valueForKey( "HLTTriggerTableView" );
156  else
157  main = iFrom.valueForKey( "L1TriggerTableView" );
158  }
159 
160  const FWConfiguration *sortColumn = main->valueForKey( kSortColumn );
161  const FWConfiguration *descendingSort = main->valueForKey( kDescendingSort );
162  if( sortColumn != 0 && descendingSort != 0 )
163  {
164  unsigned int sort = sortColumn->version();
165  bool descending = descendingSort->version();
166  if( sort < (( unsigned int ) m_tableManager->numberOfColumns()))
167  m_tableWidget->sort( sort, descending );
168  }
169 
170  if ( typeId() == FWViewType::kTableHLT )
171  {
172  const FWConfiguration* vp = iFrom.valueForKey("Process" );
173  if ( vp && (vp->value() != m_process.value()))
174  m_process.setFrom(iFrom);
175  }
176 
177  {
178  const FWConfiguration* vp = iFrom.valueForKey("Filter" );
179  if (vp && (vp->value() != m_regex.value()))
180  m_regex.setFrom(iFrom);
181  }
182 }
FWStringParameter m_regex
unsigned int version() const
virtual int numberOfColumns() const
Number of columns in the table.
int main(int argc, char **argv)
FWTableWidget * m_tableWidget
void sort(UInt_t iColumn, bool iDescendingSort)
static const std::string kDescendingSort
const std::string & value(unsigned int iIndex=0) const
static const std::string kSortColumn
FWStringParameter m_process
virtual void setFrom(const FWConfiguration &iFrom)
FWTriggerTableViewTableManager * m_tableManager
const FWConfiguration * valueForKey(const std::string &iKey) const
FWViewType::EType typeId() const
Definition: FWViewBase.h:42
void FWTriggerTableView::setProcessList ( std::vector< std::string > *  x)
inline

Definition at line 67 of file FWTriggerTableView.h.

References m_processList, and x.

67 { m_processList = x; }
std::vector< std::string > * m_processList
Definition: DDAxes.h:10

Friends And Related Function Documentation

friend class FWTriggerTableViewTableManager
friend

Definition at line 41 of file FWTriggerTableView.h.

Member Data Documentation

Color_t FWTriggerTableView::m_backgroundColor
private

Definition at line 96 of file FWTriggerTableView.h.

Referenced by backgroundColor(), and setBackgroundColor().

std::vector<Column> FWTriggerTableView::m_columns
protected
TGComboBox* FWTriggerTableView::m_combo
mutableprivate

Definition at line 87 of file FWTriggerTableView.h.

Referenced by populateController(), and resetCombo().

TEveWindowFrame* FWTriggerTableView::m_eveWindow
private

Definition at line 90 of file FWTriggerTableView.h.

Referenced by FWTriggerTableView(), and ~FWTriggerTableView().

FWStringParameter FWTriggerTableView::m_process
protected
std::vector<std::string>* FWTriggerTableView::m_processList
private

Definition at line 98 of file FWTriggerTableView.h.

Referenced by isProcessValid(), resetCombo(), and setProcessList().

FWStringParameter FWTriggerTableView::m_regex
protected
FWTriggerTableViewTableManager* FWTriggerTableView::m_tableManager
protected
FWTableWidget* FWTriggerTableView::m_tableWidget
private
TGCompositeFrame* FWTriggerTableView::m_vert
private

Definition at line 91 of file FWTriggerTableView.h.

Referenced by FWTriggerTableView(), and ~FWTriggerTableView().