CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Public Attributes | Private Types | Private Member Functions | Private Attributes
CmsShowNavigator Class Reference

#include <CmsShowNavigator.h>

Inheritance diagram for CmsShowNavigator:
FWNavigatorBase FWConfigurable

Classes

struct  FileQueue_t
 

Public Types

enum  EFilterMode { kOr = 1, kAnd = 2 }
 
enum  EFilterState { kOff, kOn, kWithdrawn }
 
- Public Types inherited from FWNavigatorBase
enum  EFilterMode { kOr = 1, kAnd = 2 }
 
enum  EFilterState { kOff, kOn, kWithdrawn }
 

Public Member Functions

void activateNewFileOnNextEvent ()
 
void addTo (FWConfiguration &) const override
 
bool appendFile (const std::string &fileName, bool checkFileQueueSize, bool live)
 
void applyFiltersFromGUI ()
 
bool canEditFiltersExternally ()
 
 CmsShowNavigator (const CmsShowMain &)
 
void editFiltersExternally ()
 
void eventFilterEnableCallback (Bool_t)
 
bool filesNeedUpdate () const
 
void filterEvents ()
 
void filterEventsAndReset ()
 
const char * filterStatusMessage ()
 
void firstEvent () override
 
const char * frameTitle ()
 
const edm::EventBasegetCurrentEvent () const override
 
std::string getCurrentGlobalTag ()
 
int getFilterState ()
 
int getNSelectedEvents () override
 
int getNTotalEvents () override
 
std::vector< std::string > & getProcessList () const
 
void goTo (FileQueue_i fi, int event)
 
void goToRunEvent (edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t) override
 
bool isFirstEvent () override
 
bool isLastEvent () override
 
void lastEvent () override
 
void nextEvent () override
 
bool nextSelectedEvent () override
 
bool openFile (const std::string &fileName)
 
void previousEvent () override
 
bool previousSelectedEvent () override
 
Int_t realEntry (Int_t rawEntry)
 
void resetNewFileOnNextEvent ()
 
void resumeFilter ()
 
void setFrom (const FWConfiguration &) override
 
void setMaxNumberOfFilesToChain (unsigned int i)
 
void showEventFilterGUI (const TGWindow *p)
 
void toggleFilterEnable ()
 
void withdrawFilter ()
 
 ~CmsShowNavigator () override
 
- Public Member Functions inherited from FWNavigatorBase
 FWNavigatorBase (const CmsShowMainBase &)
 
 FWNavigatorBase (const FWNavigatorBase &)=delete
 
const FWNavigatorBaseoperator= (const FWNavigatorBase &)=delete
 
 ~FWNavigatorBase () override
 
- Public Member Functions inherited from FWConfigurable
 FWConfigurable ()
 
 FWConfigurable (const FWConfigurable &)=delete
 
const FWConfigurableoperator= (const FWConfigurable &)=delete
 
virtual ~FWConfigurable ()
 

Public Attributes

sigc::signal< void(bool)> editFiltersExternally_
 
sigc::signal< void(const TFile *)> fileChanged_
 
sigc::signal< void(int)> filterStateChanged_
 
sigc::signal< void(bool)> postFiltering_
 
sigc::signal< void()> preFiltering_
 
- Public Attributes inherited from FWNavigatorBase
sigc::signal< void()> newEvent_
 

Private Types

typedef FileQueue_t::iterator FileQueue_i
 
typedef FQBase_t::iterator FQBase_i
 
typedef std::list< FWFileEntry * > FQBase_t
 

Private Member Functions

void addFilter (FWEventSelector *)
 
void changeFilter (FWEventSelector *, bool filterNeedUpdate)
 
 CmsShowNavigator (const CmsShowNavigator &)
 
void newFile (FileQueue_i)
 
const CmsShowNavigatoroperator= (const CmsShowNavigator &)
 
void removeFilter (std::list< FWEventSelector *>::iterator)
 
void setCurrentFile (FileQueue_i)
 
void updateFileFilters ()
 
void updateSelectorsInfo ()
 

Private Attributes

int m_currentEvent
 
FileQueue_i m_currentFile
 
FileQueue_t m_files
 
bool m_filesNeedUpdate
 
int m_filterMode
 
EFilterState m_filterState
 
FWGUIEventFilterm_guiFilter
 
const CmsShowMainm_main
 
unsigned int m_maxNumberOfFilesToChain
 
bool m_newFileOnNextEvent
 
std::list< FWEventSelector * > m_selectors
 

Detailed Description

Definition at line 36 of file CmsShowNavigator.h.

Member Typedef Documentation

◆ FileQueue_i

Definition at line 72 of file CmsShowNavigator.h.

◆ FQBase_i

typedef FQBase_t::iterator CmsShowNavigator::FQBase_i
private

Definition at line 43 of file CmsShowNavigator.h.

◆ FQBase_t

typedef std::list<FWFileEntry*> CmsShowNavigator::FQBase_t
private

Definition at line 42 of file CmsShowNavigator.h.

Member Enumeration Documentation

◆ EFilterMode

Enumerator
kOr 
kAnd 

Definition at line 39 of file CmsShowNavigator.h.

◆ EFilterState

Enumerator
kOff 
kOn 
kWithdrawn 

Definition at line 38 of file CmsShowNavigator.h.

Constructor & Destructor Documentation

◆ CmsShowNavigator() [1/2]

CmsShowNavigator::CmsShowNavigator ( const CmsShowMain main)

Definition at line 46 of file CmsShowNavigator.cc.

References filterStateChanged_, m_guiFilter, and FWGUIEventFilter::updateFilterStateLabel().

48  m_currentEvent(0),
49 
52 
53  m_filesNeedUpdate(true),
54  m_newFileOnNextEvent(false),
55 
57 
58  m_main(main),
59  m_guiFilter(nullptr) {
60  m_guiFilter = new FWGUIEventFilter(this);
61  filterStateChanged_.connect(std::bind(&FWGUIEventFilter::updateFilterStateLabel, m_guiFilter, std::placeholders::_1));
62 }
EFilterState m_filterState
FWNavigatorBase(const CmsShowMainBase &)
const CmsShowMain & m_main
unsigned int m_maxNumberOfFilesToChain
FWGUIEventFilter * m_guiFilter
void updateFilterStateLabel(int)
sigc::signal< void(int)> filterStateChanged_
Definition: main.py:1

◆ ~CmsShowNavigator()

CmsShowNavigator::~CmsShowNavigator ( )
override

Definition at line 64 of file CmsShowNavigator.cc.

References m_guiFilter.

64 { delete m_guiFilter; }
FWGUIEventFilter * m_guiFilter

◆ CmsShowNavigator() [2/2]

CmsShowNavigator::CmsShowNavigator ( const CmsShowNavigator )
private

Member Function Documentation

◆ activateNewFileOnNextEvent()

void CmsShowNavigator::activateNewFileOnNextEvent ( )
inline

Definition at line 124 of file CmsShowNavigator.h.

References m_newFileOnNextEvent.

124 { m_newFileOnNextEvent = true; }

◆ addFilter()

void CmsShowNavigator::addFilter ( FWEventSelector ref)
private

Definition at line 447 of file CmsShowNavigator.cc.

References CmsShowNavigator::FileQueue_t::begin(), CmsShowNavigator::FileQueue_t::end(), geometryDiff::file, fwLog, fwlog::kDebug, FWEventSelector::m_expression, m_files, m_filesNeedUpdate, and m_selectors.

Referenced by applyFiltersFromGUI().

447  {
448  fwLog(fwlog::kDebug) << "CmsShowNavigator::addFilter " << ref->m_expression << std::endl;
449 
450  FWEventSelector* selector = new FWEventSelector(ref);
451  m_selectors.push_back(selector);
452 
453  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file) {
454  (*file)->filters().push_back(new FWFileEntry::Filter(selector));
455  }
456  m_filesNeedUpdate = true;
457 }
FileQueue_t::iterator FileQueue_i
std::string m_expression
#define fwLog(_level_)
Definition: fwLog.h:45
std::list< FWEventSelector * > m_selectors

◆ addTo()

void CmsShowNavigator::addTo ( FWConfiguration iTo) const
overridevirtual

Implements FWNavigatorBase.

Definition at line 753 of file CmsShowNavigator.cc.

References FWConfiguration::addKeyValue(), ALCARECOTkAlBeamHalo_cff::filter, kOn, m_filterMode, m_filterState, m_selectors, alignCSCRings::s, EgammaValidation_Wenu_cff::sel, and createJobs::tmp.

753  {
754  // selectors
756  int cnt = 0;
757  for (std::list<FWEventSelector*>::const_iterator sel = m_selectors.begin(); sel != m_selectors.end(); ++sel) {
759 
760  filter.addKeyValue("expression", FWConfiguration((*sel)->m_expression));
761  filter.addKeyValue("enabled", FWConfiguration((*sel)->m_enabled ? "1" : "0"));
762  filter.addKeyValue("comment", FWConfiguration((*sel)->m_description));
763 
764  if (!(*sel)->m_triggerProcess.empty())
765  filter.addKeyValue("triggerProcess", FWConfiguration((*sel)->m_triggerProcess));
766 
767  tmp.addKeyValue(Form("------Filter[%d]------", cnt), filter, true);
768  ++cnt;
769  }
770 
771  iTo.addKeyValue("EventFilters", tmp, true);
772 
773  // mode
774  {
775  std::stringstream s;
776  s << m_filterMode;
777  iTo.addKeyValue("EventFilter_mode", s.str());
778  }
779 
780  // enabled
781  iTo.addKeyValue("EventFilter_enabled", FWConfiguration(m_filterState == kOn ? "1" : "0"));
782 }
EFilterState m_filterState
FWConfiguration & addKeyValue(const std::string &, const FWConfiguration &)
std::list< FWEventSelector * > m_selectors
tmp
align.sh
Definition: createJobs.py:716

◆ appendFile()

bool CmsShowNavigator::appendFile ( const std::string &  fileName,
bool  checkFileQueueSize,
bool  live 
)

Definition at line 109 of file CmsShowNavigator.cc.

References CmsShowNavigator::FileQueue_t::begin(), DMR_cfg::cerr, cppFunctionSkipper::exception, geometryDiff::file, MillePedeFileConverter_cfg::fileName, fwLog, CmsShowMain::getGlobalTagCheck(), CmsShowMain::getVersionCheck(), mps_fire::i, CmsShowNavigator::FileQueue_t::iterator::isSet(), fwlog::kDebug, fwlog::kError, kOff, fwlog::kWarning, m_currentFile, m_files, m_filterState, m_main, m_maxNumberOfFilesToChain, m_selectors, newFile(), setCurrentFile(), and updateFileFilters().

109  {
110  fwLog(fwlog::kDebug) << "CmsShowNavigator::appendFile [" << fileName << "]" << std::endl;
111  FWFileEntry* newFile = nullptr;
112  try {
114  } catch (std::exception& iException) {
115  fwLog(fwlog::kError) << "Navigator::appendFile caught exception FWFileEntry constructor " << iException.what()
116  << std::endl;
117  delete newFile;
118  return false;
119  }
120 
121  try {
122  if (checkFileQueueSize) {
123  int toErase = m_files.size() - (m_maxNumberOfFilesToChain + 1);
124  while (toErase > 0) {
125  FileQueue_i si = m_files.begin();
126  if (m_currentFile == si)
127  si++;
128  FWFileEntry* file = *si;
129  file->closeFile();
130  delete file;
131 
132  m_files.erase(si);
133  --toErase;
134  }
135 
136  if (m_files.size() > m_maxNumberOfFilesToChain)
137  fwLog(fwlog::kWarning) << " " << m_files.size() << " chained files more than maxNumberOfFilesToChain \n"
138  << m_maxNumberOfFilesToChain << std::endl;
139  }
140 
141  m_files.push_back(newFile);
142 
143  // Needed for proper handling of first registered file when -port option is in effect.
144  if (!m_currentFile.isSet())
146 
147  // set filters
148  for (std::list<FWEventSelector*>::iterator i = m_selectors.begin(); i != m_selectors.end(); ++i)
149  newFile->filters().push_back(new FWFileEntry::Filter(*i));
150 
151  if (m_filterState != kOff)
153 
154  } catch (std::exception& iException) {
155  std::cerr << "Navigator::openFile caught exception " << iException.what() << std::endl;
156  return false;
157  }
158 
159  return true;
160 }
EFilterState m_filterState
const CmsShowMain & m_main
unsigned int m_maxNumberOfFilesToChain
FileQueue_t::iterator FileQueue_i
void newFile(FileQueue_i)
FileQueue_i m_currentFile
bool getVersionCheck() const
Definition: CmsShowMain.h:78
#define fwLog(_level_)
Definition: fwLog.h:45
bool getGlobalTagCheck() const
Definition: CmsShowMain.h:79
void setCurrentFile(FileQueue_i)
std::list< FWEventSelector * > m_selectors

◆ applyFiltersFromGUI()

void CmsShowNavigator::applyFiltersFromGUI ( )

Definition at line 476 of file CmsShowNavigator.cc.

References addFilter(), changeFilter(), filterStateChanged_, g, FWGUIEventFilter::getFilterMode(), FWGUIEventFilter::guiSelectors(), kOff, kOn, m_filesNeedUpdate, m_filterMode, m_filterState, m_guiFilter, m_selectors, EcalTangentSkim_cfg::o, removeFilter(), FWGUIEventFilter::setupDisableFilteringButton(), and updateFileFilters().

Referenced by FWGUIEventFilter::apply().

476  {
477  m_filesNeedUpdate = false;
478 
479  // check if filters are set ON
480  if (m_filterState == kOff) {
481  m_filesNeedUpdate = true;
482  m_filterState = kOn;
484  }
485 
486  // compare changes and then call updateFileFilters
487  std::list<FWEventSelector*>::iterator si = m_selectors.begin();
488  std::list<FWGUIEventSelector*>::iterator gi = m_guiFilter->guiSelectors().begin();
489 
492  m_filesNeedUpdate = true;
493  }
494 
495  while (si != m_selectors.end() || gi != m_guiFilter->guiSelectors().end()) {
496  if (gi == m_guiFilter->guiSelectors().end() && si != m_selectors.end()) {
497  removeFilter(si++);
498  } else if (si == m_selectors.end() && gi != m_guiFilter->guiSelectors().end()) {
499  addFilter((*gi)->guiSelector());
500  (*gi)->setOrigSelector(m_selectors.back());
501  ++gi;
502  } else {
503  if (*si == (*gi)->origSelector()) {
504  FWEventSelector* g = (*gi)->guiSelector();
505  FWEventSelector* o = *si;
506  bool filterNeedUpdate = o->m_expression != g->m_expression;
507  if (filterNeedUpdate || o->m_enabled != g->m_enabled) {
508  *o = *g;
509  changeFilter(*si, filterNeedUpdate);
510  } else {
511  o->m_description = g->m_description;
512  }
513  ++si;
514  ++gi;
515  } else if ((*gi)->origSelector() == nullptr) {
516  addFilter((*gi)->guiSelector());
517  (*gi)->setOrigSelector(m_selectors.back());
518  ++gi;
519  } else {
520  removeFilter(si++);
521  }
522  }
523  }
524 
525  if (m_filesNeedUpdate)
527 
529 }
EFilterState m_filterState
void removeFilter(std::list< FWEventSelector *>::iterator)
void addFilter(FWEventSelector *)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
FWGUIEventFilter * m_guiFilter
void changeFilter(FWEventSelector *, bool filterNeedUpdate)
sigc::signal< void(int)> filterStateChanged_
std::list< FWGUIEventSelector * > & guiSelectors()
void setupDisableFilteringButton(bool)
std::list< FWEventSelector * > m_selectors

◆ canEditFiltersExternally()

bool CmsShowNavigator::canEditFiltersExternally ( )

Definition at line 631 of file CmsShowNavigator.cc.

References CmsShowNavigator::FileQueue_t::begin(), CmsShowNavigator::FileQueue_t::end(), geometryDiff::file, FWGUIEventFilter::isOpen(), m_files, and m_guiFilter.

Referenced by editFiltersExternally(), and showEventFilterGUI().

631  {
632  bool haveActiveFilters = false;
633  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file) {
634  if ((*file)->hasActiveFilters()) {
635  haveActiveFilters = true;
636  break;
637  }
638  }
639 
640  bool btnEnabled = haveActiveFilters;
641 
642  if (m_guiFilter && m_guiFilter->isOpen())
643  btnEnabled = false;
644 
645  return btnEnabled;
646 }
FileQueue_t::iterator FileQueue_i
FWGUIEventFilter * m_guiFilter

◆ changeFilter()

void CmsShowNavigator::changeFilter ( FWEventSelector selector,
bool  filterNeedUpdate 
)
private

Definition at line 459 of file CmsShowNavigator.cc.

References CmsShowNavigator::FileQueue_t::begin(), CmsShowNavigator::FileQueue_t::end(), geometryDiff::file, fwLog, fwlog::kDebug, FWEventSelector::m_expression, m_files, and m_filesNeedUpdate.

Referenced by applyFiltersFromGUI().

459  {
460  fwLog(fwlog::kDebug) << "CmsShowNavigator::changeFilter " << selector->m_expression << std::endl;
461 
462  std::list<FWFileEntry::Filter*>::iterator it;
463  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file) {
464  for (it = (*file)->filters().begin(); it != (*file)->filters().end(); ++it) {
465  if ((*it)->m_selector == selector) {
466  if (updateFilter)
467  (*it)->m_needsUpdate = true;
468  (*it)->m_selector->m_expression = selector->m_expression;
469  break;
470  }
471  }
472  }
473  m_filesNeedUpdate = true;
474 }
FileQueue_t::iterator FileQueue_i
std::string m_expression
#define fwLog(_level_)
Definition: fwLog.h:45

◆ editFiltersExternally()

void CmsShowNavigator::editFiltersExternally ( )

Definition at line 648 of file CmsShowNavigator.cc.

References canEditFiltersExternally(), and editFiltersExternally_.

Referenced by FWGUIEventFilter::CloseWindow().

sigc::signal< void(bool)> editFiltersExternally_

◆ eventFilterEnableCallback()

void CmsShowNavigator::eventFilterEnableCallback ( Bool_t  )

◆ filesNeedUpdate()

bool CmsShowNavigator::filesNeedUpdate ( ) const
inline

Definition at line 119 of file CmsShowNavigator.h.

References m_filesNeedUpdate.

119 { return m_filesNeedUpdate; }

◆ filterEvents()

void CmsShowNavigator::filterEvents ( )

◆ filterEventsAndReset()

void CmsShowNavigator::filterEventsAndReset ( )

◆ filterStatusMessage()

const char * CmsShowNavigator::filterStatusMessage ( )

Definition at line 622 of file CmsShowNavigator.cc.

References getNSelectedEvents(), getNTotalEvents(), kOff, kOn, and m_filterState.

622  {
623  if (m_filterState == kOn)
624  return Form("%d events are selected from %d.", getNSelectedEvents(), getNTotalEvents());
625  else if (m_filterState == kOff)
626  return "Filtering is OFF.";
627  else
628  return "Filtering is disabled.";
629 }
int getNSelectedEvents() override
EFilterState m_filterState
int getNTotalEvents() override

◆ firstEvent()

void CmsShowNavigator::firstEvent ( )
overridevirtual

Implements FWNavigatorBase.

Definition at line 235 of file CmsShowNavigator.cc.

References CmsShowNavigator::FileQueue_t::begin(), CmsShowNavigator::FileQueue_t::end(), goTo(), kOn, m_files, m_filterState, and x.

235  {
237  if (m_filterState == kOn) {
238  while (x != m_files.end()) {
239  if ((*x)->hasSelectedEvents()) {
240  goTo(x, (*x)->firstSelectedEvent());
241  return;
242  }
243  ++x;
244  }
245  } else {
246  goTo(x, 0);
247  }
248 }
EFilterState m_filterState
FileQueue_t::iterator FileQueue_i
void goTo(FileQueue_i fi, int event)

◆ frameTitle()

const char * CmsShowNavigator::frameTitle ( )

Definition at line 792 of file CmsShowNavigator.cc.

References CmsShowNavigator::FileQueue_t::begin(), CmsShowNavigator::FileQueue_t::end(), mps_fire::i, createfilelist::int, MainPageGenerator::l, m_currentEvent, m_currentFile, m_files, and Skims_PA_cff::name.

792  {
793  if (m_files.empty())
794  return "";
795 
796  int nf = 0;
797  for (FileQueue_t::const_iterator i = m_files.begin(); i != m_files.end(); i++) {
798  if (i == m_currentFile)
799  break;
800  nf++;
801  }
802 
803  TString name = (*m_currentFile)->file()->GetName();
804  int l = name.Last('/');
805  if (l != kNPOS)
806  name.Remove(0, l + 1);
807 
808  return Form("%s [%d/%d], event [%d/%d]",
809  name.Data(),
810  nf + 1,
811  (int)m_files.size(),
812  m_currentEvent + 1,
813  (*m_currentFile)->lastEvent() + 1);
814 }
FileQueue_i m_currentFile

◆ getCurrentEvent()

const edm::EventBase * CmsShowNavigator::getCurrentEvent ( ) const
overridevirtual

Implements FWNavigatorBase.

Definition at line 788 of file CmsShowNavigator.cc.

References CmsShowNavigator::FileQueue_t::iterator::isSet(), and m_currentFile.

788  {
789  return m_currentFile.isSet() ? (*m_currentFile)->event() : nullptr;
790 }
FileQueue_i m_currentFile

◆ getCurrentGlobalTag()

std::string CmsShowNavigator::getCurrentGlobalTag ( )

Definition at line 816 of file CmsShowNavigator.cc.

References m_files, and AlCaHLTBitMon_QueryRunRegistry::string.

816  {
818  if (!m_files.empty()) {
819  res = (*m_currentFile)->getGlobalTag();
820  }
821  return res;
822 }
Definition: Electron.h:6

◆ getFilterState()

int CmsShowNavigator::getFilterState ( )
inline

Definition at line 120 of file CmsShowNavigator.h.

References m_filterState.

120 { return m_filterState; }
EFilterState m_filterState

◆ getNSelectedEvents()

int CmsShowNavigator::getNSelectedEvents ( )
overridevirtual

Implements FWNavigatorBase.

Definition at line 604 of file CmsShowNavigator.cc.

References CmsShowNavigator::FileQueue_t::begin(), CmsShowNavigator::FileQueue_t::end(), geometryDiff::file, and m_files.

Referenced by filterStatusMessage(), updateFileFilters(), and FWGUIEventFilter::updateFilterStateLabel().

604  {
605  int sum = 0;
606  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file) {
607  if ((*file)->globalSelection())
608  sum += (*file)->globalSelection()->GetN();
609  }
610  return sum;
611 }
FileQueue_t::iterator FileQueue_i

◆ getNTotalEvents()

int CmsShowNavigator::getNTotalEvents ( )
overridevirtual

Implements FWNavigatorBase.

Definition at line 613 of file CmsShowNavigator.cc.

References CmsShowNavigator::FileQueue_t::begin(), CmsShowNavigator::FileQueue_t::end(), geometryDiff::file, and m_files.

Referenced by filterStatusMessage(), updateFileFilters(), and FWGUIEventFilter::updateFilterStateLabel().

613  {
614  int sum = 0;
615  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file) {
616  sum += (*file)->tree()->GetEntries();
617  }
618 
619  return sum;
620 }
FileQueue_t::iterator FileQueue_i

◆ getProcessList()

std::vector< std::string > & CmsShowNavigator::getProcessList ( ) const

Definition at line 784 of file CmsShowNavigator.cc.

References CmsShowMain::context(), m_main, fireworks::Context::metadataManager(), and FWJobMetadataManager::processNamesInJob().

Referenced by FWGUIEventFilter::addSelector().

784  {
786 }
const CmsShowMain & m_main
std::vector< std::string > & processNamesInJob()
FWJobMetadataManager * metadataManager() const
Definition: Context.h:60
const fireworks::Context * context() const
Definition: CmsShowMain.h:77

◆ goTo()

void CmsShowNavigator::goTo ( FileQueue_i  fi,
int  event 
)

Definition at line 183 of file CmsShowNavigator.cc.

References edmPickEvents::event, fwLog, FWTTreeCache::IsLogging(), fwlog::kDebug, m_currentEvent, m_currentFile, FWNavigatorBase::newEvent_, fwlog::presentLogLevel(), setCurrentFile(), hcalRecHitTable_cff::time, and dqmMemoryStats::total.

Referenced by firstEvent(), goToRunEvent(), lastEvent(), nextEvent(), nextSelectedEvent(), previousEvent(), and previousSelectedEvent().

183  {
184  if (fi != m_currentFile)
185  setCurrentFile(fi);
186 
188  int total = (*fi)->tree()->GetEntries();
189  fwLog(fwlog::kDebug) << "CmsShowNavigator::goTo current file event [" << event << "/" << total - 1 << "]"
190  << std::endl;
191 
192  CpuInfo_t cpuInfo;
193  MemInfo_t memInfo;
194  ProcInfo_t procInfo;
195  gSystem->GetCpuInfo(&cpuInfo, 0);
196  gSystem->GetMemInfo(&memInfo);
197  gSystem->GetProcInfo(&procInfo);
198 
199  time_t curtime;
200  time(&curtime);
201 
202  fwLog(fwlog::kDebug) << "Current Time: " << ctime(&curtime);
203  fwLog(fwlog::kDebug) << "memInfo.fMemUsed \t" << memInfo.fMemUsed << std::endl;
204  fwLog(fwlog::kDebug) << "memInfo.fSwapUsed\t" << memInfo.fSwapUsed << std::endl;
205  fwLog(fwlog::kDebug) << "procInfo.fMemResident\t" << procInfo.fMemResident << std::endl;
206  fwLog(fwlog::kDebug) << "procInfo.fMemVirtual\t" << procInfo.fMemVirtual << std::endl;
207  fwLog(fwlog::kDebug) << "cpuInfo.fLoad1m \t" << cpuInfo.fLoad1m << std::endl;
208  fwLog(fwlog::kDebug) << "cpuInfo.fLoad5m \t" << cpuInfo.fLoad5m << std::endl;
209  }
210 
211  if (FWTTreeCache::IsLogging()) {
212  printf("FWTTreeCache statistics before going to event %d:\n", event);
213  (*m_currentFile)->tree()->PrintCacheStats(); // ("cachedbranches");
214  }
215 
216  (*m_currentFile)->event()->to(event);
217  (*m_currentFile)->tree()->LoadTree(event);
219 
220  newEvent_.emit();
221 }
sigc::signal< void()> newEvent_
LogLevel presentLogLevel()
Definition: fwLog.cc:46
FileQueue_i m_currentFile
static bool IsLogging()
Definition: FWTTreeCache.cc:23
#define fwLog(_level_)
Definition: fwLog.h:45
void setCurrentFile(FileQueue_i)
Definition: event.py:1

◆ goToRunEvent()

void CmsShowNavigator::goToRunEvent ( edm::RunNumber_t  run,
edm::LuminosityBlockNumber_t  lumi,
edm::EventNumber_t  event 
)
overridevirtual

Implements FWNavigatorBase.

Definition at line 223 of file CmsShowNavigator.cc.

References CmsShowNavigator::FileQueue_t::begin(), CmsShowNavigator::FileQueue_t::end(), geometryDiff::file, goTo(), m_files, and writedatasetfile::run.

223  {
224  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file) {
225  Long64_t index = (*file)->event()->indexFromEventId(run, lumi, event);
226  if (index >= 0) {
227  goTo(file, index);
228  break;
229  }
230  }
231 }
FileQueue_t::iterator FileQueue_i
void goTo(FileQueue_i fi, int event)
Definition: event.py:1

◆ isFirstEvent()

bool CmsShowNavigator::isFirstEvent ( )
overridevirtual

Implements FWNavigatorBase.

Definition at line 533 of file CmsShowNavigator.cc.

References CmsShowNavigator::FileQueue_t::begin(), CmsShowNavigator::FileQueue_t::end(), geometryDiff::file, kOn, m_currentEvent, m_currentFile, m_files, and m_filterState.

533  {
534  if (m_filterState == kOn) {
535  FileQueue_i firstSelectedFile;
536  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file) {
537  if ((*file)->hasSelectedEvents()) {
538  firstSelectedFile = file;
539  break;
540  }
541  }
542 
543  if (firstSelectedFile == m_currentFile)
544  return (*m_currentFile)->firstSelectedEvent() == m_currentEvent;
545  } else {
546  if (m_currentFile == m_files.begin()) {
547  return m_currentEvent == 0;
548  }
549  }
550  return false;
551 }
EFilterState m_filterState
FileQueue_t::iterator FileQueue_i
FileQueue_i m_currentFile

◆ isLastEvent()

bool CmsShowNavigator::isLastEvent ( )
overridevirtual

Implements FWNavigatorBase.

Definition at line 553 of file CmsShowNavigator.cc.

References CmsShowNavigator::FileQueue_t::begin(), CmsShowNavigator::FileQueue_t::end(), geometryDiff::file, kOn, m_currentEvent, m_currentFile, m_files, and m_filterState.

553  {
554  if (m_filterState == kOn) {
555  FileQueue_i lastSelectedFile;
556  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file) {
557  if ((*file)->hasSelectedEvents())
558  lastSelectedFile = file;
559  }
560  if (lastSelectedFile == m_currentFile)
561  return (*m_currentFile)->lastSelectedEvent() == m_currentEvent;
562  } else {
563  FileQueue_i lastFile = m_files.end();
564  --lastFile;
565  if (m_currentFile == lastFile) {
566  return (*m_currentFile)->lastEvent() == m_currentEvent;
567  }
568  }
569  return false;
570 }
EFilterState m_filterState
FileQueue_t::iterator FileQueue_i
FileQueue_i m_currentFile

◆ lastEvent()

void CmsShowNavigator::lastEvent ( )
overridevirtual

Implements FWNavigatorBase.

Definition at line 250 of file CmsShowNavigator.cc.

References CmsShowNavigator::FileQueue_t::begin(), CmsShowNavigator::FileQueue_t::end(), goTo(), kOn, m_files, m_filterState, and x.

250  {
251  FileQueue_i x = m_files.end();
252  if (m_filterState == kOn) {
253  while (x != m_files.begin()) {
254  --x;
255  if ((*x)->hasSelectedEvents()) {
256  goTo(x, (*x)->lastSelectedEvent());
257  return;
258  }
259  }
260  } else {
261  --x;
262  goTo(x, (*x)->lastEvent());
263  }
264 }
EFilterState m_filterState
FileQueue_t::iterator FileQueue_i
void goTo(FileQueue_i fi, int event)

◆ newFile()

void CmsShowNavigator::newFile ( FileQueue_i  )
private

Referenced by appendFile(), and openFile().

◆ nextEvent()

void CmsShowNavigator::nextEvent ( )
overridevirtual

Implements FWNavigatorBase.

Definition at line 290 of file CmsShowNavigator.cc.

References CmsShowNavigator::FileQueue_t::end(), goTo(), kOn, dqmdumpme::last, m_currentEvent, m_currentFile, m_files, m_filterState, m_newFileOnNextEvent, nextSelectedEvent(), and x.

290  {
291  if (m_newFileOnNextEvent) {
293  --last;
294  if (m_filterState == kOn)
295  goTo(last, (*last)->firstSelectedEvent());
296  else
297  goTo(last, 0);
298 
299  m_newFileOnNextEvent = false;
300  return;
301  }
302 
303  if (m_filterState == kOn) {
305  return;
306  } else {
307  if (m_currentEvent < (*m_currentFile)->lastEvent()) {
309  } else {
311  ++x;
312  if (x != m_files.end()) {
313  goTo(x, 0);
314  }
315  }
316  }
317 }
EFilterState m_filterState
FileQueue_t::iterator FileQueue_i
bool nextSelectedEvent() override
FileQueue_i m_currentFile
void goTo(FileQueue_i fi, int event)

◆ nextSelectedEvent()

bool CmsShowNavigator::nextSelectedEvent ( )
overridevirtual

Implements FWNavigatorBase.

Definition at line 268 of file CmsShowNavigator.cc.

References CmsShowNavigator::FileQueue_t::end(), goTo(), mps_fire::i, m_currentEvent, m_currentFile, and m_files.

Referenced by nextEvent(), and updateFileFilters().

268  {
269  int nextEv = (*m_currentFile)->nextSelectedEvent(m_currentEvent);
270  if (nextEv > -1) {
271  goTo(m_currentFile, nextEv);
272  return true;
273  } else {
275  ++i;
276  while (i != m_files.end()) {
277  if ((*i)->hasSelectedEvents()) {
278  goTo(i, (*i)->firstSelectedEvent());
279  return true;
280  }
281  ++i;
282  }
283  }
284 
285  return false;
286 }
FileQueue_t::iterator FileQueue_i
FileQueue_i m_currentFile
void goTo(FileQueue_i fi, int event)

◆ openFile()

bool CmsShowNavigator::openFile ( const std::string &  fileName)

Definition at line 70 of file CmsShowNavigator.cc.

References CmsShowNavigator::FileQueue_t::begin(), cppFunctionSkipper::exception, geometryDiff::file, MillePedeFileConverter_cfg::fileName, fwLog, CmsShowMain::getGlobalTagCheck(), CmsShowMain::getVersionCheck(), mps_fire::i, fwlog::kDebug, fwlog::kError, kOff, m_files, m_filterState, m_main, m_selectors, newFile(), setCurrentFile(), and updateFileFilters().

70  {
71  fwLog(fwlog::kDebug) << "CmsShowNavigator::openFile [" << fileName << "]" << std::endl;
72  FWFileEntry* newFile = nullptr;
73  try {
75  } catch (std::exception& iException) {
76  fwLog(fwlog::kError) << "Navigator::openFile ecaught exception FWFileEntry constructor " << iException.what()
77  << std::endl;
78 
79  delete newFile;
80  return false;
81  }
82 
83  try {
84  // delete all previous files
85  while (!m_files.empty()) {
86  FWFileEntry* file = m_files.front();
87  m_files.pop_front();
88  file->closeFile();
89  delete file;
90  }
91 
92  m_files.push_back(newFile);
94 
95  // set filters
96  for (std::list<FWEventSelector*>::iterator i = m_selectors.begin(); i != m_selectors.end(); ++i)
97  newFile->filters().push_back(new FWFileEntry::Filter(*i));
98 
99  if (m_filterState != kOff)
101 
102  return true;
103  } catch (std::exception& iException) {
104  fwLog(fwlog::kError) << "Navigator::openFile caught exception " << iException.what() << std::endl;
105  return false;
106  }
107 }
EFilterState m_filterState
const CmsShowMain & m_main
void newFile(FileQueue_i)
bool getVersionCheck() const
Definition: CmsShowMain.h:78
#define fwLog(_level_)
Definition: fwLog.h:45
bool getGlobalTagCheck() const
Definition: CmsShowMain.h:79
void setCurrentFile(FileQueue_i)
std::list< FWEventSelector * > m_selectors

◆ operator=()

const CmsShowNavigator& CmsShowNavigator::operator= ( const CmsShowNavigator )
private

◆ previousEvent()

void CmsShowNavigator::previousEvent ( )
overridevirtual

Implements FWNavigatorBase.

Definition at line 342 of file CmsShowNavigator.cc.

References CmsShowNavigator::FileQueue_t::begin(), goTo(), kOn, m_currentEvent, m_currentFile, m_files, m_filterState, previousSelectedEvent(), and x.

342  {
343  if (m_filterState == kOn) {
345  } else {
346  if (m_currentEvent > 0) {
348  } else {
349  // last event in previous file
351  if (x != m_files.begin()) {
352  --x;
353  goTo(x, (*x)->lastEvent());
354  }
355  }
356  }
357 }
EFilterState m_filterState
FileQueue_t::iterator FileQueue_i
FileQueue_i m_currentFile
bool previousSelectedEvent() override
void goTo(FileQueue_i fi, int event)

◆ previousSelectedEvent()

bool CmsShowNavigator::previousSelectedEvent ( )
overridevirtual

Implements FWNavigatorBase.

Definition at line 321 of file CmsShowNavigator.cc.

References CmsShowNavigator::FileQueue_t::end(), goTo(), mps_fire::i, m_currentEvent, m_currentFile, and m_files.

Referenced by previousEvent(), and updateFileFilters().

321  {
322  int prevEv = (*m_currentFile)->previousSelectedEvent(m_currentEvent);
323  if (prevEv > -1) {
324  goTo(m_currentFile, prevEv);
325  return true;
326  } else {
328  i.previous(m_files);
329  while (i != m_files.end()) {
330  if ((*i)->hasSelectedEvents()) {
331  goTo(i, (*i)->lastSelectedEvent());
332  return true;
333  }
334  i.previous(m_files);
335  }
336  }
337  return false;
338 }
FileQueue_t::iterator FileQueue_i
FileQueue_i m_currentFile
void goTo(FileQueue_i fi, int event)

◆ realEntry()

Int_t CmsShowNavigator::realEntry ( Int_t  rawEntry)

◆ removeFilter()

void CmsShowNavigator::removeFilter ( std::list< FWEventSelector *>::iterator  si)
private

Definition at line 427 of file CmsShowNavigator.cc.

References CmsShowNavigator::FileQueue_t::begin(), CmsShowNavigator::FileQueue_t::end(), f, geometryDiff::file, fwLog, fwlog::kDebug, m_files, m_filesNeedUpdate, and m_selectors.

Referenced by applyFiltersFromGUI().

427  {
428  fwLog(fwlog::kDebug) << "CmsShowNavigator::removeFilter " << (*si)->m_expression << std::endl;
429 
430  std::list<FWFileEntry::Filter*>::iterator it;
431  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file) {
432  for (it = (*file)->filters().begin(); it != (*file)->filters().end(); ++it) {
433  if ((*it)->m_selector == *si) {
434  FWFileEntry::Filter* f = *it;
435  delete f;
436  (*file)->filters().erase(it);
437  break;
438  }
439  }
440  }
441 
442  delete *si;
443  m_selectors.erase(si);
444  m_filesNeedUpdate = true;
445 }
FileQueue_t::iterator FileQueue_i
double f[11][100]
#define fwLog(_level_)
Definition: fwLog.h:45
std::list< FWEventSelector * > m_selectors

◆ resetNewFileOnNextEvent()

void CmsShowNavigator::resetNewFileOnNextEvent ( )
inline

Definition at line 125 of file CmsShowNavigator.h.

References m_newFileOnNextEvent.

125 { m_newFileOnNextEvent = false; }

◆ resumeFilter()

void CmsShowNavigator::resumeFilter ( )

Definition at line 386 of file CmsShowNavigator.cc.

References filterStateChanged_, fwLog, fwlog::kInfo, kOn, and m_filterState.

Referenced by updateFileFilters().

386  {
387  fwLog(fwlog::kInfo) << "CmsShowNavigator::resumeFilter" << std::endl;
388  m_filterState = kOn;
390 }
EFilterState m_filterState
sigc::signal< void(int)> filterStateChanged_
#define fwLog(_level_)
Definition: fwLog.h:45

◆ setCurrentFile()

void CmsShowNavigator::setCurrentFile ( FileQueue_i  fi)
private

Definition at line 164 of file CmsShowNavigator.cc.

References CmsShowNavigator::FileQueue_t::begin(), CmsShowNavigator::FileQueue_t::end(), fileChanged_, fwLog, mps_fire::i, fwlog::kDebug, fwlog::kInfo, m_currentFile, m_files, and fwlog::presentLogLevel().

Referenced by appendFile(), goTo(), and openFile().

164  {
166  int cnt = 0;
167  for (FileQueue_i i = m_files.begin(); i != m_files.end(); i++) {
168  if (i == fi)
169  break;
170  cnt++;
171  }
172 
173  fwLog(fwlog::kDebug) << "CmsShowNavigator::setCurrentFile [" << (*fi)->file()->GetName() << "] file idx in chain ["
174  << cnt << "/" << m_files.size() - 1 << "]" << std::endl;
175  } else {
176  fwLog(fwlog::kInfo) << "Set current file to " << (*fi)->file()->GetName() << ".\n";
177  }
178 
179  m_currentFile = fi;
180  fileChanged_.emit((*m_currentFile)->file());
181 }
FileQueue_t::iterator FileQueue_i
LogLevel presentLogLevel()
Definition: fwLog.cc:46
FileQueue_i m_currentFile
sigc::signal< void(const TFile *)> fileChanged_
#define fwLog(_level_)
Definition: fwLog.h:45

◆ setFrom()

void CmsShowNavigator::setFrom ( const FWConfiguration iFrom)
overridevirtual

Implements FWNavigatorBase.

Definition at line 661 of file CmsShowNavigator.cc.

References cms::cuda::assert(), CmsShowNavigator::FileQueue_t::begin(), CmsShowNavigator::FileQueue_t::end(), geometryDiff::file, filterStateChanged_, mps_fire::i, FWConfiguration::keyValues(), kOff, kOn, FWEventSelector::m_description, FWEventSelector::m_enabled, FWEventSelector::m_expression, m_files, m_filesNeedUpdate, m_filterMode, m_filterState, m_guiFilter, m_selectors, FWEventSelector::m_triggerProcess, postFiltering_, FWGUIEventFilter::reset(), alignCSCRings::s, FWGUIEventFilter::show(), updateFileFilters(), FWConfiguration::value(), FWConfiguration::valueForKey(), and x.

661  {
662  m_filesNeedUpdate = true;
663 
664  EFilterState oldFilterState = m_filterState;
665 
666  m_selectors.clear();
667 
668  // selectors
669  const FWConfiguration* sConf = iFrom.valueForKey("EventFilters");
670 
671  if (sConf) {
672  const FWConfiguration::KeyValues* keyVals = sConf->keyValues();
673  if (keyVals) {
674  for (FWConfiguration::KeyValuesIt it = keyVals->begin(); it != keyVals->end(); ++it) {
675  const FWConfiguration& conf = (*it).second;
676  FWEventSelector* selector = new FWEventSelector();
677  selector->m_expression = conf.valueForKey("expression")->value();
678  selector->m_description = conf.valueForKey("comment")->value();
679  selector->m_enabled = atoi(conf.valueForKey("enabled")->value().c_str());
680  if (conf.valueForKey("triggerProcess"))
681  selector->m_triggerProcess = conf.valueForKey("triggerProcess")->value();
682  m_selectors.push_back(selector);
683  }
684  }
685  } else {
686  int numberOfFilters = 0;
687  const FWConfiguration* nfvalue = iFrom.valueForKey("EventFilter_total");
688  if (nfvalue)
689  numberOfFilters = atoi(nfvalue->value().c_str());
690 
691  for (int i = 0; i < numberOfFilters; ++i) {
692  FWEventSelector* selector = new FWEventSelector();
693  {
694  const FWConfiguration* value = iFrom.valueForKey(Form("EventFilter%d_enabled", i));
695  assert(value);
696  std::istringstream s(value->value());
697  s >> selector->m_enabled;
698  }
699  selector->m_expression = iFrom.valueForKey(Form("EventFilter%d_selection", i))->value();
700  selector->m_description = iFrom.valueForKey(Form("EventFilter%d_comment", i))->value();
701 
702  if (strstr(selector->m_expression.c_str(), "HLT"))
703  selector->m_triggerProcess = "HLT";
704 
705  m_selectors.push_back(selector);
706  }
707  }
708 
709  // filter mode
710  {
711  const FWConfiguration* value = iFrom.valueForKey("EventFilter_mode");
712  if (value) {
713  std::istringstream s(value->value());
714  s >> m_filterMode;
715  }
716  }
717 
718  // filter on
719  {
720  const FWConfiguration* value = iFrom.valueForKey("EventFilter_enabled");
721  std::istringstream s(value->value());
722  int x;
723  s >> x;
724  m_filterState = x ? kOn : kOff;
725  }
726 
727  // redesplay new filters in event filter dialog if already mapped
728  if (m_guiFilter) {
729  m_guiFilter->reset();
730  if (m_guiFilter->IsMapped())
732  }
733 
734  if (!m_files.empty()) {
735  // change filters in existing files
736  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file) {
737  (*file)->filters().clear();
738  for (std::list<FWEventSelector*>::iterator i = m_selectors.begin(); i != m_selectors.end(); ++i)
739  (*file)->filters().push_back(new FWFileEntry::Filter(*i));
740  }
741 
742  // run new filters if enabled, else just reset
743  if (m_filterState == kOn)
745  else
746  postFiltering_.emit(true);
747  }
748  // update CmsShowMainFrame checkBoxIcon and button text
749  if (oldFilterState != m_filterState)
751 }
EFilterState m_filterState
std::string m_triggerProcess
FileQueue_t::iterator FileQueue_i
assert(be >=bs)
FWGUIEventFilter * m_guiFilter
const std::string & value(unsigned int iIndex=0) const
std::string m_expression
Definition: value.py:1
std::vector< std::pair< std::string, FWConfiguration > > KeyValues
std::string m_description
sigc::signal< void(int)> filterStateChanged_
void show(std::list< FWEventSelector *> *sels, int filterMode, int state)
KeyValues::const_iterator KeyValuesIt
const FWConfiguration * valueForKey(const std::string &iKey) const
std::list< FWEventSelector * > m_selectors
const KeyValues * keyValues() const
sigc::signal< void(bool)> postFiltering_

◆ setMaxNumberOfFilesToChain()

void CmsShowNavigator::setMaxNumberOfFilesToChain ( unsigned int  i)
inline

Definition at line 99 of file CmsShowNavigator.h.

References mps_fire::i, and m_maxNumberOfFilesToChain.

Referenced by CmsShowMain::CmsShowMain().

unsigned int m_maxNumberOfFilesToChain

◆ showEventFilterGUI()

void CmsShowNavigator::showEventFilterGUI ( const TGWindow *  p)

Definition at line 650 of file CmsShowNavigator.cc.

References canEditFiltersExternally(), FWGUIEventFilter::CloseWindow(), editFiltersExternally_, m_filterMode, m_filterState, m_guiFilter, m_selectors, and FWGUIEventFilter::show().

Referenced by CmsShowMain::setupDataHandling().

650  {
651  if (m_guiFilter->IsMapped()) {
653  } else {
656  }
657 }
EFilterState m_filterState
FWGUIEventFilter * m_guiFilter
void show(std::list< FWEventSelector *> *sels, int filterMode, int state)
void CloseWindow() override
std::list< FWEventSelector * > m_selectors
sigc::signal< void(bool)> editFiltersExternally_

◆ toggleFilterEnable()

void CmsShowNavigator::toggleFilterEnable ( )

Definition at line 361 of file CmsShowNavigator.cc.

References filterStateChanged_, fwLog, fwlog::kInfo, kOff, kOn, m_filterState, m_guiFilter, FWGUIEventFilter::setupDisableFilteringButton(), and updateFileFilters().

Referenced by FWGUIEventFilter::disableFilters().

361  {
362  // callback
363 
364  fwLog(fwlog::kInfo) << "CmsShowNavigator::toggleFilterEnable filters enabled [" << (m_filterState == kOff) << "]"
365  << std::endl;
366 
367  if (m_filterState == kOff) {
368  m_filterState = kOn;
370 
372  } else {
375  }
376 
378 }
EFilterState m_filterState
FWGUIEventFilter * m_guiFilter
sigc::signal< void(int)> filterStateChanged_
#define fwLog(_level_)
Definition: fwLog.h:45
void setupDisableFilteringButton(bool)

◆ updateFileFilters()

void CmsShowNavigator::updateFileFilters ( )
private

Definition at line 392 of file CmsShowNavigator.cc.

References CmsShowNavigator::FileQueue_t::begin(), CmsShowMain::context(), CmsShowNavigator::FileQueue_t::end(), fireworks::Context::eventItemsManager(), geometryDiff::file, fwLog, getNSelectedEvents(), getNTotalEvents(), fwlog::kDebug, kOr, kWithdrawn, m_currentEvent, m_files, m_filesNeedUpdate, m_filterMode, m_filterState, m_main, nextSelectedEvent(), postFiltering_, fwlog::presentLogLevel(), previousSelectedEvent(), resumeFilter(), updateSelectorsInfo(), and withdrawFilter().

Referenced by appendFile(), applyFiltersFromGUI(), openFile(), setFrom(), and toggleFilterEnable().

392  {
393  // run filters on files
394  std::list<FWFileEntry::Filter>::iterator it;
395  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file) {
396  if (m_filesNeedUpdate)
397  (*file)->needUpdate();
398  (*file)->updateFilters(m_main.context()->eventItemsManager(), m_filterMode == kOr);
399  }
401  m_filesNeedUpdate = false;
402 
403  int nSelected = getNSelectedEvents();
404  if (nSelected) {
405  // go to the nearest selected event/file
406  bool changeCurrentEvent = !(*m_currentFile)->isEventSelected(m_currentEvent);
407  if (changeCurrentEvent) {
408  if (!nextSelectedEvent())
410  }
411 
412  if (m_filterState == kWithdrawn)
413  resumeFilter();
414 
415  postFiltering_.emit(changeCurrentEvent);
416  } else {
417  withdrawFilter();
418  }
419 
421  fwLog(fwlog::kDebug) << "CmsShowNavigator::updateFileFilters selected events over files [" << getNSelectedEvents()
422  << "/" << getNTotalEvents() << "]" << std::endl;
423  }
424 }
int getNSelectedEvents() override
EFilterState m_filterState
const FWEventItemsManager * eventItemsManager() const
Definition: Context.h:56
const CmsShowMain & m_main
FileQueue_t::iterator FileQueue_i
LogLevel presentLogLevel()
Definition: fwLog.cc:46
bool nextSelectedEvent() override
int getNTotalEvents() override
bool previousSelectedEvent() override
#define fwLog(_level_)
Definition: fwLog.h:45
const fireworks::Context * context() const
Definition: CmsShowMain.h:77
sigc::signal< void(bool)> postFiltering_

◆ updateSelectorsInfo()

void CmsShowNavigator::updateSelectorsInfo ( )
private

Definition at line 573 of file CmsShowNavigator.cc.

References CmsShowNavigator::FileQueue_t::begin(), CmsShowNavigator::FileQueue_t::end(), geometryDiff::file, filters, FWGUIEventFilter::guiSelectors(), mps_fire::i, m_files, m_guiFilter, m_selectors, and EgammaValidation_Wenu_cff::sel.

Referenced by updateFileFilters().

573  {
574  // reset
575  std::list<FWEventSelector*>::const_iterator sel = m_selectors.begin();
576  while (sel != m_selectors.end()) {
577  (*sel)->m_selected = 0;
578  (*sel)->m_updated = true;
579  ++sel;
580  }
581 
582  // loop file filters
583  std::list<FWFileEntry::Filter*>::iterator i;
584  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file) {
585  std::list<FWFileEntry::Filter*>& filters = (*file)->filters();
586  for (i = filters.begin(); i != filters.end(); ++i) {
587  if ((*i)->m_eventList) {
588  (*i)->m_selector->m_selected += (*i)->m_eventList->GetN();
589  }
590 
591  if ((*i)->m_needsUpdate)
592  (*i)->m_selector->m_updated = false;
593  }
594  }
595  if (m_guiFilter) {
596  std::list<FWGUIEventSelector*>::const_iterator gs = m_guiFilter->guiSelectors().begin();
597  while (gs != m_guiFilter->guiSelectors().end()) {
598  (*gs)->updateNEvents();
599  ++gs;
600  }
601  }
602 }
FileQueue_t::iterator FileQueue_i
std::vector< TPRegexp > filters
Definition: eve_filter.cc:22
FWGUIEventFilter * m_guiFilter
std::list< FWGUIEventSelector * > & guiSelectors()
Definition: AbsArchive.cc:46
std::list< FWEventSelector * > m_selectors

◆ withdrawFilter()

void CmsShowNavigator::withdrawFilter ( )

Definition at line 380 of file CmsShowNavigator.cc.

References filterStateChanged_, fwLog, fwlog::kInfo, kWithdrawn, and m_filterState.

Referenced by updateFileFilters().

380  {
381  fwLog(fwlog::kInfo) << "CmsShowNavigator::witdrawFilter" << std::endl;
384 }
EFilterState m_filterState
sigc::signal< void(int)> filterStateChanged_
#define fwLog(_level_)
Definition: fwLog.h:45

Member Data Documentation

◆ editFiltersExternally_

sigc::signal<void(bool)> CmsShowNavigator::editFiltersExternally_

Definition at line 132 of file CmsShowNavigator.h.

Referenced by editFiltersExternally(), and showEventFilterGUI().

◆ fileChanged_

sigc::signal<void(const TFile*)> CmsShowNavigator::fileChanged_

Definition at line 129 of file CmsShowNavigator.h.

Referenced by setCurrentFile().

◆ filterStateChanged_

sigc::signal<void(int)> CmsShowNavigator::filterStateChanged_

◆ m_currentEvent

int CmsShowNavigator::m_currentEvent
private

◆ m_currentFile

FileQueue_i CmsShowNavigator::m_currentFile
private

◆ m_files

FileQueue_t CmsShowNavigator::m_files
private

◆ m_filesNeedUpdate

bool CmsShowNavigator::m_filesNeedUpdate
private

◆ m_filterMode

int CmsShowNavigator::m_filterMode
private

◆ m_filterState

EFilterState CmsShowNavigator::m_filterState
private

◆ m_guiFilter

FWGUIEventFilter* CmsShowNavigator::m_guiFilter
private

◆ m_main

const CmsShowMain& CmsShowNavigator::m_main
private

Definition at line 165 of file CmsShowNavigator.h.

Referenced by appendFile(), getProcessList(), openFile(), and updateFileFilters().

◆ m_maxNumberOfFilesToChain

unsigned int CmsShowNavigator::m_maxNumberOfFilesToChain
private

Definition at line 161 of file CmsShowNavigator.h.

Referenced by appendFile(), and setMaxNumberOfFilesToChain().

◆ m_newFileOnNextEvent

bool CmsShowNavigator::m_newFileOnNextEvent
private

◆ m_selectors

std::list<FWEventSelector*> CmsShowNavigator::m_selectors
private

◆ postFiltering_

sigc::signal<void(bool)> CmsShowNavigator::postFiltering_

Definition at line 131 of file CmsShowNavigator.h.

Referenced by setFrom(), and updateFileFilters().

◆ preFiltering_

sigc::signal<void()> CmsShowNavigator::preFiltering_

Definition at line 130 of file CmsShowNavigator.h.