CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Friends
CmsShowCommon Class Reference

#include <Fireworks/Core/interface/CmsShowCommon.h>

Inheritance diagram for CmsShowCommon:
FWConfigurableParameterizable FWParameterizable FWConfigurable

Public Member Functions

virtual void addTo (FWConfiguration &) const
 
 CmsShowCommon (fireworks::Context *)
 
int gamma ()
 
FWViewEnergyScalegetEnergyScale () const
 
UChar_t getProjTrackBreaking () const
 
bool getRnrPTBMarkers () const
 
void setDrawBreakMarkers ()
 
virtual void setFrom (const FWConfiguration &)
 
void setGamma ()
 
void setGeomColor (FWGeomColorIndex, Color_t)
 
void setGeomTransparency (int val, bool projected)
 
void setTrackBreakMode ()
 
void switchBackground ()
 
virtual ~CmsShowCommon ()
 
- Public Member Functions inherited from FWConfigurableParameterizable
 FWConfigurableParameterizable (unsigned int iVersion=1)
 
unsigned int version () const
 
virtual ~FWConfigurableParameterizable ()
 
- Public Member Functions inherited from FWParameterizable
void add (FWParameterBase *)
 
const_iterator begin () const
 
const_iterator end () const
 
 FWParameterizable ()
 
virtual ~FWParameterizable ()
 
- Public Member Functions inherited from FWConfigurable
 FWConfigurable ()
 
virtual ~FWConfigurable ()
 

Protected Member Functions

const FWColorManagercolorManager () const
 

Protected Attributes

FWLongParameter m_backgroundColor
 
fireworks::Contextm_context
 
FWBoolParameter m_drawBreakPoints
 
std::auto_ptr< FWViewEnergyScalem_energyScale
 
FWLongParameter m_gamma
 
FWLongParameterm_geomColors [kFWGeomColorSize]
 
FWLongParameter m_geomTransparency2D
 
FWLongParameter m_geomTransparency3D
 
FWEnumParameter m_trackBreak
 

Private Member Functions

 CmsShowCommon (const CmsShowCommon &)
 
const CmsShowCommonoperator= (const CmsShowCommon &)
 

Friends

class CmsShowCommonPopup
 

Additional Inherited Members

- Public Types inherited from FWParameterizable
typedef std::vector
< FWParameterBase * >
::const_iterator 
const_iterator
 

Detailed Description

Description: [one line class summary]

Usage: <usage>

Definition at line 41 of file CmsShowCommon.h.

Constructor & Destructor Documentation

CmsShowCommon::CmsShowCommon ( fireworks::Context c)

Definition at line 32 of file CmsShowCommon.cc.

References FWEnumParameter::addEntry(), FWGenericParameter< T >::changed_, colorManager(), i, kFWGeomColorSize, prof2calltree::l, m_drawBreakPoints, m_gamma, m_geomColors, m_trackBreak, mergeVDriftHistosByStation::name, setDrawBreakMarkers(), setGamma(), and setTrackBreakMode().

32  :
34  m_context(c),
35  m_trackBreak(this, " ", 2l, 0l, 2l), // do not want to render text at setter
36  m_drawBreakPoints(this, "Show y=0 points as markers", false),
37  m_backgroundColor(this, "backgroundColIdx", 1l, 0l, 1000l),
38  m_gamma(this, "Brightness", 0l, -15l, 15l),
39  m_geomTransparency2D(this, "Transparency 2D", long(colorManager()->geomTransparency(true)), 0l, 100l),
40  m_geomTransparency3D(this, "Transparency 3D", long(colorManager()->geomTransparency(false)), 0l, 100l),
41  m_energyScale(new FWViewEnergyScale("global", 2))
42 {
43  // projections
44  m_trackBreak.addEntry(0, "Jump to proper hemisphere");
45  m_trackBreak.addEntry(1, "Stay on first point side");
46  m_trackBreak.addEntry(2, "Stay on last point side");
47 
48  // colors
49  char name[32];
50  for (int i = 0; i < kFWGeomColorSize; ++i)
51  {
52  snprintf(name, 31, "GeometryColor %d ", i);
53  m_geomColors[i] = new FWLongParameter(this, name , long(colorManager()->geomColor(FWGeomColorIndex(i))), 1000l, 1100l);
54  }
55 
56  m_trackBreak.changed_.connect(boost::bind(&CmsShowCommon::setTrackBreakMode, this));
58  m_gamma.changed_.connect(boost::bind(&CmsShowCommon::setGamma, this));
59 }
int i
Definition: DBlmapReader.cc:9
FWBoolParameter m_drawBreakPoints
Definition: CmsShowCommon.h:82
FWConfigurableParameterizable(unsigned int iVersion=1)
FWLongParameter m_backgroundColor
Definition: CmsShowCommon.h:85
FWGeomColorIndex
void setTrackBreakMode()
FWLongParameter * m_geomColors[kFWGeomColorSize]
Definition: CmsShowCommon.h:91
sigc::signal< void, T > changed_
const FWColorManager * colorManager() const
FWLongParameter m_gamma
Definition: CmsShowCommon.h:86
bool addEntry(Long_t id, const std::string &txt)
fireworks::Context * m_context
Definition: CmsShowCommon.h:79
FWLongParameter m_geomTransparency3D
Definition: CmsShowCommon.h:90
void setDrawBreakMarkers()
FWLongParameter m_geomTransparency2D
Definition: CmsShowCommon.h:89
std::auto_ptr< FWViewEnergyScale > m_energyScale
Definition: CmsShowCommon.h:94
FWParameters::Long FWLongParameter
Definition: FWParameters.h:36
FWEnumParameter m_trackBreak
Definition: CmsShowCommon.h:81
CmsShowCommon::~CmsShowCommon ( )
virtual

Definition at line 61 of file CmsShowCommon.cc.

62 {
63 }
CmsShowCommon::CmsShowCommon ( const CmsShowCommon )
private

Member Function Documentation

void CmsShowCommon::addTo ( FWConfiguration oTo) const
virtual

Reimplemented from FWConfigurableParameterizable.

Definition at line 165 of file CmsShowCommon.cc.

References FWConfigurableParameterizable::addTo(), colorManager(), m_backgroundColor, m_energyScale, FWGenericParameter< T >::set(), and v.

166 {
167  m_backgroundColor.set(int(colorManager()->background()));
168 
170  m_energyScale->addTo(oTo);
171 
172  if (gEve)
173  {
174  TGLViewer* v = gEve->GetDefaultGLViewer();
175  addGLColorToConfig("SelectionColorLight", v->RefLightColorSet().Selection(1), oTo);
176  addGLColorToConfig("HighlightColorLight", v->RefLightColorSet().Selection(3), oTo);
177  addGLColorToConfig("SelectionColorDark", v->RefDarkColorSet().Selection(1), oTo);
178  addGLColorToConfig("HighlightColorDark", v->RefDarkColorSet().Selection(3), oTo);
179  }
180 }
FWLongParameter m_backgroundColor
Definition: CmsShowCommon.h:85
const FWColorManager * colorManager() const
std::auto_ptr< FWViewEnergyScale > m_energyScale
Definition: CmsShowCommon.h:94
mathSSE::Vec4< T > v
virtual void addTo(FWConfiguration &) const
const FWColorManager * CmsShowCommon::colorManager ( ) const
protected
int CmsShowCommon::gamma ( )
inline

Definition at line 60 of file CmsShowCommon.h.

References m_gamma, and FWGenericParameter< T >::value().

60 { return m_gamma.value(); }
FWLongParameter m_gamma
Definition: CmsShowCommon.h:86
FWViewEnergyScale* CmsShowCommon::getEnergyScale ( ) const
inline

Definition at line 67 of file CmsShowCommon.h.

References m_energyScale.

Referenced by FWEveViewManager::setContext(), and FWEveView::useGlobalEnergyScaleChanged().

67 { return m_energyScale.get(); }
std::auto_ptr< FWViewEnergyScale > m_energyScale
Definition: CmsShowCommon.h:94
UChar_t CmsShowCommon::getProjTrackBreaking ( ) const
inline

Definition at line 70 of file CmsShowCommon.h.

References m_trackBreak, and FWGenericParameter< T >::value().

Referenced by fireworks::Context::initEveElements().

70 { return m_trackBreak.value(); }
FWEnumParameter m_trackBreak
Definition: CmsShowCommon.h:81
bool CmsShowCommon::getRnrPTBMarkers ( ) const
inline

Definition at line 71 of file CmsShowCommon.h.

References m_drawBreakPoints, and FWGenericParameter< T >::value().

Referenced by fireworks::Context::initEveElements().

71 { return m_drawBreakPoints.value(); }
FWBoolParameter m_drawBreakPoints
Definition: CmsShowCommon.h:82
const CmsShowCommon& CmsShowCommon::operator= ( const CmsShowCommon )
private
void CmsShowCommon::setDrawBreakMarkers ( )

Definition at line 89 of file CmsShowCommon.cc.

References fireworks::Context::getMuonTrackPropagator(), fireworks::Context::getTrackerTrackPropagator(), fireworks::Context::getTrackPropagator(), m_context, m_drawBreakPoints, and FWGenericParameter< T >::value().

Referenced by CmsShowCommon().

90 {
91  if (m_context->getTrackPropagator()->GetRnrPTBMarkers() != m_drawBreakPoints.value())
92  {
93  m_context->getTrackPropagator()->SetRnrPTBMarkers(m_drawBreakPoints.value());
96  gEve->Redraw3D();
97  }
98 }
FWBoolParameter m_drawBreakPoints
Definition: CmsShowCommon.h:82
TEveTrackPropagator * getTrackerTrackPropagator() const
Definition: Context.h:75
TEveTrackPropagator * getTrackPropagator() const
Definition: Context.h:74
fireworks::Context * m_context
Definition: CmsShowCommon.h:79
TEveTrackPropagator * getMuonTrackPropagator() const
Definition: Context.h:76
void CmsShowCommon::setFrom ( const FWConfiguration iFrom)
virtual

Reimplemented from FWConfigurableParameterizable.

Definition at line 183 of file CmsShowCommon.cc.

References FWParameterizable::begin(), fireworks::Context::colorManager(), convert(), FWParameterizable::end(), i, kFWGeomColorSize, m_backgroundColor, m_context, m_energyScale, m_gamma, m_geomColors, m_geomTransparency2D, m_geomTransparency3D, alignBH_cfg::mode, FWColorManager::setBackgroundAndBrightness(), FWColorManager::setGeomColor(), FWColorManager::setGeomTransparency(), v, FWConfiguration::value(), relativeConstraints::value, FWGenericParameter< T >::value(), and FWConfiguration::valueForKey().

184 {
185  for(const_iterator it =begin(), itEnd = end();
186  it != itEnd;
187  ++it) {
188  (*it)->setFrom(iFrom);
189  }
190 
191  // handle old and new energy scale configuration if existing
192  if (iFrom.valueForKey("ScaleMode"))
193  {
194  long mode = atol(iFrom.valueForKey("ScaleMode")->value().c_str());
195 
196  float convert;
197  if (iFrom.valueForKey("EnergyToLength [GeV/m]"))
198  convert = atof(iFrom.valueForKey("EnergyToLength [GeV/m]")->value().c_str());
199  else
200  convert = atof(iFrom.valueForKey("ValueToHeight [GeV/m]")->value().c_str());
201 
202  float maxH;
203  if (iFrom.valueForKey("MaximumLength [m]"))
204  maxH = atof(iFrom.valueForKey("MaximumLength [m]")->value().c_str());
205  else
206  maxH = atof(iFrom.valueForKey("MaxTowerH [m]")->value().c_str());
207 
208  int et = atoi(iFrom.valueForKey("PlotEt")->value().c_str());
209  m_energyScale->SetFromCmsShowCommonConfig(mode, convert, maxH, et);
210  }
211 
212  // background
215 
216  // geom colors
219 
220  for (int i = 0; i < kFWGeomColorSize; ++i)
222 
223  if (gEve)
224  {
225  TGLViewer* v = gEve->GetDefaultGLViewer();
226  setGLColorFromConfig(v->RefLightColorSet().Selection(1), iFrom.valueForKey("SelectionColorLight"));
227  setGLColorFromConfig(v->RefLightColorSet().Selection(3), iFrom.valueForKey("HighlightColorLight"));
228  setGLColorFromConfig(v->RefDarkColorSet().Selection(1), iFrom.valueForKey("SelectionColorDark"));
229  setGLColorFromConfig(v->RefDarkColorSet().Selection(3), iFrom.valueForKey("HighlightColorDark"));
230  }
231 }
int i
Definition: DBlmapReader.cc:9
std::vector< FWParameterBase * >::const_iterator const_iterator
const_iterator begin() const
FWLongParameter m_backgroundColor
Definition: CmsShowCommon.h:85
FWColorManager * colorManager() const
Definition: Context.h:66
FWGeomColorIndex
FWLongParameter * m_geomColors[kFWGeomColorSize]
Definition: CmsShowCommon.h:91
void convert(uint32 i, char_uint32 v)
Definition: MsgTools.h:46
FWLongParameter m_gamma
Definition: CmsShowCommon.h:86
void setGeomColor(FWGeomColorIndex, Color_t)
void setGeomTransparency(Color_t idx, bool projectedType)
const_iterator end() const
fireworks::Context * m_context
Definition: CmsShowCommon.h:79
FWLongParameter m_geomTransparency3D
Definition: CmsShowCommon.h:90
const std::string & value(unsigned int iIndex=0) const
FWLongParameter m_geomTransparency2D
Definition: CmsShowCommon.h:89
std::auto_ptr< FWViewEnergyScale > m_energyScale
Definition: CmsShowCommon.h:94
void setBackgroundAndBrightness(BackgroundColorIndex, int)
const FWConfiguration * valueForKey(const std::string &iKey) const
mathSSE::Vec4< T > v
void CmsShowCommon::setGamma ( )

Definition at line 101 of file CmsShowCommon.cc.

References fireworks::Context::colorManager(), m_context, m_gamma, FWColorManager::setBrightness(), and FWGenericParameter< T >::value().

Referenced by CmsShowCommon().

102 {
104 }
FWColorManager * colorManager() const
Definition: Context.h:66
FWLongParameter m_gamma
Definition: CmsShowCommon.h:86
void setBrightness(int)
fireworks::Context * m_context
Definition: CmsShowCommon.h:79
void CmsShowCommon::setGeomColor ( FWGeomColorIndex  cidx,
Color_t  iColor 
)

Definition at line 114 of file CmsShowCommon.cc.

References fireworks::Context::colorManager(), m_context, m_geomColors, FWGenericParameter< T >::set(), and FWColorManager::setGeomColor().

Referenced by CmsShowCommonPopup::changeGeomColor().

115 {
116  m_geomColors[cidx]->set(iColor);
117  m_context->colorManager()->setGeomColor(cidx, iColor);
118 }
FWColorManager * colorManager() const
Definition: Context.h:66
FWLongParameter * m_geomColors[kFWGeomColorSize]
Definition: CmsShowCommon.h:91
void setGeomColor(FWGeomColorIndex, Color_t)
fireworks::Context * m_context
Definition: CmsShowCommon.h:79
void CmsShowCommon::setGeomTransparency ( int  val,
bool  projected 
)

Definition at line 121 of file CmsShowCommon.cc.

References fireworks::Context::colorManager(), m_context, m_geomTransparency2D, m_geomTransparency3D, FWGenericParameter< T >::set(), and FWColorManager::setGeomTransparency().

Referenced by CmsShowCommonPopup::changeGeomTransparency2D(), and CmsShowCommonPopup::changeGeomTransparency3D().

122 {
123  if (projected)
124  m_geomTransparency2D.set(iTransp);
125  else
126  m_geomTransparency3D.set(iTransp);
127 
128  m_context->colorManager()->setGeomTransparency(iTransp, projected);
129 }
FWColorManager * colorManager() const
Definition: Context.h:66
void setGeomTransparency(Color_t idx, bool projectedType)
fireworks::Context * m_context
Definition: CmsShowCommon.h:79
FWLongParameter m_geomTransparency3D
Definition: CmsShowCommon.h:90
FWLongParameter m_geomTransparency2D
Definition: CmsShowCommon.h:89
void CmsShowCommon::setTrackBreakMode ( )

Definition at line 76 of file CmsShowCommon.cc.

References fireworks::Context::getMuonTrackPropagator(), fireworks::Context::getTrackerTrackPropagator(), fireworks::Context::getTrackPropagator(), m_context, m_trackBreak, and FWGenericParameter< T >::value().

Referenced by CmsShowCommon().

77 {
78  if (m_context->getTrackPropagator()->GetProjTrackBreaking() != m_trackBreak.value())
79  {
80  m_context->getTrackPropagator()->SetProjTrackBreaking(m_trackBreak.value());
81  m_context->getTrackerTrackPropagator()->SetProjTrackBreaking(m_trackBreak.value());
82  m_context->getMuonTrackPropagator()->SetProjTrackBreaking(m_trackBreak.value());
83  gEve->Redraw3D();
84  }
85 }
TEveTrackPropagator * getTrackerTrackPropagator() const
Definition: Context.h:75
TEveTrackPropagator * getTrackPropagator() const
Definition: Context.h:74
fireworks::Context * m_context
Definition: CmsShowCommon.h:79
TEveTrackPropagator * getMuonTrackPropagator() const
Definition: Context.h:76
FWEnumParameter m_trackBreak
Definition: CmsShowCommon.h:81
void CmsShowCommon::switchBackground ( )

Definition at line 107 of file CmsShowCommon.cc.

References fireworks::Context::colorManager(), colorManager(), m_backgroundColor, m_context, FWGenericParameter< T >::set(), and FWColorManager::switchBackground().

Referenced by CmsShowCommonPopup::switchBackground().

108 {
110  m_backgroundColor.set(colorManager()->background());
111 }
FWLongParameter m_backgroundColor
Definition: CmsShowCommon.h:85
FWColorManager * colorManager() const
Definition: Context.h:66
const FWColorManager * colorManager() const
fireworks::Context * m_context
Definition: CmsShowCommon.h:79

Friends And Related Function Documentation

friend class CmsShowCommonPopup
friend

Definition at line 43 of file CmsShowCommon.h.

Member Data Documentation

FWLongParameter CmsShowCommon::m_backgroundColor
mutableprotected

Definition at line 85 of file CmsShowCommon.h.

Referenced by addTo(), setFrom(), and switchBackground().

fireworks::Context* CmsShowCommon::m_context
protected
FWBoolParameter CmsShowCommon::m_drawBreakPoints
protected
std::auto_ptr<FWViewEnergyScale> CmsShowCommon::m_energyScale
protected
FWLongParameter CmsShowCommon::m_gamma
protected
FWLongParameter* CmsShowCommon::m_geomColors[kFWGeomColorSize]
protected

Definition at line 91 of file CmsShowCommon.h.

Referenced by CmsShowCommon(), setFrom(), and setGeomColor().

FWLongParameter CmsShowCommon::m_geomTransparency2D
protected

Definition at line 89 of file CmsShowCommon.h.

Referenced by setFrom(), and setGeomTransparency().

FWLongParameter CmsShowCommon::m_geomTransparency3D
protected

Definition at line 90 of file CmsShowCommon.h.

Referenced by setFrom(), and setGeomTransparency().

FWEnumParameter CmsShowCommon::m_trackBreak
protected