Fireworks
Core
src
FWEventAnnotation.cc
Go to the documentation of this file.
1
#include "TGLViewer.h"
2
#include "TEveManager.h"
3
4
#include "
Fireworks/Core/interface/FWEventAnnotation.h
"
5
#include "
Fireworks/Core/interface/FWGUIManager.h
"
6
#include "
Fireworks/Core/interface/BuilderUtils.h
"
7
#include "
Fireworks/Core/interface/FWConfiguration.h
"
8
9
#include "
DataFormats/FWLite/interface/Event.h
"
10
11
FWEventAnnotation::FWEventAnnotation
(TGLViewerBase* view) : TGLAnnotation(view,
"Event Info"
, 0.05, 0.95), m_level(1) {
12
SetRole(TGLOverlayElement::kViewer);
13
SetUseColorSet(
true
);
14
fAllowClose =
false
;
15
}
16
17
FWEventAnnotation::~FWEventAnnotation
() {}
18
19
//______________________________________________________________________________
20
21
void
FWEventAnnotation::setLevel
(
long
x
) {
22
if
(
x
!=
m_level
) {
23
m_level
=
x
;
24
fParent->Changed();
25
gEve->Redraw3D();
26
}
27
updateOverlayText
();
28
}
29
30
void
FWEventAnnotation::setEvent
() {
updateOverlayText
(); }
31
32
void
FWEventAnnotation::updateOverlayText
() {
33
fText =
"CMS Experiment at LHC, CERN"
;
34
35
const
edm::EventBase
*
event
=
FWGUIManager::getGUIManager
()->
getCurrentEvent
();
36
37
if
(
event
&&
m_level
) {
38
fText +=
"\nData recorded: "
;
39
fText +=
fireworks::getLocalTime
(*
event
);
40
fText +=
"\nRun/Event: "
;
41
fText +=
event
->id().run();
42
fText +=
" / "
;
43
fText +=
event
->id().event();
44
if
(
m_level
> 1) {
45
fText +=
"\nLumi section: "
;
46
fText +=
event
->luminosityBlock();
47
}
48
if
(
m_level
> 2) {
49
fText +=
"\nOrbit/Crossing: "
;
50
fText +=
event
->orbitNumber();
51
fText +=
" / "
;
52
fText +=
event
->bunchCrossing();
53
}
54
}
55
56
if
(
m_level
) {
57
fParent->Changed();
58
gEve->Redraw3D();
59
}
60
}
61
62
void
FWEventAnnotation::Render
(TGLRnrCtx& rnrCtx) {
63
if
(
m_level
)
64
TGLAnnotation::Render(rnrCtx);
65
}
66
67
//______________________________________________________________________________
68
69
void
FWEventAnnotation::addTo
(
FWConfiguration
& iTo)
const
{
70
std::stringstream
s
;
71
s
<< fTextSize;
72
iTo.
addKeyValue
(
"EventInfoTextSize"
,
FWConfiguration
(
s
.str()));
73
74
std::stringstream
x
;
75
x
<< fPosX;
76
iTo.
addKeyValue
(
"EventInfoPosX"
,
FWConfiguration
(
x
.str()));
77
78
std::stringstream
y
;
79
y
<< fPosY;
80
iTo.
addKeyValue
(
"EventInfoPosY"
,
FWConfiguration
(
y
.str()));
81
}
82
83
void
FWEventAnnotation::setFrom
(
const
FWConfiguration
& iFrom) {
84
const
FWConfiguration
*
value
;
85
86
value
= iFrom.
valueForKey
(
"EventInfoTextSize"
);
87
if
(
value
)
88
fTextSize = atof(
value
->value().c_str());
89
90
value
= iFrom.
valueForKey
(
"EventInfoPosX"
);
91
if
(
value
)
92
fPosX = atof(
value
->value().c_str());
93
94
value
= iFrom.
valueForKey
(
"EventInfoPosY"
);
95
if
(
value
)
96
fPosY = atof(
value
->value().c_str());
97
}
DDAxes::y
FWEventAnnotation::~FWEventAnnotation
~FWEventAnnotation() override
Definition:
FWEventAnnotation.cc:17
DDAxes::x
BuilderUtils.h
FWEventAnnotation::updateOverlayText
void updateOverlayText()
Definition:
FWEventAnnotation.cc:32
FWEventAnnotation::addTo
virtual void addTo(FWConfiguration &) const
Definition:
FWEventAnnotation.cc:69
alignCSCRings.s
s
Definition:
alignCSCRings.py:92
FWEventAnnotation::setLevel
void setLevel(long x)
Definition:
FWEventAnnotation.cc:21
FWConfiguration::valueForKey
const FWConfiguration * valueForKey(const std::string &iKey) const
Definition:
FWConfiguration.cc:122
FWGUIManager::getCurrentEvent
const edm::EventBase * getCurrentEvent() const
Definition:
FWGUIManager.cc:687
FWEventAnnotation.h
FWEventAnnotation::FWEventAnnotation
FWEventAnnotation(TGLViewerBase *view)
Definition:
FWEventAnnotation.cc:11
fireworks::getLocalTime
std::string getLocalTime(const edm::EventBase &event)
Definition:
BuilderUtils.cc:119
FWEventAnnotation::setFrom
virtual void setFrom(const FWConfiguration &)
Definition:
FWEventAnnotation.cc:83
value
Definition:
value.py:1
FWGUIManager::getGUIManager
static FWGUIManager * getGUIManager()
Definition:
FWGUIManager.cc:685
FWConfiguration::addKeyValue
FWConfiguration & addKeyValue(const std::string &, const FWConfiguration &)
Definition:
FWConfiguration.cc:58
relativeConstraints.value
value
Definition:
relativeConstraints.py:53
Event.h
edm::EventBase
Definition:
EventBase.h:46
genVertex_cff.x
x
Definition:
genVertex_cff.py:13
FWConfiguration
Definition:
FWConfiguration.h:31
FWEventAnnotation::Render
void Render(TGLRnrCtx &rnrCtx) override
Definition:
FWEventAnnotation.cc:62
event
Definition:
event.py:1
FWEventAnnotation::m_level
int m_level
Definition:
FWEventAnnotation.h:31
FWGUIManager.h
FWConfiguration.h
FWEventAnnotation::setEvent
void setEvent()
Definition:
FWEventAnnotation.cc:30
Generated for CMSSW Reference Manual by
1.8.16