ATLAS Offline Software
Loading...
Searching...
No Matches
IVP1System.h
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// Header file for class IVP1System //
8// //
9// Author: Thomas Kittelmann <Thomas.Kittelmann@cern.ch> //
10// //
11// Initial version: April 2007 //
12// //
14
15#ifndef IVP1SYSTEM_H
16#define IVP1SYSTEM_H
17
18#include "VP1Base/VP1String.h"
19#include <QObject>
20#include <QByteArray>
21
22// GeoModel
24//
25#include "GeoModelKernel/GeoVPhysVol.h"
26
27#ifdef BUILDVP1LIGHT
28 #include "xAODBase/IParticle.h"
29#endif // BUILDVP1LIGHT
30
32class StoreGateSvc;
33class ISvcLocator;
34class IToolSvc;
35// Base class for all systems:
36class IVP1System : public QObject, public VP1String {
37
38 Q_OBJECT
39
40public:
41
42 // Constructor:
43 IVP1System(const QString & name, const QString & information, const QString & contact_info);
44
45 // Destructor:
46 virtual ~IVP1System();
47
48protected:
49 // Initialize the system:
50 virtual void create( StoreGateSvc* detectorStore ) = 0;
51
52 // Refresh event-per-event graphics (sg will be null for standalone apps):
53 virtual void refresh( StoreGateSvc* eventStore ) = 0;
54
55 // Erase any event-per-event graphics:
56 virtual void erase() = 0;
57
58 // Finalize the system:
59 virtual void uncreate();
60
61 // Retrieve label information:
62public:
63 const QString& name() const;
64 const QString& information() const;
65 const QString& contact_info() const;
66
67 QWidget * controllerWidget();
68
69protected:
70 //If the systems needs a custom control widget to allow the user to
71 //control how it presents itself, call the follwing method in
72 //create() (and at most once). NB: It is up to a given channel
73 //whether to actually show this controller to the user by
74 //e.g. incorporating it into its own controller:
75 void registerController(QWidget*);
76
77public:
78 //Override the following if the system needs to be able to save info in the .vp1 files:
79 virtual QByteArray saveState();
80 virtual void restoreFromState(QByteArray);//If channel loaded from .vp1 files, this will be called
81 //after create() and before the first refresh().
82
83 void message(const QString&) const; //calling this method causes a message show up in the text
84 //window of the application (through emission of the sysmessage signal below).
85 void messageDebug(const QString&) const;//Output only to stdout.
86 static bool verbose() { return s_vp1verbose; }// Returns true if env var VP1_VERBOSE_OUTPUT=1
87 void messageVerbose(const QString&) const;//Only outputs when verbose()
88
89 //Overloaded convenience methods, for outputting several lines:
90 void message(const QStringList&, const QString& addtoend = "" ) const;
91 void messageDebug(const QStringList&, const QString& addtoend = "") const;
92 void messageVerbose(const QStringList&, const QString& addtoend = "") const;
93 void message(const QString& addtostart, const QStringList&, const QString& addtoend = "" ) const;
94 void messageDebug(const QString& addtostart, const QStringList&, const QString& addtoend = "") const;
95 void messageVerbose(const QString& addtostart, const QStringList&, const QString& addtoend = "") const;
96
97#ifdef BUILDVP1LIGHT
98 xAOD::TEvent* getEvent();
99 void setEvent(xAOD::TEvent* event );
100 QStringList getObjectList(xAOD::Type::ObjectType); // Pass the collection names
101 void setObjectList(QList<QStringList>);
102#endif // BUILDVP1LIGHT
103
104signals:
105 void sysmessage(QString) const;
106
107#ifdef BUILDVP1LIGHT
108 void signalLoadEvent(IVP1System*);
109#endif // BUILDVP1LIGHT
110
111public://Public for easier use in helper classes.
112
113 void updateGUI();//Please call this occasionally if doing a lot of
114 //heavy calculations, to prevent the GUI from
115 //freezing up (for now we are single-threaded, so
116 //this is what we need to do).
117
118 //Use these to access athena services (it is wise to check that they are not null):
119 StoreGateSvc * storeGate() const { return eventStore(); }//OBSOLETE NAME. Use eventStore() instead.
120 StoreGateSvc * eventStore() const;
121 StoreGateSvc * detectorStore() const;
122 ISvcLocator * serviceLocator() const;
123 IToolSvc * toolSvc() const;
124
125private:
126
129
130 class Imp;
133 friend class VP1Prioritiser;
134 friend class IVP1ChannelWidget;
135 friend class VP1MainWindow;
136 void disallowUpdateGUI();
137 void allowUpdateGUI();
139
140 IVP1ChannelWidget * channel() const;
141 void deleteController();
142public:
144 enum ActiveState { ON=0, OFF };//Whether it is part of the erase/refresh cycle.
145 State state() const;
146 ActiveState activeState() const;
147private:
148 void setState(const State&);
149 void setActiveState(const ActiveState&, const bool& donttriggererase=true);
150 bool isRefreshing();
151 void setRefreshing(const bool&);
152 void setCanRegisterController(const bool&);
153signals:
154 void inactiveSystemTurnedActive();//Do NOT call this method in derived classes!!!
155 void needErase();//Do NOT call this method in derived classes!!!
156
157private:
158 static const bool s_vp1verbose;
159
160#ifdef BUILDVP1LIGHT
161 QList<QStringList> m_list;
162 xAOD::TEvent* m_event;
163#endif // BUILDVP1LIGHT
164
165};
166
167#endif
friend class VP1Prioritiser
Definition IVP1System.h:133
IToolSvc * toolSvc() const
friend class IVP1ChannelWidget
Definition IVP1System.h:134
void messageVerbose(const QString &) const
ActiveState activeState() const
friend class VP1ExecutionScheduler
Definition IVP1System.h:132
virtual void restoreFromState(QByteArray)
void allowUpdateGUI()
StoreGateSvc * detectorStore() const
void messageDebug(const QString &) const
const QString & name() const
State state() const
virtual void uncreate()
StoreGateSvc * eventStore() const
void setCanRegisterController(const bool &)
QWidget * controllerWidget()
void updateGUI()
void deleteController()
virtual void erase()=0
IVP1System(const QString &name, const QString &information, const QString &contact_info)
void message(const QString &) const
IVP1System & operator=(const IVP1System &)
void setChannel(IVP1ChannelWidget *)
static const bool s_vp1verbose
Definition IVP1System.h:158
virtual ~IVP1System()
IVP1ChannelWidget * channel() const
void inactiveSystemTurnedActive()
void sysmessage(QString) const
virtual void create(StoreGateSvc *detectorStore)=0
void registerController(QWidget *)
friend class VP1MainWindow
Definition IVP1System.h:135
void setRefreshing(const bool &)
StoreGateSvc * storeGate() const
Definition IVP1System.h:119
void setState(const State &)
void disallowUpdateGUI()
const QString & information() const
static bool verbose()
Definition IVP1System.h:86
const QString & contact_info() const
virtual void refresh(StoreGateSvc *eventStore)=0
void needErase()
ISvcLocator * serviceLocator() const
bool isRefreshing()
IVP1System(const IVP1System &)
virtual QByteArray saveState()
void setActiveState(const ActiveState &, const bool &donttriggererase=true)
The Athena Transient Store API.
Tool for accessing xAOD files outside of Athena.
ObjectType
Type of objects that have a representation in the xAOD EDM.
Definition ObjectType.h:32