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 12 of file FWEventAnnotation.h.

Constructor & Destructor Documentation

FWEventAnnotation::FWEventAnnotation ( TGLViewerBase *  view)

Definition at line 11 of file FWEventAnnotation.cc.

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

Definition at line 20 of file FWEventAnnotation.cc.

21 {
22 }
FWEventAnnotation::FWEventAnnotation ( const FWEventAnnotation )
privatedelete

Member Function Documentation

void FWEventAnnotation::addTo ( FWConfiguration iTo) const
virtual

Definition at line 91 of file FWEventAnnotation.cc.

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

Referenced by FWEveView::addTo().

92 {
93  std::stringstream s;
94  s<<fTextSize;
95  iTo.addKeyValue("EventInfoTextSize",FWConfiguration(s.str()));
96 
97  std::stringstream x;
98  x<<fPosX;
99  iTo.addKeyValue("EventInfoPosX",FWConfiguration(x.str()));
100 
101  std::stringstream y;
102  y<<fPosY;
103  iTo.addKeyValue("EventInfoPosY",FWConfiguration(y.str()));
104 }
FWConfiguration & addKeyValue(const std::string &, const FWConfiguration &)
const FWEventAnnotation& FWEventAnnotation::operator= ( const FWEventAnnotation )
privatedelete
void FWEventAnnotation::Render ( TGLRnrCtx &  rnrCtx)
override

Definition at line 82 of file FWEventAnnotation.cc.

References m_level.

83 {
84  if (m_level)
85  TGLAnnotation::Render(rnrCtx);
86 }
void FWEventAnnotation::setEvent ( )

Definition at line 40 of file FWEventAnnotation.cc.

References updateOverlayText().

Referenced by FWEveView::eventEnd().

41 {
43 }
void FWEventAnnotation::setFrom ( const FWConfiguration iFrom)
virtual

Definition at line 107 of file FWEventAnnotation.cc.

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

Referenced by FWEveView::setFrom().

108 {
109  const FWConfiguration* value;
110 
111  value = iFrom.valueForKey("EventInfoTextSize");
112  if (value) fTextSize = atof(value->value().c_str());
113 
114  value = iFrom.valueForKey("EventInfoPosX");
115  if (value) fPosX = atof(value->value().c_str());
116 
117  value = iFrom.valueForKey("EventInfoPosY");
118  if (value) fPosY = atof(value->value().c_str());
119 
120 }
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 27 of file FWEventAnnotation.cc.

References m_level, updateOverlayText(), and x.

Referenced by FWEveView::FWEveView().

28 {
29  if (x != m_level)
30  {
31  m_level = x;
32  fParent->Changed();
33  gEve->Redraw3D();
34  }
36 }
void FWEventAnnotation::updateOverlayText ( )
private

Definition at line 46 of file FWEventAnnotation.cc.

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

Referenced by setEvent(), and setLevel().

47 {
48  fText = "CMS Experiment at LHC, CERN";
49 
51 
52  if (event && m_level)
53  {
54  fText += "\nData recorded: ";
55  fText += fireworks::getLocalTime( *event );
56  fText += "\nRun/Event: ";
57  fText += event->id().run();
58  fText += " / ";
59  fText += event->id().event();
60  if ( m_level > 1)
61  {
62  fText += "\nLumi section: ";
63  fText += event->luminosityBlock();
64  }
65  if ( m_level > 2)
66  {
67  fText += "\nOrbit/Crossing: ";
68  fText += event->orbitNumber();
69  fText += " / ";
70  fText += event->bunchCrossing();
71  }
72  }
73 
74  if (m_level)
75  {
76  fParent->Changed();
77  gEve->Redraw3D();
78  }
79 }
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 33 of file FWEventAnnotation.h.

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