ATLAS Offline Software
VP1ExecutionScheduler.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // //
7 // Header file for class VP1ExecutionScheduler //
8 // //
9 // Author: Thomas Kittelmann <Thomas.Kittelmann@cern.ch> //
10 // //
11 // Initial version: April 2007 //
12 // //
14 
15 #ifndef VP1EXECUTIONSCHEDULER_H
16 #define VP1EXECUTIONSCHEDULER_H
17 
18 // include C++
19 //#include <stddef.h> // this to fix the 'ptrdiff_t' does not name a type error with Qt (http://qt-project.org/forums/viewthread/16992)
20 
21 // include VP1
23 
24 // include Qt
25 #include <QObject>
26 #include <QStringList>
27 
28 #ifdef BUILDVP1LIGHT
29  #include <TTree.h>
30  #include "xAODBase/IParticle.h"
31 #endif // BUILDVP1LIGHT
32 
33 
34 class IVP1System;
35 class IVP1ChannelWidget;
36 
37 class StoreGateSvc;
38 class IToolSvc;
39 class ISvcLocator;
40 class VP1AvailEvents;
41 
42 class VP1ExecutionScheduler : public QObject {
43 
44  Q_OBJECT
45 
46 public:
47 
48  //Cruise mode:
49  enum CruiseMode { NONE,
50  TAB, //Cycles to a new tab at a fixed interval (when it is loaded - gives soonvisible bonus)
51  EVENT,//Proceeds to a new event at a fixed interval (counting from when all visible channels are refreshed)
52  BOTH };//Cycles through all tabs and loads next event when they have all been shown.
53 
54 
55  void setCruiseMode(const CruiseMode&);
56 
57  //Fixme: Need shortcut keys for the cruise modes as well as next/prev. tab (for full screen).
58 
59 
60  //init/cleanup:
61  static VP1ExecutionScheduler* init(StoreGateSvc* eventStore,
63  ISvcLocator* svcLocator,
64  IToolSvc*toolSvc,
65  QStringList joboptions,
66  QString initialCruiseMode = "NONE",
67  unsigned initialCruiseSeconds = 10,
68  QString singleEventSource = "",
69  QString singleEventLocalTmpDir = "",
70  unsigned localFileCacheLimit = 10,
71  QStringList availableLocalInputDirectories = QStringList() );
72  static void cleanup(VP1ExecutionScheduler*);
73 
74  //Call when new event data are available (returns false when the user closes the program)
75  bool executeNewEvent(const int& runnumber, const unsigned long long& eventnumber, const unsigned& triggerType = 0, const unsigned& time = 0);//
76 
77  VP1ExecutionScheduler(QObject * parent,
79  ISvcLocator* svcLocator,IToolSvc*toolSvc,
80  VP1AvailEvents * availEvents);
81  virtual ~VP1ExecutionScheduler();
82 
85 
86  bool isRefreshing() const;
87 
89 
90  //For VP1Gui:
91  QString nextRequestedEventFile() const;
92 
93  //For use by whatever logic wants to determine the next event file
94  //(probably VP1MainWindow):
95  void setNextRequestedEventFile(const QString&);
96 
97  QStringList userRequestedFiles();
98 
99  QString saveSnaphsotToFile(IVP1System* s, bool batch = false);
100 
101 
102  #if defined BUILDVP1LIGHT
103  void loadEvent();
104  QString split(const std::string& input, const std::string& regex);
105  int getEvtNr(){ return m_evtNr; };
106  void setEvtNr(int evtNr){ m_evtNr = evtNr; };
107  int getTotEvtNr(){ return m_totEvtNr; };
108  #endif // BUILDVP1LIGHT
109 
110 signals:
112 
113 
114 
115 private:
116  class Imp;
117  Imp * m_d;
118  void refreshSystem(IVP1System*);
119  void eraseSystem(IVP1System*);
121 
122  #if defined BUILDVP1LIGHT
123  xAOD::TEvent* m_event;
124  ::TFile* m_ifile;
125  QList<QStringList> m_list;
126  int m_evtNr = 0;
127  int m_totEvtNr = -1;
128  bool m_goBackFlag = false;
129  bool firstlaunch = true;
130  #endif // BUILDVP1LIGHT
131 
132 private Q_SLOTS:
138  void systemNeedErase();
139 
140  void performCruise();
141  //OPVASK: void abortCruise();
142  //Start
143 
144  #if defined BUILDVP1LIGHT
145  void passEvent(IVP1System*);
146  #endif // BUILDVP1LIGHT
147 };
148 
149 #endif
VP1ExecutionScheduler::refreshSystem
void refreshSystem(IVP1System *)
Definition: VP1ExecutionScheduler.cxx:804
VP1ExecutionScheduler::NONE
@ NONE
Definition: VP1ExecutionScheduler.h:49
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
VP1ExecutionScheduler::uncreateAndDelete
void uncreateAndDelete(IVP1ChannelWidget *)
Definition: VP1ExecutionScheduler.cxx:1098
VP1ExecutionScheduler::m_d
Imp * m_d
Definition: VP1ExecutionScheduler.h:116
VP1ExecutionScheduler::CruiseMode
CruiseMode
Definition: VP1ExecutionScheduler.h:49
IParticle.h
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
VP1ExecutionScheduler::actualUncreateAndDelete
void actualUncreateAndDelete(IVP1ChannelWidget *)
Definition: VP1ExecutionScheduler.cxx:1110
VP1ExecutionScheduler::bringFromConstructedToReady
void bringFromConstructedToReady(IVP1ChannelWidget *)
Definition: VP1ExecutionScheduler.cxx:1069
VP1ExecutionScheduler::refreshingStatusChanged
void refreshingStatusChanged(bool)
VP1ExecutionScheduler::setCruiseMode
void setCruiseMode(const CruiseMode &)
Definition: VP1ExecutionScheduler.cxx:1312
VP1ExecutionScheduler::saveSnaphsotToFile
QString saveSnaphsotToFile(IVP1System *s, bool batch=false)
Definition: VP1ExecutionScheduler.cxx:944
VP1ExecutionScheduler::channelCreated
void channelCreated(IVP1ChannelWidget *)
Definition: VP1ExecutionScheduler.cxx:767
Preparation.batch
batch
Definition: Preparation.py:50
VP1ExecutionScheduler::~VP1ExecutionScheduler
virtual ~VP1ExecutionScheduler()
Definition: VP1ExecutionScheduler.cxx:339
VP1ExecutionScheduler::nextRequestedEventFile
QString nextRequestedEventFile() const
Definition: VP1ExecutionScheduler.cxx:578
VP1ExecutionScheduler::EVENT
@ EVENT
Definition: VP1ExecutionScheduler.h:51
VP1ExecutionScheduler::updateProgressBarDuringRefresh
void updateProgressBarDuringRefresh()
Definition: VP1ExecutionScheduler.cxx:566
PrepareReferenceFile.regex
regex
Definition: PrepareReferenceFile.py:43
VP1ExecutionScheduler::systemNeedErase
void systemNeedErase()
Definition: VP1ExecutionScheduler.cxx:734
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
IVP1System
Definition: IVP1System.h:36
VP1ExecutionScheduler::userRequestedFiles
QStringList userRequestedFiles()
Definition: VP1ExecutionScheduler.cxx:1371
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
VP1ExecutionScheduler::performCruise
void performCruise()
Definition: VP1ExecutionScheduler.cxx:1327
test_pyathena.parent
parent
Definition: test_pyathena.py:15
VP1ExecutionScheduler::TAB
@ TAB
Definition: VP1ExecutionScheduler.h:50
VP1ExecutionScheduler::channelUncreated
void channelUncreated(IVP1ChannelWidget *)
Definition: VP1ExecutionScheduler.cxx:783
python.L1.Config.LegacyTopoMergerMap.signals
signals
Definition: LegacyTopoMergerMap.py:13
DeMoScan.runnumber
runnumber
Definition: DeMoScan.py:266
IVP1ChannelWidget
Definition: IVP1ChannelWidget.h:34
VP1ExecutionScheduler
Definition: VP1ExecutionScheduler.h:42
VP1ExecutionScheduler::isRefreshing
bool isRefreshing() const
Definition: VP1ExecutionScheduler.cxx:798
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
VP1ExecutionScheduler::startRefreshQueueIfAppropriate
void startRefreshQueueIfAppropriate()
Definition: VP1ExecutionScheduler.cxx:791
VP1ExecutionScheduler::hasAllActiveSystemsRefreshed
bool hasAllActiveSystemsRefreshed(IVP1ChannelWidget *) const
Definition: VP1ExecutionScheduler.cxx:1186
VP1ExecutionScheduler::Imp
Definition: VP1ExecutionScheduler.cxx:129
VP1QtApplication.h
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
RunTileMonitoring.triggerType
triggerType
Definition: RunTileMonitoring.py:162
VP1ExecutionScheduler::eraseSystem
void eraseSystem(IVP1System *)
Definition: VP1ExecutionScheduler.cxx:713
VP1AvailEvents
Definition: VP1AvailEvents.h:25
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
VP1ExecutionScheduler::cleanup
static void cleanup(VP1ExecutionScheduler *)
Definition: VP1ExecutionScheduler.cxx:506
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
xAOD::TEvent
Tool for accessing xAOD files outside of Athena.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:81
VP1ExecutionScheduler::executeNewEvent
bool executeNewEvent(const int &runnumber, const unsigned long long &eventnumber, const unsigned &triggerType=0, const unsigned &time=0)
Definition: VP1ExecutionScheduler.cxx:590