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 // $Id: CmsShowNavigator.cc,v 1.107 2011/03/04 21:11:41 amraktad Exp $
6 //
7 
10 
12 
13 // system include files
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);
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 }
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);
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 
196  m_currentFile = fi;
197  fileChanged_.emit((*m_currentFile)->file());
198 }
199 
200 void
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 }
232 
233 void
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 }
246 
247 //______________________________________________________________________________
248 
249 void
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 }
270 
271 void
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 }
293 
294 //______________________________________________________________________________
295 
296 bool
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 }
321 
322 //______________________________________________________________________________
323 
324 void
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 }
360 
361 //______________________________________________________________________________
362 
363 bool
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  {
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 }
387 
388 //______________________________________________________________________________
389 
390 void
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 }
415 
416 //______________________________________________________________________________
417 
418 void
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 }
440 
441 void
443 {
444  fwLog(fwlog::kInfo) << "CmsShowNavigator::witdrawFilter" << std::endl;
447 }
448 
449 void
451 {
452  fwLog(fwlog::kInfo) << "CmsShowNavigator::resumeFilter" << std::endl;
453  m_filterState = kOn;
455 }
456 
457 void
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 }
495 
496 //=======================================================================
497 void
498 CmsShowNavigator::removeFilter(std::list<FWEventSelector*>::iterator si)
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 }
521 
522 void
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 }
536 
537 void
538 CmsShowNavigator::changeFilter(FWEventSelector* selector, bool updateFilter)
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 }
557 
558 void
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 }
628 //______________________________________________________________________________
629 // helpers for gui state
630 
631 bool
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 }
658 
659 bool
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 }
684 
685 //______________________________________________________________________________
686 void
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 }
725 
726 int
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 }
737 
738 int
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 }
749 
750 const char*
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 }
760 
761 bool
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 }
781 
782 void
784 {
786 }
787 
788 void
790 {
791  if (m_guiFilter->IsMapped())
792  {
794  }
795  else
796  {
799  }
800 }
801 
802 //______________________________________________________________________________
803 
804 void
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 }
909 
910 void
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 }
943 
944 std::vector<std::string>&
946 {
948 }
949 
950 const edm::EventBase*
952 {
953  return m_currentFile.isSet() ? (*m_currentFile)->event() : 0;
954 }
955 
956 const char*
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 }
virtual ~CmsShowNavigator()
EFilterState m_filterState
std::vector< std::pair< std::string, FWConfiguration > > KeyValues
void closeFile()
Definition: FWFileEntry.cc:62
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:62
unsigned int EventNumber_t
Definition: EventID.h:30
const char * frameTitle()
virtual void lastEvent()
virtual bool isFirstEvent()
list file
Definition: dbtoweb.py:253
tuple lumi
Definition: fjr2json.py:41
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()
def main
— Main —############################
std::string m_triggerProcess
void show(std::list< FWEventSelector * > *sels, int filterMode, int state)
virtual bool isLastEvent()
LogLevel presentLogLevel()
Definition: fwLog.cc:53
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)
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()
sigc::signal< void > postFiltering_
CmsShowNavigator(const CmsShowMain &)
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:65
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
std::vector< std::string > & getProcessList() const
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
#define fwLog(_level_)
Definition: fwLog.h:51
FWJobMetadataManager * metadataManager() const
Definition: Context.h:70
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
string s
Definition: asciidump.py:422
virtual void addTo(FWConfiguration &) const
std::list< FWEventSelector * > m_selectors
sigc::signal< void, int > filterStateChanged_
const fireworks::Context * context() const
Definition: CmsShowMain.h:81
iterator & previous(FileQueue_t &cont)
void removeFilter(std::list< FWEventSelector * >::iterator)
sigc::signal< void > newEvent_
virtual void CloseWindow()
virtual void setFrom(const FWConfiguration &)