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
 
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 () override
 
- Public Member Functions inherited from FWConfigurable
 FWConfigurable ()
 
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

Definition at line 77 of file CmsShowNavigator.h.

typedef FQBase_t::iterator CmsShowNavigator::FQBase_i
private

Definition at line 44 of file CmsShowNavigator.h.

Definition at line 43 of file CmsShowNavigator.h.

Member Enumeration Documentation

Enumerator
kOr 
kAnd 

Definition at line 40 of file CmsShowNavigator.h.

Enumerator
kOff 
kOn 
kWithdrawn 

Definition at line 39 of file CmsShowNavigator.h.

Constructor & Destructor Documentation

CmsShowNavigator::CmsShowNavigator ( const CmsShowMain main)

Definition at line 46 of file CmsShowNavigator.cc.

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

46  :
47  FWNavigatorBase(main),
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 {
61  m_guiFilter = new FWGUIEventFilter(this);
63 }
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_
CmsShowNavigator::~CmsShowNavigator ( )
override

Definition at line 65 of file CmsShowNavigator.cc.

References m_guiFilter.

66 {
67  delete m_guiFilter;
68 }
FWGUIEventFilter * m_guiFilter
CmsShowNavigator::CmsShowNavigator ( const CmsShowNavigator )
private

Member Function Documentation

void CmsShowNavigator::activateNewFileOnNextEvent ( )
inline

Definition at line 129 of file CmsShowNavigator.h.

129 { m_newFileOnNextEvent = true; }
void CmsShowNavigator::addFilter ( FWEventSelector ref)
private

Definition at line 540 of file CmsShowNavigator.cc.

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

Referenced by applyFiltersFromGUI().

541 {
542  fwLog(fwlog::kDebug) << "CmsShowNavigator::addFilter " << ref->m_expression << std::endl;
543 
544  FWEventSelector* selector = new FWEventSelector(ref);
545  m_selectors.push_back(selector);
546 
547  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
548  {
549  (*file)->filters ().push_back(new FWFileEntry::Filter(selector));
550  }
551  m_filesNeedUpdate = true;
552 }
FileQueue_t::iterator FileQueue_i
std::string m_expression
#define fwLog(_level_)
Definition: fwLog.h:50
std::list< FWEventSelector * > m_selectors
void CmsShowNavigator::addTo ( FWConfiguration iTo) const
overridevirtual

Implements FWNavigatorBase.

Definition at line 928 of file CmsShowNavigator.cc.

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

929 {
930  // selectors
932  int cnt = 0;
933  for (std::list<FWEventSelector*>::const_iterator sel = m_selectors.begin(); sel != m_selectors.end(); ++sel)
934  {
936 
937  filter.addKeyValue("expression",FWConfiguration((*sel)->m_expression));
938  filter.addKeyValue("enabled", FWConfiguration((*sel)->m_enabled ? "1" : "0"));
939  filter.addKeyValue("comment", FWConfiguration((*sel)->m_description));
940 
941  if (!(*sel)->m_triggerProcess.empty())
942  filter.addKeyValue("triggerProcess",FWConfiguration((*sel)->m_triggerProcess));
943 
944  tmp.addKeyValue(Form("------Filter[%d]------", cnt), filter,true);
945  ++cnt;
946  }
947 
948  iTo.addKeyValue("EventFilters", tmp,true);
949 
950  // mode
951  {
952  std::stringstream s;
953  s<< m_filterMode;
954  iTo.addKeyValue("EventFilter_mode", s.str());
955  }
956 
957  // enabled
958  iTo.addKeyValue("EventFilter_enabled",FWConfiguration( m_filterState == kOn ? "1" : "0"));
959 }
EFilterState m_filterState
FWConfiguration & addKeyValue(const std::string &, const FWConfiguration &)
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
std::list< FWEventSelector * > m_selectors
bool CmsShowNavigator::appendFile ( const std::string &  fileName,
bool  checkFileQueueSize,
bool  live 
)

Definition at line 122 of file CmsShowNavigator.cc.

References CmsShowNavigator::FileQueue_t::begin(), MessageLogger_cfi::cerr, FWFileEntry::closeFile(), cppFunctionSkipper::exception, FrontierConditions_GlobalTag_cff::file, FWFileEntry::filters(), fwLog, 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().

123 {
124  fwLog(fwlog::kDebug) << "CmsShowNavigator::appendFile [" << fileName << "]" << std::endl;
125  FWFileEntry* newFile = nullptr;
126  try
127  {
128  newFile = new FWFileEntry(fileName, m_main.getVersionCheck());
129  }
130  catch(std::exception& iException)
131  {
132  fwLog(fwlog::kError) <<"Navigator::appendFile caught exception FWFileEntry constructor "<<iException.what()<<std::endl;
133  delete newFile;
134  return false;
135  }
136 
137  try
138  {
139  if (checkFileQueueSize)
140  {
141  int toErase = m_files.size() - (m_maxNumberOfFilesToChain + 1);
142  while (toErase > 0)
143  {
144  FileQueue_i si = m_files.begin();
145  if (m_currentFile == si)
146  si++;
147  FWFileEntry* file = *si;
148  file->closeFile();
149  delete file;
150 
151  m_files.erase(si);
152  --toErase;
153  }
154 
155  if (m_files.size() > m_maxNumberOfFilesToChain)
156  fwLog(fwlog::kWarning) << " " << m_files.size() << " chained files more than maxNumberOfFilesToChain \n" << m_maxNumberOfFilesToChain << std::endl;
157  }
158 
159  m_files.push_back(newFile);
160 
161  // Needed for proper handling of first registered file when -port option is in effect.
162  if (!m_currentFile.isSet())
164 
165  // set filters
166  for (std::list<FWEventSelector*>::iterator i = m_selectors.begin(); i != m_selectors.end(); ++i)
167  newFile->filters().push_back(new FWFileEntry::Filter(*i));
168 
169  if (m_filterState != kOff)
171 
172  }
173  catch(std::exception& iException)
174  {
175  std::cerr <<"Navigator::openFile caught exception "<<iException.what()<<std::endl;
176  return false;
177  }
178 
179  return true;
180 }
EFilterState m_filterState
void closeFile()
Definition: FWFileEntry.cc:141
const CmsShowMain & m_main
unsigned int m_maxNumberOfFilesToChain
FileQueue_t::iterator FileQueue_i
void newFile(FileQueue_i)
FileQueue_i m_currentFile
std::list< Filter * > & filters()
Definition: FWFileEntry.h:65
bool getVersionCheck() const
Definition: CmsShowMain.h:80
#define fwLog(_level_)
Definition: fwLog.h:50
void setCurrentFile(FileQueue_i)
std::list< FWEventSelector * > m_selectors
void CmsShowNavigator::applyFiltersFromGUI ( )

Definition at line 576 of file CmsShowNavigator.cc.

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

Referenced by FWGUIEventFilter::apply().

577 {
578  m_filesNeedUpdate = false;
579 
580  // check if filters are set ON
581  if (m_filterState == kOff)
582  {
583  m_filesNeedUpdate = true;
584  m_filterState = kOn;
586  }
587 
588  // compare changes and then call updateFileFilters
589  std::list<FWEventSelector*>::iterator si = m_selectors.begin();
590  std::list<FWGUIEventSelector*>::iterator gi = m_guiFilter->guiSelectors().begin();
591 
594  m_filesNeedUpdate = true;
595  }
596 
597  while (si != m_selectors.end() || gi != m_guiFilter->guiSelectors().end())
598  {
599  if (gi == m_guiFilter->guiSelectors().end() && si != m_selectors.end())
600  {
601  removeFilter(si++);
602  }
603  else if (si == m_selectors.end() && gi != m_guiFilter->guiSelectors().end() )
604  {
605  addFilter((*gi)->guiSelector());
606  (*gi)->setOrigSelector(m_selectors.back());
607  ++gi;
608  }
609  else
610  {
611  if (*si == (*gi)->origSelector())
612  {
613  FWEventSelector* g = (*gi)->guiSelector();
614  FWEventSelector* o = *si;
615  bool filterNeedUpdate = o->m_expression != g->m_expression;
616  if (filterNeedUpdate || o->m_enabled != g->m_enabled) {
617  *o = *g;
618  changeFilter(*si, filterNeedUpdate);
619  }
620  else
621  {
623  }
624  ++si; ++gi;
625  }
626  else if ((*gi)->origSelector() == nullptr)
627  {
628  addFilter((*gi)->guiSelector());
629  (*gi)->setOrigSelector(m_selectors.back());
630  ++gi;
631  }
632  else
633  {
634  removeFilter(si++);
635  }
636  }
637  }
638 
639  if ( m_filesNeedUpdate )
641 
643 
644 }
EFilterState m_filterState
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)
std::string m_expression
std::string m_description
std::list< FWGUIEventSelector * > & guiSelectors()
void setupDisableFilteringButton(bool)
std::list< FWEventSelector * > m_selectors
sigc::signal< void, int > filterStateChanged_
void removeFilter(std::list< FWEventSelector * >::iterator)
bool CmsShowNavigator::canEditFiltersExternally ( )

Definition at line 779 of file CmsShowNavigator.cc.

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

Referenced by editFiltersExternally(), and showEventFilterGUI().

780 {
781  bool haveActiveFilters = false;
782  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
783  {
784  if ((*file)->hasActiveFilters())
785  {
786  haveActiveFilters = true;
787  break;
788  }
789  }
790 
791  bool btnEnabled = haveActiveFilters;
792 
793  if (m_guiFilter && m_guiFilter->isOpen())
794  btnEnabled = false;
795 
796  return btnEnabled;
797 }
FileQueue_t::iterator FileQueue_i
FWGUIEventFilter * m_guiFilter
void CmsShowNavigator::changeFilter ( FWEventSelector selector,
bool  filterNeedUpdate 
)
private

Definition at line 555 of file CmsShowNavigator.cc.

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

Referenced by applyFiltersFromGUI().

556 {
557  fwLog(fwlog::kDebug) << "CmsShowNavigator::changeFilter " << selector->m_expression << std::endl;
558 
559  std::list<FWFileEntry::Filter*>::iterator it;
560  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
561  {
562  for (it = (*file)->filters().begin(); it != (*file)->filters().end(); ++it)
563  {
564  if ((*it)->m_selector == selector)
565  {
566  if (updateFilter) (*it)->m_needsUpdate = true;
567  (*it)->m_selector->m_expression = selector->m_expression;
568  break;
569  }
570  }
571  }
572  m_filesNeedUpdate = true;
573 }
FileQueue_t::iterator FileQueue_i
std::string m_expression
#define fwLog(_level_)
Definition: fwLog.h:50
void CmsShowNavigator::editFiltersExternally ( )

Definition at line 800 of file CmsShowNavigator.cc.

References canEditFiltersExternally(), and editFiltersExternally_.

Referenced by FWGUIEventFilter::CloseWindow().

801 {
803 }
sigc::signal< void, bool > editFiltersExternally_
void CmsShowNavigator::eventFilterEnableCallback ( Bool_t  )
bool CmsShowNavigator::filesNeedUpdate ( ) const
inline

Definition at line 124 of file CmsShowNavigator.h.

124 { return m_filesNeedUpdate; }
void CmsShowNavigator::filterEvents ( )
void CmsShowNavigator::filterEventsAndReset ( )
const char * CmsShowNavigator::filterStatusMessage ( )

Definition at line 768 of file CmsShowNavigator.cc.

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

769 {
770  if (m_filterState == kOn)
771  return Form("%d events are selected from %d.", getNSelectedEvents(), getNTotalEvents());
772  else if (m_filterState == kOff)
773  return "Filtering is OFF.";
774  else
775  return "Filtering is disabled.";
776 }
int getNSelectedEvents() override
EFilterState m_filterState
int getNTotalEvents() override
void CmsShowNavigator::firstEvent ( )
overridevirtual

Implements FWNavigatorBase.

Definition at line 266 of file CmsShowNavigator.cc.

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

267 {
269  if (m_filterState == kOn)
270  {
271  while (x != m_files.end())
272  {
273  if ((*x)->hasSelectedEvents())
274  {
275  goTo(x, (*x)->firstSelectedEvent());
276  return;
277  }
278  ++x;
279  }
280  }
281  else
282  {
283  goTo(x, 0);
284  }
285 }
EFilterState m_filterState
FileQueue_t::iterator FileQueue_i
void goTo(FileQueue_i fi, int event)
const char * CmsShowNavigator::frameTitle ( )

Definition at line 974 of file CmsShowNavigator.cc.

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

975 {
976  if (m_files.empty()) return "";
977 
978  int nf = 0;
979  for (FileQueue_t::const_iterator i = m_files.begin(); i!= m_files.end(); i++)
980  {
981 
982  if ( i == m_currentFile) break;
983  nf++;
984  }
985 
986  TString name = (*m_currentFile)->file()->GetName();
987  int l = name.Last('/');
988  if (l != kNPOS)
989  name.Remove(0, l+1);
990 
991  return Form("%s [%d/%d], event [%d/%d]", name.Data(),
992  nf+1, (int) m_files.size(),
993  m_currentEvent+1, (*m_currentFile)->lastEvent()+1);
994 }
FileQueue_i m_currentFile
const edm::EventBase * CmsShowNavigator::getCurrentEvent ( ) const
overridevirtual

Implements FWNavigatorBase.

Definition at line 968 of file CmsShowNavigator.cc.

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

969 {
970  return m_currentFile.isSet() ? (*m_currentFile)->event() : nullptr;
971 }
FileQueue_i m_currentFile
int CmsShowNavigator::getFilterState ( )
inline

Definition at line 125 of file CmsShowNavigator.h.

125 { return m_filterState; }
EFilterState m_filterState
int CmsShowNavigator::getNSelectedEvents ( )
overridevirtual

Implements FWNavigatorBase.

Definition at line 744 of file CmsShowNavigator.cc.

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

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

745 {
746  int sum = 0;
747  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
748  {
749  if ((*file)->globalSelection())
750  sum += (*file)->globalSelection()->GetN();
751  }
752  return sum;
753 }
FileQueue_t::iterator FileQueue_i
int CmsShowNavigator::getNTotalEvents ( )
overridevirtual

Implements FWNavigatorBase.

Definition at line 756 of file CmsShowNavigator.cc.

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

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

757 {
758  int sum = 0;
759  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
760  {
761  sum += (*file)->tree()->GetEntries();
762  }
763 
764  return sum;
765 }
FileQueue_t::iterator FileQueue_i
std::vector< std::string > & CmsShowNavigator::getProcessList ( ) const

Definition at line 962 of file CmsShowNavigator.cc.

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

Referenced by FWGUIEventFilter::addSelector().

963 {
965 }
const CmsShowMain & m_main
std::vector< std::string > & processNamesInJob()
FWJobMetadataManager * metadataManager() const
Definition: Context.h:69
const fireworks::Context * context() const
Definition: CmsShowMain.h:79
void CmsShowNavigator::goTo ( FileQueue_i  fi,
int  event 
)

Definition at line 207 of file CmsShowNavigator.cc.

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

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

208 {
209  if (fi != m_currentFile)
210  setCurrentFile(fi);
211 
213  {
214  int total = (*fi)->tree()->GetEntries();
215  fwLog(fwlog::kDebug) << "CmsShowNavigator::goTo current file event [" << event << "/" << total -1<< "]" << std::endl;
216 
217  CpuInfo_t cpuInfo;
218  MemInfo_t memInfo;
219  ProcInfo_t procInfo;
220  gSystem->GetCpuInfo(&cpuInfo, 0);
221  gSystem->GetMemInfo(&memInfo);
222  gSystem->GetProcInfo(&procInfo);
223 
224  time_t curtime;
225  time(&curtime);
226 
227  fwLog(fwlog::kDebug) << "Current Time: " << ctime(&curtime);
228  fwLog(fwlog::kDebug) << "memInfo.fMemUsed \t" << memInfo.fMemUsed << std::endl;
229  fwLog(fwlog::kDebug) << "memInfo.fSwapUsed\t" << memInfo.fSwapUsed << std::endl;
230  fwLog(fwlog::kDebug) << "procInfo.fMemResident\t" << procInfo.fMemResident << std::endl;
231  fwLog(fwlog::kDebug) << "procInfo.fMemVirtual\t" << procInfo.fMemVirtual << std::endl;
232  fwLog(fwlog::kDebug) << "cpuInfo.fLoad1m \t" << cpuInfo.fLoad1m << std::endl;
233  fwLog(fwlog::kDebug) << "cpuInfo.fLoad5m \t" << cpuInfo.fLoad5m << std::endl;
234  }
235 
237  {
238  printf("FWTTreeCache statistics before going to event %d:\n", event);
239  (*m_currentFile)->tree()->PrintCacheStats(); // ("cachedbranches");
240  }
241 
242  (*m_currentFile)->event()->to(event);
243  (*m_currentFile)->tree()->LoadTree(event);
245 
246  newEvent_.emit();
247 }
LogLevel presentLogLevel()
Definition: fwLog.cc:52
FileQueue_i m_currentFile
static bool IsLogging()
Definition: FWTTreeCache.cc:28
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
#define fwLog(_level_)
Definition: fwLog.h:50
void setCurrentFile(FileQueue_i)
Definition: event.py:1
sigc::signal< void > newEvent_
void CmsShowNavigator::goToRunEvent ( edm::RunNumber_t  run,
edm::LuminosityBlockNumber_t  lumi,
edm::EventNumber_t  event 
)
overridevirtual

Implements FWNavigatorBase.

Definition at line 250 of file CmsShowNavigator.cc.

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

251 {
252  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
253  {
254  Long64_t index = (*file)->event()->indexFromEventId(run, lumi, event);
255  if (index >= 0)
256  {
257  goTo(file, index);
258  break;
259  }
260  }
261 }
FileQueue_t::iterator FileQueue_i
void goTo(FileQueue_i fi, int event)
Definition: event.py:1
bool CmsShowNavigator::isFirstEvent ( )
overridevirtual

Implements FWNavigatorBase.

Definition at line 649 of file CmsShowNavigator.cc.

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

650 {
651  if (m_filterState == kOn)
652  {
653  FileQueue_i firstSelectedFile;
654  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
655  {
656  if ((*file)->hasSelectedEvents())
657  {
658  firstSelectedFile = file;
659  break;
660  }
661  }
662 
663  if (firstSelectedFile == m_currentFile)
664  return (*m_currentFile)->firstSelectedEvent() == m_currentEvent;
665  }
666  else
667  {
668  if (m_currentFile == m_files.begin())
669  {
670  return m_currentEvent == 0;
671  }
672  }
673  return false;
674 }
EFilterState m_filterState
FileQueue_t::iterator FileQueue_i
FileQueue_i m_currentFile
bool CmsShowNavigator::isLastEvent ( )
overridevirtual

Implements FWNavigatorBase.

Definition at line 677 of file CmsShowNavigator.cc.

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

678 {
679  if (m_filterState == kOn)
680  {
681  FileQueue_i lastSelectedFile;
682  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
683  {
684  if ((*file)->hasSelectedEvents())
685  lastSelectedFile = file;
686  }
687  if (lastSelectedFile == m_currentFile)
688  return (*m_currentFile)->lastSelectedEvent() == m_currentEvent;
689  }
690  else
691  {
692  FileQueue_i lastFile = m_files.end();
693  --lastFile;
694  if (m_currentFile == lastFile)
695  {
696  return (*m_currentFile)->lastEvent() == m_currentEvent;
697  }
698  }
699  return false;
700 }
EFilterState m_filterState
FileQueue_t::iterator FileQueue_i
FileQueue_i m_currentFile
void CmsShowNavigator::lastEvent ( )
overridevirtual

Implements FWNavigatorBase.

Definition at line 288 of file CmsShowNavigator.cc.

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

289 {
290  FileQueue_i x = m_files.end();
291  if (m_filterState == kOn)
292  {
293  while (x != m_files.begin())
294  {
295  --x;
296  if ((*x)->hasSelectedEvents())
297  {
298  goTo(x, (*x)->lastSelectedEvent());
299  return;
300  }
301  }
302  }
303  else
304  {
305  --x;
306  goTo(x, (*x)->lastEvent());
307  }
308 }
EFilterState m_filterState
FileQueue_t::iterator FileQueue_i
void goTo(FileQueue_i fi, int event)
void CmsShowNavigator::newFile ( FileQueue_i  )
private
void CmsShowNavigator::nextEvent ( )
overridevirtual

Implements FWNavigatorBase.

Definition at line 341 of file CmsShowNavigator.cc.

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

342 {
344  {
346  if (m_filterState == kOn)
347  goTo(last, (*last)->firstSelectedEvent());
348  else
349  goTo(last, 0);
350 
351  m_newFileOnNextEvent = false;
352  return;
353  }
354 
355  if (m_filterState == kOn)
356  {
358  return;
359  }
360  else
361  {
362  if (m_currentEvent < (*m_currentFile)->lastEvent())
363  {
365  }
366  else
367  {
369  if (x != m_files.end())
370  {
371  goTo(x, 0);
372  }
373  }
374  }
375 }
EFilterState m_filterState
FileQueue_t::iterator FileQueue_i
bool nextSelectedEvent() override
FileQueue_i m_currentFile
void goTo(FileQueue_i fi, int event)
bool CmsShowNavigator::nextSelectedEvent ( )
overridevirtual

Implements FWNavigatorBase.

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

314 {
315  int nextEv = (*m_currentFile)->nextSelectedEvent(m_currentEvent);
316  if (nextEv > -1)
317  {
318  goTo(m_currentFile, nextEv);
319  return true;
320  }
321  else
322  {
324  while (i != m_files.end())
325  {
326  if ((*i)->hasSelectedEvents())
327  {
328  goTo(i, (*i)->firstSelectedEvent());
329  return true;
330  }
331  ++i;
332  }
333  }
334 
335  return false;
336 }
FileQueue_t::iterator FileQueue_i
FileQueue_i m_currentFile
void goTo(FileQueue_i fi, int event)
bool CmsShowNavigator::openFile ( const std::string &  fileName)

Definition at line 75 of file CmsShowNavigator.cc.

References CmsShowNavigator::FileQueue_t::begin(), FWFileEntry::closeFile(), cppFunctionSkipper::exception, FrontierConditions_GlobalTag_cff::file, FWFileEntry::filters(), fwLog, CmsShowMain::getVersionCheck(), mps_fire::i, fwlog::kDebug, fwlog::kError, kOff, m_files, m_filterState, m_main, m_selectors, newFile(), setCurrentFile(), and updateFileFilters().

Referenced by Vispa.Main.Application.Application::_readCommandLineAttributes(), Vispa.Main.Application.Application::doubleClickOnFile(), Vispa.Main.Application.Application::openFileDialog(), and Vispa.Main.Application.Application::openRecentFileSlot().

76 {
77  fwLog(fwlog::kDebug) << "CmsShowNavigator::openFile [" << fileName << "]" << std::endl;
78  FWFileEntry* newFile = nullptr;
79  try
80  {
81  newFile = new FWFileEntry(fileName, m_main.getVersionCheck());
82  }
83  catch (std::exception& iException)
84  {
85  fwLog(fwlog::kError) <<"Navigator::openFile ecaught exception FWFileEntry constructor " << iException.what()<<std::endl;
86 
87  delete newFile;
88  return false;
89  }
90 
91  try
92  {
93  // delete all previous files
94  while ( !m_files.empty() )
95  {
96  FWFileEntry* file = m_files.front();
97  m_files.pop_front();
98  file->closeFile();
99  delete file;
100  }
101 
102  m_files.push_back(newFile);
104 
105  // set filters
106  for (std::list<FWEventSelector*>::iterator i = m_selectors.begin(); i != m_selectors.end(); ++i)
107  newFile->filters().push_back(new FWFileEntry::Filter(*i));
108 
109  if (m_filterState != kOff)
111 
112  return true;
113  }
114  catch (std::exception& iException)
115  {
116  fwLog(fwlog::kError) <<"Navigator::openFile caught exception "<<iException.what()<<std::endl;
117  return false;
118  }
119 }
EFilterState m_filterState
void closeFile()
Definition: FWFileEntry.cc:141
const CmsShowMain & m_main
void newFile(FileQueue_i)
std::list< Filter * > & filters()
Definition: FWFileEntry.h:65
bool getVersionCheck() const
Definition: CmsShowMain.h:80
#define fwLog(_level_)
Definition: fwLog.h:50
void setCurrentFile(FileQueue_i)
std::list< FWEventSelector * > m_selectors
const CmsShowNavigator& CmsShowNavigator::operator= ( const CmsShowNavigator )
private
void CmsShowNavigator::previousEvent ( )
overridevirtual

Implements FWNavigatorBase.

Definition at line 407 of file CmsShowNavigator.cc.

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

408 {
409  if (m_filterState == kOn)
410  {
412  }
413  else
414  {
415  if (m_currentEvent > 0)
416  {
418  }
419  else
420  {
421  // last event in previous file
423  if (x != m_files.begin())
424  {
425  --x;
426  goTo(x, (*x)->lastEvent());
427  }
428  }
429  }
430 }
EFilterState m_filterState
FileQueue_t::iterator FileQueue_i
FileQueue_i m_currentFile
bool previousSelectedEvent() override
void goTo(FileQueue_i fi, int event)
bool CmsShowNavigator::previousSelectedEvent ( )
overridevirtual

Implements FWNavigatorBase.

Definition at line 380 of file CmsShowNavigator.cc.

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

Referenced by previousEvent(), and updateFileFilters().

381 {
382  int prevEv = (*m_currentFile)->previousSelectedEvent(m_currentEvent);
383  if (prevEv > -1)
384  {
385  goTo(m_currentFile, prevEv);
386  return true;
387  }
388  else
389  {
390  FileQueue_i i(m_currentFile); i.previous(m_files);
391  while (i != m_files.end())
392  {
393  if ((*i)->hasSelectedEvents())
394  {
395  goTo(i, (*i)->lastSelectedEvent());
396  return true;
397  }
398  i.previous(m_files);
399  }
400  }
401  return false;
402 }
FileQueue_t::iterator FileQueue_i
FileQueue_i m_currentFile
void goTo(FileQueue_i fi, int event)
Int_t CmsShowNavigator::realEntry ( Int_t  rawEntry)
void CmsShowNavigator::removeFilter ( std::list< FWEventSelector * >::iterator  si)
private

Definition at line 515 of file CmsShowNavigator.cc.

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

Referenced by applyFiltersFromGUI().

516 {
517  fwLog(fwlog::kDebug) << "CmsShowNavigator::removeFilter " << (*si)->m_expression << std::endl;
518 
519  std::list<FWFileEntry::Filter*>::iterator it;
520  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
521  {
522  for (it = (*file)->filters().begin(); it != (*file)->filters().end(); ++it)
523  {
524  if ((*it)->m_selector == *si)
525  {
526  FWFileEntry::Filter* f = *it;
527  delete f;
528  (*file)->filters().erase(it);
529  break;
530  }
531  }
532  }
533 
534  delete *si;
535  m_selectors.erase(si);
536  m_filesNeedUpdate = true;
537 }
FileQueue_t::iterator FileQueue_i
double f[11][100]
#define fwLog(_level_)
Definition: fwLog.h:50
std::list< FWEventSelector * > m_selectors
void CmsShowNavigator::resetNewFileOnNextEvent ( )
inline

Definition at line 130 of file CmsShowNavigator.h.

130 { m_newFileOnNextEvent = false; }
void CmsShowNavigator::resumeFilter ( )

Definition at line 466 of file CmsShowNavigator.cc.

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

Referenced by updateFileFilters().

467 {
468  fwLog(fwlog::kInfo) << "CmsShowNavigator::resumeFilter" << std::endl;
469  m_filterState = kOn;
471 }
EFilterState m_filterState
#define fwLog(_level_)
Definition: fwLog.h:50
sigc::signal< void, int > filterStateChanged_
void CmsShowNavigator::setCurrentFile ( FileQueue_i  fi)
private

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

185 {
187  {
188  int cnt = 0;
189  for (FileQueue_i i = m_files.begin(); i!= m_files.end(); i++)
190  {
191  if ( i == fi) break;
192  cnt++;
193  }
194 
195  fwLog(fwlog::kDebug) << "CmsShowNavigator::setCurrentFile [" << (*fi)->file()->GetName() << "] file idx in chain [" << cnt << "/" << m_files.size() -1 << "]" << std::endl;
196  }
197  else
198  {
199  fwLog(fwlog::kInfo) << "Set current file to "<< (*fi)->file()->GetName() << ".\n";
200  }
201 
202  m_currentFile = fi;
203  fileChanged_.emit((*m_currentFile)->file());
204 }
FileQueue_t::iterator FileQueue_i
LogLevel presentLogLevel()
Definition: fwLog.cc:52
FileQueue_i m_currentFile
sigc::signal< void, const TFile * > fileChanged_
#define fwLog(_level_)
Definition: fwLog.h:50
void CmsShowNavigator::setFrom ( const FWConfiguration iFrom)
overridevirtual

Implements FWNavigatorBase.

Definition at line 822 of file CmsShowNavigator.cc.

References CmsShowNavigator::FileQueue_t::begin(), CmsShowNavigator::FileQueue_t::end(), FrontierConditions_GlobalTag_cff::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.

823 {
824  m_filesNeedUpdate = true;
825 
826  EFilterState oldFilterState = m_filterState;
827 
828 
829  m_selectors.clear();
830 
831  // selectors
832  const FWConfiguration* sConf = iFrom.valueForKey("EventFilters");
833 
834  if (sConf)
835  {
836  const FWConfiguration::KeyValues* keyVals = sConf->keyValues();
837  if (keyVals) {
838  for(FWConfiguration::KeyValuesIt it = keyVals->begin(); it!= keyVals->end(); ++it)
839  {
840  const FWConfiguration& conf = (*it).second;
841  FWEventSelector* selector = new FWEventSelector();
842  selector->m_expression = conf.valueForKey("expression")->value();
843  selector->m_description = conf.valueForKey("comment")->value();
844  selector->m_enabled = atoi(conf.valueForKey("enabled")->value().c_str());
845  if (conf.valueForKey("triggerProcess"))
846  selector->m_triggerProcess = conf.valueForKey("triggerProcess")->value();
847  m_selectors.push_back(selector);
848  }
849  }
850  }
851  else
852  {
853  int numberOfFilters = 0;
854  const FWConfiguration* nfvalue = iFrom.valueForKey( "EventFilter_total" );
855  if(nfvalue)
856  numberOfFilters = atoi(nfvalue->value().c_str());
857 
858  for(int i=0; i<numberOfFilters; ++i)
859  {
860  FWEventSelector* selector = new FWEventSelector();
861  {
862  const FWConfiguration* value = iFrom.valueForKey( Form("EventFilter%d_enabled",i));
863  assert(value);
864  std::istringstream s(value->value());
865  s>>selector->m_enabled;
866  }
867  selector->m_expression = iFrom.valueForKey( Form("EventFilter%d_selection",i))->value();
868  selector->m_description = iFrom.valueForKey( Form("EventFilter%d_comment",i) )->value();
869 
870 
871  if (strstr(selector->m_expression.c_str(), "HLT"))
872  selector->m_triggerProcess = "HLT";
873 
874  m_selectors.push_back(selector);
875  }
876  }
877 
878  // filter mode
879  {
880  const FWConfiguration* value = iFrom.valueForKey( "EventFilter_mode" );
881  if (value)
882  {
883  std::istringstream s(value->value());
884  s>> m_filterMode;
885  }
886  }
887 
888  // filter on
889  {
890  const FWConfiguration* value = iFrom.valueForKey( "EventFilter_enabled" );
891  std::istringstream s(value->value());
892  int x;
893  s>> x;
894  m_filterState = x ? kOn : kOff;
895  }
896 
897 
898  // redesplay new filters in event filter dialog if already mapped
899  if (m_guiFilter)
900  {
901  m_guiFilter->reset();
903  }
904 
905  if (!m_files.empty())
906  {
907  // change filters in existing files
908  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
909  {
910  (*file)->filters().clear();
911  for (std::list<FWEventSelector*>::iterator i = m_selectors.begin(); i != m_selectors.end(); ++i)
912  (*file)->filters().push_back(new FWFileEntry::Filter(*i));
913  }
914 
915 
916  // run new filters if enabled, else just reset
917  if (m_filterState == kOn)
919  else
920  postFiltering_.emit(true);
921  }
922  // update CmsShowMainFrame checkBoxIcon and button text
923  if (oldFilterState != m_filterState)
925 }
EFilterState m_filterState
std::vector< std::pair< std::string, FWConfiguration > > KeyValues
const KeyValues * keyValues() const
std::string m_triggerProcess
FileQueue_t::iterator FileQueue_i
void show(std::list< FWEventSelector * > *sels, int filterMode, int state)
FWGUIEventFilter * m_guiFilter
std::string m_expression
sigc::signal< void, bool > postFiltering_
Definition: value.py:1
std::string m_description
const std::string & value(unsigned int iIndex=0) const
KeyValues::const_iterator KeyValuesIt
const FWConfiguration * valueForKey(const std::string &iKey) const
std::list< FWEventSelector * > m_selectors
sigc::signal< void, int > filterStateChanged_
void CmsShowNavigator::setMaxNumberOfFilesToChain ( unsigned int  i)
inline

Definition at line 104 of file CmsShowNavigator.h.

References mps_fire::i, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by CmsShowMain::CmsShowMain().

104  {
106  }
unsigned int m_maxNumberOfFilesToChain
void CmsShowNavigator::showEventFilterGUI ( const TGWindow *  p)

Definition at line 806 of file CmsShowNavigator.cc.

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

Referenced by CmsShowMain::setupDataHandling().

807 {
808  if (m_guiFilter->IsMapped())
809  {
811  }
812  else
813  {
816  }
817 }
EFilterState m_filterState
sigc::signal< void, bool > editFiltersExternally_
void show(std::list< FWEventSelector * > *sels, int filterMode, int state)
FWGUIEventFilter * m_guiFilter
void CloseWindow() override
std::list< FWEventSelector * > m_selectors
void CmsShowNavigator::toggleFilterEnable ( )

Definition at line 435 of file CmsShowNavigator.cc.

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

Referenced by FWGUIEventFilter::disableFilters().

436 {
437  // callback
438 
439  fwLog(fwlog::kInfo) << "CmsShowNavigator::toggleFilterEnable filters enabled [" << ( m_filterState == kOff) << "]" << std::endl;
440 
441  if (m_filterState == kOff)
442  {
443  m_filterState = kOn;
445 
447  }
448  else
449  {
452  }
453 
455 }
EFilterState m_filterState
FWGUIEventFilter * m_guiFilter
#define fwLog(_level_)
Definition: fwLog.h:50
void setupDisableFilteringButton(bool)
sigc::signal< void, int > filterStateChanged_
void CmsShowNavigator::updateFileFilters ( )
private

Definition at line 474 of file CmsShowNavigator.cc.

References CmsShowNavigator::FileQueue_t::begin(), CmsShowMain::context(), CmsShowNavigator::FileQueue_t::end(), fireworks::Context::eventItemsManager(), FrontierConditions_GlobalTag_cff::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().

475 {
476  // run filters on files
477  std::list<FWFileEntry::Filter>::iterator it;
478  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
479  {
480  if ( m_filesNeedUpdate) (*file)->needUpdate();
481  (*file)->updateFilters(m_main.context()->eventItemsManager(), m_filterMode == kOr);
482  }
484  m_filesNeedUpdate = false;
485 
486  int nSelected = getNSelectedEvents();
487  if (nSelected)
488  {
489  // go to the nearest selected event/file
490  bool changeCurrentEvent = !(*m_currentFile)->isEventSelected(m_currentEvent);
491  if (changeCurrentEvent)
492  {
493  if (!nextSelectedEvent())
495  }
496 
497  if (m_filterState == kWithdrawn)
498  resumeFilter();
499 
500  postFiltering_.emit(changeCurrentEvent);
501  }
502  else
503  {
504  withdrawFilter();
505  }
506 
508  {
509  fwLog(fwlog::kDebug) << "CmsShowNavigator::updateFileFilters selected events over files [" << getNSelectedEvents() << "/" << getNTotalEvents() << "]" << std::endl;
510  }
511 }
int getNSelectedEvents() override
EFilterState m_filterState
const FWEventItemsManager * eventItemsManager() const
Definition: Context.h:61
const CmsShowMain & m_main
FileQueue_t::iterator FileQueue_i
LogLevel presentLogLevel()
Definition: fwLog.cc:52
bool nextSelectedEvent() override
int getNTotalEvents() override
bool previousSelectedEvent() override
sigc::signal< void, bool > postFiltering_
#define fwLog(_level_)
Definition: fwLog.h:50
const fireworks::Context * context() const
Definition: CmsShowMain.h:79
void CmsShowNavigator::updateSelectorsInfo ( )
private

Definition at line 704 of file CmsShowNavigator.cc.

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

Referenced by updateFileFilters().

705 {
706 
707  // reset
708  std::list<FWEventSelector*>::const_iterator sel = m_selectors.begin();
709  while ( sel != m_selectors.end())
710  {
711  (*sel)->m_selected = 0;
712  (*sel)->m_updated = true;
713  ++sel;
714  }
715 
716  // loop file filters
717  std::list<FWFileEntry::Filter*>::iterator i;
718  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
719  {
720  std::list<FWFileEntry::Filter*>& filters = (*file)->filters();
721  for (i = filters.begin(); i != filters.end(); ++i)
722  {
723  if ((*i)->m_eventList)
724  {
725  (*i)->m_selector->m_selected += (*i)->m_eventList->GetN();
726  }
727 
728  if ((*i)->m_needsUpdate)
729  (*i)->m_selector->m_updated = false;
730  }
731  }
732  if (m_guiFilter)
733  {
734  std::list<FWGUIEventSelector*>::const_iterator gs = m_guiFilter->guiSelectors().begin();
735  while ( gs != m_guiFilter->guiSelectors().end())
736  {
737  (*gs)->updateNEvents();
738  ++gs;
739  }
740  }
741 }
FileQueue_t::iterator FileQueue_i
std::vector< TPRegexp > filters
Definition: eve_filter.cc:22
FWGUIEventFilter * m_guiFilter
std::list< FWGUIEventSelector * > & guiSelectors()
Definition: AbsArchive.cc:45
std::list< FWEventSelector * > m_selectors
void CmsShowNavigator::withdrawFilter ( )

Definition at line 458 of file CmsShowNavigator.cc.

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

Referenced by updateFileFilters().

459 {
460  fwLog(fwlog::kInfo) << "CmsShowNavigator::witdrawFilter" << std::endl;
463 }
EFilterState m_filterState
#define fwLog(_level_)
Definition: fwLog.h:50
sigc::signal< void, int > filterStateChanged_

Member Data Documentation

sigc::signal<void, bool> CmsShowNavigator::editFiltersExternally_

Definition at line 137 of file CmsShowNavigator.h.

Referenced by editFiltersExternally(), and showEventFilterGUI().

sigc::signal<void, const TFile*> CmsShowNavigator::fileChanged_

Definition at line 134 of file CmsShowNavigator.h.

Referenced by setCurrentFile().

sigc::signal<void, int> CmsShowNavigator::filterStateChanged_
int CmsShowNavigator::m_currentEvent
private
FileQueue_i CmsShowNavigator::m_currentFile
private
FileQueue_t CmsShowNavigator::m_files
private
bool CmsShowNavigator::m_filesNeedUpdate
private
int CmsShowNavigator::m_filterMode
private
EFilterState CmsShowNavigator::m_filterState
private
FWGUIEventFilter* CmsShowNavigator::m_guiFilter
private
const CmsShowMain& CmsShowNavigator::m_main
private

Definition at line 170 of file CmsShowNavigator.h.

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

unsigned int CmsShowNavigator::m_maxNumberOfFilesToChain
private

Definition at line 166 of file CmsShowNavigator.h.

Referenced by appendFile().

bool CmsShowNavigator::m_newFileOnNextEvent
private

Definition at line 164 of file CmsShowNavigator.h.

Referenced by nextEvent().

std::list<FWEventSelector*> CmsShowNavigator::m_selectors
private
sigc::signal<void, bool> CmsShowNavigator::postFiltering_

Definition at line 136 of file CmsShowNavigator.h.

Referenced by setFrom(), and updateFileFilters().

sigc::signal<void> CmsShowNavigator::preFiltering_

Definition at line 135 of file CmsShowNavigator.h.