ATLAS Offline Software
VP1ExecutionScheduler.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // //
7 // Implementation of class VP1ExecutionScheduler //
8 // //
9 // Author: Thomas Kittelmann <Thomas.Kittelmann@cern.ch> //
10 // //
11 // Initial version: April 2007 //
12 // //
13 // History: //
14 // R.M.Bianchi <rbianchi@cern.ch> - Feb 2013 //
15 // //
17 
18 //TODO:
19 //
20 // * Save sys2time data in .vp1 file
21 // * Disable custom controllers between events!
22 // * Integrate with cruise modes (tab and event)
23 // * In tab cruise mode, dont go to next tab until it is ready. Thus,
24 // we need to be able to ask the scheduler if a given tab is ready.
25 // * "Soon to be visible" priority
26 // * General performance optimisation (inline internal methods +
27 // cache iterators).
28 // * Take care of accumulators.
29 // * Accumulate cruise mode (with ETA if it is a given number of events).
30 
31 /* this to fix the 'ptrdiff_t' does not name a type error with Qt:
32  * refs:
33  * - http://qt-project.org/forums/viewthread/16992
34  * - http://stackoverflow.com/questions/6727193/g-4-6-complains-about-iterator-difference-type-g-4-4-and-visual-studio-don
35  */
36 // #include <stddef.h>
37 
38 
40 #include "VP1Gui/VP1AvailEvents.h"
45 #include "VP1Gui/VP1Prioritiser.h"
46 #include "VP1Gui/VP1MainWindow.h"
48 #include "VP1Gui/VP1TabManager.h"
49 
50 #include "VP1Base/VP1QtUtils.h"
51 #include "VP1Base/IVP1System.h"
53 #include "VP1Base/VP1Msg.h"
55 #include "VP1Base/VP1AthenaPtrs.h"
56 #include "VP1Base/VP1Settings.h"
57 
59 
60 #include <QApplication>
61 #include <QProgressBar>
62 #include <QDesktopWidget>
63 #include <QMouseEvent>
64 #include <QWheelEvent>
65 #include <QCursor>
66 #include <QTimer>
67 #include <QSet>
68 #include <QStringList>
69 #include <QMessageBox>
70 #include <QCommandLineParser>
71 
72 #include <Inventor/C/errors/debugerror.h>
73 #include <Inventor/Qt/SoQt.h>
74 
75 #include <set>
76 #include <cassert>
77 #include <iostream> //For "widgetcount" output
78 #include <sstream> // std::ostringstream
79 #include <ctime>
80 #include <stdexcept>
81 #include <string>
82 #include <vector>
83 
84 
85 
86 std::vector<std::string> qstringlistToVecString(QStringList list)
87 {
88  std::vector<std::string> vec;
89  for (QString str : list) {
90  vec.push_back(str.toStdString());
91  }
92  return vec;
93 }
94 
95 
96 #ifdef BUILDVP1LIGHT
97  //Qt
98  #include <QSettings>
99 
100  // XAOD
101  #include "xAODRootAccess/Init.h"
102  #include "xAODRootAccess/TEvent.h"
103  #include "xAODRootAccess/TStore.h"
105  #include "xAODRootAccess/TAuxStore.h"
106  #include "xAODCore/AuxContainerBase.h"
107  #include "xAODCore/tools/ReadStats.h"
108  #include "xAODCore/tools/IOStats.h"
109 
110  // // For testing
111  #include "xAODEventInfo/EventInfo.h"
112  #include <QDebug>
115  #include <regex>
116  #include <QString>
117 
118  // ROOT include(s):
119  #include <TTree.h>
120  #include <TFile.h>
121  #include <TError.h>
122 
123  template <typename... Args> inline void unused(Args&&...) {} // to declare unused variables (see executeNewEvent() ).
124 #endif // BUILDVP1LIGHT
125 
126 
127 
128 //___________________________________________________________________
130 public:
131  class GlobalEventFilter;//Used to animate mouse clicks (for screencasts);
133 
137 
138  long int eventsProcessed;
139 
140  bool batchMode;
145 
147 
148  QTimer * refreshtimer;
152 
153  //Statusbar:
154  QProgressBar * pb;
157  void updateProgressBar();
158  QTimer * pbtimer;
159 
160  //When receiving erase requests for a system that is currently refreshing, we use this:
163 
165  QTimer * cruisetimer;
166  bool allVisibleRefreshed() const;
167  bool allSoonVisibleRefreshed() const;
168  void initCruise();
171 
172  static void warnIfWidgetsAlive();
173 
175 
176  bool skipEvent;
177 };
178 
179 //___________________________________________________________________
181 public:
182  GlobalEventFilter():m_lastPopup(QTime::currentTime()),
183  m_lastPopupWasQMenu(false){}
184  bool eventFilter ( QObject * watched, QEvent * event ) {
185  if (event->type()==QEvent::MouseButtonPress
186  ||event->type()==QEvent::MouseButtonDblClick
187  ||event->type()==QEvent::Wheel) {
188  QTime t = QTime::currentTime();
189  int timediff(abs(t.msecsTo(m_lastPopup)));
190  int timecut(m_lastPopupWasQMenu?300:100);
191  if (timediff>timecut) {
192  m_lastPopup = t;
193  QString txt;
194  QMouseEvent*mouseEvent = dynamic_cast<QMouseEvent*>(event);
195  if (mouseEvent) {
196  txt = event->type()==QEvent::MouseButtonDblClick?"Dbl-click"
197  :(mouseEvent->button()&Qt::LeftButton?"Left-click"
198  :(mouseEvent->button()&Qt::RightButton?"Right-click":"Middle-click"));
199  } else {
200  QWheelEvent * wheelEvent = dynamic_cast<QWheelEvent*>(event);
201  if (wheelEvent)
202  txt = "wheel";
203  else
204  txt = "Unknown event";
205  }
206  // std::cout<<"Popup (dt="<<timediff<<") "<<txt.toStdString()<<". watched = "<<watched
207  // <<" (on="<<watched->objectName().toStdString()<<")"
208  // <<" (cn="<<watched->metaObject()->className()<<")"
209  // <<std::endl;
210  QLabel * label = new QLabel(txt,0,Qt::Tool|Qt::FramelessWindowHint
211  |Qt::X11BypassWindowManagerHint|Qt::WindowStaysOnTopHint);
212  label->setStyleSheet("background-color: yellow;color: black;"
213  "font: bold 140%;border: 2px solid black");
214  //"border-radius: 3px;"
215  label->setFrameStyle(QFrame::StyledPanel);
216  label->setAttribute(Qt::WA_ShowWithoutActivating);
217  label->setFocusPolicy(Qt::NoFocus);
218  QPoint p(QCursor::pos().x()-label->sizeHint().width()/2,QCursor::pos().y()-label->sizeHint().height());
219  label->move(p);
220  QTimer::singleShot(0,label,SLOT(show()));
221  QTimer::singleShot(500, label, SLOT(deleteLater()));
222  m_lastPopupWasQMenu = (dynamic_cast<QMenu*>(watched)!=0);
223  }
224  }
225  return false;
226  }
227 private:
228  QTime m_lastPopup;
230 };
231 
232 //___________________________________________________________________
234  StoreGateSvc* eventStore,
236  ISvcLocator* svcLocator,
237  IToolSvc*toolSvc,
238  VP1AvailEvents * availEvents)
239 : QObject(parent), m_d(new Imp)
240 {
241  m_d->availEvents = availEvents;
242  VP1AthenaPtrs::setPointers(eventStore,detStore,svcLocator,toolSvc);
243  m_d->eventsProcessed = 0;
244 
245  m_d->scheduler = this;
246  m_d->prioritiser = new VP1Prioritiser(this);
247  m_d->mainwindow = new VP1MainWindow(this,availEvents);//mainwindow takes ownership of available events
248 
249  m_d->batchMode = false;
250  m_d->batchUtilities = nullptr;
251  m_d->batchModeAllEvents = false;
252  m_d->batchModeNEvents = 0;
253  m_d->batchModeRandomConfig = false;
254 
255  m_d->allSystemsRefreshed = false;
256  m_d->goingtonextevent=true;
258  m_d->eraseJustAfterRefresh=false;
260  m_d->refreshtimer = new QTimer(this);
261  connect(m_d->refreshtimer, SIGNAL(timeout()), this, SLOT(processSystemForRefresh()));
262 
263  //Connect signals to ensure that prioritiser knows about present channels and their visibility:
266  connect(m_d->mainwindow->channelManager(),SIGNAL(newChannelCreated(IVP1ChannelWidget*)),this, SLOT(channelCreated(IVP1ChannelWidget*)));
268 
269  connect(m_d->mainwindow->tabManager(),SIGNAL(visibleChannelsChanged(const QSet<IVP1ChannelWidget*>&,const QSet<IVP1ChannelWidget*>&,const double&)),
270  m_d->prioritiser,SLOT(visibleChannelsChanged(const QSet<IVP1ChannelWidget*>&,const QSet<IVP1ChannelWidget*>&,const double&)));
271 
272 
273  // Init and show the main window of VP1
274  SoQt::init( m_d->mainwindow );// SoQt::init( "VP1" );
275 
276  // check if 'batch mode'
277  bool batchMode = VP1QtUtils::environmentVariableIsSet("VP1_BATCHMODE"); // ::getenv("VP1_BATCHMODE");
278  if(VP1Msg::debug()){
279  qDebug() << "VP1ExecutionScheduler:: Do we run in 'batch' mode?" << batchMode;
280  }
281  if (batchMode) {
282  VP1Msg::messageWarningAllRed("User has run VP1 in 'batch-mode', so the main window of the program will not be shown.");
283  m_d->batchMode = true;
284 
285  // check if the user set the "all events" option as well
286  m_d->batchModeAllEvents = VP1QtUtils::environmentVariableIsSet("VP1_BATCHMODE_ALLEVENTS");
287 
288  // check if the user set the "random configuration file" option as well
289  m_d->batchModeRandomConfig = VP1QtUtils::environmentVariableIsSet("VP1_BATCHMODE_RANDOMCONFIG");
290  }
291  else {
292  m_d->mainwindow->show();
293  }
294 
295 
297  m_d->pbtimer = new QTimer(this);
298  connect(m_d->pbtimer, SIGNAL(timeout()), this, SLOT(updateProgressBarDuringRefresh()));
301 
302  m_d->cruisemode = NONE;
303  m_d->cruisetimer = new QTimer(this);
304  connect(m_d->cruisetimer, SIGNAL(timeout()), this, SLOT(performCruise()));
306 
307  #if defined BUILDVP1LIGHT
308  bool checkDisplayMouseClicks = VP1QtUtils::expertSettingIsOn("general","ExpertSettings/VP1_DISPLAY_MOUSE_CLICKS");
309  #else
310  bool checkDisplayMouseClicks = VP1QtUtils::environmentVariableIsOn("VP1_DISPLAY_MOUSE_CLICKS");
311  #endif
312 
313  if (checkDisplayMouseClicks) {
315  qApp->installEventFilter(m_d->globalEventFilter);
316  } else {
317  m_d->globalEventFilter = 0;
318  }
319 
320  VP1AvailEvtsHttps* availEvtsHttps = dynamic_cast<VP1AvailEvtsHttps*>(availEvents);
321  if(availEvtsHttps) {
322  m_d->skipEvent = true;
324 
325  connect(auth,SIGNAL(authenticationSuccessful(QNetworkAccessManager*)),
326  availEvtsHttps,SLOT(start(QNetworkAccessManager*)));
327  connect(availEvtsHttps,SIGNAL(freshEventsChanged()),
328  auth,SLOT(accept()));
329 
330  SoQt::init(auth);
331  auth->exec();
332  delete auth;
333  }
334  else
335  m_d->skipEvent = false;
336 }
337 
338 //___________________________________________________________________
340 {
341  m_d->refreshtimer->stop();
342  delete m_d->batchUtilities;
343  delete m_d->mainwindow;
344  delete m_d->prioritiser;
345  delete m_d->globalEventFilter;
346  delete m_d;
347 }
348 
349 //___________________________________________________________________
352  ISvcLocator* svcLocator,
353  IToolSvc*toolSvc,
354  QStringList joboptions,
355  QString initialCruiseMode,
356  unsigned initialCruiseSeconds,
357  QString singleEventSource,
358  QString singleEventLocalTmpDir,
359  unsigned localFileCacheLimit,
360  QStringList availableLocalInputDirectories )
361 {
362  //First we make sure the DISPLAY variable is set (importing ROOT in
363  //athena.py might cause it to be unset!).
364  //
365  //NB: The following might only be relevant in X11 build:
366  if (VP1QtUtils::environmentVariableValue("DISPLAY").isEmpty()) {
367  const bool unset(!VP1QtUtils::environmentVariableIsSet("DISPLAY"));
368  QString alternative = VP1QtUtils::environmentVariableValue("DISPLAY_ORIG");
369  if (alternative.isEmpty()) {
370  VP1Msg::message("ERROR: The DISPLAY environment variable is "+QString(unset?"not set":"empty")+".");
371  VP1Msg::message("This might be because something else in Athena has disabled it.");
372  VP1Msg::message("You can work around this problem by setting "
373  "the DISPLAY_ORIG environment variable to the contents of DISPLAY before launching your job.");
374  VP1Msg::message("E.g., in bash do:");
375  VP1Msg::message(" export DISPLAY_ORIG=$DISPLAY");
376  VP1Msg::message("");
377  VP1Msg::message("For the current job, I will try with DISPLAY=\":0.0\", which is the correct value when running locally.");
378  alternative=":0.0";
379  } else {
380  VP1Msg::message("WARNING: The DISPLAY environment variable is "+QString(unset?"not set":"empty")+". Setting to value found in DISPLAY_ORIG");
381  }
382  VP1Msg::message("WARNING: Setting DISPLAY variable to '"+alternative+"'");
383  VP1QtUtils::setEnvironmentVariable("DISPLAY",alternative);
384  }
385 
386 
387 
388  QCoreApplication::setOrganizationName("ATLAS");
389  #if defined BUILDVP1LIGHT
390  QCoreApplication::setApplicationName("VP1Light");
391  #else
392  QCoreApplication::setApplicationName("VP1");
393  #endif
394  QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL);
395 
396 
397 
398  // here we check if the main (and unique!) Qt application has been initialized already. If not we initialize it.
399  if (qApp) {
400  VP1Msg::message("VP1ExecutionScheduler::init ERROR: QApplication already initialized. Expect problems!!!");
401  } else {
402  //NB: Static to avoid scope-problems:
403  static int argc=1;
404  static char execpath[] = "/some/fake/executable/vp1";
405  static char *argv[2];
406  // VP1Msg::messageDebug("setting argv[0]...");
407  argv[0] = execpath;
408  // VP1Msg::messageDebug("setting argv[1]...");
409  argv[1] = NULL;
410  // instead of using the default Qt QApplication class,
411  // we now use our custom inherited class where we
412  // reimplemented the notify() method, in order to catch
413  // C++ exceptions, especially while running it inside Athena.
414  //new QApplication(argc, argv);
415  new VP1QtApplication(argc, argv);
416  }
417 
418  VP1AvailEvents * availEvents(0);
419  if (!singleEventSource.isEmpty()&&!singleEventLocalTmpDir.isEmpty()) {
420  const bool httpmode = singleEventSource.startsWith("http://");
421  const bool httpsmode = singleEventSource.startsWith("https://");
422  //Create appropriate instance:
423  if (httpmode) {
424  availEvents = new VP1AvailEvtsHttp(singleEventSource, 60/*update interval*/, 30*60/*time cut for new*/, singleEventLocalTmpDir,localFileCacheLimit);
425  } else if(httpsmode) {
426  availEvents = new VP1AvailEvtsHttps(singleEventSource, 1000/*update interval*/, 30*60/*time cut for new*/, singleEventLocalTmpDir,localFileCacheLimit);
427  } else {
428  availEvents = new VP1AvailEvtsLocalDir(5*60/*time cut for new*/, singleEventSource,
429  singleEventLocalTmpDir,localFileCacheLimit);
430  static_cast<VP1AvailEvtsLocalDir*>(availEvents)->setAvailableSourceDirectories(availableLocalInputDirectories);
431 
432  }
433 
434  }
435 
436  VP1ExecutionScheduler*scheduler = new VP1ExecutionScheduler(0,eventStore,detStore,svcLocator,toolSvc,availEvents);
437 
438  //Pass on "joboptions"
439  if (joboptions.empty()) {
440  //scheduler->m_d->mainwindow->tabManager()->addNewTab("My Tab");
441  } else {
442  qDebug() << "config files: " << joboptions; // DEBUG
443  for (QString opt : joboptions)
445 
446  if ( scheduler->m_d->batchMode ) {
447  if (scheduler->m_d->batchModeRandomConfig ) {
448  if (joboptions.size() != 0 ) {
449  scheduler->m_d->batchUtilities = new VP1BatchUtilities( qstringlistToVecString(joboptions) );
450  }
451  }
452  QString batchNevents = VP1QtUtils::environmentVariableValue("VP1_BATCHMODE_NEVENTS");
453  if (batchNevents > 0 ) {
454  scheduler->m_d->batchModeNEvents = batchNevents.toInt();
455  }
456  }
457  }
458 
459 
460  if (scheduler->m_d->mainwindow->tabWidget_central->count()<=1) {
461  if (initialCruiseMode=="TAB") {
462  VP1Msg::message("ERROR: Can not start in cruisemode TAB unless there are at least 2 tabs loaded from initial .vp1 files. Reverting to cruise mode NONE.");
463  initialCruiseMode="NONE";
464  } else if (initialCruiseMode=="BOTH") {
465  VP1Msg::message("ERROR: Can not start in cruisemode BOTH unless there are at least 2 tabs loaded from initial .vp1 files. Reverting to cruise mode EVENT.");
466  initialCruiseMode="EVENT";
467  }
468  }
469 
470  //Set default value of cruisemode (dont use setCruiseMode() since it starts timers):
471  if (initialCruiseMode=="EVENT") {
472  scheduler->m_d->cruisemode=EVENT;
473  scheduler->m_d->mainwindow->radioButton_cruise_event->setChecked(true);
474  scheduler->m_d->mainwindow->pushButton_cruise->setChecked(true);
475 
476  } else if (initialCruiseMode=="TAB") {
477  scheduler->m_d->cruisemode=TAB;
478  scheduler->m_d->mainwindow->radioButton_cruise_tab->setChecked(true);
479  scheduler->m_d->mainwindow->pushButton_cruise->setChecked(true);
480  } else if (initialCruiseMode=="BOTH") {
481  scheduler->m_d->cruisemode=BOTH;
482  scheduler->m_d->mainwindow->radioButton_cruise_both->setChecked(true);
483  scheduler->m_d->mainwindow->pushButton_cruise->setChecked(true);
484  } else {
485  if (initialCruiseMode!="NONE")
486  VP1Msg::message("ERROR: unknown initial cruise mode "+initialCruiseMode+" (valid are NONE/EVENT/TAB/BOTH). Assuming NONE.");
487  scheduler->m_d->cruisemode=NONE;
488  scheduler->m_d->mainwindow->radioButton_cruise_event->setChecked(true);
489  scheduler->m_d->mainwindow->pushButton_cruise->setChecked(false);
490  }
491 
492  scheduler->m_d->mainwindow->request_cruisemodechange();
493 
494  int cruisesecs = ( initialCruiseSeconds == 0 ? 0 :
495  std::max(scheduler->m_d->mainwindow->spinBox_cruise->minimum(),
496  std::min(scheduler->m_d->mainwindow->spinBox_cruise->maximum(),
497  static_cast<int>(initialCruiseSeconds))));
498  if ( cruisesecs>0 )
499  scheduler->m_d->mainwindow->spinBox_cruise->setValue(cruisesecs);
500 
501 
502  return scheduler;
503 }
504 
505 //___________________________________________________________________
507 {
508  #if defined BUILDVP1LIGHT
509  bool checkEnableInformOnEndOfJob = VP1QtUtils::expertSettingIsOn("expert","ExpertSettings/VP1_ENABLE_INFORM_ON_END_OF_JOB");
510  #else
511  bool checkEnableInformOnEndOfJob = VP1QtUtils::environmentVariableIsOn("VP1_ENABLE_INFORM_ON_END_OF_JOB");
512  #endif
513 
514  if (checkEnableInformOnEndOfJob && ( !scheduler||!(scheduler->m_d->mainwindow->userRequestedExit()) ) )
515  QMessageBox::information(0, "End of job reached",Qt::convertFromPlainText("Job about to end.\n\nThis is most"
516  " likely since there are no more available events to process."),QMessageBox::Ok,QMessageBox::Ok);
517 
518  if (scheduler) {
519  delete scheduler;
520 // qApp->processEvents(QEventLoop::DeferredDeletion); // Qt 4
521  qApp->processEvents(); // Qt 5
522  qApp->deleteLater(); // Qt 5
523 
526 
527  delete qApp;
528  SoQt::done();
529  }
530 
531 
532 
533  const QString quickExitEnv("VP1_HARD_EXIT_AT_END");
534 
535  #if defined BUILDVP1LIGHT
536  bool checkHardExitAtEnd = VP1QtUtils::expertSettingIsOn("expert","ExpertSettings/"+quickExitEnv);
537  #else
538  bool checkHardExitAtEnd = VP1QtUtils::environmentVariableIsOn(quickExitEnv);
539  #endif
540 
541  if (checkHardExitAtEnd) {
542  VP1Msg::message("Hard job exit (unset "+quickExitEnv+" to disable this behaviour).");
543  exit(0);
544  }
545 
546 }
547 
548 //___________________________________________________________________
550 {
552  if (remaining>0.0) {
553  pb->setMaximum(static_cast<int>((calctimethisevent+remaining)*10.0));
554  pb->setValue(static_cast<int>((calctimethisevent)*10.0));
555  pb->show();
556  if (!pbtimer->isActive())
557  pbtimer->start(40);//25 "frames"/second. If it is good enough for TV, it is good enough for us.
558  } else {
559  calctimethisevent=0.0;
560  pb->hide();
561  pb->reset();
562  pbtimer->stop();
563  }
564 }
565 //___________________________________________________________________
567 {
569  return;
570  double timing=(m_d->prioritiser->elapsedTiming_Refresh())*0.95;//The *0.95 is to give a smoother overall impression.
572  return;
573  m_d->pb->setValue(static_cast<int>((m_d->calctimethisevent+timing)*10.0));
574 }
575 
576 
577 //___________________________________________________________________
579 {
580  return m_d->nextRequestedEvent;
581 }
582 
583 //___________________________________________________________________
585 {
587 }
588 
589 //___________________________________________________________________
590 bool VP1ExecutionScheduler::executeNewEvent(const int& runnumber, const unsigned long long& eventnumber, const unsigned& triggerType, const unsigned& time)
591 {
592  VP1Msg::messageDebug("VP1ExecutionScheduler::executeNewEvent()");
593 
595 
596 #if defined BUILDVP1LIGHT
597  unused(runnumber,eventnumber,triggerType,time); // silences the "unused parameter" warnings when building VP1Light. In this case, in fact, those variables will be used later in loadEvent().
598  if ( !firstlaunch ) {
599  if ( (getEvtNr() >= 0) && (getEvtNr() < m_totEvtNr) ) { // If selected event number is available in file
600  loadEvent();
601  //Pass the event to the AOD System
603  for (itsys = m_d->mainwindow->tabManager()->selectedChannelWidget()->systems().begin();itsys!=itsysE;++itsys) {
604  if((*itsys)->name()=="Analysis"){
605  passEvent(*itsys);
606  }
607  }
608  }
609  else if ( (getEvtNr() < 0) && (getEvtNr() >= m_totEvtNr) ) {
610  QMessageBox msgBox;
611  msgBox.setWindowTitle("No more events");
612  msgBox.setText("There are no more events in this file. Returning to previous event.");
613  msgBox.setIcon(QMessageBox::Icon::Information);
614  msgBox.exec();
615  }
616  }
617  else{
618  firstlaunch = false;
619  }
620 #else
622 #endif
623 
624  m_d->goingtonextevent = false;
628 
629  assert(!m_d->refreshtimer->isActive());//fixme: -> if.
630 
631 
632  VP1Msg::messageDebug("calling refreshtimer->start()...");
633  m_d->refreshtimer->start();
634 
635  VP1Msg::messageDebug("calling initCruise...");
636  m_d->initCruise();
637  VP1Msg::messageDebug("initCruise called.");
638 
639  //Flush event queue before reenabling controllers, etc.:
640  qApp->processEvents();
641  VP1Msg::messageDebug("qApp->processEvents() called.");
642 
643  //Enable various user input:
644  m_d->mainwindow->groupBox_channelcontrols->setEnabled(true);
645  m_d->mainwindow->groupBox_cruise->setEnabled(true);
646  m_d->mainwindow->groupBox_event->setEnabled(true);
647 
648 
650 
651  if (m_d->batchModeRandomConfig) {
652  VP1Msg::messageDebug("User chose 'batch' and 'batch-random-config'. So we now replace the configuration with a random one from the input set...");
653  QString randomConfigFile = QString::fromStdString( m_d->batchUtilities->getRandomConfigFile() );
654  m_d->mainwindow->replaceConfigurationFile(randomConfigFile);
655  }
656 
657  if ( m_d->batchMode && m_d->allVisibleRefreshed() ) { // or m_d->allSystemsRefreshed ???
658  VP1Msg::messageDebug("We're in batch mode, skipping the execution of the GUI...");
659  } else {
661  if(m_d->skipEvent) {
662  VP1Msg::messageDebug("skipEvent");
663  m_d->skipEvent=false;
665  }
666  else {
667  VP1Msg::messageDebug("calling qApp->exec()...");
668  qApp->exec();//NOTE!!! We then exit the exec() when someone pushes the "next event" button.
669  }
670  }
671 
672  VP1Msg::messageDebug("Disabling user inputs...");
673  //Disable various user input:
674  m_d->mainwindow->groupBox_channelcontrols->setEnabled(false);
675  m_d->mainwindow->groupBox_cruise->setEnabled(false);
676  m_d->mainwindow->groupBox_event->setEnabled(false);
677 
678  m_d->goingtonextevent = true;
679 
680  if (m_d->refreshtimer->isActive()) {
681  m_d->refreshtimer->stop();
682  }
683  m_d->pb->hide();
684  m_d->pb->reset();
685  m_d->pbtimer->stop();
686  //Fixme: Refresh all accumulators that still needs refresh (or just have the button disabled until now)
687 
688  //Fixme: wait here until end of any active refreshing...
689 
690  VP1Msg::messageDebug("Erasing systems...");
691  assert(!m_d->currentsystemrefreshing);
693  qApp->processEvents(QEventLoop::ExcludeUserInputEvents|QEventLoop::ExcludeSocketNotifiers);
694  eraseSystem(s);
695  }
696 
697  ++m_d->eventsProcessed; // we don't use Athena's tools for this, so we can use this in VP1Light as well.
698  VP1Msg::messageDebug("event processed. " + QString::number(m_d->eventsProcessed) + " events processed so far.");
699 
700  //Let channels know we are going to the next event now:
702  cw->goingToNextEvent();
703  }
704 
705  qApp->processEvents(QEventLoop::ExcludeUserInputEvents|QEventLoop::ExcludeSocketNotifiers);
706 
707 
708  VP1Msg::messageDebug("mainwindow->mustQuit ? " + QString::number(m_d->mainwindow->mustQuit()) );
709  return !m_d->mainwindow->mustQuit();
710 }
711 
712 //___________________________________________________________________
714 
715  VP1Msg::messageDebug("VP1ExecutionScheduler::eraseSystem()");
716 
717  assert(s->state()==IVP1System::REFRESHED);
718  // cppcheck-suppress assertWithSideEffect
719  assert(!s->isRefreshing());
720 
721  QString base = QString(s->name())+" from channel "+s->channel()->unique_name();
722  m_d->mainwindow->statusBar()->showMessage( "Erasing system ["+base+"]" );
723  VP1Msg::messageDebug("ERASING - " + base);
724 
725  s->disallowUpdateGUI();
726  s->erase();//fixme: time?
727  s->setState(IVP1System::ERASED);
728  m_d->mainwindow->statusBar()->showMessage( "Post-erase update to channel ["+base+"]" );
729  s->channel()->systemErased(s);//fixme: time?
730  m_d->mainwindow->statusBar()->clearMessage();
731 }
732 
733 //___________________________________________________________________
735  IVP1System*s = static_cast<IVP1System*>(sender());
736  assert(s);
737  if (m_d->currentsystemrefreshing!=s) {
738  eraseSystem(s);
739  } else {
740  // cppcheck-suppress assertWithSideEffect
741  assert(s->isRefreshing());
743  }
744 }
745 
746 //___________________________________________________________________
748 {
749  assert(!m_d->goingtonextevent);
751  return;
752 
754  if (s) {
755  refreshSystem(s);
756  } else {
757  assert(m_d->refreshtimer->isActive());//fixme: -> if. ???
758  //if (refreshtimer->isActive())
759  m_d->refreshtimer->stop();
760  m_d->pb->hide();
761  m_d->pb->reset();
762  m_d->pbtimer->stop();
763  }
764 }
765 
766 //___________________________________________________________________
768 {
769  std::set<IVP1System*>::const_iterator it, itE = cw->systems().end();
770  for (it=cw->systems().begin();it!=itE;++it) {
771  qInfo() << "System name:" << (*it)->name();
772  connect(*it,SIGNAL(inactiveSystemTurnedActive()),this,SLOT(startRefreshQueueIfAppropriate()));
773  connect(*it,SIGNAL(needErase()),this,SLOT(systemNeedErase()));
774  #ifdef BUILDVP1LIGHT
775  connect(*it,SIGNAL(signalLoadEvent(IVP1System*)),this,SLOT(passEvent(IVP1System*)));
776  #endif // BUILDVP1LIGHT
777  }
779 
780 }
781 
782 //___________________________________________________________________
784 {
785  std::set<IVP1System*>::const_iterator it, itE = cw->systems().end();
786  for (it=cw->systems().begin();it!=itE;++it)
787  disconnect(*it,SIGNAL(inactiveSystemTurnedActive()),this,SLOT(startRefreshQueueIfAppropriate()));
788 }
789 
790 //___________________________________________________________________
792 {
793  if (!m_d->goingtonextevent&&!m_d->refreshtimer->isActive())
794  m_d->refreshtimer->start();
795 }
796 
797 //___________________________________________________________________
799 {
801 }
802 
803 //___________________________________________________________________
805 {
806  QString sysname = s->name();
807  VP1Msg::messageDebug("VP1ExecutionScheduler::refreshSystem() - system: " + sysname);
808 
810 
811  assert(s->state()==IVP1System::ERASED);
812  assert(s->activeState()==IVP1System::ON);
813  assert(!m_d->currentsystemrefreshing);
814 
817 
818  QString base = QString(s->name())+" from channel "+s->channel()->unique_name();
819  m_d->mainwindow->statusBar()->showMessage( "Refreshing system ["+base+"]" );
820 
821  s->allowUpdateGUI();
822  s->setRefreshing(true);
824  s->channel()->emitRefreshInfoChanged();
825  s->refresh(VP1AthenaPtrs::eventStore());
826  s->setState(IVP1System::REFRESHED);
827  s->setRefreshing(false);
828  s->disallowUpdateGUI();
829 
830  m_d->mainwindow->statusBar()->showMessage( "Post-refresh update to channel ["+base+"]" );
831  s->channel()->systemRefreshed(s);//fixme: time independently?
832 
833  m_d->mainwindow->statusBar()->clearMessage();
838 
840  s->channel()->emitRefreshInfoChanged();
841 
842  VP1Msg::messageDebug("checking if all systems have refreshed...");
843  if (hasAllActiveSystemsRefreshed(s->channel())) {
844 
845  VP1Msg::messageDebug("All systems refreshed! - last system refreshed! - system: " + sysname);
846  s->channel()->lastOfActiveSystemsRefreshed();
847 
848  m_d->allSystemsRefreshed = true; // check if that is fine for multiple channels window: i.e. VP1 instances with a couple of 3DCkocktail windows, for example.
849 
850  } // end of hasAllActiveSystemsRefreshed()
851 
853 
854  if (m_d->eraseJustAfterRefresh) {
855  //Someone asked to erase the system while it was refreshing!
856  m_d->eraseJustAfterRefresh=false;
857  //Check that it still needs to (maybe it was flicked back to ON by the impatient user)
858  if (s->activeState()==IVP1System::OFF)
859  eraseSystem(s);
860  }
864  }
865 
866  VP1Msg::messageDebug("end of refreshing the system: " + sysname);
867 
868 // // if in "batch mode", now exit from VP1
869 // if (m_d->batchMode) {
870 //
873 //
874 // VP1Msg::messageWarningRed("'batch mode'. Now exiting VP1");
875 //
876 // // N.B. calling QApplication::quit() here it makes move to the next event;
877 // // NOTE!!!! It can be useful for a batch mode on all events of one single file!!
878 // // TODO: An additional switch to the command line batch option should be implemented
879 // //QApplication::quit();
880 //
881 // //for the moment, we only quit VP1.
882 // //To quit the application completely, we have to call "MainWindow::close()"
883 // m_d->mainwindow->close();
885 //
886 // }
887 
888  // ***************************
889  // we now run all the things
890  // that need to be done
891  // after all tabs are drawn...
892  // ***************************
893  if ( hasAllActiveSystemsRefreshed(s->channel()) ) {
894 
895 
896  if (m_d->batchMode) {
897 
898  VP1Msg::messageDebug("we are in 'batch-mode'...");
899  VP1Msg::messageDebug("batchModeNEvents: " + QString::number(m_d->batchModeNEvents) + " - m_d->eventsProcessed: " + QString::number(m_d->eventsProcessed) );
900 
901  // saving the snapshot of the 3D window to a file
902  QString save_ok = saveSnaphsotToFile(s, true);
903  if (save_ok == "") {
904  VP1Msg::messageWarningAllRed("FAILED! The snapshot for the channel '" + s->channel()->name() + "' has not been saved!");
905  } else {
906  VP1Msg::message("OK! Snapshot saved to file: " + save_ok);
907  }
908 
909 
910  if (m_d->batchModeAllEvents) {
911  VP1Msg::messageWarningAllRed("******************************************************************");
912  VP1Msg::messageWarningAllRed("'batch mode' with 'all events' option. Moving to the next event...");
913  VP1Msg::messageWarningAllRed("******************************************************************");
914  // N.B. calling QApplication::quit() here it makes VP1 move to the next event;
915  QApplication::quit();
916  // Now, VP1ExecutionScheduler::executeNewEvent() will end, then VP1Gui::executeNewEvent() will end, then they will start again: first VP1Gui then VP1ExecutionScheduler.
917  } else if ( m_d->batchModeNEvents > 0 ) {
918  if ( m_d->batchModeNEvents == m_d->eventsProcessed+1) { // here we use +1 because this is performed after the creation of the event snapshot. //TODO: maybe we can move this to a more natural place, at the beginning or at the end of an event
919  VP1Msg::messageWarningAllRed("******************************************************************");
920  VP1Msg::messageWarningAllRed("'batch mode' with 'batch-n-events' option. Processed the " + QString::number(m_d->eventsProcessed+1) + " events set by the user. Now exiting VP1");
921  VP1Msg::messageWarningAllRed("******************************************************************");
922  m_d->mainwindow->close();
923  } else {
924  VP1Msg::messageWarningAllRed("'batch mode' with 'batch-n-events' option. Moving to the next event...");
925  // N.B. calling QApplication::quit() here it makes VP1 move to the next event;
926  QApplication::quit();
927  // Now, VP1ExecutionScheduler::executeNewEvent() will end, then VP1Gui::executeNewEvent() will end, then they will start again: first VP1Gui then VP1ExecutionScheduler.
928  }
929  }
930  else {
931  // We come here if the user did not choose to run batch mode on all events.
932  // Thus, we want to close VP1 completely.
933  // So, in order to do that, we have to call "MainWindow::close()"
934  VP1Msg::messageWarningRed("'batch mode'. Done. Now exiting VP1");
935  m_d->mainwindow->close();
936  }
937 
938 
939  }
940  }
941 }
942 
943 //___________________________________________________________________
945 {
946  QString chnlname = s->name().toLower();
947  VP1Msg::messageDebug("VP1ExecutionScheduler::saveSnaphsotToFile() - taking the snapshot of the channel " + chnlname );
948 
949  QString currentsaveimagepath = VP1Settings::defaultFileSelectDirectory() + QDir::separator();
950 
951 
952  if (batch) {
953 
954  VP1Msg::messageDebug("Note: 'batch-mode'");
955 
956 
957  // A FOLDER CONTAINER
958  QString folderName = "";
959 
960  // check if use specified an output folder for the batch job
961  QString batchOutFolder = VP1QtUtils::environmentVariableValue("VP1_BATCHMODE_OUT_FOLDER"); // ::getenv("VP1_BATCHMODE");
962  if ( ! (batchOutFolder == "") ) {
963  VP1Msg::messageDebug("Setting 'batch' output folder from user's settings");
964  folderName = batchOutFolder;
965  }
966  else
967  folderName = "atlas_vp1_batch_images";
968 
969  // check if the folder already exists, if not make a new folder
970  QDir dir(folderName);
971  if (!dir.exists()) {
972  dir.mkpath(".");
973  }
974 
975  QString folder;
976  if (folderName.startsWith("/"))
977  folder = folderName + QDir::separator();
978  else
979  folder = currentsaveimagepath + folderName + QDir::separator();
980 
981  VP1Msg::messageDebug("folder set: " + folder);
982 
983 
984  // EVENT INFO AND TIMESTAMP
985 
986  QString runnumb = QString::number(m_d->mainwindow->getRunNumber());
987  QString evnumb = QString::number(m_d->mainwindow->getEventNumber());
988  QString evtimestamp = QString::number(m_d->mainwindow->getEventTimestamp());
989 
990  time_t t_evttimestamp = m_d->mainwindow->getEventTimestamp();
991  tm * human_evtimestamp = localtime(&t_evttimestamp);
992 
993  std::ostringstream h_evtimestamp_ostri;
994  h_evtimestamp_ostri << 1900 + human_evtimestamp->tm_year
995  << "-" << 1 + human_evtimestamp->tm_mon // tm_mon is in the range [0, 11], so 1 must be added to get real months
996  << "-" << human_evtimestamp->tm_mday
997  << "T" << human_evtimestamp->tm_hour << "-" << human_evtimestamp->tm_min << "-" << human_evtimestamp->tm_sec << "CEST";
998 
999  std::string h_evtimestamp_str = h_evtimestamp_ostri.str();
1000  QString h_evtimestamp = QString::fromStdString(h_evtimestamp_str);
1001 
1002  // IMAGE TIMESTAMP
1003 
1004  time_t t_timestamp = time(0); // get time now;
1005  tm *ltm = localtime(&t_timestamp);
1006 
1007  // print various components of tm structure.
1008  VP1Msg::messageDebug( "Year: "+ QString::number(1900 + ltm->tm_year)
1009  + " - " + "Month: " + QString::number(1 + ltm->tm_mon) + " - " // tm_mon is in the range [0, 11], so 1 must be added to get real months
1010  + "Day: " + QString::number(ltm->tm_mday)
1011  + " - " "Time: " + QString::number(ltm->tm_hour) + ":" + QString::number(ltm->tm_min) + ":" + QString::number(ltm->tm_sec) + "CEST");
1012 
1013  std::ostringstream ostri_unix;
1014  ostri_unix << t_timestamp;
1015 
1016  std::ostringstream ostri;
1017  ostri << 1900 + ltm->tm_year
1018  << "-" << 1 + ltm->tm_mon // tm_mon is in the range [0, 11], so 1 must be added to get real months
1019  << "-" << ltm->tm_mday
1020  << "T" << ltm->tm_hour << "-" << ltm->tm_min << "-" << ltm->tm_sec << "CEST";
1021 
1022  std::string unixTimestamp = ostri_unix.str();
1023  std::string humanTimestamp = ostri.str();
1024  QString q_unixTimestamp = QString::fromStdString(unixTimestamp);
1025  QString q_humanTimestamp = QString::fromStdString(humanTimestamp);
1026  VP1Msg::messageDebug("Unix timestamp: " + q_unixTimestamp );
1027  VP1Msg::messageDebug("'human readable' timestamp: " + q_humanTimestamp );
1028 
1029  /* channel's name is the name of the last channel updated by the executer,
1030  * i.e. the name changes according to the order the channels are refreshed.
1031  * Thus, we don't use the channel's name in the filename,
1032  * because it could be misleading.
1033  */
1034  //QString filename = currentsaveimagepath + "vp1_" + chnlname + "_snapshot_" + q_humanTimestamp + ".png";
1035  QString filename = folder + "vp1_batch_snapshot_r" + runnumb + "_ev" + evnumb + "_evtime_H" + h_evtimestamp + "_U" + evtimestamp + "___imgtime_H" + q_humanTimestamp + "_U" + q_unixTimestamp + ".png";
1036 
1037  // taking the actual snapshot
1038  QPixmap pm = s->channel()->getSnapshot();
1039  if (pm.isNull()) {
1040  VP1Msg::messageDebug("QPixmap is null! returning...");
1041  return QString();
1042  }
1043 
1044  // saving to file
1045  pm.save(filename);
1046 
1047  // save last-saved image filename to working dir
1048  QString latestImageFileName = currentsaveimagepath + QString("latest_vp1image");
1049  QFile latestImage(latestImageFileName);
1050  if(latestImage.exists() && !latestImage.remove())
1051  throw std::runtime_error("Unable to overwrite the existing latest image file");
1052  if(!latestImage.open(QIODevice::WriteOnly | QIODevice::Text))
1053  throw std::runtime_error("Unable to create new latest image file");
1054  latestImage.write(filename.toStdString().c_str());
1055  latestImage.close();
1056 
1057 
1058  return filename;
1059  }
1060 
1061  // default exit
1062  return QString();//filename;
1063 
1064 }
1065 
1066 
1067 
1068 //___________________________________________________________________
1070 {
1071  assert(cw->state()==IVP1ChannelWidget::CONSTRUCTED);
1072 
1073  connect(cw,SIGNAL(message(const QString&)),m_d->mainwindow,SLOT(channelAddToMessageBox(const QString&)));
1074 
1075  std::set<IVP1System *>::iterator itsys, itsysE = cw->systems().end();
1076  for (itsys = cw->systems().begin();itsys!=itsysE;++itsys) {
1077  assert((*itsys)->state()==IVP1System::CONSTRUCTED);
1078  connect((*itsys),SIGNAL(sysmessage(const QString&)),m_d->mainwindow,SLOT(systemAddToMessageBox(const QString&)));
1079  }
1080  itsysE = cw->systems().end();
1081  for (itsys = cw->systems().begin();itsys!=itsysE;++itsys) {
1082  (*itsys)->setCanRegisterController(true);
1083  (*itsys)->create(VP1AthenaPtrs::detectorStore());
1084  (*itsys)->setCanRegisterController(false);
1085  (*itsys)->setState(IVP1System::ERASED);
1086  }
1087  assert(cw->state()==IVP1ChannelWidget::CONSTRUCTED);
1088  cw->setCanRegister(true,false);//Ok to register controllers during create.
1089  cw->create();
1090  cw->setCanRegister(false,false);
1092 
1093  assert(cw->state()==IVP1ChannelWidget::READY);
1094  //Fixme: statusbar!!!!!
1095 }
1096 
1097 //___________________________________________________________________
1099 {
1100  assert(cw->state()==IVP1ChannelWidget::READY);
1101  if (m_d->currentsystemrefreshing&&cw->systems().find(m_d->currentsystemrefreshing)!=cw->systems().end()) {
1104  } else {
1106  }
1107 }
1108 
1109 //___________________________________________________________________
1111 {
1112  assert(cw->state()==IVP1ChannelWidget::READY);
1113  cw->setUpdatesEnabled(false);//Just because...
1114 
1115  //From this point on, we are not interested in signals from the channel (and its systems) that could disturb us:
1116  std::set<IVP1System *>::iterator itsys, itsysE = cw->systems().end();
1117  for (itsys = cw->systems().begin();itsys!=itsysE;++itsys) {
1118  (*itsys)->blockSignals(true);
1119  disconnect(*itsys,0,0,0);
1120  }
1121  cw->blockSignals(true);
1122  disconnect(cw,0,0,0);
1123 
1124  //Make sure that all systems gets in the ERASED state. Throw assert if any is presently refreshing (BAD PROGRAMMER!!)
1125  for (itsys = cw->systems().begin();itsys!=itsysE;++itsys) {
1126  assert(m_d->currentsystemrefreshing!=(*itsys));
1127  if ((*itsys)->state()==IVP1System::REFRESHED)
1128  eraseSystem(*itsys);
1129  }
1130 
1131  //Uncreate systems:
1132  for (itsys = cw->systems().begin();itsys!=itsysE;++itsys) {
1133  assert((*itsys)->state()==IVP1System::ERASED);
1134  (*itsys)->uncreate();
1135  (*itsys)->setState(IVP1System::UNCREATED);
1136  }
1137 
1138  //Uncreate channel:
1139  assert(cw->state()==IVP1ChannelWidget::READY);
1140  cw->uncreate();//Fixme: Return codes!!
1142 
1143  assert(cw->state()==IVP1ChannelWidget::UNCREATED);
1144 
1145  cw->deleteControllers();//Also deletes system controllers.
1146 
1147  //Delete:
1148  cw->deleteLater();
1149 
1150 }
1151 
1152 //___________________________________________________________________
1154 {
1155  QSet<QWidget*> w_ignore;
1156 #if QTCORE_VERSION >= 0x050E00
1157  QList<QWidget*> widgets = QApplication::allWidgets();
1158  QSet<QWidget*> wl (widgets.begin(), widgets.end());
1159 #else
1160  QSet<QWidget*> wl = QApplication::allWidgets().toSet();
1161 #endif
1162  w_ignore<<qApp->desktop();
1163  for (QObject*o : qApp->children()) {
1164  if (o->isWidgetType())
1165  w_ignore << static_cast<QWidget*>(o);
1166  }
1167  for (QWidget * w : wl) {
1168  if (w->objectName().startsWith("internal clipboard"))
1169  w_ignore << w;
1170  if (w->objectName()=="empty_widget")
1171  w_ignore << w;
1172  }
1173  wl.subtract(w_ignore);
1174  if (!wl.empty()) {
1175  std::cout<<std::endl;
1176  std::cout<<"VP1 WARNING: "<<wl.count()<< " widget"<<(wl.count()>1?"s":"")<<" left at end of job:"<<std::endl;
1177  int i(0);
1178  for (QWidget*w : wl) {
1179  std::cout<<++i<<") Address="<<w<<", ObjectName="<<w->objectName().toStdString()<<", ClassName="<<w->metaObject()->className()<<std::endl;
1180  }
1181  std::cout<<std::endl;
1182  }
1183 }
1184 
1185 //___________________________________________________________________
1187 {
1188  VP1Msg::messageDebug("VP1ExecutionScheduler::hasAllActiveSystemsRefreshed() - channelWidget: " + cw->name());
1189 
1190  std::set<IVP1System*>::const_iterator it, itE = cw->systems().end();
1191  int i=0;
1192  for (it=cw->systems().begin();it!=itE;++it) {
1193 
1194  /*
1195  * enum State { CONSTRUCTED=0, REFRESHED, ERASED, UNCREATED };
1196  * enum ActiveState { ON=0, OFF };//Whether it is part of the erase/refresh cycle.
1197  */
1198  if (VP1Msg::verbose()) {
1199  QString name = QString((*it)->name());
1200  QString active = QString::number((*it)->activeState());
1201  QString state = QString::number((*it)->state());
1202  std::cout << i << " - name: " << name.toStdString() << " - active: " << active.toStdString() << " - refreshed: " << state.toStdString() << std::endl;
1203  }
1204  if ((*it)->activeState()==IVP1System::ON&&(*it)->state()!=IVP1System::REFRESHED)
1205  return false;
1206 
1207  i++;
1208  }
1209 
1210  return true;
1211 }
1212 
1213 //___________________________________________________________________
1215 {
1216  for (IVP1ChannelWidget*cw : mainwindow->tabManager()->visibleChannels())
1217  if (!scheduler->hasAllActiveSystemsRefreshed(cw))
1218  return false;
1219  return true;
1220 }
1221 
1222 //___________________________________________________________________
1224 {
1225  for (IVP1ChannelWidget*cw : mainwindow->tabManager()->soonVisibleChannels())
1226  if (!scheduler->hasAllActiveSystemsRefreshed(cw))
1227  return false;
1228  return true;
1229 }
1230 
1231 //___________________________________________________________________
1233 
1234  //Abort if not in cruise mode, or if the system just refreshed did
1235  //not make cw fully refreshed:
1236  if (cruisemode==NONE||!scheduler->hasAllActiveSystemsRefreshed(cw))
1237  return;
1238 
1239  if (cruisemode==EVENT) {
1240  //Abort if this refresh did not make all visible channels refreshed:
1241  if (!mainwindow->tabManager()->isVisible(cw)||!allVisibleRefreshed())
1242  return;
1243  //Start the countdown for the next event:
1244  assert(!cruisetimer->isActive());
1245  cruisetimer->start(mainwindow->spinBox_cruise->value()*1000);
1246  return;
1247  } else if (cruisemode==TAB) {
1248  if (cruisetab_waitingtoproceed) {
1249  //We are waiting for channels in the next tab to refresh before
1250  //we can move on, so we should check if this channel refresh
1251  //made all soonvisible channels refreshed. If so: move on.
1252  if (allSoonVisibleRefreshed()) {
1253  mainwindow->tabManager()->showNextTab();
1254  cruisetab_waitingtoproceed=false;
1255  //If now all visible are refreshed, we start the timer again.
1256  if (allVisibleRefreshed())
1257  cruisetimer->start(mainwindow->spinBox_cruise->value()*1000);
1258  }
1259  } else {
1260  //Same as in the EVENT case: Check if it is time to start the countdown:
1261  //Abort if this refresh did not make all visible channels refreshed:
1262  if (!mainwindow->tabManager()->isVisible(cw)||!allVisibleRefreshed())
1263  return;
1264  //Start the countdown for the next event:
1265  assert(!cruisetimer->isActive());
1266  cruisetimer->start(mainwindow->spinBox_cruise->value()*1000);
1267  return;
1268  }
1269 
1270  return;
1271  } else {
1272  assert(cruisemode==BOTH);
1273  assert(0&&"not implemented");
1274  }
1275 }
1276 
1277 //___________________________________________________________________
1279 {
1280  //No matter what we stop the timer when changing mode or starting a new event.
1281  if (cruisetimer->isActive())
1282  cruisetimer->stop();
1283  cruisetab_waitingtoproceed=false;
1284 
1285  //FIXME: DO STUFF HERE
1286 
1287  switch (cruisemode) {
1288  case NONE:
1289  VP1Msg::messageVerbose("initCruise NONE");
1290  break;
1291  case TAB:
1292  if (allVisibleRefreshed())
1293  cruisetimer->start(mainwindow->spinBox_cruise->value()*1000);
1294  VP1Msg::messageVerbose("initCruise TAB");
1295  break;
1296  case EVENT:
1297  //Start cruise countdown if all visible refreshed:
1298  if (allVisibleRefreshed())
1299  cruisetimer->start(mainwindow->spinBox_cruise->value()*1000);
1300  VP1Msg::messageVerbose("initCruise EVENT");
1301  break;
1302  case BOTH:
1303  VP1Msg::messageVerbose("initCruise BOTH");
1304  break;
1305  default:
1306  assert(0&&"UNKNOWN CRUISE MODE");
1307  break;
1308  }
1309 }
1310 
1311 //___________________________________________________________________
1313 {
1314  if (m_d->cruisemode == m)
1315  return;
1316  m_d->cruisemode = m;
1317 
1319 
1320  m_d->initCruise();
1321 
1322 }
1323 
1324 //Fixme: abort cruise when this and that... (or, sometimes just reset timer).
1325 
1326 //___________________________________________________________________
1328 {
1329  //In any case, we should stop the timer (fixme: What if there are 0 visible channels - when will the timer get started again?):
1330  m_d->cruisetimer->stop();
1331 
1333  //Hmm. Would like to cruise, but that is not ok. Check back in a few seconds.
1334  m_d->cruisetimer->start( (m_d->mainwindow->spinBox_cruise->value() > 5 ? 3000 : 1000) );
1335  return;
1336  }
1337 
1338  assert(!m_d->goingtonextevent);//Otherwise it is a bit silly?
1339 
1340  switch (m_d->cruisemode) {
1341  case NONE:
1342  assert(0&&"should never happen");
1343  break;
1344  case TAB:
1345  assert(m_d->cruisetab_waitingtoproceed==false);
1346  if (m_d->allSoonVisibleRefreshed()) {
1348  //If now all visible are refreshed, we start the timer again.
1349  if (m_d->allVisibleRefreshed())
1350  m_d->cruisetimer->start(m_d->mainwindow->spinBox_cruise->value()*1000);
1351  } else {
1353  }
1354  break;
1355  case EVENT:
1357  VP1Msg::messageDebug("Crusing to next event");
1358  break;
1359  case BOTH:
1360  assert(0&&"Not implemented");
1361  VP1Msg::messageDebug("ERROR: BOTH cruise mode not implemented");
1362  break;
1363  default:
1364  assert(0&&"UNKNOWN CRUISE MODE");
1365  VP1Msg::messageDebug("ERROR: Unknown cruise mode");
1366  break;
1367  }
1368 }
1369 
1370 //___________________________________________________________________
1372 {
1373  return m_d->mainwindow->userRequestedFiles();
1374 }
1375 
1376 
1377 //When in tabcruise mode:
1378 // 1) We know that we are not in single-channel FS mode.
1379 // 2) Soonvisible next
1380 
1381 //FS tab mode: What about floating dock widgets? Rather high priority, but those in next tab should get next...
1382 
1383 //Actually: Floating widgets from other tabs should get docked anyway when going FS-tab when in cruise-TAB mode...
1384 
1385 
1386 //___________________________________________________________________
1387 #ifdef BUILDVP1LIGHT
1388 void VP1ExecutionScheduler::loadEvent(){
1389  // Get the name of the application:
1390  const char* appName = "VP1Light";
1391 
1392  // Initialize the environment:
1393  if( !xAOD::Init( appName ).isSuccess() ) {
1394  ::Error( appName, XAOD_MESSAGE( "Failed to execute xAOD::Init" ) );
1395  return;
1396  }
1397 
1398  m_event = new xAOD::TEvent( xAOD::TEvent::kAthenaAccess );
1399 
1400  // Get local xAOD and set valid xAOD path
1401  QSettings settings("ATLAS", "VP1Light");
1402  std::string path = settings.value("aod/path").toString().toStdString();
1403 
1404  // Open xAOD file and read it in
1405  m_ifile = ::TFile::Open( path.c_str(), "READ" );
1406  if( ! m_ifile ) {
1407  ::Error( appName, XAOD_MESSAGE( "File %s couldn't be opened..." ),
1408  path.c_str() );
1409  return;
1410  }
1411  if( !m_event->readFrom( m_ifile ).isSuccess() ) {
1412  ::Error( appName, XAOD_MESSAGE( "Failed to read from xAOD file %s" ),
1413  path.c_str() );
1414  return;
1415  }
1416 
1417  // Check if file is empty:
1418  if( m_event->getEntry( 0 ) < 0 ) {
1419  ::Error( appName, XAOD_MESSAGE( "Couldn't load entry 0 from file %s" ),
1420  path.c_str() );
1421  return;
1422  }
1423 
1424  //Load the current event
1425  m_event->getEntry( m_evtNr );
1426 
1427  // List for available collections
1428  QStringList jetList;
1429  QStringList vertexList;
1430  QStringList otherList;
1431  QStringList caloClusterList;
1432  QStringList trackParticleList;
1433  QStringList muonList;
1434  QStringList electronList;
1435 
1436 
1437  // // Loop over all entries in the CollectionTree
1438  TTree* ct = (TTree*)m_ifile->Get("CollectionTree");
1439  m_totEvtNr = ct->GetEntriesFast();
1440  for (int i = 0; i<ct->GetListOfBranches()->GetEntries();i++){
1441  std::string className = ct->GetBranch(ct->GetListOfBranches()->At(i)->GetName())->GetClassName();
1442 
1443  // Store collections in their respective QStringList
1444  if(split(className,"_v[1-9]")=="DataVector<xAOD::Vertex>"){
1445  vertexList << ct->GetListOfBranches()->At(i)->GetName();
1446  }
1447  if(split(className,"_v[1-9]")=="xAOD::MissingETContainer"){
1448  otherList << ct->GetListOfBranches()->At(i)->GetName();
1449  }
1450  if(split(className,"_v[1-9]")=="DataVector<xAOD::Jet>"){
1451  jetList << ct->GetListOfBranches()->At(i)->GetName();
1452  }
1453  if(split(className,"_v[1-9]")=="DataVector<xAOD::CaloCluster>"){
1454  caloClusterList << ct->GetListOfBranches()->At(i)->GetName();
1455  }
1456  if(split(className,"_v[1-9]")=="DataVector<xAOD::TrackParticle>"){
1457  trackParticleList << ct->GetListOfBranches()->At(i)->GetName();
1458  }
1459  if(split(className,"_v[1-9]")=="DataVector<xAOD::Muon>"){
1460  muonList << ct->GetListOfBranches()->At(i)->GetName();
1461  }
1462  if(split(className,"_v[1-9]")=="DataVector<xAOD::Electron>"){
1463  electronList << ct->GetListOfBranches()->At(i)->GetName();
1464  }
1465  }
1466 
1467  //Fill the collection lists
1468  m_list.append(vertexList);
1469  m_list.append(otherList);
1470  m_list.append(jetList);
1471  m_list.append(caloClusterList);
1472  m_list.append(trackParticleList);
1473  m_list.append(muonList);
1474  m_list.append(electronList);
1475 
1476  // Get the event info:
1477  const xAOD::EventInfo *eventInfo = nullptr;
1478  if( !m_event->retrieve (eventInfo, "EventInfo").isSuccess() ) {
1479  VP1Msg::messageWarningRed("Failed to retrieve EventInfo");
1480  return;
1481  }
1482  // Save Event info
1483  m_d->mainwindow->setRunEvtNumber(eventInfo->runNumber(),eventInfo->eventNumber(),eventInfo->level1TriggerType(),eventInfo->timeStamp());
1484 
1485  // Update the GUI event counter
1486  QString currentEvt = "Event: " + QString::number(getEvtNr()+1) + "/" + QString::number(getTotEvtNr());
1487  m_d->mainwindow->pushButton_eventselect->setText(currentEvt);
1488 }
1489 
1490 //____________________________________________________________________
1491 void VP1ExecutionScheduler::passEvent(IVP1System* sys){
1492  sys->setEvent(m_event);
1493  sys->setObjectList(m_list);
1494 }
1495 
1496 //____________________________________________________________________
1497 QString VP1ExecutionScheduler::split(const std::string& input, const std::string& regex) {
1498  std::regex re(regex);
1499  std::sregex_token_iterator first{input.begin(), input.end(), re, -1}, last;
1500  std::vector<std::string> vec = {first, last};
1501  QStringList list;
1502  for (unsigned int i=0;i<vec.size();i++){
1503  list << QString::fromStdString(vec[i]);
1504  }
1505  return list.join("");
1506 }
1507 #endif // BUILDVP1LIGHT
VP1ExecutionScheduler::Imp::allSystemsRefreshed
bool allSystemsRefreshed
Definition: VP1ExecutionScheduler.cxx:150
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
VP1ExecutionScheduler::Imp::eventsProcessed
long int eventsProcessed
Definition: VP1ExecutionScheduler.cxx:138
base
std::string base
Definition: hcg.cxx:78
VP1ExecutionScheduler::refreshSystem
void refreshSystem(IVP1System *)
Definition: VP1ExecutionScheduler.cxx:804
VP1ExecutionScheduler::NONE
@ NONE
Definition: VP1ExecutionScheduler.h:49
VP1TabManager::showNextTab
void showNextTab()
Definition: VP1TabManager.cxx:1108
python.CaloRecoConfig.f
f
Definition: CaloRecoConfig.py:127
VP1QtUtils::setEnvironmentVariable
static void setEnvironmentVariable(const QString &name, const QString &content)
Definition: VP1QtUtils.cxx:146
VP1Prioritiser::nextErasedActiveSystemByPriority
IVP1System * nextErasedActiveSystemByPriority()
Definition: VP1Prioritiser.cxx:208
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
VP1ExecutionScheduler::uncreateAndDelete
void uncreateAndDelete(IVP1ChannelWidget *)
Definition: VP1ExecutionScheduler.cxx:1098
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
athena.path
path
python interpreter configuration --------------------------------------—
Definition: athena.py:126
max
#define max(a, b)
Definition: cfImp.cxx:41
VP1ExecutionScheduler::m_d
Imp * m_d
Definition: VP1ExecutionScheduler.h:116
VP1Prioritiser::getSystemsToEraseByPriority
QList< IVP1System * > getSystemsToEraseByPriority()
Definition: VP1Prioritiser.cxx:218
VP1ExecutionScheduler::CruiseMode
CruiseMode
Definition: VP1ExecutionScheduler.h:49
VP1ExecutionScheduler::Imp::mainwindow
VP1MainWindow * mainwindow
Definition: VP1ExecutionScheduler.cxx:136
VP1AvailEvtsHttps
Definition: VP1AvailEvtsHttps.h:28
VP1AvailEvtsHttps.h
VP1ExecutionScheduler.h
xAOD::EventInfo_v1::eventNumber
uint64_t eventNumber() const
The current event's event number.
VP1BatchUtilities
Definition: VP1BatchUtilities.h:25
VP1ExecutionScheduler::init
static VP1ExecutionScheduler * init(StoreGateSvc *eventStore, StoreGateSvc *detStore, ISvcLocator *svcLocator, IToolSvc *toolSvc, QStringList joboptions, QString initialCruiseMode="NONE", unsigned initialCruiseSeconds=10, QString singleEventSource="", QString singleEventLocalTmpDir="", unsigned localFileCacheLimit=10, QStringList availableLocalInputDirectories=QStringList())
Definition: VP1ExecutionScheduler.cxx:350
python.base_data.auth
auth
Definition: base_data.py:57
VP1ExecutionScheduler::Imp::warnIfWidgetsAlive
static void warnIfWidgetsAlive()
Definition: VP1ExecutionScheduler.cxx:1153
IVP1System::CONSTRUCTED
@ CONSTRUCTED
Definition: IVP1System.h:143
VP1ExecutionScheduler::Imp::batchModeRandomConfig
bool batchModeRandomConfig
Definition: VP1ExecutionScheduler.cxx:143
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
VP1Msg.h
VP1ExecutionScheduler::actualUncreateAndDelete
void actualUncreateAndDelete(IVP1ChannelWidget *)
Definition: VP1ExecutionScheduler.cxx:1110
xAOD::TEvent::kAthenaAccess
@ kAthenaAccess
Access containers/objects like Athena does.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:98
CutsMETMaker::accept
StatusCode accept(const xAOD::Muon *mu)
Definition: CutsMETMaker.cxx:18
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
VP1AvailEvents.h
VP1MainWindow::replaceConfigurationFile
void replaceConfigurationFile(QString file)
Definition: VP1MainWindow.cxx:1415
fillPileUpNoiseLumi.connect
string connect
Definition: fillPileUpNoiseLumi.py:70
VP1MainWindow::getEventNumber
unsigned long long getEventNumber()
Definition: VP1MainWindow.h:151
VP1ExecutionScheduler::bringFromConstructedToReady
void bringFromConstructedToReady(IVP1ChannelWidget *)
Definition: VP1ExecutionScheduler.cxx:1069
CSV_InDetExporter.new
new
Definition: CSV_InDetExporter.py:145
AuxContainerBase.h
VP1ChannelManager.h
skel.it
it
Definition: skel.GENtoEVGEN.py:423
VP1ExecutionScheduler::refreshingStatusChanged
void refreshingStatusChanged(bool)
VP1QtUtils.h
VP1ExecutionScheduler::Imp::calctimethisevent
double calctimethisevent
Definition: VP1ExecutionScheduler.cxx:155
VP1ExecutionScheduler::Imp::availEvents
VP1AvailEvents * availEvents
Definition: VP1ExecutionScheduler.cxx:146
VP1Msg::debug
static bool debug()
Definition: VP1Msg.h:32
IVP1ChannelWidget::deleteControllers
void deleteControllers()
Definition: IVP1ChannelWidget.cxx:161
VP1ExecutionScheduler::setCruiseMode
void setCruiseMode(const CruiseMode &)
Definition: VP1ExecutionScheduler.cxx:1312
VP1ExecutionScheduler::saveSnaphsotToFile
QString saveSnaphsotToFile(IVP1System *s, bool batch=false)
Definition: VP1ExecutionScheduler.cxx:944
VP1ExecutionScheduler::Imp::GlobalEventFilter::m_lastPopupWasQMenu
bool m_lastPopupWasQMenu
Definition: VP1ExecutionScheduler.cxx:229
VP1Msg::messageWarningAllRed
static void messageWarningAllRed(const QString &str, IVP1System *sys=0)
Definition: VP1Msg.cxx:70
python.sizes.txt
string txt
Definition: sizes.py:141
VP1AvailEvtsHttps::fileinfoLocation
QString fileinfoLocation()
Definition: VP1AvailEvtsHttps.cxx:148
VP1ExecutionScheduler::channelCreated
void channelCreated(IVP1ChannelWidget *)
Definition: VP1ExecutionScheduler.cxx:767
XAOD_MESSAGE
#define XAOD_MESSAGE(MESSAGE)
Simple macro for printing error/verbose messages.
Definition: Control/xAODRootAccess/xAODRootAccess/tools/Message.h:19
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
VP1ExecutionScheduler::Imp::eraseJustAfterRefresh
bool eraseJustAfterRefresh
Definition: VP1ExecutionScheduler.cxx:161
LArCellConditions.argv
argv
Definition: LArCellConditions.py:112
IVP1ChannelWidget::create
virtual void create()
Definition: IVP1ChannelWidget.cxx:124
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Preparation.batch
batch
Definition: Preparation.py:50
IOStats.h
VP1ExecutionScheduler::Imp::batchModeAllEvents
bool batchModeAllEvents
Definition: VP1ExecutionScheduler.cxx:141
Args
Definition: test_lwtnn_fastgraph.cxx:12
VP1AthenaPtrs::setPointers
static void setPointers(StoreGateSvc *eventStore, StoreGateSvc *detectorStore, ISvcLocator *, IToolSvc *)
Definition: VP1AthenaPtrs.cxx:23
VP1ExecutionScheduler::Imp::scheduler
VP1ExecutionScheduler * scheduler
Definition: VP1ExecutionScheduler.cxx:134
VP1ExecutionScheduler::Imp::refreshtimer
QTimer * refreshtimer
Definition: VP1ExecutionScheduler.cxx:148
x
#define x
VP1ExecutionScheduler::Imp::performPostRefreshCruiseActions
void performPostRefreshCruiseActions(IVP1ChannelWidget *cw)
Definition: VP1ExecutionScheduler.cxx:1232
ReweightUtils.message
message
Definition: ReweightUtils.py:15
VP1ExecutionScheduler::~VP1ExecutionScheduler
virtual ~VP1ExecutionScheduler()
Definition: VP1ExecutionScheduler.cxx:339
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
VP1ExecutionScheduler::nextRequestedEventFile
QString nextRequestedEventFile() const
Definition: VP1ExecutionScheduler.cxx:578
xAOD::EventInfo_v1::runNumber
uint32_t runNumber() const
The current event's run number.
VP1MainWindow::tabManager
VP1TabManager * tabManager() const
Definition: VP1MainWindow.h:146
TruthTest.itE
itE
Definition: TruthTest.py:25
VP1AthenaPtrs.h
VP1QtUtils::environmentVariableValue
static QString environmentVariableValue(const QString &name)
Definition: VP1QtUtils.cxx:117
VP1ExecutionScheduler::EVENT
@ EVENT
Definition: VP1ExecutionScheduler.h:51
VP1Prioritiser.h
VP1ExecutionScheduler::updateProgressBarDuringRefresh
void updateProgressBarDuringRefresh()
Definition: VP1ExecutionScheduler.cxx:566
PrepareReferenceFile.regex
regex
Definition: PrepareReferenceFile.py:43
VP1ExecutionScheduler::systemNeedErase
void systemNeedErase()
Definition: VP1ExecutionScheduler.cxx:734
VP1Authenticator.h
VP1ExecutionScheduler::Imp::pbtimer
QTimer * pbtimer
Definition: VP1ExecutionScheduler.cxx:158
CxxUtils::vec
typename vecDetail::vec_typedef< T, N >::type vec
Define a nice alias for the vectorized type.
Definition: vec.h:207
JetTagCalibConfig.className
string className
Definition: JetTagCalibConfig.py:31
VP1Settings.h
VP1ExecutionScheduler::Imp::cruisemode
CruiseMode cruisemode
Definition: VP1ExecutionScheduler.cxx:164
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:128
VP1ExecutionScheduler::setNextRequestedEventFile
void setNextRequestedEventFile(const QString &)
Definition: VP1ExecutionScheduler.cxx:584
VP1ExecutionScheduler::processSystemForRefresh
void processSystemForRefresh()
Definition: VP1ExecutionScheduler.cxx:747
VP1ExecutionScheduler::Imp::allVisibleRefreshed
bool allVisibleRefreshed() const
Definition: VP1ExecutionScheduler.cxx:1214
IVP1System
Definition: IVP1System.h:36
VP1MainWindow.h
VP1AvailEvtsHttp.h
VP1MainWindow::loadConfigurationFromFile
void loadConfigurationFromFile(QString file)
Definition: VP1MainWindow.cxx:1410
VP1ExecutionScheduler::userRequestedFiles
QStringList userRequestedFiles()
Definition: VP1ExecutionScheduler.cxx:1371
VP1ExecutionScheduler::Imp::batchUtilities
VP1BatchUtilities * batchUtilities
Definition: VP1ExecutionScheduler.cxx:144
ReadStats.h
trigDumpTimers.timing
def timing(hist)
Definition: trigDumpTimers.py:13
TAuxStore.h
VP1Settings::defaultFileSelectDirectory
static QString defaultFileSelectDirectory()
Definition: VP1Settings.cxx:22
Trk::active
@ active
Definition: Layer.h:48
VP1MainWindow::request_cruisemodechange
void request_cruisemodechange()
Definition: VP1MainWindow.cxx:1475
VP1ExecutionScheduler::Imp::batchMode
bool batchMode
Definition: VP1ExecutionScheduler.cxx:140
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
IVP1ChannelWidget::uncreate
virtual void uncreate()
Definition: IVP1ChannelWidget.cxx:155
VP1QtUtils::environmentVariableIsOn
static bool environmentVariableIsOn(const QString &name)
Definition: VP1QtUtils.cxx:127
VP1AvailEvtsLocalDir.h
lumiFormat.i
int i
Definition: lumiFormat.py:92
VP1Prioritiser
Definition: VP1Prioritiser.h:22
IVP1ChannelWidget::CONSTRUCTED
@ CONSTRUCTED
Definition: IVP1ChannelWidget.h:130
VP1ExecutionScheduler::Imp::prioritiser
VP1Prioritiser * prioritiser
Definition: VP1ExecutionScheduler.cxx:135
VP1MainWindow::okToProceedToNextEvent
bool okToProceedToNextEvent() const
Definition: VP1MainWindow.cxx:876
Message.h
VP1HelperClassBase::warnUndeletedInstances
static void warnUndeletedInstances()
Definition: VP1HelperClassBase.cxx:183
TVirtualEvent.h
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
VP1ExecutionScheduler::Imp::GlobalEventFilter
Definition: VP1ExecutionScheduler.cxx:180
TEvent.h
VP1ExecutionScheduler::performCruise
void performCruise()
Definition: VP1ExecutionScheduler.cxx:1327
IVP1ChannelWidget::UNCREATED
@ UNCREATED
Definition: IVP1ChannelWidget.h:130
test_pyathena.parent
parent
Definition: test_pyathena.py:15
VP1Prioritiser::endTiming_Refresh
double endTiming_Refresh()
Definition: VP1Prioritiser.cxx:259
IVP1System::REFRESHED
@ REFRESHED
Definition: IVP1System.h:143
IVP1ChannelWidget::systems
const std::set< IVP1System * > & systems()
Definition: IVP1ChannelWidget.cxx:231
VP1QtUtils::environmentVariableIsSet
static bool environmentVariableIsSet(const QString &name)
Definition: VP1QtUtils.cxx:108
VP1ExecutionScheduler::Imp::currentsystemrefreshing
IVP1System * currentsystemrefreshing
Definition: VP1ExecutionScheduler.cxx:149
Init.h
VP1BatchUtilities.h
VP1ExecutionScheduler::TAB
@ TAB
Definition: VP1ExecutionScheduler.h:50
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
VP1MainWindow::nextEvent
void nextEvent()
Definition: VP1MainWindow.cxx:883
VP1QtUtils::expertSettingIsOn
static bool expertSettingIsOn(const QString &type, const QString &name)
Definition: VP1QtUtils.cxx:60
DQHistogramMergeRegExp.argc
argc
Definition: DQHistogramMergeRegExp.py:20
VP1ExecutionScheduler::channelUncreated
void channelUncreated(IVP1ChannelWidget *)
Definition: VP1ExecutionScheduler.cxx:783
VP1ExecutionScheduler::Imp::cruisetimer
QTimer * cruisetimer
Definition: VP1ExecutionScheduler.cxx:165
VP1ExecutionScheduler::Imp::goingtonextevent
bool goingtonextevent
Definition: VP1ExecutionScheduler.cxx:151
IVP1System::UNCREATED
@ UNCREATED
Definition: IVP1System.h:143
calibdata.exit
exit
Definition: calibdata.py:236
VP1TabManager::selectedChannelWidget
IVP1ChannelWidget * selectedChannelWidget() const
Definition: VP1TabManager.cxx:465
calibdata.ct
ct
Definition: calibdata.py:418
IVP1ChannelWidget::setState
void setState(const State &)
Definition: IVP1ChannelWidget.cxx:108
VP1TabManager::allChannels
QList< IVP1ChannelWidget * > allChannels() const
Definition: VP1TabManager.cxx:1455
DeMoScan.runnumber
runnumber
Definition: DeMoScan.py:266
beamspotman.dir
string dir
Definition: beamspotman.py:623
min
#define min(a, b)
Definition: cfImp.cxx:40
VP1MainWindow::channelManager
VP1ChannelManager * channelManager() const
Definition: VP1MainWindow.h:145
VP1ExecutionScheduler::Imp::pb
QProgressBar * pb
Definition: VP1ExecutionScheduler.cxx:154
VP1Authenticator
Definition: VP1Authenticator.h:29
IVP1ChannelWidget
Definition: IVP1ChannelWidget.h:34
IVP1System::ON
@ ON
Definition: IVP1System.h:144
VP1ExecutionScheduler::Imp::globalEventFilter
GlobalEventFilter * globalEventFilter
Definition: VP1ExecutionScheduler.cxx:131
VP1ExecutionScheduler::Imp::nextRequestedEvent
QString nextRequestedEvent
Definition: VP1ExecutionScheduler.cxx:174
VP1ExecutionScheduler
Definition: VP1ExecutionScheduler.h:42
VP1ExecutionScheduler::isRefreshing
bool isRefreshing() const
Definition: VP1ExecutionScheduler.cxx:798
VP1AthenaPtrs::eventStore
static StoreGateSvc * eventStore()
Definition: VP1AthenaPtrs.h:27
VP1MainWindow::userRequestedExit
bool userRequestedExit()
Definition: VP1MainWindow.h:148
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
IVP1ChannelWidget::state
State state() const
Definition: IVP1ChannelWidget.cxx:102
TActiveEvent.h
CaloCellTimeCorrFiller.folderName
string folderName
Definition: CaloCellTimeCorrFiller.py:20
VP1ExecutionScheduler::Imp::currentrefreshsystemestimate
double currentrefreshsystemestimate
Definition: VP1ExecutionScheduler.cxx:156
python.selection.number
number
Definition: selection.py:20
VP1MainWindow::getEventTimestamp
int getEventTimestamp()
Definition: VP1MainWindow.h:152
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
pmontree.opt
opt
Definition: pmontree.py:16
VP1Prioritiser::beginTiming_Refresh
double beginTiming_Refresh(IVP1System *)
Definition: VP1Prioritiser.cxx:242
VP1MainWindow::progressbar
QProgressBar * progressbar
Definition: VP1MainWindow.h:195
VP1Msg::messageVerbose
static void messageVerbose(const QString &)
Definition: VP1Msg.cxx:84
VP1ExecutionScheduler::Imp::GlobalEventFilter::eventFilter
bool eventFilter(QObject *watched, QEvent *event)
Definition: VP1ExecutionScheduler.cxx:184
VP1HelperClassBase.h
VP1ExecutionScheduler::Imp::batchModeNEvents
int batchModeNEvents
Definition: VP1ExecutionScheduler.cxx:142
python.PyKernel.init
def init(v_theApp, v_rootStream=None)
Definition: PyKernel.py:45
VP1ExecutionScheduler::Imp::GlobalEventFilter::m_lastPopup
QTime m_lastPopup
Definition: VP1ExecutionScheduler.cxx:228
VP1ExecutionScheduler::Imp::postponedUncreateAndDeleteCW
IVP1ChannelWidget * postponedUncreateAndDeleteCW
Definition: VP1ExecutionScheduler.cxx:162
EventInfo.h
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
VP1ExecutionScheduler::startRefreshQueueIfAppropriate
void startRefreshQueueIfAppropriate()
Definition: VP1ExecutionScheduler.cxx:791
VP1ExecutionScheduler::hasAllActiveSystemsRefreshed
bool hasAllActiveSystemsRefreshed(IVP1ChannelWidget *) const
Definition: VP1ExecutionScheduler.cxx:1186
unused
void unused(Args &&...)
Definition: VP1ExpertSettings.cxx:39
VP1ExecutionScheduler::Imp
Definition: VP1ExecutionScheduler.cxx:129
VP1Msg::messageDebug
static void messageDebug(const QString &)
Definition: VP1Msg.cxx:39
qstringlistToVecString
std::vector< std::string > qstringlistToVecString(QStringList list)
Definition: VP1ExecutionScheduler.cxx:86
VP1Prioritiser::elapsedTiming_Refresh
double elapsedTiming_Refresh()
Definition: VP1Prioritiser.cxx:253
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
VP1ExecutionScheduler::Imp::skipEvent
bool skipEvent
Definition: VP1ExecutionScheduler.cxx:176
IVP1ChannelWidget::setCanRegister
void setCanRegister(const bool &controller, const bool &system)
Definition: IVP1ChannelWidget.cxx:299
VP1Prioritiser::estimateRemainingCalcTime
double estimateRemainingCalcTime() const
Definition: VP1Prioritiser.cxx:230
VP1Msg::message
static void message(const QString &, IVP1System *sys=0)
Definition: VP1Msg.cxx:30
VP1MainWindow::getRunNumber
int getRunNumber()
Definition: VP1MainWindow.h:150
IVP1ChannelWidget::READY
@ READY
Definition: IVP1ChannelWidget.h:130
DeMoScan.first
bool first
Definition: DeMoScan.py:534
re
const boost::regex re(r_e)
VP1ExecutionScheduler::Imp::GlobalEventFilter::GlobalEventFilter
GlobalEventFilter()
Definition: VP1ExecutionScheduler.cxx:182
VP1TabManager::setTabCruiseMode
void setTabCruiseMode(const bool &)
Definition: VP1TabManager.cxx:1485
EventStoreTest_jobOptions.Tool
Tool
Definition: EventStoreTest_jobOptions.py:10
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
xAOD::EventInfo_v1::level1TriggerType
uint16_t level1TriggerType() const
The Level-1 trigger type.
xAOD::EventInfo_v1::timeStamp
uint32_t timeStamp() const
POSIX time in seconds from 1970. January 1st.
RunTileMonitoring.triggerType
triggerType
Definition: RunTileMonitoring.py:162
VP1ExecutionScheduler::Imp::allSoonVisibleRefreshed
bool allSoonVisibleRefreshed() const
Definition: VP1ExecutionScheduler.cxx:1223
CaloCondBlobAlgs_fillNoiseFromASCII.folder
folder
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:56
VP1QtApplication
Definition: VP1QtApplication.h:43
IVP1ChannelWidget::name
const QString & name() const
Definition: IVP1ChannelWidget.cxx:180
VP1MainWindow::setRunEvtNumber
void setRunEvtNumber(const int &runnumber, const unsigned long long &eventnumber, const unsigned &triggerType=0, const unsigned &time=0, const bool &printmessage=true)
Definition: VP1MainWindow.cxx:974
VP1ExecutionScheduler::eraseSystem
void eraseSystem(IVP1System *)
Definition: VP1ExecutionScheduler.cxx:713
VP1AvailEvents
Definition: VP1AvailEvents.h:25
L1Topo::Error
Error
The different types of error that can be flagged in the L1TopoRDO.
Definition: Error.h:16
str
Definition: BTagTrackIpAccessor.cxx:11
VP1Msg::verbose
static bool verbose()
Definition: VP1Msg.h:31
VP1ExecutionScheduler::Imp::initCruise
void initCruise()
Definition: VP1ExecutionScheduler.cxx:1278
VP1ExecutionScheduler::VP1ExecutionScheduler
VP1ExecutionScheduler(QObject *parent, StoreGateSvc *eventStore, StoreGateSvc *detStore, ISvcLocator *svcLocator, IToolSvc *toolSvc, VP1AvailEvents *availEvents)
Definition: VP1ExecutionScheduler.cxx:233
VP1ExecutionScheduler::BOTH
@ BOTH
Definition: VP1ExecutionScheduler.h:52
VP1MainWindow::userRequestedFiles
QStringList userRequestedFiles()
Definition: VP1MainWindow.cxx:1868
VP1Msg::messageWarningRed
static void messageWarningRed(const QString &str, IVP1System *sys=0)
Definition: VP1Msg.cxx:57
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
VP1AthenaPtrs::detectorStore
static StoreGateSvc * detectorStore()
Definition: VP1AthenaPtrs.h:28
python.LArCalib_HVCorrConfig.timediff
timediff
Definition: LArCalib_HVCorrConfig.py:81
VP1BatchUtilities::getRandomConfigFile
std::string getRandomConfigFile()
Definition: VP1BatchUtilities.cxx:40
VP1MainWindow::goToNextEvent
void goToNextEvent()
Definition: VP1MainWindow.cxx:898
VP1AvailEvtsHttp
Definition: VP1AvailEvtsHttp.h:24
VP1MainWindow
Definition: VP1MainWindow.h:82
python.TrigInDetArtSteps.timeout
timeout
Definition: TrigInDetArtSteps.py:35
VP1AvailEvtsLocalDir
Definition: VP1AvailEvtsLocalDir.h:24
python.web.remaining
remaining
Definition: web.py:132
VP1ExecutionScheduler::cleanup
static void cleanup(VP1ExecutionScheduler *)
Definition: VP1ExecutionScheduler.cxx:506
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
IVP1System.h
TStore.h
VP1MainWindow::mustQuit
bool mustQuit() const
Definition: VP1MainWindow.cxx:564
IVP1System::OFF
@ OFF
Definition: IVP1System.h:144
xAOD::TEvent
Tool for accessing xAOD files outside of Athena.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:81
IVP1System::ERASED
@ ERASED
Definition: IVP1System.h:143
VP1ExecutionScheduler::Imp::cruisetab_waitingtoproceed
bool cruisetab_waitingtoproceed
Definition: VP1ExecutionScheduler.cxx:170
xAOD::Init
StatusCode Init(const char *appname)
Function initialising ROOT/PyROOT for using the ATLAS EDM.
Definition: Init.cxx:31
IVP1ChannelWidget.h
VP1ExecutionScheduler::executeNewEvent
bool executeNewEvent(const int &runnumber, const unsigned long long &eventnumber, const unsigned &triggerType=0, const unsigned &time=0)
Definition: VP1ExecutionScheduler.cxx:590
VP1ExecutionScheduler::Imp::updateProgressBar
void updateProgressBar()
Definition: VP1ExecutionScheduler.cxx:549
VP1TabManager.h