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::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 ( )
override

Definition at line 17 of file FWEventAnnotation.cc.

17 {}
FWEventAnnotation::FWEventAnnotation ( const FWEventAnnotation )
privatedelete

Member Function Documentation

void FWEventAnnotation::addTo ( FWConfiguration iTo) const
virtual

Definition at line 69 of file FWEventAnnotation.cc.

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

Referenced by FWEveView::addTo().

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 }
FWConfiguration & addKeyValue(const std::string &, const FWConfiguration &)
const FWEventAnnotation& FWEventAnnotation::operator= ( const FWEventAnnotation )
privatedelete
void FWEventAnnotation::Render ( TGLRnrCtx &  rnrCtx)
override

Definition at line 62 of file FWEventAnnotation.cc.

References m_level.

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

Definition at line 30 of file FWEventAnnotation.cc.

References updateOverlayText().

Referenced by FWEveView::eventEnd().

void FWEventAnnotation::setFrom ( const FWConfiguration iFrom)
virtual

Definition at line 83 of file FWEventAnnotation.cc.

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

Referenced by FWEveView::setFrom().

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 }
const std::string & value(unsigned int iIndex=0) const
const FWConfiguration * valueForKey(const std::string &iKey) const
void FWEventAnnotation::setLevel ( long  x)

Definition at line 21 of file FWEventAnnotation.cc.

References m_level, updateOverlayText(), and x.

Referenced by FWEveView::FWEveView().

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

Definition at line 32 of file FWEventAnnotation.cc.

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

Referenced by setEvent(), and setLevel().

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 }
const edm::EventBase * getCurrentEvent() const
static FWGUIManager * getGUIManager()
std::string getLocalTime(const edm::EventBase &event)
Definition: event.py:1

Member Data Documentation

int FWEventAnnotation::m_level
private

Definition at line 31 of file FWEventAnnotation.h.

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