CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
FWEventAnnotation Class Reference

#include <FWEventAnnotation.h>

Inheritance diagram for FWEventAnnotation:

Public Member Functions

virtual void addTo (FWConfiguration &) const
 
 FWEventAnnotation (TGLViewerBase *view)
 
void Render (TGLRnrCtx &rnrCtx) override
 
void setEvent ()
 
virtual void setFrom (const FWConfiguration &)
 
void setLevel (long x)
 
 ~FWEventAnnotation () override
 

Private Member Functions

 FWEventAnnotation (const FWEventAnnotation &)=delete
 
const FWEventAnnotationoperator= (const FWEventAnnotation &)=delete
 
void updateOverlayText ()
 

Private Attributes

int m_level
 

Detailed Description

Definition at line 11 of file FWEventAnnotation.h.

Constructor & Destructor Documentation

◆ FWEventAnnotation() [1/2]

FWEventAnnotation::FWEventAnnotation ( TGLViewerBase *  view)

Definition at line 11 of file FWEventAnnotation.cc.

11  : TGLAnnotation(view, "Event Info", 0.05, 0.95), m_level(1) {
12  SetRole(TGLOverlayElement::kViewer);
13  SetUseColorSet(true);
14  fAllowClose = false;
15 }

◆ ~FWEventAnnotation()

FWEventAnnotation::~FWEventAnnotation ( )
override

Definition at line 17 of file FWEventAnnotation.cc.

17 {}

◆ FWEventAnnotation() [2/2]

FWEventAnnotation::FWEventAnnotation ( const FWEventAnnotation )
privatedelete

Member Function Documentation

◆ addTo()

void FWEventAnnotation::addTo ( FWConfiguration iTo) const
virtual

Definition at line 69 of file FWEventAnnotation.cc.

69  {
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 }

References FWConfiguration::addKeyValue(), alignCSCRings::s, x, and y.

Referenced by FWEveView::addTo().

◆ operator=()

const FWEventAnnotation& FWEventAnnotation::operator= ( const FWEventAnnotation )
privatedelete

◆ Render()

void FWEventAnnotation::Render ( TGLRnrCtx &  rnrCtx)
override

Definition at line 62 of file FWEventAnnotation.cc.

62  {
63  if (m_level)
64  TGLAnnotation::Render(rnrCtx);
65 }

References m_level.

◆ setEvent()

void FWEventAnnotation::setEvent ( )

Definition at line 30 of file FWEventAnnotation.cc.

30 { updateOverlayText(); }

References updateOverlayText().

Referenced by FWEveView::eventEnd().

◆ setFrom()

void FWEventAnnotation::setFrom ( const FWConfiguration iFrom)
virtual

Definition at line 83 of file FWEventAnnotation.cc.

83  {
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 }

References relativeConstraints::value, and FWConfiguration::valueForKey().

Referenced by FWEveView::setFrom().

◆ setLevel()

void FWEventAnnotation::setLevel ( long  x)

Definition at line 21 of file FWEventAnnotation.cc.

21  {
22  if (x != m_level) {
23  m_level = x;
24  fParent->Changed();
25  gEve->Redraw3D();
26  }
28 }

References m_level, updateOverlayText(), and x.

Referenced by FWEveView::FWEveView().

◆ updateOverlayText()

void FWEventAnnotation::updateOverlayText ( )
private

Definition at line 32 of file FWEventAnnotation.cc.

32  {
33  fText = "CMS Experiment at LHC, CERN";
34 
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 }

References FWGUIManager::getCurrentEvent(), FWGUIManager::getGUIManager(), fireworks::getLocalTime(), and m_level.

Referenced by setEvent(), and setLevel().

Member Data Documentation

◆ m_level

int FWEventAnnotation::m_level
private

Definition at line 31 of file FWEventAnnotation.h.

Referenced by Render(), setLevel(), and updateOverlayText().

DDAxes::y
DDAxes::x
FWEventAnnotation::updateOverlayText
void updateOverlayText()
Definition: FWEventAnnotation.cc:32
alignCSCRings.s
s
Definition: alignCSCRings.py:92
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
fireworks::getLocalTime
std::string getLocalTime(const edm::EventBase &event)
Definition: BuilderUtils.cc:119
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
edm::EventBase
Definition: EventBase.h:46
FWConfiguration
Definition: FWConfiguration.h:31
event
Definition: event.py:1
FWEventAnnotation::m_level
int m_level
Definition: FWEventAnnotation.h:31