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, 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 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 129 of file CmsShowNavigator.h.

References m_newFileOnNextEvent.

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

Definition at line 532 of file CmsShowNavigator.cc.

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

Referenced by applyFiltersFromGUI().

533 {
534  fwLog(fwlog::kDebug) << "CmsShowNavigator::addFilter " << ref->m_expression << std::endl;
535 
536  FWEventSelector* selector = new FWEventSelector(ref);
537  m_selectors.push_back(selector);
538 
539  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
540  {
541  (*file)->filters ().push_back(new FWFileEntry::Filter(selector));
542  }
543  m_filesNeedUpdate = true;
544 }
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
virtual

Implements FWNavigatorBase.

Definition at line 920 of file CmsShowNavigator.cc.

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

921 {
922  // selectors
924  int cnt = 0;
925  for (std::list<FWEventSelector*>::const_iterator sel = m_selectors.begin(); sel != m_selectors.end(); ++sel)
926  {
928 
929  filter.addKeyValue("expression",FWConfiguration((*sel)->m_expression));
930  filter.addKeyValue("enabled", FWConfiguration((*sel)->m_enabled ? "1" : "0"));
931  filter.addKeyValue("comment", FWConfiguration((*sel)->m_description));
932 
933  if (!(*sel)->m_triggerProcess.empty())
934  filter.addKeyValue("triggerProcess",FWConfiguration((*sel)->m_triggerProcess));
935 
936  tmp.addKeyValue(Form("------Filter[%d]------", cnt), filter,true);
937  ++cnt;
938  }
939 
940  iTo.addKeyValue("EventFilters", tmp,true);
941 
942  // mode
943  {
944  std::stringstream s;
945  s<< m_filterMode;
946  iTo.addKeyValue("EventFilter_mode", s.str());
947  }
948 
949  // enabled
950  iTo.addKeyValue("EventFilter_enabled",FWConfiguration( m_filterState == kOn ? "1" : "0"));
951 }
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 120 of file CmsShowNavigator.cc.

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

121 {
122  fwLog(fwlog::kDebug) << "CmsShowNavigator::appendFile [" << fileName << "]" << std::endl;
123  FWFileEntry* newFile = 0;
124  try
125  {
126  newFile = new FWFileEntry(fileName, m_main.getVersionCheck());
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:112
int i
Definition: DBlmapReader.cc:9
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:64
bool getVersionCheck() const
Definition: CmsShowMain.h:81
#define fwLog(_level_)
Definition: fwLog.h:50
void setCurrentFile(FileQueue_i)
std::list< FWEventSelector * > m_selectors
void CmsShowNavigator::applyFiltersFromGUI ( )

Definition at line 568 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, python.connectstrParser::o, removeFilter(), FWGUIEventFilter::setupDisableFilteringButton(), and updateFileFilters().

Referenced by FWGUIEventFilter::apply().

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

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

Referenced by editFiltersExternally(), and showEventFilterGUI().

772 {
773  bool haveActiveFilters = false;
774  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
775  {
776  if ((*file)->hasActiveFilters())
777  {
778  haveActiveFilters = true;
779  break;
780  }
781  }
782 
783  bool btnEnabled = haveActiveFilters;
784 
785  if (m_guiFilter && m_guiFilter->isOpen())
786  btnEnabled = false;
787 
788  return btnEnabled;
789 }
FileQueue_t::iterator FileQueue_i
FWGUIEventFilter * m_guiFilter
void CmsShowNavigator::changeFilter ( FWEventSelector selector,
bool  filterNeedUpdate 
)
private

Definition at line 547 of file CmsShowNavigator.cc.

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

Referenced by applyFiltersFromGUI().

548 {
549  fwLog(fwlog::kDebug) << "CmsShowNavigator::changeFilter " << selector->m_expression << std::endl;
550 
551  std::list<FWFileEntry::Filter*>::iterator it;
552  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
553  {
554  for (it = (*file)->filters().begin(); it != (*file)->filters().end(); ++it)
555  {
556  if ((*it)->m_selector == selector)
557  {
558  if (updateFilter) (*it)->m_needsUpdate = true;
559  (*it)->m_selector->m_expression = selector->m_expression;
560  break;
561  }
562  }
563  }
564  m_filesNeedUpdate = true;
565 }
FileQueue_t::iterator FileQueue_i
std::string m_expression
#define fwLog(_level_)
Definition: fwLog.h:50
void CmsShowNavigator::editFiltersExternally ( )

Definition at line 792 of file CmsShowNavigator.cc.

References canEditFiltersExternally(), and editFiltersExternally_.

Referenced by FWGUIEventFilter::CloseWindow().

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

Definition at line 124 of file CmsShowNavigator.h.

References m_filesNeedUpdate.

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

Definition at line 760 of file CmsShowNavigator.cc.

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

761 {
762  if (m_filterState == kOn)
763  return Form("%d events are selected from %d.", getNSelectedEvents(), getNTotalEvents());
764  else if (m_filterState == kOff)
765  return "Filtering is OFF.";
766  else
767  return "Filtering is disabled.";
768 }
EFilterState m_filterState
void CmsShowNavigator::firstEvent ( )
virtual

Implements FWNavigatorBase.

Definition at line 258 of file CmsShowNavigator.cc.

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

259 {
261  if (m_filterState == kOn)
262  {
263  while (x != m_files.end())
264  {
265  if ((*x)->hasSelectedEvents())
266  {
267  goTo(x, (*x)->firstSelectedEvent());
268  return;
269  }
270  ++x;
271  }
272  }
273  else
274  {
275  goTo(x, 0);
276  }
277 }
EFilterState m_filterState
FileQueue_t::iterator FileQueue_i
void goTo(FileQueue_i fi, int event)
Definition: DDAxes.h:10
const char * CmsShowNavigator::frameTitle ( )

Definition at line 966 of file CmsShowNavigator.cc.

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

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

Implements FWNavigatorBase.

Definition at line 960 of file CmsShowNavigator.cc.

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

961 {
962  return m_currentFile.isSet() ? (*m_currentFile)->event() : 0;
963 }
FileQueue_i m_currentFile
int CmsShowNavigator::getFilterState ( )
inline

Definition at line 125 of file CmsShowNavigator.h.

References m_filterState.

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

Implements FWNavigatorBase.

Definition at line 736 of file CmsShowNavigator.cc.

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

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

737 {
738  int sum = 0;
739  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
740  {
741  if ((*file)->globalSelection())
742  sum += (*file)->globalSelection()->GetN();
743  }
744  return sum;
745 }
FileQueue_t::iterator FileQueue_i
int CmsShowNavigator::getNTotalEvents ( )
virtual

Implements FWNavigatorBase.

Definition at line 748 of file CmsShowNavigator.cc.

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

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

749 {
750  int sum = 0;
751  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
752  {
753  sum += (*file)->tree()->GetEntries();
754  }
755 
756  return sum;
757 }
FileQueue_t::iterator FileQueue_i
std::vector< std::string > & CmsShowNavigator::getProcessList ( ) const

Definition at line 954 of file CmsShowNavigator.cc.

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

Referenced by FWGUIEventFilter::addSelector().

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

Definition at line 205 of file CmsShowNavigator.cc.

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

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

206 {
207  if (fi != m_currentFile)
208  setCurrentFile(fi);
209 
211  {
212  int total = (*fi)->tree()->GetEntries();
213  fwLog(fwlog::kDebug) << "CmsShowNavigator::goTo current file event [" << event << "/" << total -1<< "]" << std::endl;
214 
215  CpuInfo_t cpuInfo;
216  MemInfo_t memInfo;
217  ProcInfo_t procInfo;
218  gSystem->GetCpuInfo(&cpuInfo, 0);
219  gSystem->GetMemInfo(&memInfo);
220  gSystem->GetProcInfo(&procInfo);
221 
222  time_t curtime;
223  time(&curtime);
224 
225  fwLog(fwlog::kDebug) << "Current Time: " << ctime(&curtime);
226  fwLog(fwlog::kDebug) << "memInfo.fMemUsed \t" << memInfo.fMemUsed << std::endl;
227  fwLog(fwlog::kDebug) << "memInfo.fSwapUsed\t" << memInfo.fSwapUsed << std::endl;
228  fwLog(fwlog::kDebug) << "procInfo.fMemResident\t" << procInfo.fMemResident << std::endl;
229  fwLog(fwlog::kDebug) << "procInfo.fMemVirtual\t" << procInfo.fMemVirtual << std::endl;
230  fwLog(fwlog::kDebug) << "cpuInfo.fLoad1m \t" << cpuInfo.fLoad1m << std::endl;
231  fwLog(fwlog::kDebug) << "cpuInfo.fLoad5m \t" << cpuInfo.fLoad5m << std::endl;
232  }
233 
234  (*m_currentFile)->event()->to(event);
235  (*m_currentFile)->tree()->LoadTree(event);
237 
238  newEvent_.emit();
239 }
LogLevel presentLogLevel()
Definition: fwLog.cc:52
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:50
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 242 of file CmsShowNavigator.cc.

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

243 {
244  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
245  {
246  Long64_t index = (*file)->event()->indexFromEventId(run, lumi, event);
247  if (index >= 0)
248  {
249  goTo(file, index);
250  break;
251  }
252  }
253 }
tuple lumi
Definition: fjr2json.py:35
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 641 of file CmsShowNavigator.cc.

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

642 {
643  if (m_filterState == kOn)
644  {
645  FileQueue_i firstSelectedFile;
646  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
647  {
648  if ((*file)->hasSelectedEvents())
649  {
650  firstSelectedFile = file;
651  break;
652  }
653  }
654 
655  if (firstSelectedFile == m_currentFile)
656  return (*m_currentFile)->firstSelectedEvent() == m_currentEvent;
657  }
658  else
659  {
660  if (m_currentFile == m_files.begin())
661  {
662  return m_currentEvent == 0;
663  }
664  }
665  return false;
666 }
EFilterState m_filterState
FileQueue_t::iterator FileQueue_i
FileQueue_i m_currentFile
bool CmsShowNavigator::isLastEvent ( )
virtual

Implements FWNavigatorBase.

Definition at line 669 of file CmsShowNavigator.cc.

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

670 {
671  if (m_filterState == kOn)
672  {
673  FileQueue_i lastSelectedFile;
674  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
675  {
676  if ((*file)->hasSelectedEvents())
677  lastSelectedFile = file;
678  }
679  if (lastSelectedFile == m_currentFile)
680  return (*m_currentFile)->lastSelectedEvent() == m_currentEvent;
681  }
682  else
683  {
684  FileQueue_i lastFile = m_files.end();
685  --lastFile;
686  if (m_currentFile == lastFile)
687  {
688  return (*m_currentFile)->lastEvent() == m_currentEvent;
689  }
690  }
691  return false;
692 }
EFilterState m_filterState
FileQueue_t::iterator FileQueue_i
FileQueue_i m_currentFile
void CmsShowNavigator::lastEvent ( )
virtual

Implements FWNavigatorBase.

Definition at line 280 of file CmsShowNavigator.cc.

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

281 {
282  FileQueue_i x = m_files.end();
283  if (m_filterState == kOn)
284  {
285  while (x != m_files.begin())
286  {
287  --x;
288  if ((*x)->hasSelectedEvents())
289  {
290  goTo(x, (*x)->lastSelectedEvent());
291  return;
292  }
293  }
294  }
295  else
296  {
297  --x;
298  goTo(x, (*x)->lastEvent());
299  }
300 }
EFilterState m_filterState
FileQueue_t::iterator FileQueue_i
void goTo(FileQueue_i fi, int event)
Definition: DDAxes.h:10
void CmsShowNavigator::newFile ( FileQueue_i  )
private
void CmsShowNavigator::nextEvent ( )
virtual

Implements FWNavigatorBase.

Definition at line 333 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 x.

334 {
336  {
338  if (m_filterState == kOn)
339  goTo(last, (*last)->firstSelectedEvent());
340  else
341  goTo(last, 0);
342 
343  m_newFileOnNextEvent = false;
344  return;
345  }
346 
347  if (m_filterState == kOn)
348  {
350  return;
351  }
352  else
353  {
354  if (m_currentEvent < (*m_currentFile)->lastEvent())
355  {
357  }
358  else
359  {
361  if (x != m_files.end())
362  {
363  goTo(x, 0);
364  }
365  }
366  }
367 }
EFilterState m_filterState
FileQueue_t::iterator FileQueue_i
FileQueue_i m_currentFile
void goTo(FileQueue_i fi, int event)
virtual bool nextSelectedEvent()
Definition: DDAxes.h:10
bool CmsShowNavigator::nextSelectedEvent ( )
virtual

Implements FWNavigatorBase.

Definition at line 305 of file CmsShowNavigator.cc.

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

Referenced by nextEvent(), and updateFileFilters().

306 {
307  int nextEv = (*m_currentFile)->nextSelectedEvent(m_currentEvent);
308  if (nextEv > -1)
309  {
310  goTo(m_currentFile, nextEv);
311  return true;
312  }
313  else
314  {
316  while (i != m_files.end())
317  {
318  if ((*i)->hasSelectedEvents())
319  {
320  goTo(i, (*i)->firstSelectedEvent());
321  return true;
322  }
323  ++i;
324  }
325  }
326 
327  return false;
328 }
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(), cppFunctionSkipper::exception, mergeVDriftHistosByStation::file, FWFileEntry::filters(), fwLog, CmsShowMain::getVersionCheck(), 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().

74 {
75  fwLog(fwlog::kDebug) << "CmsShowNavigator::openFile [" << fileName << "]" << std::endl;
76  FWFileEntry* newFile = 0;
77  try
78  {
79  newFile = new FWFileEntry(fileName, m_main.getVersionCheck());
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.empty() )
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:112
int i
Definition: DBlmapReader.cc:9
const CmsShowMain & m_main
void newFile(FileQueue_i)
std::list< Filter * > & filters()
Definition: FWFileEntry.h:64
bool getVersionCheck() const
Definition: CmsShowMain.h:81
#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 ( )
virtual

Implements FWNavigatorBase.

Definition at line 399 of file CmsShowNavigator.cc.

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

400 {
401  if (m_filterState == kOn)
402  {
404  }
405  else
406  {
407  if (m_currentEvent > 0)
408  {
410  }
411  else
412  {
413  // last event in previous file
415  if (x != m_files.begin())
416  {
417  --x;
418  goTo(x, (*x)->lastEvent());
419  }
420  }
421  }
422 }
EFilterState m_filterState
FileQueue_t::iterator FileQueue_i
FileQueue_i m_currentFile
void goTo(FileQueue_i fi, int event)
virtual bool previousSelectedEvent()
Definition: DDAxes.h:10
bool CmsShowNavigator::previousSelectedEvent ( )
virtual

Implements FWNavigatorBase.

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

373 {
374  int prevEv = (*m_currentFile)->previousSelectedEvent(m_currentEvent);
375  if (prevEv > -1)
376  {
377  goTo(m_currentFile, prevEv);
378  return true;
379  }
380  else
381  {
382  FileQueue_i i(m_currentFile); i.previous(m_files);
383  while (i != m_files.end())
384  {
385  if ((*i)->hasSelectedEvents())
386  {
387  goTo(i, (*i)->lastSelectedEvent());
388  return true;
389  }
390  i.previous(m_files);
391  }
392  }
393  return false;
394 }
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 507 of file CmsShowNavigator.cc.

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

Referenced by applyFiltersFromGUI().

508 {
509  fwLog(fwlog::kDebug) << "CmsShowNavigator::removeFilter " << (*si)->m_expression << std::endl;
510 
511  std::list<FWFileEntry::Filter*>::iterator it;
512  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
513  {
514  for (it = (*file)->filters().begin(); it != (*file)->filters().end(); ++it)
515  {
516  if ((*it)->m_selector == *si)
517  {
518  FWFileEntry::Filter* f = *it;
519  delete f;
520  (*file)->filters().erase(it);
521  break;
522  }
523  }
524  }
525 
526  delete *si;
527  m_selectors.erase(si);
528  m_filesNeedUpdate = true;
529 }
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.

References m_newFileOnNextEvent.

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

Definition at line 458 of file CmsShowNavigator.cc.

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

Referenced by updateFileFilters().

459 {
460  fwLog(fwlog::kInfo) << "CmsShowNavigator::resumeFilter" << std::endl;
461  m_filterState = kOn;
463 }
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 182 of file CmsShowNavigator.cc.

References CmsShowNavigator::FileQueue_t::begin(), CmsShowNavigator::FileQueue_t::end(), fileChanged_, fwLog, i, fwlog::kDebug, fwlog::kInfo, 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  else
196  {
197  fwLog(fwlog::kInfo) << "Set current file to "<< (*fi)->file()->GetName() << ".\n";
198  }
199 
200  m_currentFile = fi;
201  fileChanged_.emit((*m_currentFile)->file());
202 }
int i
Definition: DBlmapReader.cc:9
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)
virtual

Implements FWNavigatorBase.

Definition at line 814 of file CmsShowNavigator.cc.

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

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

Referenced by CmsShowMain::CmsShowMain().

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

Definition at line 798 of file CmsShowNavigator.cc.

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

Referenced by CmsShowMain::setupDataHandling().

799 {
800  if (m_guiFilter->IsMapped())
801  {
803  }
804  else
805  {
808  }
809 }
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 427 of file CmsShowNavigator.cc.

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

Referenced by FWGUIEventFilter::disableFilters().

428 {
429  // callback
430 
431  fwLog(fwlog::kInfo) << "CmsShowNavigator::toggleFilterEnable filters enabled [" << ( m_filterState == kOff) << "]" << std::endl;
432 
433  if (m_filterState == kOff)
434  {
435  m_filterState = kOn;
437 
439  }
440  else
441  {
444  }
445 
447 }
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 466 of file CmsShowNavigator.cc.

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

467 {
468  // run filters on files
469  std::list<FWFileEntry::Filter>::iterator it;
470  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
471  {
472  if ( m_filesNeedUpdate) (*file)->needUpdate();
473  (*file)->updateFilters(m_main.context()->eventItemsManager(), m_filterMode == kOr);
474  }
476  m_filesNeedUpdate = false;
477 
478  int nSelected = getNSelectedEvents();
479  if (nSelected)
480  {
481  // go to the nearest selected event/file
482  bool changeCurrentEvent = !(*m_currentFile)->isEventSelected(m_currentEvent);
483  if (changeCurrentEvent)
484  {
485  if (!nextSelectedEvent())
487  }
488 
489  if (m_filterState == kWithdrawn)
490  resumeFilter();
491 
492  postFiltering_.emit(changeCurrentEvent);
493  }
494  else
495  {
496  withdrawFilter();
497  }
498 
500  {
501  fwLog(fwlog::kDebug) << "CmsShowNavigator::updateFileFilters selected events over files [" << getNSelectedEvents() << "/" << getNTotalEvents() << "]" << std::endl;
502  }
503 }
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
sigc::signal< void, bool > postFiltering_
virtual bool previousSelectedEvent()
#define fwLog(_level_)
Definition: fwLog.h:50
virtual bool nextSelectedEvent()
const fireworks::Context * context() const
Definition: CmsShowMain.h:80
void CmsShowNavigator::updateSelectorsInfo ( )
private

Definition at line 696 of file CmsShowNavigator.cc.

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

Referenced by updateFileFilters().

697 {
698 
699  // reset
700  std::list<FWEventSelector*>::const_iterator sel = m_selectors.begin();
701  while ( sel != m_selectors.end())
702  {
703  (*sel)->m_selected = 0;
704  (*sel)->m_updated = true;
705  ++sel;
706  }
707 
708  // loop file filters
709  std::list<FWFileEntry::Filter*>::iterator i;
710  for (FileQueue_i file = m_files.begin(); file != m_files.end(); ++file)
711  {
712  std::list<FWFileEntry::Filter*>& filters = (*file)->filters();
713  for (i = filters.begin(); i != filters.end(); ++i)
714  {
715  if ((*i)->m_eventList)
716  {
717  (*i)->m_selector->m_selected += (*i)->m_eventList->GetN();
718  }
719 
720  if ((*i)->m_needsUpdate)
721  (*i)->m_selector->m_updated = false;
722  }
723  }
724  if (m_guiFilter)
725  {
726  std::list<FWGUIEventSelector*>::const_iterator gs = m_guiFilter->guiSelectors().begin();
727  while ( gs != m_guiFilter->guiSelectors().end())
728  {
729  (*gs)->updateNEvents();
730  ++gs;
731  }
732  }
733 }
int i
Definition: DBlmapReader.cc:9
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 450 of file CmsShowNavigator.cc.

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

Referenced by updateFileFilters().

451 {
452  fwLog(fwlog::kInfo) << "CmsShowNavigator::witdrawFilter" << std::endl;
455 }
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(), and setMaxNumberOfFilesToChain().

bool CmsShowNavigator::m_newFileOnNextEvent
private
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.