13 #include "boost/bind.hpp" 14 #include "boost/regex.hpp" 19 #include "TGTextEntry.h" 20 #include "TGNumberEntry.h" 24 #include "TApplication.h" 53 m_filesNeedUpdate(
true),
54 m_newFileOnNextEvent(
false),
56 m_maxNumberOfFilesToChain(1),
77 fwLog(
fwlog::kDebug) <<
"CmsShowNavigator::openFile [" << fileName <<
"]" << std::endl;
85 fwLog(
fwlog::kError) <<
"Navigator::openFile ecaught exception FWFileEntry constructor " << iException.what()<<std::endl;
116 fwLog(
fwlog::kError) <<
"Navigator::openFile caught exception "<<iException.what()<<std::endl;
124 fwLog(
fwlog::kDebug) <<
"CmsShowNavigator::appendFile [" << fileName <<
"]" << std::endl;
132 fwLog(
fwlog::kError) <<
"Navigator::appendFile caught exception FWFileEntry constructor "<<iException.what()<<std::endl;
139 if (checkFileQueueSize)
175 std::cerr <<
"Navigator::openFile caught exception "<<iException.what()<<std::endl;
195 fwLog(
fwlog::kDebug) <<
"CmsShowNavigator::setCurrentFile [" << (*fi)->file()->GetName() <<
"] file idx in chain [" << cnt <<
"/" <<
m_files.size() -1 <<
"]" << std::endl;
199 fwLog(
fwlog::kInfo) <<
"Set current file to "<< (*fi)->file()->GetName() <<
".\n";
214 int total = (*fi)->tree()->GetEntries();
215 fwLog(
fwlog::kDebug) <<
"CmsShowNavigator::goTo current file event [" <<
event <<
"/" << total -1<<
"]" << std::endl;
220 gSystem->GetCpuInfo(&cpuInfo, 0);
221 gSystem->GetMemInfo(&memInfo);
222 gSystem->GetProcInfo(&procInfo);
230 fwLog(
fwlog::kDebug) <<
"procInfo.fMemResident\t" << procInfo.fMemResident << std::endl;
231 fwLog(
fwlog::kDebug) <<
"procInfo.fMemVirtual\t" << procInfo.fMemVirtual << std::endl;
238 printf(
"FWTTreeCache statistics before going to event %d:\n", event);
239 (*m_currentFile)->tree()->PrintCacheStats();
242 (*m_currentFile)->event()->to(event);
243 (*m_currentFile)->tree()->LoadTree(event);
254 Long64_t
index = (*file)->event()->indexFromEventId(run, lumi, event);
273 if ((*x)->hasSelectedEvents())
275 goTo(x, (*x)->firstSelectedEvent());
296 if ((*x)->hasSelectedEvents())
298 goTo(x, (*x)->lastSelectedEvent());
306 goTo(x, (*x)->lastEvent());
326 if ((*i)->hasSelectedEvents())
328 goTo(i, (*i)->firstSelectedEvent());
347 goTo(last, (*last)->firstSelectedEvent());
382 int prevEv = (*m_currentFile)->previousSelectedEvent(
m_currentEvent);
393 if ((*i)->hasSelectedEvents())
395 goTo(i, (*i)->lastSelectedEvent());
426 goTo(x, (*x)->lastEvent());
477 std::list<FWFileEntry::Filter>::iterator it;
490 bool changeCurrentEvent = !(*m_currentFile)->isEventSelected(
m_currentEvent);
491 if (changeCurrentEvent)
517 fwLog(
fwlog::kDebug) <<
"CmsShowNavigator::removeFilter " << (*si)->m_expression << std::endl;
519 std::list<FWFileEntry::Filter*>::iterator it;
522 for (it = (*file)->filters().begin(); it != (*file)->filters().end(); ++it)
524 if ((*it)->m_selector == *si)
528 (*file)->filters().erase(it);
559 std::list<FWFileEntry::Filter*>::iterator it;
562 for (it = (*file)->filters().begin(); it != (*file)->filters().end(); ++it)
564 if ((*it)->m_selector == selector)
566 if (updateFilter) (*it)->m_needsUpdate =
true;
567 (*it)->m_selector->m_expression = selector->
m_expression;
589 std::list<FWEventSelector*>::iterator si =
m_selectors.begin();
611 if (*si == (*gi)->origSelector())
626 else if ((*gi)->origSelector() ==
nullptr)
656 if ((*file)->hasSelectedEvents())
658 firstSelectedFile =
file;
684 if ((*file)->hasSelectedEvents())
685 lastSelectedFile =
file;
708 std::list<FWEventSelector*>::const_iterator sel =
m_selectors.begin();
711 (*sel)->m_selected = 0;
712 (*sel)->m_updated =
true;
717 std::list<FWFileEntry::Filter*>::iterator
i;
720 std::list<FWFileEntry::Filter*>&
filters = (*file)->filters();
721 for (i = filters.begin(); i != filters.end(); ++
i)
723 if ((*i)->m_eventList)
725 (*i)->m_selector->m_selected += (*i)->m_eventList->GetN();
728 if ((*i)->m_needsUpdate)
729 (*i)->m_selector->m_updated =
false;
737 (*gs)->updateNEvents();
749 if ((*file)->globalSelection())
750 sum += (*file)->globalSelection()->GetN();
761 sum += (*file)->tree()->GetEntries();
773 return "Filtering is OFF.";
775 return "Filtering is disabled.";
781 bool haveActiveFilters =
false;
784 if ((*file)->hasActiveFilters())
786 haveActiveFilters =
true;
791 bool btnEnabled = haveActiveFilters;
853 int numberOfFilters = 0;
856 numberOfFilters = atoi(nfvalue->
value().c_str());
858 for(
int i=0;
i<numberOfFilters; ++
i)
864 std::istringstream
s(value->
value());
883 std::istringstream
s(value->
value());
891 std::istringstream
s(value->
value());
910 (*file)->filters().clear();
933 for (std::list<FWEventSelector*>::const_iterator sel =
m_selectors.begin(); sel !=
m_selectors.end(); ++sel)
941 if (!(*sel)->m_triggerProcess.empty())
944 tmp.
addKeyValue(Form(
"------Filter[%d]------", cnt), filter,
true);
961 std::vector<std::string>&
976 if (
m_files.empty())
return "";
986 TString
name = (*m_currentFile)->file()->GetName();
987 int l = name.Last(
'/');
991 return Form(
"%s [%d/%d], event [%d/%d]", name.Data(),
virtual ~CmsShowNavigator()
EFilterState m_filterState
std::vector< std::pair< std::string, FWConfiguration > > KeyValues
void showEventFilterGUI(const TGWindow *p)
const KeyValues * keyValues() const
virtual void previousEvent()
const FWEventItemsManager * eventItemsManager() const
const char * frameTitle()
virtual bool isFirstEvent()
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
unsigned long long EventNumber_t
std::string m_triggerProcess
void show(std::list< FWEventSelector * > *sels, int filterMode, int state)
virtual bool isLastEvent()
LogLevel presentLogLevel()
const char * filterStatusMessage()
void addFilter(FWEventSelector *)
unsigned int LuminosityBlockNumber_t
std::vector< TPRegexp > filters
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
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
bool m_newFileOnNextEvent
void applyFiltersFromGUI()
virtual void firstEvent()
CmsShowNavigator(const CmsShowMain &)
sigc::signal< void, bool > postFiltering_
void updateFilterStateLabel(int)
void goTo(FileQueue_i fi, int event)
void editFiltersExternally()
sigc::signal< void, const TFile * > fileChanged_
std::list< Filter * > & filters()
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 canEditFiltersExternally()
FWConfiguration & addKeyValue(const std::string &, const FWConfiguration &)
std::string m_description
void updateSelectorsInfo()
virtual bool previousSelectedEvent()
const std::string & value(unsigned int iIndex=0) const
bool getVersionCheck() const
std::vector< std::string > & getProcessList() const
FWJobMetadataManager * metadataManager() const
virtual bool nextSelectedEvent()
KeyValues::const_iterator KeyValuesIt
std::list< FWGUIEventSelector * > & guiSelectors()
virtual const edm::EventBase * getCurrentEvent() const
std::vector< std::vector< double > > tmp
void toggleFilterEnable()
void setupDisableFilteringButton(bool)
void setCurrentFile(FileQueue_i)
const FWConfiguration * valueForKey(const std::string &iKey) const
virtual void addTo(FWConfiguration &) const
std::list< FWEventSelector * > m_selectors
sigc::signal< void, int > filterStateChanged_
const fireworks::Context * context() const
iterator & previous(FileQueue_t &cont)
void removeFilter(std::list< FWEventSelector * >::iterator)
sigc::signal< void > newEvent_
virtual void CloseWindow()
virtual void setFrom(const FWConfiguration &)