13 #include "boost/bind.hpp"
14 #include "boost/regex.hpp"
19 #include "TGTextEntry.h"
20 #include "TGNumberEntry.h"
24 #include "TApplication.h"
51 m_filesNeedUpdate(
true),
52 m_newFileOnNextEvent(
false),
54 m_maxNumberOfFilesToChain(1),
75 fwLog(
fwlog::kDebug) <<
"CmsShowNavigator::openFile [" << fileName <<
"]" << std::endl;
83 fwLog(
fwlog::kError) <<
"Navigator::openFile ecaught exception FWFileEntry constructor " << iException.what()<<std::endl;
114 fwLog(
fwlog::kError) <<
"Navigator::openFile caught exception "<<iException.what()<<std::endl;
122 fwLog(
fwlog::kDebug) <<
"CmsShowNavigator::appendFile [" << fileName <<
"]" << std::endl;
130 fwLog(
fwlog::kError) <<
"Navigator::appendFile caught exception FWFileEntry constructor "<<iException.what()<<std::endl;
137 if (checkFileQueueSize)
173 std::cerr <<
"Navigator::openFile caught exception "<<iException.what()<<std::endl;
193 fwLog(
fwlog::kDebug) <<
"CmsShowNavigator::setCurrentFile [" << (*fi)->file()->GetName() <<
"] file idx in chain [" << cnt <<
"/" <<
m_files.size() -1 <<
"]" << std::endl;
197 fwLog(
fwlog::kInfo) <<
"Set current file to "<< (*fi)->file()->GetName() <<
".\n";
212 int total = (*fi)->tree()->GetEntries();
213 fwLog(
fwlog::kDebug) <<
"CmsShowNavigator::goTo current file event [" <<
event <<
"/" << total -1<<
"]" << std::endl;
218 gSystem->GetCpuInfo(&cpuInfo, 0);
219 gSystem->GetMemInfo(&memInfo);
220 gSystem->GetProcInfo(&procInfo);
228 fwLog(
fwlog::kDebug) <<
"procInfo.fMemResident\t" << procInfo.fMemResident << std::endl;
229 fwLog(
fwlog::kDebug) <<
"procInfo.fMemVirtual\t" << procInfo.fMemVirtual << std::endl;
234 (*m_currentFile)->event()->to(event);
235 (*m_currentFile)->tree()->LoadTree(event);
246 Long64_t
index = (*file)->event()->indexFromEventId(run, lumi, event);
265 if ((*x)->hasSelectedEvents())
267 goTo(x, (*x)->firstSelectedEvent());
288 if ((*x)->hasSelectedEvents())
290 goTo(x, (*x)->lastSelectedEvent());
298 goTo(x, (*x)->lastEvent());
318 if ((*i)->hasSelectedEvents())
320 goTo(i, (*i)->firstSelectedEvent());
339 goTo(last, (*last)->firstSelectedEvent());
374 int prevEv = (*m_currentFile)->previousSelectedEvent(
m_currentEvent);
385 if ((*i)->hasSelectedEvents())
387 goTo(i, (*i)->lastSelectedEvent());
418 goTo(x, (*x)->lastEvent());
469 std::list<FWFileEntry::Filter>::iterator it;
482 bool changeCurrentEvent = !(*m_currentFile)->isEventSelected(
m_currentEvent);
483 if (changeCurrentEvent)
509 fwLog(
fwlog::kDebug) <<
"CmsShowNavigator::removeFilter " << (*si)->m_expression << std::endl;
511 std::list<FWFileEntry::Filter*>::iterator it;
514 for (it = (*file)->filters().begin(); it != (*file)->filters().end(); ++it)
516 if ((*it)->m_selector == *si)
520 (*file)->filters().erase(it);
551 std::list<FWFileEntry::Filter*>::iterator it;
554 for (it = (*file)->filters().begin(); it != (*file)->filters().end(); ++it)
556 if ((*it)->m_selector == selector)
558 if (updateFilter) (*it)->m_needsUpdate =
true;
559 (*it)->m_selector->m_expression = selector->
m_expression;
581 std::list<FWEventSelector*>::iterator si =
m_selectors.begin();
603 if (*si == (*gi)->origSelector())
618 else if ((*gi)->origSelector() == 0)
648 if ((*file)->hasSelectedEvents())
650 firstSelectedFile =
file;
676 if ((*file)->hasSelectedEvents())
677 lastSelectedFile =
file;
700 std::list<FWEventSelector*>::const_iterator
sel =
m_selectors.begin();
703 (*sel)->m_selected = 0;
704 (*sel)->m_updated =
true;
709 std::list<FWFileEntry::Filter*>::iterator
i;
712 std::list<FWFileEntry::Filter*>&
filters = (*file)->filters();
713 for (i = filters.begin(); i != filters.end(); ++
i)
715 if ((*i)->m_eventList)
717 (*i)->m_selector->m_selected += (*i)->m_eventList->GetN();
720 if ((*i)->m_needsUpdate)
721 (*i)->m_selector->m_updated =
false;
729 (*gs)->updateNEvents();
741 if ((*file)->globalSelection())
742 sum += (*file)->globalSelection()->GetN();
753 sum += (*file)->tree()->GetEntries();
765 return "Filtering is OFF.";
767 return "Filtering is disabled.";
773 bool haveActiveFilters =
false;
776 if ((*file)->hasActiveFilters())
778 haveActiveFilters =
true;
783 bool btnEnabled = haveActiveFilters;
845 int numberOfFilters = 0;
848 numberOfFilters = atoi(nfvalue->
value().c_str());
850 for(
int i=0;
i<numberOfFilters; ++
i)
856 std::istringstream
s(value->
value());
875 std::istringstream
s(value->
value());
883 std::istringstream
s(value->
value());
902 (*file)->filters().clear();
933 if (!(*sel)->m_triggerProcess.empty())
936 tmp.
addKeyValue(Form(
"------Filter[%d]------", cnt), filter,
true);
953 std::vector<std::string>&
968 if (
m_files.empty())
return "";
978 TString
name = (*m_currentFile)->file()->GetName();
979 int l = name.Last(
'/');
983 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
unsigned int EventNumber_t
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
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)
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
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
volatile std::atomic< bool > shutdown_flag false
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 &)