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;
208 int total = (*fi)->tree()->GetEntries();
209 fwLog(
fwlog::kDebug) <<
"CmsShowNavigator::goTo current file event [" <<
event <<
"/" << total -1<<
"]" << std::endl;
214 gSystem->GetCpuInfo(&cpuInfo, 0);
215 gSystem->GetMemInfo(&memInfo);
216 gSystem->GetProcInfo(&procInfo);
220 fwLog(
fwlog::kDebug) <<
"procInfo.fMemResident\t" << procInfo.fMemResident << std::endl;
221 fwLog(
fwlog::kDebug) <<
"procInfo.fMemVirtual\t" << procInfo.fMemVirtual << std::endl;
226 (*m_currentFile)->event()->to(event);
227 (*m_currentFile)->tree()->LoadTree(event);
238 Long64_t
index = (*file)->event()->indexFromEventId(run, lumi, event);
257 if ((*x)->hasSelectedEvents())
259 goTo(x, (*x)->firstSelectedEvent());
280 if ((*x)->hasSelectedEvents())
282 goTo(x, (*x)->lastSelectedEvent());
290 goTo(x, (*x)->lastEvent());
310 if ((*i)->hasSelectedEvents())
312 goTo(i, (*i)->firstSelectedEvent());
331 goTo(last, (*last)->firstSelectedEvent());
366 int prevEv = (*m_currentFile)->previousSelectedEvent(
m_currentEvent);
377 if ((*i)->hasSelectedEvents())
379 goTo(i, (*i)->lastSelectedEvent());
410 goTo(x, (*x)->lastEvent());
461 std::list<FWFileEntry::Filter>::iterator it;
500 fwLog(
fwlog::kDebug) <<
"CmsShowNavigator::removeFilter " << (*si)->m_expression << std::endl;
502 std::list<FWFileEntry::Filter*>::iterator it;
505 for (it = (*file)->filters().begin(); it != (*file)->filters().end(); ++it)
507 if ((*it)->m_selector == *si)
511 (*file)->filters().erase(it);
542 std::list<FWFileEntry::Filter*>::iterator it;
545 for (it = (*file)->filters().begin(); it != (*file)->filters().end(); ++it)
547 if ((*it)->m_selector == selector)
549 if (updateFilter) (*it)->m_needsUpdate =
true;
550 (*it)->m_selector->m_expression = selector->
m_expression;
572 std::list<FWEventSelector*>::iterator si =
m_selectors.begin();
594 if (*si == (*gi)->origSelector())
609 else if ((*gi)->origSelector() == 0)
639 if ((*file)->hasSelectedEvents())
641 firstSelectedFile =
file;
667 if ((*file)->hasSelectedEvents())
668 lastSelectedFile =
file;
691 std::list<FWEventSelector*>::const_iterator
sel =
m_selectors.begin();
694 (*sel)->m_selected = 0;
695 (*sel)->m_updated =
true;
700 std::list<FWFileEntry::Filter*>::iterator
i;
703 std::list<FWFileEntry::Filter*>&
filters = (*file)->filters();
704 for (i = filters.begin(); i != filters.end(); ++
i)
706 if ((*i)->m_eventList)
708 (*i)->m_selector->m_selected += (*i)->m_eventList->GetN();
711 if ((*i)->m_needsUpdate)
712 (*i)->m_selector->m_updated =
false;
720 (*gs)->updateNEvents();
732 if ((*file)->globalSelection())
733 sum += (*file)->globalSelection()->GetN();
744 sum += (*file)->tree()->GetEntries();
756 return "Filtering is OFF.";
758 return "Filtering is disabled.";
764 bool haveActiveFilters =
false;
767 if ((*file)->hasActiveFilters())
769 haveActiveFilters =
true;
774 bool btnEnabled = haveActiveFilters;
836 int numberOfFilters = 0;
838 std::istringstream
s(value->
value());
841 for(
int i=0;
i<numberOfFilters; ++
i)
847 std::istringstream
s(value->
value());
866 std::istringstream
s(value->
value());
874 std::istringstream
s(value->
value());
893 (*file)->filters().clear();
924 if (!(*sel)->m_triggerProcess.empty())
927 tmp.
addKeyValue(Form(
"------Filter[%d]------", cnt), filter,
true);
944 std::vector<std::string>&
959 if (
m_files.empty())
return "";
969 TString
name = (*m_currentFile)->file()->GetName();
970 int l = name.Last(
'/');
974 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
def main
— Main —############################
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()
sigc::signal< void > postFiltering_
CmsShowNavigator(const CmsShowMain &)
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
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.
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 &)