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 42 of file FWTriggerTableView.cc.

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

43  : FWViewBase(id, 2),
44  m_regex(this,"Filter",std::string()),
45  m_process(this,"Process",std::string((id == FWViewType::FWViewType::kTableHLT) ? "HLT" : "")),
47  m_combo(0),
48  m_eveWindow(0),
49  m_vert(0),
50  m_tableWidget(0),
51  m_processList(0)
52 {
53  m_regex.changed_.connect(boost::bind(&FWTriggerTableView::dataChanged,this));
54 
55 
56  m_eveWindow = iParent->MakeFrame(0);
57  TGCompositeFrame *frame = m_eveWindow->GetGUICompositeFrame();
58 
59  m_vert = new TGVerticalFrame(frame);
60  frame->AddFrame(m_vert, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
61 
62  // have to have at least one column when call FWTableWidget constructor
63  m_columns.push_back( Column( "Name" ));
64 
66  m_tableWidget->SetHeaderBackgroundColor( gVirtualX->GetPixel( kWhite ));
67 
68  m_tableWidget->Connect("columnClicked(Int_t,Int_t,Int_t)", "FWTriggerTableView",
69  this, "columnSelected(Int_t,Int_t,Int_t)");
70  m_vert->AddFrame(m_tableWidget, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
71 
72  frame->MapSubwindows();
73  frame->Layout();
74  frame->MapWindow();
75 }
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 77 of file FWTriggerTableView.cc.

References m_eveWindow, m_tableManager, and m_vert.

78 {
79  // take out composite frame and delete it directly (without the timeout)
80  TGCompositeFrame *frame = m_eveWindow->GetGUICompositeFrame();
81  frame->RemoveFrame( m_vert );
82  delete m_vert;
83 
84  m_eveWindow->DestroyWindowAndSlot();
85  delete m_tableManager;
86 }
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 135 of file FWTriggerTableView.cc.

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

136 {
139  iTo.addKeyValue( kSortColumn, sortColumn );
140  FWConfiguration descendingSort( m_tableWidget->descendingSort());
141  iTo.addKeyValue( kDescendingSort, descendingSort );
142 }
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 127 of file FWTriggerTableView.cc.

128 {
129 }
void FWTriggerTableView::dataChanged ( void  )

Definition at line 114 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().

115 {
116  for(std::vector<Column>::iterator i = m_columns.begin(); i!= m_columns.end(); ++i)
117  (*i).values.clear();
118 
120  if (fwlite::Event* event = dynamic_cast<fwlite::Event*>(base))
121  fillTable(event);
122 
124 }
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 220 of file FWTriggerTableView.cc.

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

221 {
222  for (std::vector<std::string>::iterator i = m_processList->begin(); i!= m_processList->end(); ++i)
223  {
224  if (*i == m_process.value())
225  return true;
226  }
227  return false;
228 }
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 231 of file FWTriggerTableView.cc.

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

232 {
233  gui.requestTab("Style").addParam(&m_regex);
234 
235  // resize filter frame
236  TGCompositeFrame* parent = gui.getTabContainer();
237  TGFrameElement* el = (TGFrameElement*) parent->GetList()->Last();
238  el->fLayout->SetLayoutHints(kLHintsNormal);
239  el->fFrame->Resize(180);
240 
241  // add combo for processes
242  if (typeId() == FWViewType::kTableHLT)
243  {
244  TGHorizontalFrame* f = new TGHorizontalFrame(gui.getTabContainer());
245  gui.getTabContainer()->AddFrame(f, new TGLayoutHints(kLHintsNormal, 2, 2,2,2 ));
246 
247  m_combo = new TGComboBox(f);
248  f->AddFrame(m_combo);
249  m_combo->Resize(140, 20);
250  f->AddFrame(new TGLabel(f, "Process"), new TGLayoutHints(kLHintsLeft, 8,2,2,2));
251 
252  resetCombo();
254  m_combo->Connect("Selected(const char*)", "FWTriggerTableView", tt, "processChanged(const char*)");
255  }
256 }
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 213 of file FWTriggerTableView.cc.

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

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

Definition at line 185 of file FWTriggerTableView.cc.

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

Referenced by populateController().

186 {
187  if (m_combo && m_processList)
188  {
189  m_combo->RemoveAll();
190  int cnt = 0;
191  int id = -1;
192  for (std::vector<std::string>::iterator i = m_processList->begin(); i != m_processList->end(); ++i)
193  {
194  if (m_process.value() == *i ) id = cnt;
195 
196  m_combo->AddEntry((*i).c_str(), cnt);
197  cnt++;
198  }
199 
200  if(id < 0)
201  {
202  // fwLog(fwlog::kWarning) << "FWTriggerTableView: no trigger results with process name "<< m_process.value() << " is available" << std::endl;
203  m_combo->AddEntry(m_process.value().c_str(), cnt);
204  id = cnt;
205  }
206 
207  m_combo->SortByName();
208  m_combo->Select(id, false);
209  }
210 }
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 101 of file FWTriggerTableView.cc.

References convertXMLtoSQLite_cfg::fileName, i, m_columns, makeHLTPrescaleTable::values, and vend.

102 {
103  std::string fileName = iName + ".txt";
104  std::ofstream triggers( fileName.c_str() );
105 
106  triggers << m_columns[2].title << " " << m_columns[0].title << "\n";
107  for( unsigned int i = 0, vend = m_columns[0].values.size(); i != vend; ++i )
108  if( m_columns[1].values[i] == "1" )
109  triggers << m_columns[2].values[i] << "\t" << m_columns[0].values[i] << "\n";
110  triggers.close();
111 }
int i
Definition: DBlmapReader.cc:9
std::vector< Column > m_columns
#define vend()
Definition: vmac.h:42
void FWTriggerTableView::setBackgroundColor ( Color_t  iColor)

Definition at line 89 of file FWTriggerTableView.cc.

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

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

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

Reimplemented from FWConfigurableParameterizable.

Definition at line 145 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().

146 {
147  const FWConfiguration *main = &iFrom;
148 
149  // unnecessary nesting for old version
150  if (version() < 2)
151  {
152  if (typeId() == FWViewType::kTableHLT)
153  main = iFrom.valueForKey( "HLTTriggerTableView" );
154  else
155  main = iFrom.valueForKey( "L1TriggerTableView" );
156  }
157 
158  const FWConfiguration *sortColumn = main->valueForKey( kSortColumn );
159  const FWConfiguration *descendingSort = main->valueForKey( kDescendingSort );
160  if( sortColumn != 0 && descendingSort != 0 )
161  {
162  unsigned int sort = sortColumn->version();
163  bool descending = descendingSort->version();
164  if( sort < (( unsigned int ) m_tableManager->numberOfColumns()))
165  m_tableWidget->sort( sort, descending );
166  }
167 
168  if ( typeId() == FWViewType::kTableHLT )
169  {
170  const FWConfiguration* vp = iFrom.valueForKey("Process" );
171  if ( vp && (vp->value() != m_process.value()))
172  m_process.setFrom(iFrom);
173  }
174 
175  {
176  const FWConfiguration* vp = iFrom.valueForKey("Filter" );
177  if (vp && (vp->value() != m_regex.value()))
178  m_regex.setFrom(iFrom);
179  }
180 }
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().