ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
graphics
VP1
VP1Systems
VP1MissingEtSystems
src
VP1MissingEtSystem.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// //
7
// Implementation of class VP1MissingEtSystem //
8
// //
9
// Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) //
10
// Initial version: May 2007, rewritten July 2008 //
11
// Updated By: Giorgi Gvaberidze(ggvaberi@cern.ch) July 2010 //
13
14
#include "
VP1MissingEtSystems/VP1MissingEtSystem.h
"
15
#include "
VP1MissingEtSystems/VP1MissingEtHandle.h
"
16
#include "
VP1MissingEtSystems/VP1MissingEtCaloHandle.h
"
17
#include "
VP1MissingEtSystems/VP1MissingEtTruthHandle.h
"
18
#include "
VP1MissingEtSystems/VP1MissingEtCollWidget.h
"
19
//***
20
#include "
VP1MissingEtSystems/missingEtController.h
"
21
22
#include "
VP1Base/VP1Serialise.h
"
23
#include "
VP1Base/VP1Deserialise.h
"
24
#include <Inventor/nodes/SoSeparator.h>
25
#include <Inventor/nodes/SoSwitch.h>
26
#include <Inventor/SoPath.h>
27
28
//____________________________________________________________________
29
class
VP1MissingEtSystem::Imp
{
30
public
:
31
Imp
(
VP1MissingEtSystem
*
tc
) :
theclass
(
tc
),
collWidget
(0),
controller
(0) {}
32
VP1MissingEtSystem
*
theclass
;
33
VP1MissingEtCollWidget
*
collWidget
;
34
//***
35
missingEtController
*
controller
;
36
};
37
38
//_____________________________________________________________________________________
39
VP1MissingEtSystem::VP1MissingEtSystem
()
40
:
IVP13DSystemSimple
(
"EtMiss"
,
41
"Displaying missing ET."
,
42
"Thomas.Kittelmann@cern.ch, ggvaberi@cern.ch"
),
m_d
(new
Imp
(this))
43
{
44
}
45
46
//____________________________________________________________________
47
VP1MissingEtSystem::~VP1MissingEtSystem
()
48
{
49
delete
m_d
;
50
}
51
52
//_____________________________________________________________________________________
53
void
VP1MissingEtSystem::systemerase
( )
54
{
55
//Save present states and then clear all event data and related gui elements.
56
m_d
->collWidget->clear();
57
}
58
59
//_____________________________________________________________________________________
60
void
VP1MissingEtSystem::buildEventSceneGraph
(
StoreGateSvc
*, SoSeparator *root )
61
{
62
//Create collection list based on contents of event store, populate gui and apply states:
63
QList<VP1StdCollection*> cols;
64
for
(
VP1StdCollection
*col :
VP1MissingEtHandle::createCollections
(
this
))
65
cols << col;
66
for
(
VP1StdCollection
*col :
VP1MissingEtCaloHandle::createCollections
(
this
))
67
cols << col;
68
for
(
VP1StdCollection
*col :
VP1MissingEtTruthHandle::createCollections
(
this
))
69
cols << col;
70
71
m_d
->collWidget->setCollections(cols);
72
73
//Add collections to event scenegraph:
74
for
(
VP1StdCollection
* col :
m_d
->collWidget->collections<
VP1StdCollection
>())
75
root->addChild(col->collSwitch());
76
}
77
78
//_____________________________________________________________________________________
79
QWidget *
VP1MissingEtSystem::buildController
()
80
{
81
//Updated: replaced to predefined controller
82
m_d
->controller =
new
missingEtController
(
this
);
83
m_d
->collWidget =
static_cast<
VP1MissingEtCollWidget
*
>
(
m_d
->controller->collWidget());
84
return
m_d
->controller;
85
86
}
87
88
//_____________________________________________________________________________________
89
void
VP1MissingEtSystem::userPickedNode
(SoNode*, SoPath * pickedPath)
90
{
91
//Find in which collection an object was picked and let that deal with the pick:
92
for
(
VP1MissingEtHandle
* handle :
m_d
->collWidget->collections<
VP1MissingEtHandle
>()) {
93
if
(handle->visible()&&pickedPath->containsNode(handle->collSep())) {
94
message
(handle->clicked(pickedPath));
95
return
;
96
}
97
}
98
message
(
"Error: Unknown picked node."
);
99
}
100
101
//_____________________________________________________________________________________
102
QByteArray
VP1MissingEtSystem::saveState
()
103
{
104
ensureBuildController
();
105
VP1Serialise
serialise(1
/*version*/
,
this
);
106
serialise.save(
IVP13DSystemSimple::saveState
());
107
serialise.save(
static_cast<
VP1CollectionWidget
*
>
(
m_d
->collWidget));
108
serialise.save(
m_d
->controller->saveSettings());
109
serialise.warnUnsaved(
controllerWidget
());
110
return
serialise.result();
111
}
112
113
//_____________________________________________________________________________________
114
void
VP1MissingEtSystem::restoreFromState
(QByteArray ba)
115
{
116
VP1Deserialise
state
(ba,
this
);
117
if
(
state
.version() < 0 ||
state
.version() > 1) {
118
message
(
"Warning: State data in .vp1 file is in wrong format - ignoring!"
);
119
return
;
120
}
121
ensureBuildController
();
122
IVP13DSystemSimple::restoreFromState
(
state
.restoreByteArray());
123
state
.restore(
static_cast<
VP1CollectionWidget
*
>
(
m_d
->collWidget));
124
125
if
(
state
.version() >= 1)
126
m_d
->controller->restoreSettings(
state
.restoreByteArray());
127
state
.warnUnrestored(
controllerWidget
());
128
}
tc
static Double_t tc
Definition
LArPhysWaveHECTool.cxx:38
VP1Deserialise.h
VP1MissingEtCaloHandle.h
VP1MissingEtCollWidget.h
VP1MissingEtHandle.h
VP1MissingEtSystem.h
VP1MissingEtTruthHandle.h
VP1Serialise.h
IVP13DSystemSimple::IVP13DSystemSimple
IVP13DSystemSimple(const QString &name, const QString &information, const QString &contact_info)
Definition
IVP13DSystemSimple.cxx:50
IVP13DSystemSimple::ensureBuildController
void ensureBuildController()
Definition
IVP13DSystemSimple.cxx:90
IVP1System::restoreFromState
virtual void restoreFromState(QByteArray)
Definition
IVP1System.cxx:302
IVP1System::state
State state() const
Definition
IVP1System.cxx:129
IVP1System::controllerWidget
QWidget * controllerWidget()
Definition
IVP1System.cxx:202
IVP1System::message
void message(const QString &) const
Definition
IVP1System.cxx:336
IVP1System::saveState
virtual QByteArray saveState()
Definition
IVP1System.cxx:294
StoreGateSvc
The Athena Transient Store API.
Definition
StoreGateSvc.h:120
VP1CollectionWidget
Definition
VP1CollectionWidget.h:32
VP1Deserialise
Definition
VP1Deserialise.h:44
VP1MissingEtCaloHandle::createCollections
static QList< VP1StdCollection * > createCollections(IVP1System *sys)
Definition
VP1MissingEtCaloHandle.cxx:28
VP1MissingEtCollWidget
Definition
VP1MissingEtCollWidget.h:23
VP1MissingEtHandle
Definition
VP1MissingEtHandle.h:36
VP1MissingEtHandle::createCollections
static QList< VP1StdCollection * > createCollections(IVP1System *sys)
Definition
VP1MissingEtHandle.cxx:43
VP1MissingEtSystem::Imp
Definition
VP1MissingEtSystem.cxx:29
VP1MissingEtSystem::Imp::controller
missingEtController * controller
Definition
VP1MissingEtSystem.cxx:35
VP1MissingEtSystem::Imp::theclass
VP1MissingEtSystem * theclass
Definition
VP1MissingEtSystem.cxx:32
VP1MissingEtSystem::Imp::Imp
Imp(VP1MissingEtSystem *tc)
Definition
VP1MissingEtSystem.cxx:31
VP1MissingEtSystem::Imp::collWidget
VP1MissingEtCollWidget * collWidget
Definition
VP1MissingEtSystem.cxx:33
VP1MissingEtSystem::~VP1MissingEtSystem
virtual ~VP1MissingEtSystem()
Definition
VP1MissingEtSystem.cxx:47
VP1MissingEtSystem::buildController
QWidget * buildController()
Definition
VP1MissingEtSystem.cxx:79
VP1MissingEtSystem::saveState
QByteArray saveState()
Definition
VP1MissingEtSystem.cxx:102
VP1MissingEtSystem::restoreFromState
void restoreFromState(QByteArray ba)
Definition
VP1MissingEtSystem.cxx:114
VP1MissingEtSystem::m_d
Imp * m_d
Definition
VP1MissingEtSystem.h:38
VP1MissingEtSystem::systemerase
void systemerase()
Definition
VP1MissingEtSystem.cxx:53
VP1MissingEtSystem::userPickedNode
void userPickedNode(SoNode *pickedNode, SoPath *pickedPath)
Definition
VP1MissingEtSystem.cxx:89
VP1MissingEtSystem::buildEventSceneGraph
void buildEventSceneGraph(StoreGateSvc *sg, SoSeparator *root)
Definition
VP1MissingEtSystem.cxx:60
VP1MissingEtSystem::VP1MissingEtSystem
VP1MissingEtSystem()
Definition
VP1MissingEtSystem.cxx:39
VP1MissingEtTruthHandle::createCollections
static QList< VP1StdCollection * > createCollections(IVP1System *sys)
Definition
VP1MissingEtTruthHandle.cxx:25
VP1Serialise
Definition
VP1Serialise.h:45
VP1StdCollection
Definition
VP1StdCollection.h:31
missingEtController
Definition
missingEtController.h:22
missingEtController.h
Generated on
for ATLAS Offline Software by
1.17.0