CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends
FWPSetTableManager Class Reference

#include <Fireworks/FWInterface/interface/FWPSetTableManager.h>

Inheritance diagram for FWPSetTableManager:
FWTableManagerBase

Classes

struct  ModuleInfo
 
struct  PathInfo
 
struct  PathUpdate
 
struct  PSetData
 

Public Member Functions

bool cellDataIsSortable () const override
 
FWTableCellRendererBasecellRenderer (int iSortedRowNumber, int iCol) const override
 
std::vector< PSetData > & data ()
 
 FWPSetTableManager ()
 
std::vector< std::string > getTitles () const override
 returns the title names for each column More...
 
void implSort (int, bool) override
 Called by 'sort' method to actually handle the sorting of the rows. Arguments are the same as 'sort'. More...
 
std::vector< unsigned int > maxWidthForColumns () const override
 for each column in the table this returns the present maximum width for that column More...
 
int numberOfColumns () const override
 Number of columns in the table. More...
 
int numberOfRows () const override
 Number of rows in the table. More...
 
virtual bool rowIsSelected (int row) const
 
std::vector< int > & rowToIndex ()
 
int selectedColumn () const
 
int selectedRow () const
 
virtual const std::string title () const
 
int unsortedRowNumber (int unsorted) const override
 when passed the index to the sorted order of the rows it returns the original row number from the underlying data More...
 
virtual void updateFilter (const char *filter)
 
 ~FWPSetTableManager () override
 
- Public Member Functions inherited from FWTableManagerBase
virtual void buttonPressedInRowHeader (Int_t row, Event_t *event, Int_t relX, Int_t relY)
 Called if mouse button pressed in Row Header, defaults is to do nothing. More...
 
virtual void buttonReleasedInRowHeader (Int_t row, Event_t *event, Int_t relX, Int_t relY)
 
virtual unsigned int cellHeight () const
 require all cells to be the same height More...
 
 ClassDefOverride (FWTableManagerBase, 0)
 
void dataChanged ()
 Classes which inherit from FWTableManagerBase must call this when their underlying data changes. More...
 
 FWTableManagerBase ()
 
virtual bool hasLabelHeaders () const
 
virtual bool hasRowHeaders () const
 Returns 'true' if this table has row headers. Defaults return value is false. More...
 
virtual FWTableCellRendererBaserowHeader (int iSortedRowNumber) const
 Returns the renderer for the row header for the sorted row number iSortedRowNumber. More...
 
void sort (int iCol, bool iSortOrder)
 Call to have table sorted on values in column iCol with the sort order being descending if iSortOrder is 'true'. More...
 
int sortColumn (void)
 The current sort column. More...
 
bool sortOrder (void)
 The current sort order for the table. More...
 
void visualPropertiesChanged ()
 Classes which inherit from FWTableManagerBase must call this when how the data is shown (e.g. color) changes. More...
 
 ~FWTableManagerBase () override
 

Protected Member Functions

bool applyEditor ()
 
void cancelEditor ()
 
std::vector< PSetData > & entries ()
 
std::vector< ModuleInfo > & modules ()
 
void setExpanded (int row)
 
void setSelection (int row, int column, int mask)
 
void update (std::vector< PathUpdate > &pathUpdates)
 
void updateSchedule (const edm::ScheduleInfo *info)
 

Private Member Functions

template<class T >
void createScalarString (PSetData &data, T v)
 
template<typename T >
void createVectorString (FWPSetTableManager::PSetData &data, const T &v, bool quotes)
 
 FWPSetTableManager (const FWPSetTableManager &)=delete
 
void handleEntry (const edm::Entry &entry, const std::string &key)
 
void handlePSet (edm::ParameterSet *psp)
 
void handlePSetEntry (edm::ParameterSetEntry &entry, const std::string &key)
 
void handleVPSetEntry (edm::VParameterSetEntry &entry, const std::string &key)
 
const FWPSetTableManageroperator= (const FWPSetTableManager &)=delete
 
void recalculateVisibility ()
 
void setCellValueEditor (FWPSetCellEditor *editor)
 

Private Attributes

std::vector< std::string > m_availablePaths
 
FWPSetCellEditorm_editor
 
std::vector< PSetDatam_entries
 
std::string m_filter
 
std::vector< ModuleInfom_modules
 
std::vector< size_t > m_parentStack
 
std::map< std::string, size_t > m_pathIndex
 
std::vector< PathInfom_paths
 
FWTextTreeCellRenderer m_renderer
 
std::vector< int > m_row_to_index
 
int m_selectedColumn
 
int m_selectedRow
 

Friends

class FWPathsPopup
 

Detailed Description

Description: [one line class summary]

Usage: <usage>

Definition at line 37 of file FWPSetTableManager.h.

Constructor & Destructor Documentation

FWPSetTableManager::FWPSetTableManager ( )

Definition at line 90 of file FWPSetTableManager.cc.

References FWTextTableCellRenderer::getDefaultHighlightGC(), AnalysisDataFormats_SUSYBSMObjects::hc, m_renderer, recalculateVisibility(), FWTextTableCellRenderer::setHighlightContext(), and FWTableManagerBase::visualPropertiesChanged().

91  : m_selectedRow(-1)
92 {
93 
95  hc->SetForeground(0xdddddd);
96 
98 
101 }
FWTextTreeCellRenderer m_renderer
void setHighlightContext(const TGGC *context)
static const TGGC & getDefaultHighlightGC()
susybsm::HSCParticleCollection hc
Definition: classes.h:25
void visualPropertiesChanged()
Classes which inherit from FWTableManagerBase must call this when how the data is shown (e...
FWPSetTableManager::~FWPSetTableManager ( )
override

Definition at line 103 of file FWPSetTableManager.cc.

104 {
105 }
FWPSetTableManager::FWPSetTableManager ( const FWPSetTableManager )
privatedelete

Member Function Documentation

bool FWPSetTableManager::applyEditor ( )
protected

This is invoked every single time the editor contents must be applied to the selected entry in the pset.

Returns
true on success.

Definition at line 578 of file FWPSetTableManager.cc.

References FWPSetCellEditor::apply(), data(), MillePedeFileConverter_cfg::e, m_editor, m_entries, m_modules, m_row_to_index, m_selectedColumn, m_selectedRow, FWPSetTableManager::PSetData::module, FWPSetTableManager::PSetData::parent, class-composition::parent, setSelection(), summarizeEdmComparisonLogfiles::success, and FWPSetTableManager::PSetData::value.

Referenced by FWPathsPopup::applyEditor(), and FWPathsPopup::updateFilterString().

579 {
580  if (!m_editor)
581  return false;
582 
583  if (m_selectedRow == -1 ||m_selectedColumn != 1 )
584  return false;
585 
586 
587  // printf("FWPSetTableManager::applyEditor() \n");
589  PSetData &parent = m_entries[data.parent];
590  bool success = false;
591  try
592  {
593  success = m_editor->apply(data, parent);
594 
595  if (success)
596  {
597  data.value = m_editor->GetText();
598  m_modules[data.module].dirty = true;
599  setSelection(-1, -1, 0);
600  m_editor->UnmapWindow();
601  // ???
602  // copy current to orig
603  }
604  else
605  {
606  // ???
607  // set current from orig? reimport module ... hmmh, hard.
608  }
609  }
610  catch(cms::Exception &e)
611  {
612  m_editor->SetForegroundColor(gVirtualX->GetPixel(kRed));
613  }
614  return success;
615 }
std::vector< ModuleInfo > m_modules
std::vector< PSetData > & data()
std::vector< int > m_row_to_index
std::vector< PSetData > m_entries
bool apply(FWPSetTableManager::PSetData &data, FWPSetTableManager::PSetData &parent)
FWPSetCellEditor * m_editor
void setSelection(int row, int column, int mask)
void FWPSetTableManager::cancelEditor ( )
protected

Does not apply changes and closes window.

Definition at line 564 of file FWPSetTableManager.cc.

References m_editor, and setSelection().

Referenced by FWPathsPopup::HandleKey().

565 {
566  if (!m_editor)
567  return;
568 
569  // printf("FWPSetTableManager::cancelEditor() \n");
570  setSelection(-1, -1, 0);
571  m_editor->UnmapWindow();
572 }
FWPSetCellEditor * m_editor
void setSelection(int row, int column, int mask)
bool FWPSetTableManager::cellDataIsSortable ( ) const
inlineoverridevirtual

Reimplemented from FWTableManagerBase.

Definition at line 103 of file FWPSetTableManager.h.

References funct::false, and ALCARECOTkAlBeamHalo_cff::filter.

103 { return false ; }
FWTableCellRendererBase * FWPSetTableManager::cellRenderer ( int  iSortedRowNumber,
int  iCol 
) const
overridevirtual

Returns the particular renderer used to handle the requested cell. Arguments: iSortedRowNumber: the row number from the present sort (i.e. the cell number of the view) iCol: the column number of the cell. The returned value must be used immediately and not held onto since the same Renderer can be used for subsequent calls

Implements FWTableManagerBase.

Definition at line 736 of file FWPSetTableManager.cc.

References fireworks::boldGC(), FWPSetTableManager::PSetData::childMatches, data(), FWPSetTableManager::PSetData::editable, FWPSetTableManager::PSetData::expandedFilter, FWPSetTableManager::PSetData::expandedUser, fwLog, FWTextTableCellRenderer::getDefaultGC(), cmsRelvalreport::green(), FWTextTreeCellRenderer::iconWidth(), summarizeEdmComparisonLogfiles::indent, fireworks::italicGC(), fwlog::kWarning, label, FWPSetTableManager::PSetData::label, FWPSetTableManager::PSetData::level, m_entries, m_filter, m_modules, m_paths, m_renderer, m_row_to_index, m_selectedColumn, m_selectedRow, FWPSetTableManager::PSetData::matches, copyPickMerge_cfg::maxSize, FWPSetTableManager::PSetData::module, FWPSetTableManager::ModuleInfo::passed, FWPSetTableManager::PathInfo::passed, callgraph::path, FWPSetTableManager::PSetData::path, cmsRelvalreport::red(), FWTextTableCellRenderer::setData(), FWTextTableCellRenderer::setGraphicsContext(), FWTextTreeCellRenderer::setIndentation(), FWTextTreeCellRenderer::setIsOpen(), FWTextTreeCellRenderer::setIsParent(), FWTextTreeCellRenderer::showEditor(), AlCaHLTBitMon_QueryRunRegistry::string, TypeTrans::table_, FWPSetTableManager::PSetData::type, relativeConstraints::value, and FWPSetTableManager::PSetData::value.

737 {
738  const static size_t maxSize = 512; // maximum string length
739 
740  static TGGC boldGC(fireworks::boldGC());
741  static TGGC italicGC(fireworks::italicGC());
742  static TGGC defaultGC(FWTextTableCellRenderer::getDefaultGC());
743 
744  const static Pixel_t gray = 0x777777;
745  const static Pixel_t red = gVirtualX->GetPixel(kRed-5);
746  const static Pixel_t green = gVirtualX->GetPixel(kGreen-5);
747 
748  // return in case if nothing maches filter
749  if (static_cast<int>(m_row_to_index.size()) <= iSortedRowNumber)
750  {
751  m_renderer.setData(std::string(), false);
752  return &m_renderer;
753  }
754 
755 
756  int unsortedRow = m_row_to_index[iSortedRowNumber];
757  const PSetData& data = m_entries[unsortedRow];
758 
761  TGGC* gc = nullptr;
762  if (data.level == 0)
763  {
764  const PathInfo &path = m_paths[data.path];
765  label = data.label + " (" + data.value + ")";
766  gc = &boldGC;
767  gc->SetForeground(path.passed ? green: red);
768  }
769  else if (data.level == 1)
770  {
771  // "passed" means if module made decision on path
772  const ModuleInfo &module = m_modules[m_paths[data.path].moduleStart + data.module];
773  label = data.label + " (" + data.value + ")";
774  gc = (TGGC*)&boldGC;
775  gc->SetForeground(module.passed ? green : red);
776  }
777  else
778  {
779  if (data.type > 0)
780  label = data.label + " (" + sTypeTranslations.table_[data.type] + ")";
781  else
782  label = data.label;
783  value = data.value;
784 
785  if (data.editable)
786  {
787  gc = &defaultGC;
788  }
789  else
790  {
791  gc = &italicGC;
792  gc->SetForeground(gray);
793  }
794  }
795 
796  // check string size and cut it if necessary (problems with X11)
797  if (iCol == 1 && value.size() >= maxSize)
798  {
799  if (iSortedRowNumber == m_selectedRow)
800  fwLog(fwlog::kWarning) << "label: " << label << " has too long value " << value << std::endl << std::endl;
801 
802  value = value.substr(0, maxSize);
803  value += "[truncated]";
804  gc->SetForeground(gVirtualX->GetPixel(kMagenta));
805  }
806 
807  // debug
808  // label = Form("%s m[%d] childm[%d] ", label.c_str(), data.matches, data.childMatches);
809 
810  // set text attributes
812  bool selected = data.matches && (m_filter.empty() == false);
813  m_renderer.setData(iCol ? value : label, selected);
814 
815  // set tree attributes
816  bool isParent = false;
817  bool isOpen = false;
818  int indent = 0;
819  if (iCol == 0)
820  {
821  if (m_filter.empty())
822  {
823  size_t nextIdx = unsortedRow + 1;
824  isParent = (nextIdx < m_entries.size() && m_entries[nextIdx].parent == (size_t)unsortedRow);
825  isOpen = data.expandedUser;
826  }
827  else
828  {
829  isParent = data.childMatches;
830  isOpen = data.expandedFilter && data.childMatches;
831  }
832 
833  indent = data.level * 10 ;
834  if (!isParent) indent += FWTextTreeCellRenderer::iconWidth();
835  }
836  m_renderer.setIsParent(isParent);
837  m_renderer.setIsOpen(isOpen);
838  m_renderer.setIndentation(indent);
839 
840 
841  // If we are rendering the selected cell,
842  // we show the editor.
843  bool showEdit = (iCol == 1 && iSortedRowNumber == m_selectedRow && iCol == m_selectedColumn && value.size() < maxSize);
844  m_renderer.showEditor(data.editable && showEdit);
845 
846  return &m_renderer;
847 } // cellRender()
static TypeTrans const sTypeTranslations
std::vector< PathInfo > m_paths
FWTextTreeCellRenderer m_renderer
std::vector< ModuleInfo > m_modules
char const * label
std::vector< PSetData > & data()
static const TGGC & getDefaultGC()
std::vector< int > m_row_to_index
std::vector< PSetData > m_entries
void setGraphicsContext(const TGGC *iContext)
virtual void setIndentation(int indentation=0)
def green(string)
void setData(const std::string &, bool isSelected)
#define fwLog(_level_)
Definition: fwLog.h:50
const TGGC & italicGC()
const TGGC & boldGC()
Definition: vlib.h:208
virtual void showEditor(bool value)
template<class T >
void FWPSetTableManager::createScalarString ( PSetData data,
T  v 
)
private

Definition at line 187 of file FWPSetTableManager.cc.

References m_entries, findQualityFiles::v, and FWPSetTableManager::PSetData::value.

Referenced by handleEntry().

188 {
189  std::stringstream ss;
190  ss << v;
191  data.value = ss.str();
192  m_entries.push_back(data);
193 }
std::vector< PSetData > & data()
std::vector< PSetData > m_entries
template<typename T >
void FWPSetTableManager::createVectorString ( FWPSetTableManager::PSetData data,
const T v,
bool  quotes 
)
private

Definition at line 196 of file FWPSetTableManager.cc.

References cuy::ii, m_entries, and FWPSetTableManager::PSetData::value.

Referenced by handleEntry().

197 {
198  std::stringstream ss;
199  ss << "[";
200  for (size_t ii = 0, ie = v.size(); ii != ie; ++ii)
201  {
202  if (quotes)
203  ss << "\"";
204  ss << v[ii];
205  if (quotes)
206  ss << "\"";
207  if (ii + 1 != ie)
208  ss << ", ";
209  }
210  ss << "]";
211  data.value = ss.str();
212  m_entries.push_back(data);
213 }
std::vector< PSetData > m_entries
ii
Definition: cuy.py:590
std::vector<PSetData>& FWPSetTableManager::data ( )
inline
std::vector<PSetData>& FWPSetTableManager::entries ( )
inlineprotected

Definition at line 150 of file FWPSetTableManager.h.

References RecoTauDiscriminantConfiguration::mask.

Referenced by FWPathsPopup::scheduleReloadEvent().

150 { return m_entries; }
std::vector< PSetData > m_entries
std::vector< std::string > FWPSetTableManager::getTitles ( ) const
overridevirtual

returns the title names for each column

Implements FWTableManagerBase.

Definition at line 627 of file FWPSetTableManager.cc.

References numberOfColumns().

628 {
629  std::vector<std::string> returnValue;
630  returnValue.reserve(numberOfColumns());
631  returnValue.push_back("Label");
632  returnValue.push_back("Value");
633  return returnValue;
634 }
int numberOfColumns() const override
Number of columns in the table.
void FWPSetTableManager::handleEntry ( const edm::Entry entry,
const std::string &  key 
)
private

Definition at line 215 of file FWPSetTableManager.cc.

References createScalarString(), createVectorString(), data(), FWPSetTableManager::PSetData::editable, edm::InputTag::encode(), edm::ESInputTag::encode(), edm::Entry::getBool(), edm::Entry::getDouble(), edm::Entry::getESInputTag(), edm::Entry::getEventID(), edm::Entry::getEventRange(), edm::Entry::getFileInPath(), edm::Entry::getInputTag(), edm::Entry::getInt32(), edm::Entry::getLuminosityBlockID(), edm::Entry::getLuminosityBlockRange(), edm::Entry::getString(), edm::Entry::getUInt32(), edm::Entry::getUInt64(), edm::Entry::getVDouble(), edm::Entry::getVESInputTag(), edm::Entry::getVEventID(), edm::Entry::getVEventRange(), edm::Entry::getVInputTag(), edm::Entry::getVInt32(), edm::Entry::getVInt64(), edm::Entry::getVLuminosityBlockID(), edm::Entry::getVLuminosityBlockRange(), edm::Entry::getVString(), edm::Entry::getVUInt32(), edm::Entry::getVUInt64(), photons_cff::ids, edm::Entry::isTracked(), crabWrapper::key, FWPSetTableManager::PSetData::label, FWPSetTableManager::PSetData::level, m_entries, m_modules, m_parentStack, FWPSetTableManager::PSetData::module, FWPSetTableManager::PSetData::parent, diffTwoXMLs::ranges, edm::FileInPath::relativePath(), FWPSetTableManager::PSetData::tracked, FWPSetTableManager::PSetData::type, edm::Entry::typeCode(), and FWPSetTableManager::PSetData::value.

Referenced by handlePSet().

216 {
217  std::stringstream ss;
219  data.label = key;
220  data.tracked = entry.isTracked();
221  data.type = entry.typeCode();
222  data.level = m_parentStack.size();
223  data.parent = m_parentStack.back();
224  data.module = m_modules.size() - 1;
225  data.type = entry.typeCode();
226  if (data.label[0] == '@')
227  data.editable = false;
228  else
229  data.editable = true;
230 
231  switch(entry.typeCode())
232  {
233  case 'b':
234  {
235  data.value = entry.getBool() ? "True" : "False";
236  m_entries.push_back(data);
237  break;
238  }
239  case 'B':
240  {
241  data.value = entry.getBool() ? "True" : "False";
242  m_entries.push_back(data);
243  break;
244  }
245  case 'i':
246  {
247  createVectorString(data, entry.getVInt32(), false);
248  break;
249  }
250  case 'I':
251  {
252  createScalarString(data, entry.getInt32());
253  break;
254  }
255  case 'u':
256  {
257  createVectorString(data, entry.getVUInt32(), false);
258  break;
259  }
260  case 'U':
261  {
262  createScalarString(data, entry.getUInt32());
263  break;
264  }
265  case 'l':
266  {
267  createVectorString(data, entry.getVInt64(), false);
268  break;
269  }
270  case 'L':
271  {
272  createScalarString(data, entry.getInt32());
273  break;
274  }
275  case 'x':
276  {
277  createVectorString(data, entry.getVUInt64(), false);
278  break;
279  }
280  case 'X':
281  {
282  createScalarString(data, entry.getUInt64());
283  break;
284  }
285  case 's':
286  {
287  createVectorString(data, entry.getVString(), false);
288  break;
289  }
290  case 'S':
291  {
292  createScalarString(data, entry.getString());
293  break;
294  }
295  case 'd':
296  {
297  createVectorString(data, entry.getVDouble(), false);
298  break;
299  }
300  case 'D':
301  {
302  createScalarString(data, entry.getDouble());
303  break;
304  }
305  case 'p':
306  {
307  // Matevz ???
308  throw std::runtime_error("FWPSetTableManager::handleEntryGet, entry type 'p' not expected.");
309  // std::vector<edm::ParameterSet> psets = entry.getVPSet();
310  // for (size_t psi = 0, pse = psets.size(); psi != pse; ++psi)
311  // handlePSet(psets[psi]);
312  break;
313  }
314  case 'P':
315  {
316  // Matevz ???
317  throw std::runtime_error("FWPSetTableManager::handleEntry, entry type 'P not expected.");
318  // handlePSet(entry.getPSet());
319  break;
320  }
321  case 't':
322  {
323  data.value = entry.getInputTag().encode();
324  m_entries.push_back(data);
325  break;
326  }
327  case 'v':
328  {
329  std::vector<std::string> tags;
330  tags.resize(entry.getVInputTag().size());
331  for (size_t iti = 0, ite = tags.size(); iti != ite; ++iti)
332  tags[iti] = entry.getVInputTag()[iti].encode();
333  createVectorString(data, tags, true);
334  break;
335  }
336  case 'g':
337  {
338  data.value = entry.getESInputTag().encode();
339  m_entries.push_back(data);
340  break;
341  }
342  case 'G':
343  {
344  std::vector<std::string> tags;
345  tags.resize(entry.getVESInputTag().size());
346  for (size_t iti = 0, ite = tags.size(); iti != ite; ++iti)
347  tags[iti] = entry.getVESInputTag()[iti].encode();
348  createVectorString(data, tags, true);
349  break;
350  }
351  case 'F':
352  {
354  break;
355  }
356  case 'e':
357  {
358  data.editable = false;
359  std::vector<edm::EventID> ids;
360  ids.resize(entry.getVEventID().size());
361  for ( size_t iri = 0, ire = ids.size(); iri != ire; ++iri )
362  ids[iri] = entry.getVEventID()[iri];
363  createVectorString(data, ids, true);
364  break;
365  }
366  case 'E':
367  {
368  data.editable = false;
369  createScalarString(data, entry.getEventID());
370  break;
371  }
372  case 'm':
373  {
374  data.editable = false;
375  std::vector<edm::LuminosityBlockID> ids;
376  ids.resize(entry.getVLuminosityBlockID().size());
377  for ( size_t iri = 0, ire = ids.size(); iri != ire; ++iri )
378  ids[iri] = entry.getVLuminosityBlockID()[iri];
379  createVectorString(data, ids, true);
380  break;
381  }
382  case 'M':
383  {
384  data.editable = false;
386  break;
387  }
388  case 'a':
389  {
390  data.editable = false;
391  std::vector<edm::LuminosityBlockRange> ranges;
392  ranges.resize(entry.getVLuminosityBlockRange().size());
393  for ( size_t iri = 0, ire = ranges.size(); iri != ire; ++iri )
394  ranges[iri] = entry.getVLuminosityBlockRange()[iri];
395  createVectorString(data, ranges, true);
396  break;
397  }
398  case 'A':
399  {
400  data.editable = false;
402  break;
403  }
404  case 'r':
405  {
406  data.editable = false;
407  std::vector<edm::EventRange> ranges;
408  ranges.resize(entry.getVEventRange().size());
409  for ( size_t iri = 0, ire = ranges.size(); iri != ire; ++iri )
410  ranges[iri] = entry.getVEventRange()[iri];
411  createVectorString(data, ranges, true);
412  break;
413  }
414  case 'R':
415  {
416  data.editable = false;
417  createScalarString(data, entry.getEventRange());
418  break;
419  }
420  default:
421  {
422  break;
423  }
424  }
425 }
std::vector< unsigned > getVUInt32() const
Definition: Entry.cc:733
std::vector< double > getVDouble() const
Definition: Entry.cc:781
std::vector< unsigned long long > getVUInt64() const
Definition: Entry.cc:757
std::vector< LuminosityBlockID > getVLuminosityBlockID() const
Definition: Entry.cc:913
int getInt32() const
Definition: Entry.cc:673
unsigned getUInt32() const
Definition: Entry.cc:721
std::vector< size_t > m_parentStack
std::vector< InputTag > getVInputTag() const
Definition: Entry.cc:841
void createVectorString(FWPSetTableManager::PSetData &data, const T &v, bool quotes)
std::vector< ModuleInfo > m_modules
LuminosityBlockRange getLuminosityBlockRange() const
Definition: Entry.cc:924
std::string encode() const
Definition: InputTag.cc:159
double getDouble() const
Definition: Entry.cc:769
std::vector< EventID > getVEventID() const
Definition: Entry.cc:889
unsigned long long getUInt64() const
Definition: Entry.cc:745
std::vector< PSetData > & data()
std::vector< PSetData > m_entries
bool isTracked() const
Definition: Entry.h:174
bool getBool() const
Definition: Entry.cc:661
InputTag getInputTag() const
Definition: Entry.cc:829
std::vector< long long > getVInt64() const
Definition: Entry.cc:709
std::vector< ESInputTag > getVESInputTag() const
Definition: Entry.cc:865
std::vector< EventRange > getVEventRange() const
Definition: Entry.cc:960
string ranges
Definition: diffTwoXMLs.py:79
void createScalarString(PSetData &data, T v)
FileInPath getFileInPath() const
Definition: Entry.cc:817
std::string encode() const
Definition: ESInputTag.cc:50
std::vector< int > getVInt32() const
Definition: Entry.cc:685
LuminosityBlockID getLuminosityBlockID() const
Definition: Entry.cc:901
EventRange getEventRange() const
Definition: Entry.cc:948
std::vector< LuminosityBlockRange > getVLuminosityBlockRange() const
Definition: Entry.cc:936
char typeCode() const
Definition: Entry.h:176
ESInputTag getESInputTag() const
Definition: Entry.cc:853
std::string relativePath() const
Definition: FileInPath.cc:159
std::vector< std::string > getVString() const
Definition: Entry.cc:805
std::string getString() const
Definition: Entry.cc:793
EventID getEventID() const
Definition: Entry.cc:877
void FWPSetTableManager::handlePSet ( edm::ParameterSet psp)
private

Definition at line 169 of file FWPSetTableManager.cc.

References MillePedeFileConverter_cfg::e, handleEntry(), handlePSetEntry(), handleVPSetEntry(), mps_fire::i, edm::ParameterSet::psetTable(), edm::ParameterSet::tbl(), and edm::ParameterSet::vpsetTable().

Referenced by handlePSetEntry(), handleVPSetEntry(), and updateSchedule().

170 {
171  edm::ParameterSet &ps = * psp;
172 
173  typedef edm::ParameterSet::table::const_iterator TIterator;
174  for (TIterator i = ps.tbl().begin(), e = ps.tbl().end(); i != e; ++i)
175  handleEntry(i->second, i->first);
176 
177  typedef edm::ParameterSet::psettable::const_iterator PSIterator;
178  for (PSIterator i = ps.psetTable().begin(), e = ps.psetTable().end(); i != e; ++i)
179  handlePSetEntry(const_cast<edm::ParameterSetEntry&>(i->second), i->first);
180 
181  typedef edm::ParameterSet::vpsettable::const_iterator VPSIterator;
182  for (VPSIterator i = ps.vpsetTable().begin(), e = ps.vpsetTable().end(); i != e; ++i)
183  handleVPSetEntry(const_cast<edm::VParameterSetEntry&>(i->second), i->first);
184 }
void handlePSetEntry(edm::ParameterSetEntry &entry, const std::string &key)
void handleVPSetEntry(edm::VParameterSetEntry &entry, const std::string &key)
void handleEntry(const edm::Entry &entry, const std::string &key)
psettable const & psetTable() const
Definition: ParameterSet.h:226
vpsettable const & vpsetTable() const
Definition: ParameterSet.h:229
table const & tbl() const
Definition: ParameterSet.h:223
void FWPSetTableManager::handlePSetEntry ( edm::ParameterSetEntry entry,
const std::string &  key 
)
private

Definition at line 113 of file FWPSetTableManager.cc.

References data(), FWPSetTableManager::PSetData::editable, handlePSet(), edm::ParameterSetEntry::isTracked(), crabWrapper::key, FWPSetTableManager::PSetData::label, FWPSetTableManager::PSetData::level, m_entries, m_modules, m_parentStack, m_paths, FWPSetTableManager::PSetData::module, FWPSetTableManager::PSetData::parent, FWPSetTableManager::PSetData::path, FWPSetTableManager::PSetData::pset, edm::ParameterSetEntry::psetForUpdate(), FWPSetTableManager::PSetData::tracked, and FWPSetTableManager::PSetData::type.

Referenced by handlePSet().

114 {
115  PSetData data;
116  data.label = key;
117  data.tracked = entry.isTracked();
118  data.level = m_parentStack.size();
119  data.parent = m_parentStack.back();
120  data.type = 'P';
121  data.module = m_modules.size() - 1;
122  data.path = m_paths.size() - 1;
123  data.pset = & entry.psetForUpdate();
124  data.editable = false;
125  m_parentStack.push_back(m_entries.size());
126  m_entries.push_back(data);
127 
128  handlePSet(data.pset);
129  m_parentStack.pop_back();
130 }
std::vector< PathInfo > m_paths
std::vector< size_t > m_parentStack
std::vector< ModuleInfo > m_modules
std::vector< PSetData > & data()
std::vector< PSetData > m_entries
void handlePSet(edm::ParameterSet *psp)
ParameterSet & psetForUpdate()
void FWPSetTableManager::handleVPSetEntry ( edm::VParameterSetEntry entry,
const std::string &  key 
)
private

Definition at line 132 of file FWPSetTableManager.cc.

References data(), MillePedeFileConverter_cfg::e, FWPSetTableManager::PSetData::editable, handlePSet(), mps_fire::i, edm::VParameterSetEntry::isTracked(), crabWrapper::key, FWPSetTableManager::PSetData::label, FWPSetTableManager::PSetData::level, m_entries, m_modules, m_parentStack, m_paths, FWPSetTableManager::PSetData::module, FWPSetTableManager::PSetData::parent, FWPSetTableManager::PSetData::path, FWPSetTableManager::PSetData::pset, FWPSetTableManager::PSetData::tracked, FWPSetTableManager::PSetData::type, edm::VParameterSetEntry::vpset(), and edm::VParameterSetEntry::vpsetForUpdate().

Referenced by handlePSet().

133 {
134  PSetData data;
135  data.label = key;
136  data.tracked = entry.isTracked();
137  data.level = m_parentStack.size();
138  data.parent = m_parentStack.back();
139  data.type = 'p';
140  data.module = m_modules.size() - 1;
141  data.path = m_paths.size() - 1;
142  data.editable = false;
143  m_parentStack.push_back(m_entries.size());
144  m_entries.push_back(data);
145 
146  std::stringstream ss;
147 
148  for (size_t i = 0, e = entry.vpset().size(); i != e; ++i)
149  {
150  ss.str("");
151  ss << key << "[" << i << "]";
152  PSetData vdata;
153  vdata.label = ss.str();
154  vdata.tracked = entry.isTracked();
155  vdata.level = m_parentStack.size();
156  vdata.parent = m_parentStack.back();
157  vdata.module = m_modules.size() - 1;
158  vdata.path = m_paths.size() - 1;
159  vdata.editable = false;
160  vdata.pset = &entry.vpsetForUpdate()[i];
161  m_parentStack.push_back(m_entries.size());
162  m_entries.push_back(vdata);
163  handlePSet( & entry.vpsetForUpdate()[i]);
164  m_parentStack.pop_back();
165  }
166  m_parentStack.pop_back();
167 }
std::vector< PathInfo > m_paths
std::vector< size_t > m_parentStack
std::vector< ParameterSet > & vpsetForUpdate()
std::vector< ModuleInfo > m_modules
std::vector< PSetData > & data()
std::vector< PSetData > m_entries
std::vector< ParameterSet > const & vpset() const
returns the VPSet
void handlePSet(edm::ParameterSet *psp)
void FWPSetTableManager::implSort ( int  iCol,
bool  iSortOrder 
)
overridevirtual

Called by 'sort' method to actually handle the sorting of the rows. Arguments are the same as 'sort'.

Implements FWTableManagerBase.

Definition at line 708 of file FWPSetTableManager.cc.

Referenced by update().

709 {
710 }
std::vector< unsigned int > FWPSetTableManager::maxWidthForColumns ( ) const
overridevirtual

for each column in the table this returns the present maximum width for that column

Reimplemented from FWTableManagerBase.

Definition at line 694 of file FWPSetTableManager.cc.

References FWTableManagerBase::cellHeight(), m_editor, and FWTableManagerBase::maxWidthForColumns().

695 {
696  std::vector<unsigned int> ww = FWTableManagerBase::maxWidthForColumns();
697  if (ww.size() > 1 && ww[1] > 0)
698  {
699  // printf("dim W %d \n",ww[1]);
700  // printf("dim H %d \n",cellHeight());
701  if (m_editor)
702  m_editor->MoveResize(m_editor->GetX(),m_editor->GetY(), ww[1], cellHeight());
703  }
704  return ww;
705 
706 }
virtual std::vector< unsigned int > maxWidthForColumns() const
for each column in the table this returns the present maximum width for that column ...
FWPSetCellEditor * m_editor
virtual unsigned int cellHeight() const
require all cells to be the same height
std::vector<ModuleInfo>& FWPSetTableManager::modules ( )
inlineprotected

Definition at line 149 of file FWPSetTableManager.h.

Referenced by FWPathsPopup::scheduleReloadEvent().

149 { return m_modules; }
std::vector< ModuleInfo > m_modules
int FWPSetTableManager::numberOfColumns ( ) const
overridevirtual

Number of columns in the table.

Implements FWTableManagerBase.

Definition at line 658 of file FWPSetTableManager.cc.

Referenced by getTitles().

658  {
659  return 2;
660 }
int FWPSetTableManager::numberOfRows ( ) const
overridevirtual

Number of rows in the table.

Implements FWTableManagerBase.

Definition at line 654 of file FWPSetTableManager.cc.

References m_row_to_index.

654  {
655  return m_row_to_index.size();
656 }
std::vector< int > m_row_to_index
const FWPSetTableManager& FWPSetTableManager::operator= ( const FWPSetTableManager )
privatedelete
void FWPSetTableManager::recalculateVisibility ( )
private

Definition at line 937 of file FWPSetTableManager.cc.

References FWPSetTableManager::PSetData::childMatches, data(), MillePedeFileConverter_cfg::e, mps_fire::i, FWPSetTableManager::PSetData::level, m_entries, m_filter, m_row_to_index, FWPSetTableManager::PSetData::matches, FWPSetTableManager::PSetData::parent, and FWPSetTableManager::PSetData::visible.

Referenced by FWPSetTableManager(), setExpanded(), updateFilter(), and updateSchedule().

938 {
939  m_row_to_index.clear();
940 
941  // Decide about visibility.
942  // * If the items are toplevel and they match the filter, they get shown
943  // in any case.
944  // * If the item or any of its children match the filter, the item
945  // is visible.
946  // * If the filter is empty and the parent is expanded.
947  for (size_t i = 0, e = m_entries.size(); i != e; ++i)
948  {
949  PSetData &data = m_entries[i];
950  if (data.parent == ((size_t) -1))
951  {
952  data.visible = data.childMatches || data.matches || m_filter.empty();
953  }
954  else
955  {
956  if (m_filter.empty())
957  {
958  data.visible = m_entries[data.parent].expandedUser && m_entries[data.parent].visible;
959  }
960  else
961  {
962  if (data.level < 2)
963  data.visible = m_entries[data.parent].expandedFilter && m_entries[data.parent].visible && (data.matches || data.childMatches);
964  else
965  data.visible = m_entries[data.parent].expandedFilter && m_entries[data.parent].visible;
966  }
967  }
968  }
969 
970  // Put in the index only the entries which are visible.
971  for (size_t i = 0, e = m_entries.size(); i != e; ++i)
972  if (m_entries[i].visible)
973  m_row_to_index.push_back(i);
974 }
std::vector< PSetData > & data()
std::vector< int > m_row_to_index
std::vector< PSetData > m_entries
bool FWPSetTableManager::rowIsSelected ( int  row) const
virtual

Definition at line 644 of file FWPSetTableManager.cc.

References m_selectedRow.

645 {
646  return m_selectedRow == row;
647 }
std::vector<int>& FWPSetTableManager::rowToIndex ( )
inline

Definition at line 110 of file FWPSetTableManager.h.

Referenced by FWPathsPopup::cellClicked(), and setExpanded().

110 { return m_row_to_index; }
std::vector< int > m_row_to_index
int FWPSetTableManager::selectedColumn ( ) const

Definition at line 640 of file FWPSetTableManager.cc.

References m_selectedColumn.

Referenced by FWPathsPopup::cellClicked().

640  {
641  return m_selectedColumn;
642 }
int FWPSetTableManager::selectedRow ( ) const

Definition at line 636 of file FWPSetTableManager.cc.

References m_selectedRow.

Referenced by FWPathsPopup::cellClicked().

636  {
637  return m_selectedRow;
638 }
void FWPSetTableManager::setCellValueEditor ( FWPSetCellEditor editor)
private

Definition at line 556 of file FWPSetTableManager.cc.

References idDealer::editor, m_editor, m_renderer, and FWTextTreeCellRenderer::setCellEditor().

Referenced by FWPathsPopup::FWPathsPopup().

557 {
558  m_editor = editor;
560 }
FWTextTreeCellRenderer m_renderer
virtual void setCellEditor(TGTextEntry *editor)
FWPSetCellEditor * m_editor
void FWPSetTableManager::setExpanded ( int  row)
protected

Definition at line 713 of file FWPSetTableManager.cc.

References FWPSetTableManager::PSetData::childMatches, data(), FWTableManagerBase::dataChanged(), FWPSetTableManager::PSetData::expandedFilter, FWPSetTableManager::PSetData::expandedUser, m_entries, m_filter, recalculateVisibility(), rowToIndex(), and FWTableManagerBase::visualPropertiesChanged().

Referenced by FWPathsPopup::cellClicked().

714 {
715  if (row == -1)
716  return;
717 
718  int index = rowToIndex()[row];
719  PSetData& data = m_entries[index];
720 
721  if (m_filter.empty() == false && data.childMatches == false)
722  return;
723 
724  if (m_filter.empty())
725  data.expandedUser = !data.expandedUser;
726  else
727  data.expandedFilter = !data.expandedFilter;
728 
730  dataChanged();
732 }
std::vector< int > & rowToIndex()
void dataChanged()
Classes which inherit from FWTableManagerBase must call this when their underlying data changes...
std::vector< PSetData > & data()
std::vector< PSetData > m_entries
void visualPropertiesChanged()
Classes which inherit from FWTableManagerBase must call this when how the data is shown (e...
void FWPSetTableManager::setSelection ( int  row,
int  column,
int  mask 
)
protected

Definition at line 662 of file FWPSetTableManager.cc.

References FWTableManagerBase::cellHeight(), data(), FWPSetTableManager::PSetData::editable, m_editor, m_entries, m_row_to_index, m_selectedColumn, m_selectedRow, FWPSetTableManager::PSetData::value, and FWTableManagerBase::visualPropertiesChanged().

Referenced by applyEditor(), cancelEditor(), FWPathsPopup::cellClicked(), FWPathsPopup::HandleKey(), and FWPathsPopup::updateFilterString().

663 {
664  // printf("set selection %d %d mode %d\n", iRow, iColumn, mask);
665 
666  // Nothing changes if we clicked selected
667  // twice the same cell.
668  if (iRow == m_selectedRow && iColumn == m_selectedColumn)
669  return;
670 
671  // Otherwise update the selection information
672  // and notify observers.
673  m_selectedRow = iRow;
674  m_selectedColumn = iColumn;
675  if (iColumn == 1 && iRow > 0 )
676  {
677  int unsortedRow = m_row_to_index[iRow];
678  const PSetData& data = m_entries[unsortedRow];
679  if (m_editor && data.editable) {
680  m_editor->MoveResize(0, cellHeight()*iRow, m_editor->GetWidth() , m_editor->GetHeight());
681  m_editor->MapWindow();
682  m_editor->SetText(data.value.c_str());
683  m_editor->SetFocus();
684  m_editor->SetCursorPosition(data.value.size()-1);
685  }
686  }
687  else
688  {
689  if (m_editor) m_editor->UnmapWindow();
690  }
692 }
std::vector< PSetData > & data()
std::vector< int > m_row_to_index
std::vector< PSetData > m_entries
FWPSetCellEditor * m_editor
void visualPropertiesChanged()
Classes which inherit from FWTableManagerBase must call this when how the data is shown (e...
virtual unsigned int cellHeight() const
require all cells to be the same height
const std::string FWPSetTableManager::title ( ) const
virtual
int FWPSetTableManager::unsortedRowNumber ( int  iSortedRowNumber) const
overridevirtual

when passed the index to the sorted order of the rows it returns the original row number from the underlying data

Implements FWTableManagerBase.

Definition at line 649 of file FWPSetTableManager.cc.

650 {
651  return unsorted;
652 }
void FWPSetTableManager::update ( std::vector< PathUpdate > &  pathUpdates)
protected

Update the status of a given path. This is the information that changes on event by event basis.

Definition at line 518 of file FWPSetTableManager.cc.

References FWPSetTableManager::PathUpdate::choiceMaker, fwLog, implSort(), fwlog::kError, m_modules, m_pathIndex, m_paths, FWPSetTableManager::PathInfo::moduleEnd, FWPSetTableManager::PathInfo::moduleStart, TriggerAnalyzer::passed, FWPSetTableManager::ModuleInfo::passed, FWPSetTableManager::PathUpdate::passed, FWPSetTableManager::PathInfo::passed, FWPSetTableManager::PathUpdate::pathName, and pi.

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), MatrixUtil.Steps::overwrite(), FWPathsPopup::postEvent(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

519 {
520  // Reset all the path / module status information, so that
521  // by default paths and modules are considered "not passed".
522  for (size_t pi = 0, pe = m_paths.size(); pi != pe; ++pi)
523  m_paths[pi].passed = false;
524  for (size_t mi = 0, me = m_modules.size(); mi != me; ++mi)
525  m_modules[mi].passed = false;
526 
527  // Update whether or not a given path / module passed selection.
528  for (size_t pui = 0, pue = pathUpdates.size(); pui != pue; ++pui)
529  {
530  PathUpdate &update = pathUpdates[pui];
531  std::map<std::string, size_t>::const_iterator index = m_pathIndex.find(update.pathName);
532  if (index == m_pathIndex.end())
533  {
534  fwLog(fwlog::kError) << "Path " << update.pathName << "cannot be found!" << std::endl;
535  continue;
536  }
537  PathInfo &pathInfo = m_paths[index->second];
538  pathInfo.passed = update.passed;
539 
540  for (size_t mi = pathInfo.moduleStart, me = pathInfo.moduleEnd; mi != me; ++mi)
541  {
542  ModuleInfo &moduleInfo = m_modules[mi];
543  moduleInfo.passed = update.passed || ((mi-pathInfo.moduleStart) < update.choiceMaker);
544  }
545  }
546 
547  implSort(-1, true);
548 }
std::vector< PathInfo > m_paths
void implSort(int, bool) override
Called by &#39;sort&#39; method to actually handle the sorting of the rows. Arguments are the same as &#39;sort&#39;...
std::vector< ModuleInfo > m_modules
const Double_t pi
std::map< std::string, size_t > m_pathIndex
#define fwLog(_level_)
Definition: fwLog.h:50
void update(std::vector< PathUpdate > &pathUpdates)
void FWPSetTableManager::updateFilter ( const char *  filter)
virtual

Definition at line 851 of file FWPSetTableManager.cc.

References data(), FWTableManagerBase::dataChanged(), MillePedeFileConverter_cfg::e, ALCARECOTkAlBeamHalo_cff::filter, mps_fire::i, FWPSetTableManager::PSetData::label, FWPSetTableManager::PSetData::level, m_entries, m_filter, FWPSetTableManager::PSetData::matches, FWPSetTableManager::PSetData::parent, pi, recalculateVisibility(), svgfig::stack, and FWPSetTableManager::PSetData::value.

Referenced by FWPathsPopup::updateFilterString().

852 {
853  m_filter = filter;
854 
855  if (m_filter.empty())
856  {
857  // collapse entries when filter is removed
858  for (size_t i = 0, e = m_entries.size(); i != e; ++i)
859  m_entries[i].expandedFilter = false;
860  }
861  else
862  {
863  // Decide whether or not items match the filter.
864  for (size_t i = 0, e = m_entries.size(); i != e; ++i)
865  {
866  PSetData &data = m_entries[i];
867 
868  // First of all decide whether or not we match
869  // the filter.
870  if (strstr(data.label.c_str(), m_filter.c_str()) || strstr(data.value.c_str(), m_filter.c_str()) )
871  data.matches = true;
872  else
873  data.matches = false;
874  }
875 
876  // We reset whether or not a given parent has children that match the
877  // filter, and we recompute the whole information by checking all the
878  // children.
879  for (size_t i = 0, e = m_entries.size(); i != e; ++i)
880  m_entries[i].childMatches = false;
881 
882  std::vector<int> stack;
883  int previousLevel = 0;
884  for (size_t i = 0, e = m_entries.size(); i != e; ++i)
885  {
886  PSetData &data = m_entries[i];
887  // Top level.
888  if (data.parent == (size_t)-1)
889  {
890  previousLevel = 0;
891  // std::cout << "reset stack for top level " << data.label << std::endl;
892  stack.clear();
893  continue;
894  }
895  // If the level is greater than the previous one,
896  // it means we are among the children of the
897  // previous level, hence we push the parent to
898  // the stack.
899  // If the level is not greater than the previous
900  // one it means we have popped out n levels of
901  // parents, where N is the difference between the
902  // new and the old level. In this case we
903  // pop up N parents from the stack.
904  if (data.level > previousLevel)
905  stack.push_back(data.parent);
906  else
907  for (size_t pi = 0, pe = previousLevel - data.level; pi != pe; ++pi)
908  stack.pop_back();
909 
910  if (data.matches && m_entries[stack.back()].childMatches == false)
911  {
912  // printf("match for %s with level %d\n",data.label.c_str(), data.level );
913  for (size_t pi = 0, pe = stack.size(); pi != pe; ++pi)
914  {
915  // printf("set child match to parent %s with level %d \n",m_entries[stack[pi]].label.c_str(), m_entries[stack[pi]].level);
916  m_entries[stack[pi]].childMatches = true;
917 
918  }
919  }
920 
921  previousLevel = data.level;
922  }
923 
924  // expand to matching children
925  for (size_t i = 0, e = m_entries.size(); i != e; ++i)
926  m_entries[i].expandedFilter = m_entries[i].childMatches;
927 
928  }
929 
931 
932  dataChanged();
933 } // updateFilter()
void dataChanged()
Classes which inherit from FWTableManagerBase must call this when their underlying data changes...
const Double_t pi
std::vector< PSetData > & data()
std::vector< PSetData > m_entries
stack
Definition: svgfig.py:559
void FWPSetTableManager::updateSchedule ( const edm::ScheduleInfo info)
protected

Definition at line 431 of file FWPSetTableManager.cc.

References edm::ScheduleInfo::availablePaths(), FWPSetTableManager::ModuleInfo::current_pset, FWPSetTableManager::ModuleInfo::dirty, MillePedeFileConverter_cfg::e, FWPSetTableManager::PSetData::editable, FWPSetTableManager::ModuleInfo::entry, FWPSetTableManager::PathInfo::entryId, handlePSet(), mps_fire::i, FWPSetTableManager::PSetData::label, FWPSetTableManager::PSetData::level, m_availablePaths, m_entries, m_filter, m_modules, m_parentStack, m_pathIndex, m_paths, FWPSetTableManager::PSetData::module, edm::ScheduleInfo::modulesInPath(), FWPSetTableManager::PathInfo::moduleStart, FWPSetTableManager::ModuleInfo::orig_pset, edm::ScheduleInfo::parametersForModule(), FWPSetTableManager::PSetData::parent, FWPSetTableManager::ModuleInfo::passed, FWPSetTableManager::PathInfo::passed, FWPSetTableManager::PSetData::path, FWPSetTableManager::ModuleInfo::path, FWPSetTableManager::PSetData::pset, recalculateVisibility(), AlCaHLTBitMon_QueryRunRegistry::string, edm::ParameterSet::tbl(), and FWPSetTableManager::PSetData::value.

Referenced by FWPathsPopup::postEvent().

432 {
433  if (!m_entries.empty())
434  return;
435  // Execute only once since the schedule itself
436  // cannot be altered.
437  assert(m_availablePaths.empty());
439 
440  for (size_t i = 0, e = m_availablePaths.size(); i != e; ++i)
441  {
442  PSetData pathEntry;
443  const std::string &pathName = m_availablePaths[i];
444  pathEntry.label = pathName;
445  m_pathIndex.insert(std::make_pair(pathName, m_paths.size()));
446 
447  pathEntry.value = "Path";
448  pathEntry.level= 0;
449  pathEntry.parent = -1;
450  pathEntry.path = i;
451  pathEntry.editable = false;
452 
453  PathInfo pathInfo;
454  pathInfo.entryId = m_entries.size();
455  pathInfo.passed = false;
456  pathInfo.moduleStart = m_modules.size();
457  m_paths.push_back(pathInfo);
458 
459  m_parentStack.push_back(m_entries.size());
460  m_entries.push_back(pathEntry);
461 
462  std::vector<std::string> pathModules;
463  info->modulesInPath(pathName, pathModules);
464 
465  for (size_t mi = 0, me = pathModules.size(); mi != me; ++mi)
466  {
467  PSetData moduleEntry;
468 
469  const edm::ParameterSet* ps = info->parametersForModule(pathModules[mi]);
470 
471  const edm::ParameterSet::table& pst = ps->tbl();
472  const edm::ParameterSet::table::const_iterator ti = pst.find("@module_edm_type");
473  if (ti == pst.end())
474  moduleEntry.value = "Unknown module name";
475  else
476  moduleEntry.value = ti->second.getString();
477 
478  moduleEntry.label = pathModules[mi];
479  moduleEntry.parent = m_parentStack.back();
480  moduleEntry.level = m_parentStack.size();
481  moduleEntry.module = mi;
482  moduleEntry.path = i;
483  moduleEntry.editable = false;
484 
485  ModuleInfo moduleInfo;
486  moduleInfo.path = m_paths.size() - 1;
487  moduleInfo.entry = m_entries.size();
488  moduleInfo.passed = false;
489  moduleInfo.dirty = false;
490  moduleInfo.orig_pset = new edm::ParameterSet(*ps);
491  moduleInfo.current_pset = new edm::ParameterSet(*ps);
492  m_modules.push_back(moduleInfo);
493 
494  moduleEntry.pset = moduleInfo.current_pset;
495 
496  m_parentStack.push_back(m_entries.size());
497  m_entries.push_back(moduleEntry);
498  handlePSet(moduleEntry.pset);
499  m_parentStack.pop_back();
500  }
501  m_paths.back().moduleEnd = m_modules.size();
502  m_parentStack.pop_back();
503  }
504 
505  // Nothing is expanded by default.
506  for (size_t i = 0, e = m_entries.size(); i != e; ++i)
507  m_entries[i].expandedUser = false;
508 
509  m_filter = "";
510 
512 } //updateSchedule
void modulesInPath(const std::string &iPathLabel, std::vector< std::string > &oLabelsToFill) const
add to oLabelsToFill in execution order the labels of all modules in path iPathLabel ...
Definition: ScheduleInfo.cc:91
std::vector< std::string > m_availablePaths
std::vector< PathInfo > m_paths
std::vector< size_t > m_parentStack
std::vector< ModuleInfo > m_modules
std::map< std::string, size_t > m_pathIndex
std::vector< PSetData > m_entries
void handlePSet(edm::ParameterSet *psp)
const edm::ParameterSet * parametersForModule(const std::string &iLabel) const
Definition: ScheduleInfo.cc:73
std::map< std::string, Entry > table
Definition: ParameterSet.h:222
table const & tbl() const
Definition: ParameterSet.h:223
void availablePaths(std::vector< std::string > &oLabelsToFill) const
adds to oLabelsToFill the labels for all paths in the process
Definition: ScheduleInfo.cc:87

Friends And Related Function Documentation

friend class FWPathsPopup
friend

Definition at line 39 of file FWPSetTableManager.h.

Member Data Documentation

std::vector<std::string> FWPSetTableManager::m_availablePaths
private

Definition at line 194 of file FWPSetTableManager.h.

Referenced by updateSchedule().

FWPSetCellEditor* FWPSetTableManager::m_editor
private
std::vector<PSetData> FWPSetTableManager::m_entries
private
std::string FWPSetTableManager::m_filter
private
std::vector<ModuleInfo> FWPSetTableManager::m_modules
private
std::vector<size_t> FWPSetTableManager::m_parentStack
private
std::map<std::string, size_t> FWPSetTableManager::m_pathIndex
private

Definition at line 187 of file FWPSetTableManager.h.

Referenced by update(), and updateSchedule().

std::vector<PathInfo> FWPSetTableManager::m_paths
private

Index in m_entries where to find paths

Definition at line 185 of file FWPSetTableManager.h.

Referenced by cellRenderer(), handlePSetEntry(), handleVPSetEntry(), update(), and updateSchedule().

FWTextTreeCellRenderer FWPSetTableManager::m_renderer
mutableprivate

Definition at line 196 of file FWPSetTableManager.h.

Referenced by cellRenderer(), FWPSetTableManager(), and setCellValueEditor().

std::vector<int> FWPSetTableManager::m_row_to_index
private
int FWPSetTableManager::m_selectedColumn
private

Definition at line 191 of file FWPSetTableManager.h.

Referenced by applyEditor(), cellRenderer(), selectedColumn(), and setSelection().

int FWPSetTableManager::m_selectedRow
private