CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CmsShowNavigator.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: newVersion
4 // Class : CmsShowNavigator
5 //
6 
9 
11 
12 // system include files
13 #include "boost/bind.hpp"
14 #include "boost/regex.hpp"
15 #include "TROOT.h"
16 #include "TTree.h"
17 #include "TFile.h"
18 #include "TError.h"
19 #include "TGTextEntry.h"
20 #include "TGNumberEntry.h"
21 #include "TBranch.h"
22 #include "TAxis.h"
23 
24 #include "TApplication.h"
25 #include "TSystem.h"
26 #include "TObject.h"
27 
28 // user include files
40 
41 //
42 // constructors and destructor
43 //
45  FWNavigatorBase(main),
46  m_currentEvent(0),
47 
48  m_filterState(kOff),
49  m_filterMode(kOr),
50 
51  m_filesNeedUpdate(true),
52  m_newFileOnNextEvent(false),
53 
54  m_maxNumberOfFilesToChain(1),
55 
56  m_main(main),
57  m_guiFilter(0)
58 {
59  m_guiFilter = new FWGUIEventFilter(this);
61 }
62 
64 {
65  delete m_guiFilter;
66 }
67 
68 //
69 // member functions
70 //
71 
72 bool
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 }
118 
119 bool
120 CmsShowNavigator::appendFile(const std::string& fileName, bool checkFileQueueSize, bool live)
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 }
179 
180 //______________________________________________________________________________
181 
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 }
203 
204 void
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 }
240 
241 void
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 }
254 
255 //______________________________________________________________________________
256 
257 void
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 }
278 
279 void
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 }
301 
302 //______________________________________________________________________________
303 
304 bool
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 }
329 
330 //______________________________________________________________________________
331 
332 void
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 }
368 
369 //______________________________________________________________________________
370 
371 bool
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  {
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 }
395 
396 //______________________________________________________________________________
397 
398 void
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 }
423 
424 //______________________________________________________________________________
425 
426 void
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 }
448 
449 void
451 {
452  fwLog(fwlog::kInfo) << "CmsShowNavigator::witdrawFilter" << std::endl;
455 }
456 
457 void
459 {
460  fwLog(fwlog::kInfo) << "CmsShowNavigator::resumeFilter" << std::endl;
461  m_filterState = kOn;
463 }
464 
465 void
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 }
504 
505 //=======================================================================
506 void
507 CmsShowNavigator::removeFilter(std::list<FWEventSelector*>::iterator si)
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 }
530 
531 void
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 }
545 
546 void
547 CmsShowNavigator::changeFilter(FWEventSelector* selector, bool updateFilter)
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 }
566 
567 void
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 }
637 //______________________________________________________________________________
638 // helpers for gui state
639 
640 bool
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 }
667 
668 bool
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  {
685  --lastFile;
686  if (m_currentFile == lastFile)
687  {
688  return (*m_currentFile)->lastEvent() == m_currentEvent;
689  }
690  }
691  return false;
692 }
693 
694 //______________________________________________________________________________
695 void
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 }
734 
735 int
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 }
746 
747 int
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 }
758 
759 const char*
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 }
769 
770 bool
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 }
790 
791 void
793 {
795 }
796 
797 void
799 {
800  if (m_guiFilter->IsMapped())
801  {
803  }
804  else
805  {
808  }
809 }
810 
811 //______________________________________________________________________________
812 
813 void
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 }
918 
919 void
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 }
952 
953 std::vector<std::string>&
955 {
957 }
958 
959 const edm::EventBase*
961 {
962  return m_currentFile.isSet() ? (*m_currentFile)->event() : 0;
963 }
964 
965 const char*
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 }
virtual ~CmsShowNavigator()
EFilterState m_filterState
std::vector< std::pair< std::string, FWConfiguration > > KeyValues
void closeFile()
Definition: FWFileEntry.cc:112
int i
Definition: DBlmapReader.cc:9
void showEventFilterGUI(const TGWindow *p)
const KeyValues * keyValues() const
virtual void previousEvent()
const FWEventItemsManager * eventItemsManager() const
Definition: Context.h:61
unsigned int EventNumber_t
Definition: EventID.h:30
const char * frameTitle()
virtual void lastEvent()
virtual bool isFirstEvent()
tuple lumi
Definition: fjr2json.py:35
const CmsShowMain & m_main
sigc::signal< void, bool > editFiltersExternally_
virtual void goToRunEvent(edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t)
unsigned int m_maxNumberOfFilesToChain
std::vector< std::string > & processNamesInJob()
std::string m_triggerProcess
void show(std::list< FWEventSelector * > *sels, int filterMode, int state)
virtual bool isLastEvent()
LogLevel presentLogLevel()
Definition: fwLog.cc:52
const char * filterStatusMessage()
void addFilter(FWEventSelector *)
unsigned int LuminosityBlockNumber_t
Definition: EventID.h:31
std::vector< TPRegexp > filters
Definition: eve_filter.cc:25
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
bool openFile(const std::string &fileName)
int main(int argc, char **argv)
void newFile(FileQueue_i)
bool appendFile(const std::string &fileName, bool checkFileQueueSize, bool live)
void changeFilter(FWEventSelector *, bool filterNeedUpdate)
FileQueue_i m_currentFile
std::string m_expression
virtual void firstEvent()
CmsShowNavigator(const CmsShowMain &)
sigc::signal< void, bool > postFiltering_
double f[11][100]
void updateFilterStateLabel(int)
void goTo(FileQueue_i fi, int event)
sigc::signal< void, const TFile * > fileChanged_
std::list< Filter * > & filters()
Definition: FWFileEntry.h:64
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
virtual void nextEvent()
tuple conf
Definition: dbtoconf.py:185
FWConfiguration & addKeyValue(const std::string &, const FWConfiguration &)
std::string m_description
virtual bool previousSelectedEvent()
const std::string & value(unsigned int iIndex=0) const
bool getVersionCheck() const
Definition: CmsShowMain.h:81
tuple lastFile
Definition: archive.py:471
std::vector< std::string > & getProcessList() const
#define fwLog(_level_)
Definition: fwLog.h:50
FWJobMetadataManager * metadataManager() const
Definition: Context.h:69
virtual bool nextSelectedEvent()
KeyValues::const_iterator KeyValuesIt
std::list< FWGUIEventSelector * > & guiSelectors()
virtual const edm::EventBase * getCurrentEvent() const
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
void setupDisableFilteringButton(bool)
void setCurrentFile(FileQueue_i)
unsigned int RunNumber_t
Definition: EventRange.h:32
const FWConfiguration * valueForKey(const std::string &iKey) const
volatile std::atomic< bool > shutdown_flag false
Definition: DDAxes.h:10
virtual void addTo(FWConfiguration &) const
std::list< FWEventSelector * > m_selectors
sigc::signal< void, int > filterStateChanged_
const fireworks::Context * context() const
Definition: CmsShowMain.h:80
iterator & previous(FileQueue_t &cont)
void removeFilter(std::list< FWEventSelector * >::iterator)
sigc::signal< void > newEvent_
virtual void CloseWindow()
virtual void setFrom(const FWConfiguration &)