CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
virtual void addTo (FWConfiguration &) const
 
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 ()
 
virtual void firstEvent ()
 
const char * frameTitle ()
 
virtual const edm::EventBasegetCurrentEvent () const
 
int getFilterState ()
 
int getNSelectedEvents ()
 
int getNTotalEvents ()
 
std::vector< std::string > & getProcessList () const
 
void goTo (FileQueue_i fi, int event)
 
virtual void goToRunEvent (edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t)
 
virtual bool isFirstEvent ()
 
virtual bool isLastEvent ()
 
virtual void lastEvent ()
 
virtual void nextEvent ()
 
virtual bool nextSelectedEvent ()
 
bool openFile (const std::string &fileName)
 
virtual void previousEvent ()
 
virtual bool previousSelectedEvent ()
 
Int_t realEntry (Int_t rawEntry)
 
void resetNewFileOnNextEvent ()
 
void resumeFilter ()
 
virtual void setFrom (const FWConfiguration &)
 
void setMaxNumberOfFilesToChain (unsigned int i)
 
void showEventFilterGUI (const TGWindow *p)
 
void toggleFilterEnable ()
 
void withdrawFilter ()
 
virtual ~CmsShowNavigator ()
 
- Public Member Functions inherited from FWNavigatorBase
 FWNavigatorBase (const CmsShowMainBase &)
 
virtual ~FWNavigatorBase ()
 
- 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 > 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 37 of file CmsShowNavigator.h.

Member Typedef Documentation

Definition at line 78 of file CmsShowNavigator.h.

typedef FQBase_t::iterator CmsShowNavigator::FQBase_i
private

Definition at line 45 of file CmsShowNavigator.h.

Definition at line 44 of file CmsShowNavigator.h.

Member Enumeration Documentation

Enumerator
kOr 
kAnd 

Definition at line 41 of file CmsShowNavigator.h.

Enumerator
kOff 
kOn 
kWithdrawn 

Definition at line 40 of file CmsShowNavigator.h.

Constructor & Destructor Documentation

CmsShowNavigator::CmsShowNavigator ( const CmsShowMain main)

Definition at line 44 of file CmsShowNavigator.cc.

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

44  :
45  FWNavigatorBase(main),
46  m_currentEvent(0),
47 
50 
51  m_filesNeedUpdate(true),
52  m_newFileOnNextEvent(false),
53 
55 
56  m_main(main),
57  m_guiFilter(0)
58 {
59  m_guiFilter = new FWGUIEventFilter(this);
61 }
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 ( )
virtual

Definition at line 63 of file CmsShowNavigator.cc.

References m_guiFilter.

64 {
65  delete m_guiFilter;
66 }
FWGUIEventFilter * m_guiFilter
CmsShowNavigator::CmsShowNavigator ( const CmsShowNavigator )
private

Member Function Documentation

void CmsShowNavigator::activateNewFileOnNextEvent ( )
inline

Definition at line 130 of file CmsShowNavigator.h.

References m_newFileOnNextEvent.

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

Definition at line 523 of file CmsShowNavigator.cc.

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

Referenced by applyFiltersFromGUI().

524 {
525  fwLog(fwlog::kDebug) << "CmsShowNavigator::addFilter " << ref->m_expression << std::endl;
526 
527  FWEventSelector* selector = new FWEventSelector(ref);
528  m_selectors.push_back(selector);
529 
530  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
531  {
532  (*file)->filters ().push_back(new FWFileEntry::Filter(selector));
533  }
534  m_filesNeedUpdate = true;
535 }
list file
Definition: dbtoweb.py:253
FileQueue_t::iterator FileQueue_i
std::string m_expression
#define fwLog(_level_)
Definition: fwLog.h:51
std::list< FWEventSelector * > m_selectors
void CmsShowNavigator::addTo ( FWConfiguration iTo) const
virtual

Implements FWNavigatorBase.

Definition at line 911 of file CmsShowNavigator.cc.

References FWConfiguration::addKeyValue(), align_tpl::filter, kOn, m_filterMode, m_filterState, m_selectors, asciidump::s, runTheMatrix::sel, and tmp.

912 {
913  // selectors
915  int cnt = 0;
916  for (std::list<FWEventSelector*>::const_iterator sel = m_selectors.begin(); sel != m_selectors.end(); ++sel)
917  {
919 
920  filter.addKeyValue("expression",FWConfiguration((*sel)->m_expression));
921  filter.addKeyValue("enabled", FWConfiguration((*sel)->m_enabled ? "1" : "0"));
922  filter.addKeyValue("comment", FWConfiguration((*sel)->m_description));
923 
924  if (!(*sel)->m_triggerProcess.empty())
925  filter.addKeyValue("triggerProcess",FWConfiguration((*sel)->m_triggerProcess));
926 
927  tmp.addKeyValue(Form("------Filter[%d]------", cnt), filter,true);
928  ++cnt;
929  }
930 
931  iTo.addKeyValue("EventFilters", tmp,true);
932 
933  // mode
934  {
935  std::stringstream s;
936  s<< m_filterMode;
937  iTo.addKeyValue("EventFilter_mode", s.str());
938  }
939 
940  // enabled
941  iTo.addKeyValue("EventFilter_enabled",FWConfiguration( m_filterState == kOn ? "1" : "0"));
942 }
EFilterState m_filterState
FWConfiguration & addKeyValue(const std::string &, const FWConfiguration &)
tuple filter
USE THIS FOR SKIMMED TRACKS process.p = cms.Path(process.hltLevel1GTSeed*process.skimming*process.offlineBeamSpot*process.TrackRefitter2) OTHERWISE USE THIS.
Definition: align_tpl.py:86
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
string s
Definition: asciidump.py:422
std::list< FWEventSelector * > m_selectors
bool CmsShowNavigator::appendFile ( const std::string &  fileName,
bool  checkFileQueueSize,
bool  live 
)

Definition at line 120 of file CmsShowNavigator.cc.

References CmsShowNavigator::FileQueue_t::begin(), ExpressReco_HICollisions_FallBack::cerr, FWFileEntry::closeFile(), cmsCodeRules.cppFunctionSkipper::exception, dbtoweb::file, FWFileEntry::filters(), fwLog, i, CmsShowNavigator::FileQueue_t::iterator::isSet(), fwlog::kDebug, fwlog::kError, kOff, fwlog::kWarning, m_currentFile, m_files, m_filterState, m_maxNumberOfFilesToChain, m_selectors, newFile(), setCurrentFile(), and updateFileFilters().

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

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

560 {
561  m_filesNeedUpdate = false;
562 
563  // check if filters are set ON
564  if (m_filterState == kOff)
565  {
566  m_filesNeedUpdate = true;
567  m_filterState = kOn;
569  }
570 
571  // compare changes and then call updateFileFilters
572  std::list<FWEventSelector*>::iterator si = m_selectors.begin();
573  std::list<FWGUIEventSelector*>::iterator gi = m_guiFilter->guiSelectors().begin();
574 
577  m_filesNeedUpdate = true;
578  }
579 
580  while (si != m_selectors.end() || gi != m_guiFilter->guiSelectors().end())
581  {
582  if (gi == m_guiFilter->guiSelectors().end() && si != m_selectors.end())
583  {
584  removeFilter(si++);
585  }
586  else if (si == m_selectors.end() && gi != m_guiFilter->guiSelectors().end() )
587  {
588  addFilter((*gi)->guiSelector());
589  (*gi)->setOrigSelector(m_selectors.back());
590  ++gi;
591  }
592  else
593  {
594  if (*si == (*gi)->origSelector())
595  {
596  FWEventSelector* g = (*gi)->guiSelector();
597  FWEventSelector* o = *si;
598  bool filterNeedUpdate = o->m_expression != g->m_expression;
599  if (filterNeedUpdate || o->m_enabled != g->m_enabled) {
600  *o = *g;
601  changeFilter(*si, filterNeedUpdate);
602  }
603  else
604  {
606  }
607  ++si; ++gi;
608  }
609  else if ((*gi)->origSelector() == 0)
610  {
611  addFilter((*gi)->guiSelector());
612  (*gi)->setOrigSelector(m_selectors.back());
613  ++gi;
614  }
615  else
616  {
617  removeFilter(si++);
618  }
619  }
620  }
621 
622  if ( m_filesNeedUpdate )
624 
626 
627 }
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 762 of file CmsShowNavigator.cc.

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

Referenced by editFiltersExternally(), and showEventFilterGUI().

763 {
764  bool haveActiveFilters = false;
765  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
766  {
767  if ((*file)->hasActiveFilters())
768  {
769  haveActiveFilters = true;
770  break;
771  }
772  }
773 
774  bool btnEnabled = haveActiveFilters;
775 
776  if (m_guiFilter && m_guiFilter->isOpen())
777  btnEnabled = false;
778 
779  return btnEnabled;
780 }
list file
Definition: dbtoweb.py:253
FileQueue_t::iterator FileQueue_i
FWGUIEventFilter * m_guiFilter
void CmsShowNavigator::changeFilter ( FWEventSelector selector,
bool  filterNeedUpdate 
)
private

Definition at line 538 of file CmsShowNavigator.cc.

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

Referenced by applyFiltersFromGUI().

539 {
540  fwLog(fwlog::kDebug) << "CmsShowNavigator::changeFilter " << selector->m_expression << std::endl;
541 
542  std::list<FWFileEntry::Filter*>::iterator it;
543  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
544  {
545  for (it = (*file)->filters().begin(); it != (*file)->filters().end(); ++it)
546  {
547  if ((*it)->m_selector == selector)
548  {
549  if (updateFilter) (*it)->m_needsUpdate = true;
550  (*it)->m_selector->m_expression = selector->m_expression;
551  break;
552  }
553  }
554  }
555  m_filesNeedUpdate = true;
556 }
list file
Definition: dbtoweb.py:253
FileQueue_t::iterator FileQueue_i
std::string m_expression
#define fwLog(_level_)
Definition: fwLog.h:51
void CmsShowNavigator::editFiltersExternally ( )

Definition at line 783 of file CmsShowNavigator.cc.

References canEditFiltersExternally(), and editFiltersExternally_.

Referenced by FWGUIEventFilter::CloseWindow().

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

Definition at line 125 of file CmsShowNavigator.h.

References m_filesNeedUpdate.

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

Definition at line 751 of file CmsShowNavigator.cc.

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

752 {
753  if (m_filterState == kOn)
754  return Form("%d events are selected from %d.", getNSelectedEvents(), getNTotalEvents());
755  else if (m_filterState == kOff)
756  return "Filtering is OFF.";
757  else
758  return "Filtering is disabled.";
759 }
EFilterState m_filterState
void CmsShowNavigator::firstEvent ( )
virtual

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 ExpressReco_HICollisions_FallBack::x.

251 {
253  if (m_filterState == kOn)
254  {
255  while (x != m_files.end())
256  {
257  if ((*x)->hasSelectedEvents())
258  {
259  goTo(x, (*x)->firstSelectedEvent());
260  return;
261  }
262  ++x;
263  }
264  }
265  else
266  {
267  goTo(x, 0);
268  }
269 }
EFilterState m_filterState
FileQueue_t::iterator FileQueue_i
void goTo(FileQueue_i fi, int event)
const char * CmsShowNavigator::frameTitle ( )

Definition at line 957 of file CmsShowNavigator.cc.

References CmsShowNavigator::FileQueue_t::begin(), CmsShowNavigator::FileQueue_t::end(), i, prof2calltree::l, m_currentEvent, m_currentFile, m_files, and AlCaRecoCosmics_cfg::name.

958 {
959  if (m_files.empty()) return "";
960 
961  int nf = 0;
962  for (FileQueue_t::const_iterator i = m_files.begin(); i!= m_files.end(); i++)
963  {
964 
965  if ( i == m_currentFile) break;
966  nf++;
967  }
968 
969  TString name = (*m_currentFile)->file()->GetName();
970  int l = name.Last('/');
971  if (l != kNPOS)
972  name.Remove(0, l+1);
973 
974  return Form("%s [%d/%d], event [%d/%d]", name.Data(),
975  nf+1, (int) m_files.size(),
976  m_currentEvent+1, (*m_currentFile)->lastEvent()+1);
977 }
int i
Definition: DBlmapReader.cc:9
FileQueue_i m_currentFile
const edm::EventBase * CmsShowNavigator::getCurrentEvent ( ) const
virtual

Implements FWNavigatorBase.

Definition at line 951 of file CmsShowNavigator.cc.

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

952 {
953  return m_currentFile.isSet() ? (*m_currentFile)->event() : 0;
954 }
FileQueue_i m_currentFile
int CmsShowNavigator::getFilterState ( )
inline

Definition at line 126 of file CmsShowNavigator.h.

References m_filterState.

126 { return m_filterState; }
EFilterState m_filterState
int CmsShowNavigator::getNSelectedEvents ( )
virtual

Implements FWNavigatorBase.

Definition at line 727 of file CmsShowNavigator.cc.

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

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

728 {
729  int sum = 0;
730  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
731  {
732  if ((*file)->globalSelection())
733  sum += (*file)->globalSelection()->GetN();
734  }
735  return sum;
736 }
list file
Definition: dbtoweb.py:253
FileQueue_t::iterator FileQueue_i
int CmsShowNavigator::getNTotalEvents ( )
virtual

Implements FWNavigatorBase.

Definition at line 739 of file CmsShowNavigator.cc.

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

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

740 {
741  int sum = 0;
742  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
743  {
744  sum += (*file)->tree()->GetEntries();
745  }
746 
747  return sum;
748 }
list file
Definition: dbtoweb.py:253
FileQueue_t::iterator FileQueue_i
std::vector< std::string > & CmsShowNavigator::getProcessList ( ) const

Definition at line 945 of file CmsShowNavigator.cc.

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

Referenced by FWGUIEventFilter::addSelector().

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

Definition at line 201 of file CmsShowNavigator.cc.

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

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

202 {
203  if (fi != m_currentFile)
204  setCurrentFile(fi);
205 
207  {
208  int total = (*fi)->tree()->GetEntries();
209  fwLog(fwlog::kDebug) << "CmsShowNavigator::goTo current file event [" << event << "/" << total -1<< "]" << std::endl;
210 
211  CpuInfo_t cpuInfo;
212  MemInfo_t memInfo;
213  ProcInfo_t procInfo;
214  gSystem->GetCpuInfo(&cpuInfo, 0);
215  gSystem->GetMemInfo(&memInfo);
216  gSystem->GetProcInfo(&procInfo);
217 
218  fwLog(fwlog::kDebug) << "memInfo.fMemUsed \t" << memInfo.fMemUsed << std::endl;
219  fwLog(fwlog::kDebug) << "memInfo.fSwapUsed\t" << memInfo.fSwapUsed<< std::endl;
220  fwLog(fwlog::kDebug) << "procInfo.fMemResident\t" << procInfo.fMemResident << std::endl;
221  fwLog(fwlog::kDebug) << "procInfo.fMemVirtual\t" << procInfo.fMemVirtual << std::endl;
222  fwLog(fwlog::kDebug) << "cpuInfo.fLoad1m \t" << cpuInfo.fLoad1m << std::endl;
223  fwLog(fwlog::kDebug) << "cpuInfo.fLoad5m \t" << cpuInfo.fLoad5m << std::endl;
224  }
225 
226  (*m_currentFile)->event()->to(event);
227  (*m_currentFile)->tree()->LoadTree(event);
229 
230  newEvent_.emit();
231 }
LogLevel presentLogLevel()
Definition: fwLog.cc:53
FileQueue_i m_currentFile
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:51
void setCurrentFile(FileQueue_i)
sigc::signal< void > newEvent_
void CmsShowNavigator::goToRunEvent ( edm::RunNumber_t  run,
edm::LuminosityBlockNumber_t  lumi,
edm::EventNumber_t  event 
)
virtual

Implements FWNavigatorBase.

Definition at line 234 of file CmsShowNavigator.cc.

References CmsShowNavigator::FileQueue_t::begin(), CmsShowNavigator::FileQueue_t::end(), dbtoweb::file, goTo(), getHLTprescales::index, and m_files.

235 {
236  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
237  {
238  Long64_t index = (*file)->event()->indexFromEventId(run, lumi, event);
239  if (index >= 0)
240  {
241  goTo(file, index);
242  break;
243  }
244  }
245 }
list file
Definition: dbtoweb.py:253
tuple lumi
Definition: fjr2json.py:41
FileQueue_t::iterator FileQueue_i
void goTo(FileQueue_i fi, int event)
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
bool CmsShowNavigator::isFirstEvent ( )
virtual

Implements FWNavigatorBase.

Definition at line 632 of file CmsShowNavigator.cc.

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

633 {
634  if (m_filterState == kOn)
635  {
636  FileQueue_i firstSelectedFile;
637  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
638  {
639  if ((*file)->hasSelectedEvents())
640  {
641  firstSelectedFile = file;
642  break;
643  }
644  }
645 
646  if (firstSelectedFile == m_currentFile)
647  return (*m_currentFile)->firstSelectedEvent() == m_currentEvent;
648  }
649  else
650  {
651  if (m_currentFile == m_files.begin())
652  {
653  return m_currentEvent == 0;
654  }
655  }
656  return false;
657 }
EFilterState m_filterState
list file
Definition: dbtoweb.py:253
FileQueue_t::iterator FileQueue_i
FileQueue_i m_currentFile
bool CmsShowNavigator::isLastEvent ( )
virtual

Implements FWNavigatorBase.

Definition at line 660 of file CmsShowNavigator.cc.

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

661 {
662  if (m_filterState == kOn)
663  {
664  FileQueue_i lastSelectedFile;
665  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
666  {
667  if ((*file)->hasSelectedEvents())
668  lastSelectedFile = file;
669  }
670  if (lastSelectedFile == m_currentFile)
671  return (*m_currentFile)->lastSelectedEvent() == m_currentEvent;
672  }
673  else
674  {
675  FileQueue_i lastFile = m_files.end();
676  --lastFile;
677  if (m_currentFile == lastFile)
678  {
679  return (*m_currentFile)->lastEvent() == m_currentEvent;
680  }
681  }
682  return false;
683 }
EFilterState m_filterState
list file
Definition: dbtoweb.py:253
FileQueue_t::iterator FileQueue_i
FileQueue_i m_currentFile
void CmsShowNavigator::lastEvent ( )
virtual

Implements FWNavigatorBase.

Definition at line 272 of file CmsShowNavigator.cc.

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

273 {
274  FileQueue_i x = m_files.end();
275  if (m_filterState == kOn)
276  {
277  while (x != m_files.begin())
278  {
279  --x;
280  if ((*x)->hasSelectedEvents())
281  {
282  goTo(x, (*x)->lastSelectedEvent());
283  return;
284  }
285  }
286  }
287  else
288  {
289  --x;
290  goTo(x, (*x)->lastEvent());
291  }
292 }
EFilterState m_filterState
FileQueue_t::iterator FileQueue_i
void goTo(FileQueue_i fi, int event)
void CmsShowNavigator::newFile ( FileQueue_i  )
private
void CmsShowNavigator::nextEvent ( )
virtual

Implements FWNavigatorBase.

Definition at line 325 of file CmsShowNavigator.cc.

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

326 {
328  {
330  if (m_filterState == kOn)
331  goTo(last, (*last)->firstSelectedEvent());
332  else
333  goTo(last, 0);
334 
335  m_newFileOnNextEvent = false;
336  return;
337  }
338 
339  if (m_filterState == kOn)
340  {
342  return;
343  }
344  else
345  {
346  if (m_currentEvent < (*m_currentFile)->lastEvent())
347  {
349  }
350  else
351  {
353  if (x != m_files.end())
354  {
355  goTo(x, 0);
356  }
357  }
358  }
359 }
EFilterState m_filterState
FileQueue_t::iterator FileQueue_i
FileQueue_i m_currentFile
void goTo(FileQueue_i fi, int event)
virtual bool nextSelectedEvent()
bool CmsShowNavigator::nextSelectedEvent ( )
virtual

Implements FWNavigatorBase.

Definition at line 297 of file CmsShowNavigator.cc.

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

Referenced by nextEvent(), and updateFileFilters().

298 {
299  int nextEv = (*m_currentFile)->nextSelectedEvent(m_currentEvent);
300  if (nextEv > -1)
301  {
302  goTo(m_currentFile, nextEv);
303  return true;
304  }
305  else
306  {
308  while (i != m_files.end())
309  {
310  if ((*i)->hasSelectedEvents())
311  {
312  goTo(i, (*i)->firstSelectedEvent());
313  return true;
314  }
315  ++i;
316  }
317  }
318 
319  return false;
320 }
int i
Definition: DBlmapReader.cc:9
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 73 of file CmsShowNavigator.cc.

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

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

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

Implements FWNavigatorBase.

Definition at line 391 of file CmsShowNavigator.cc.

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

392 {
393  if (m_filterState == kOn)
394  {
396  }
397  else
398  {
399  if (m_currentEvent > 0)
400  {
402  }
403  else
404  {
405  // last event in previous file
407  if (x != m_files.begin())
408  {
409  --x;
410  goTo(x, (*x)->lastEvent());
411  }
412  }
413  }
414 }
EFilterState m_filterState
FileQueue_t::iterator FileQueue_i
FileQueue_i m_currentFile
void goTo(FileQueue_i fi, int event)
virtual bool previousSelectedEvent()
bool CmsShowNavigator::previousSelectedEvent ( )
virtual

Implements FWNavigatorBase.

Definition at line 364 of file CmsShowNavigator.cc.

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

Referenced by previousEvent(), and updateFileFilters().

365 {
366  int prevEv = (*m_currentFile)->previousSelectedEvent(m_currentEvent);
367  if (prevEv > -1)
368  {
369  goTo(m_currentFile, prevEv);
370  return true;
371  }
372  else
373  {
374  FileQueue_i i(m_currentFile); i.previous(m_files);
375  while (i != m_files.end())
376  {
377  if ((*i)->hasSelectedEvents())
378  {
379  goTo(i, (*i)->lastSelectedEvent());
380  return true;
381  }
382  i.previous(m_files);
383  }
384  }
385  return false;
386 }
int i
Definition: DBlmapReader.cc:9
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 498 of file CmsShowNavigator.cc.

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

Referenced by applyFiltersFromGUI().

499 {
500  fwLog(fwlog::kDebug) << "CmsShowNavigator::removeFilter " << (*si)->m_expression << std::endl;
501 
502  std::list<FWFileEntry::Filter*>::iterator it;
503  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
504  {
505  for (it = (*file)->filters().begin(); it != (*file)->filters().end(); ++it)
506  {
507  if ((*it)->m_selector == *si)
508  {
509  FWFileEntry::Filter* f = *it;
510  delete f;
511  (*file)->filters().erase(it);
512  break;
513  }
514  }
515  }
516 
517  delete *si;
518  m_selectors.erase(si);
519  m_filesNeedUpdate = true;
520 }
list file
Definition: dbtoweb.py:253
FileQueue_t::iterator FileQueue_i
double f[11][100]
#define fwLog(_level_)
Definition: fwLog.h:51
std::list< FWEventSelector * > m_selectors
void CmsShowNavigator::resetNewFileOnNextEvent ( )
inline

Definition at line 131 of file CmsShowNavigator.h.

References m_newFileOnNextEvent.

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

Definition at line 450 of file CmsShowNavigator.cc.

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

Referenced by updateFileFilters().

451 {
452  fwLog(fwlog::kInfo) << "CmsShowNavigator::resumeFilter" << std::endl;
453  m_filterState = kOn;
455 }
EFilterState m_filterState
#define fwLog(_level_)
Definition: fwLog.h:51
sigc::signal< void, int > filterStateChanged_
void CmsShowNavigator::setCurrentFile ( FileQueue_i  fi)
private

Definition at line 182 of file CmsShowNavigator.cc.

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

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

183 {
185  {
186  int cnt = 0;
187  for (FileQueue_i i = m_files.begin(); i!= m_files.end(); i++)
188  {
189  if ( i == fi) break;
190  cnt++;
191  }
192 
193  fwLog(fwlog::kDebug) << "CmsShowNavigator::setCurrentFile [" << (*fi)->file()->GetName() << "] file idx in chain [" << cnt << "/" << m_files.size() -1 << "]" << std::endl;
194  }
195 
196  m_currentFile = fi;
197  fileChanged_.emit((*m_currentFile)->file());
198 }
int i
Definition: DBlmapReader.cc:9
FileQueue_t::iterator FileQueue_i
LogLevel presentLogLevel()
Definition: fwLog.cc:53
FileQueue_i m_currentFile
sigc::signal< void, const TFile * > fileChanged_
#define fwLog(_level_)
Definition: fwLog.h:51
void CmsShowNavigator::setFrom ( const FWConfiguration iFrom)
virtual

Implements FWNavigatorBase.

Definition at line 805 of file CmsShowNavigator.cc.

References CmsShowNavigator::FileQueue_t::begin(), dbtoconf::conf, CmsShowNavigator::FileQueue_t::end(), dbtoweb::file, filterStateChanged_, 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(), asciidump::s, FWGUIEventFilter::show(), updateFileFilters(), FWConfiguration::value(), relativeConstraints::value, FWConfiguration::valueForKey(), and ExpressReco_HICollisions_FallBack::x.

806 {
807  m_filesNeedUpdate = true;
808 
809  EFilterState oldFilterState = m_filterState;
810 
811 
812  m_selectors.clear();
813 
814  // selectors
815  const FWConfiguration* sConf = iFrom.valueForKey("EventFilters");
816 
817  if (sConf)
818  {
819  const FWConfiguration::KeyValues* keyVals = sConf->keyValues();
820  if (keyVals) {
821  for(FWConfiguration::KeyValuesIt it = keyVals->begin(); it!= keyVals->end(); ++it)
822  {
823  const FWConfiguration& conf = (*it).second;
824  FWEventSelector* selector = new FWEventSelector();
825  selector->m_expression = conf.valueForKey("expression")->value();
826  selector->m_description = conf.valueForKey("comment")->value();
827  selector->m_enabled = atoi(conf.valueForKey("enabled")->value().c_str());
828  if (conf.valueForKey("triggerProcess"))
829  selector->m_triggerProcess = conf.valueForKey("triggerProcess")->value();
830  m_selectors.push_back(selector);
831  }
832  }
833  }
834  else
835  {
836  int numberOfFilters = 0;
837  const FWConfiguration* value = iFrom.valueForKey( "EventFilter_total" );
838  std::istringstream s(value->value());
839  s>>numberOfFilters;
840 
841  for(int i=0; i<numberOfFilters; ++i)
842  {
843  FWEventSelector* selector = new FWEventSelector();
844  {
845  const FWConfiguration* value = iFrom.valueForKey( Form("EventFilter%d_enabled",i));
846  assert(value);
847  std::istringstream s(value->value());
848  s>>selector->m_enabled;
849  }
850  selector->m_expression = iFrom.valueForKey( Form("EventFilter%d_selection",i))->value();
851  selector->m_description = iFrom.valueForKey( Form("EventFilter%d_comment",i) )->value();
852 
853 
854  if (strstr(selector->m_expression.c_str(), "HLT"))
855  selector->m_triggerProcess = "HLT";
856 
857  m_selectors.push_back(selector);
858  }
859  }
860 
861  // filter mode
862  {
863  const FWConfiguration* value = iFrom.valueForKey( "EventFilter_mode" );
864  if (value)
865  {
866  std::istringstream s(value->value());
867  s>> m_filterMode;
868  }
869  }
870 
871  // filter on
872  {
873  const FWConfiguration* value = iFrom.valueForKey( "EventFilter_enabled" );
874  std::istringstream s(value->value());
875  int x;
876  s>> x;
877  m_filterState = x ? kOn : kOff;
878  }
879 
880 
881  // redesplay new filters in event filter dialog if already mapped
882  if (m_guiFilter)
883  {
884  m_guiFilter->reset();
886  }
887 
888  if (!m_files.empty())
889  {
890  // change filters in existing files
891  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
892  {
893  (*file)->filters().clear();
894  for (std::list<FWEventSelector*>::iterator i = m_selectors.begin(); i != m_selectors.end(); ++i)
895  (*file)->filters().push_back(new FWFileEntry::Filter(*i));
896  }
897 
898 
899  // run new filters if enabled, else just reset
900  if (m_filterState == kOn)
902  else
903  postFiltering_.emit();
904  }
905  // update CmsShowMainFrame checkBoxIcon and button text
906  if (oldFilterState != m_filterState)
908 }
EFilterState m_filterState
std::vector< std::pair< std::string, FWConfiguration > > KeyValues
int i
Definition: DBlmapReader.cc:9
const KeyValues * keyValues() const
list file
Definition: dbtoweb.py:253
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 > postFiltering_
tuple conf
Definition: dbtoconf.py:185
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
string s
Definition: asciidump.py:422
std::list< FWEventSelector * > m_selectors
sigc::signal< void, int > filterStateChanged_
void CmsShowNavigator::setMaxNumberOfFilesToChain ( unsigned int  i)
inline

Definition at line 105 of file CmsShowNavigator.h.

References i, and m_maxNumberOfFilesToChain.

Referenced by CmsShowMain::CmsShowMain().

105  {
107  }
int i
Definition: DBlmapReader.cc:9
unsigned int m_maxNumberOfFilesToChain
void CmsShowNavigator::showEventFilterGUI ( const TGWindow *  p)

Definition at line 789 of file CmsShowNavigator.cc.

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

Referenced by CmsShowMain::setupDataHandling().

790 {
791  if (m_guiFilter->IsMapped())
792  {
794  }
795  else
796  {
799  }
800 }
EFilterState m_filterState
sigc::signal< void, bool > editFiltersExternally_
void show(std::list< FWEventSelector * > *sels, int filterMode, int state)
FWGUIEventFilter * m_guiFilter
std::list< FWEventSelector * > m_selectors
virtual void CloseWindow()
void CmsShowNavigator::toggleFilterEnable ( )

Definition at line 419 of file CmsShowNavigator.cc.

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

Referenced by FWGUIEventFilter::disableFilters().

420 {
421  // callback
422 
423  fwLog(fwlog::kInfo) << "CmsShowNavigator::toggleFilterEnable filters enabled [" << ( m_filterState == kOff) << "]" << std::endl;
424 
425  if (m_filterState == kOff)
426  {
427  m_filterState = kOn;
429 
431  }
432  else
433  {
436  }
437 
439 }
EFilterState m_filterState
FWGUIEventFilter * m_guiFilter
#define fwLog(_level_)
Definition: fwLog.h:51
void setupDisableFilteringButton(bool)
sigc::signal< void, int > filterStateChanged_
void CmsShowNavigator::updateFileFilters ( )
private

Definition at line 458 of file CmsShowNavigator.cc.

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

459 {
460  // run filters on files
461  std::list<FWFileEntry::Filter>::iterator it;
462  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
463  {
464  if ( m_filesNeedUpdate) (*file)->needUpdate();
465  (*file)->updateFilters(m_main.context()->eventItemsManager(), m_filterMode == kOr);
466  }
468  m_filesNeedUpdate = false;
469 
470  int nSelected = getNSelectedEvents();
471  if (nSelected)
472  {
473  // go to the nearest selected event/file
474  if (!(*m_currentFile)->isEventSelected(m_currentEvent))
475  {
476  if (!nextSelectedEvent())
478  }
479 
480  if (m_filterState == kWithdrawn)
481  resumeFilter();
482 
483  postFiltering_.emit();
484  }
485  else
486  {
487  withdrawFilter();
488  }
489 
491  {
492  fwLog(fwlog::kDebug) << "CmsShowNavigator::updateFileFilters selected events over files [" << getNSelectedEvents() << "/" << getNTotalEvents() << "]" << std::endl;
493  }
494 }
EFilterState m_filterState
const FWEventItemsManager * eventItemsManager() const
Definition: Context.h:62
list file
Definition: dbtoweb.py:253
const CmsShowMain & m_main
FileQueue_t::iterator FileQueue_i
LogLevel presentLogLevel()
Definition: fwLog.cc:53
sigc::signal< void > postFiltering_
virtual bool previousSelectedEvent()
#define fwLog(_level_)
Definition: fwLog.h:51
virtual bool nextSelectedEvent()
const fireworks::Context * context() const
Definition: CmsShowMain.h:81
void CmsShowNavigator::updateSelectorsInfo ( )
private

Definition at line 687 of file CmsShowNavigator.cc.

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

Referenced by updateFileFilters().

688 {
689 
690  // reset
691  std::list<FWEventSelector*>::const_iterator sel = m_selectors.begin();
692  while ( sel != m_selectors.end())
693  {
694  (*sel)->m_selected = 0;
695  (*sel)->m_updated = true;
696  ++sel;
697  }
698 
699  // loop file filters
700  std::list<FWFileEntry::Filter*>::iterator i;
701  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
702  {
703  std::list<FWFileEntry::Filter*>& filters = (*file)->filters();
704  for (i = filters.begin(); i != filters.end(); ++i)
705  {
706  if ((*i)->m_eventList)
707  {
708  (*i)->m_selector->m_selected += (*i)->m_eventList->GetN();
709  }
710 
711  if ((*i)->m_needsUpdate)
712  (*i)->m_selector->m_updated = false;
713  }
714  }
715  if (m_guiFilter)
716  {
717  std::list<FWGUIEventSelector*>::const_iterator gs = m_guiFilter->guiSelectors().begin();
718  while ( gs != m_guiFilter->guiSelectors().end())
719  {
720  (*gs)->updateNEvents();
721  ++gs;
722  }
723  }
724 }
int i
Definition: DBlmapReader.cc:9
list file
Definition: dbtoweb.py:253
FileQueue_t::iterator FileQueue_i
std::vector< TPRegexp > filters
Definition: eve_filter.cc:25
FWGUIEventFilter * m_guiFilter
std::list< FWGUIEventSelector * > & guiSelectors()
std::list< FWEventSelector * > m_selectors
void CmsShowNavigator::withdrawFilter ( )

Definition at line 442 of file CmsShowNavigator.cc.

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

Referenced by updateFileFilters().

443 {
444  fwLog(fwlog::kInfo) << "CmsShowNavigator::witdrawFilter" << std::endl;
447 }
EFilterState m_filterState
#define fwLog(_level_)
Definition: fwLog.h:51
sigc::signal< void, int > filterStateChanged_

Member Data Documentation

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

Definition at line 138 of file CmsShowNavigator.h.

Referenced by editFiltersExternally(), and showEventFilterGUI().

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

Definition at line 135 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 171 of file CmsShowNavigator.h.

Referenced by getProcessList(), and updateFileFilters().

unsigned int CmsShowNavigator::m_maxNumberOfFilesToChain
private

Definition at line 167 of file CmsShowNavigator.h.

Referenced by appendFile(), and setMaxNumberOfFilesToChain().

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

Definition at line 137 of file CmsShowNavigator.h.

Referenced by setFrom(), and updateFileFilters().

sigc::signal<void> CmsShowNavigator::preFiltering_

Definition at line 136 of file CmsShowNavigator.h.