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 30 of file CmsShowCommon.cc.

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

30  :
32  m_context(c),
33  m_trackBreak(this, " ", 2l, 0l, 2l), // do not want to render text at setter
34  m_drawBreakPoints(this, "Show y=0 points as markers", true),
35  m_backgroundColor(this, "backgroundColIdx", 1l, 0l, 1000l),
36  m_gamma(this, "Brightness", 0l, -15l, 15l),
37  m_geomTransparency2D(this, "Transparency 2D", long(colorManager()->geomTransparency(true)), 0l, 100l),
38  m_geomTransparency3D(this, "Transparency 3D", long(colorManager()->geomTransparency(false)), 0l, 100l),
39  m_energyScale(new FWViewEnergyScale("global", 2))
40 {
41  // projections
42  m_trackBreak.addEntry(0, "Jump to proper hemisphere");
43  m_trackBreak.addEntry(1, "Stay on first point side");
44  m_trackBreak.addEntry(2, "Stay on last point side");
45 
46  // colors
47  char name[32];
48  for (int i = 0; i < kFWGeomColorSize; ++i)
49  {
50  snprintf(name, 31, "GeometryColor %d ", i);
51  m_geomColors[i] = new FWLongParameter(this, name , long(colorManager()->geomColor(FWGeomColorIndex(i))), 1000l, 1100l);
52  }
53 
54  m_trackBreak.changed_.connect(boost::bind(&CmsShowCommon::setTrackBreakMode, this));
56  m_gamma.changed_.connect(boost::bind(&CmsShowCommon::setGamma, this));
57 }
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 59 of file CmsShowCommon.cc.

60 {
61 }
CmsShowCommon::CmsShowCommon ( const CmsShowCommon )
private

Member Function Documentation

void CmsShowCommon::addTo ( FWConfiguration oTo) const
virtual

Reimplemented from FWConfigurableParameterizable.

Definition at line 132 of file CmsShowCommon.cc.

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

133 {
134  m_backgroundColor.set(int(colorManager()->background()));
135 
137  m_energyScale->addTo(oTo);
138 }
FWLongParameter m_backgroundColor
Definition: CmsShowCommon.h:85
const FWColorManager * colorManager() const
std::auto_ptr< FWViewEnergyScale > m_energyScale
Definition: CmsShowCommon.h:94
virtual void addTo(FWConfiguration &) const
const FWColorManager * CmsShowCommon::colorManager ( ) const
protected

Definition at line 64 of file CmsShowCommon.cc.

References fireworks::Context::colorManager(), and m_context.

Referenced by addTo(), CmsShowCommon(), CmsShowCommonPopup::CmsShowCommonPopup(), CmsShowCommonPopup::colorSetChanged(), and switchBackground().

65 {
66  return m_context->colorManager();
67 }
FWColorManager * colorManager() const
Definition: Context.h:66
fireworks::Context * m_context
Definition: CmsShowCommon.h:79
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 87 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().

88 {
89  if (m_context->getTrackPropagator()->GetRnrPTBMarkers() != m_drawBreakPoints.value())
90  {
91  m_context->getTrackPropagator()->SetRnrPTBMarkers(m_drawBreakPoints.value());
94  gEve->Redraw3D();
95  }
96 }
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 141 of file CmsShowCommon.cc.

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

142 {
143  for(const_iterator it =begin(), itEnd = end();
144  it != itEnd;
145  ++it) {
146  (*it)->setFrom(iFrom);
147  }
148 
149  // handle old and new energy scale configuration if existing
150  if (iFrom.valueForKey("ScaleMode"))
151  {
152  long mode = atol(iFrom.valueForKey("ScaleMode")->value().c_str());
153 
154  float convert;
155  if (iFrom.valueForKey("EnergyToLength [GeV/m]"))
156  convert = atof(iFrom.valueForKey("EnergyToLength [GeV/m]")->value().c_str());
157  else
158  convert = atof(iFrom.valueForKey("ValueToHeight [GeV/m]")->value().c_str());
159 
160  float maxH;
161  if (iFrom.valueForKey("MaximumLength [m]"))
162  maxH = atof(iFrom.valueForKey("MaximumLength [m]")->value().c_str());
163  else
164  maxH = atof(iFrom.valueForKey("MaxTowerH [m]")->value().c_str());
165 
166  int et = atoi(iFrom.valueForKey("PlotEt")->value().c_str());
167  m_energyScale->SetFromCmsShowCommonConfig(mode, convert, maxH, et);
168  }
169 
170  // background
173 
174  // geom colors
177 
178  for (int i = 0; i < kFWGeomColorSize; ++i)
180 }
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
int mode
Definition: AMPTWrapper.h:139
void setBackgroundAndBrightness(BackgroundColorIndex, int)
const FWConfiguration * valueForKey(const std::string &iKey) const
void CmsShowCommon::setGamma ( )

Definition at line 99 of file CmsShowCommon.cc.

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

Referenced by CmsShowCommon().

100 {
102 }
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 112 of file CmsShowCommon.cc.

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

Referenced by CmsShowCommonPopup::changeGeomColor().

113 {
114  m_geomColors[cidx]->set(iColor);
115  m_context->colorManager()->setGeomColor(cidx, iColor);
116 }
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 119 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().

120 {
121  if (projected)
122  m_geomTransparency2D.set(iTransp);
123  else
124  m_geomTransparency3D.set(iTransp);
125 
126  m_context->colorManager()->setGeomTransparency(iTransp, projected);
127 }
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 74 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().

75 {
76  if (m_context->getTrackPropagator()->GetProjTrackBreaking() != m_trackBreak.value())
77  {
78  m_context->getTrackPropagator()->SetProjTrackBreaking(m_trackBreak.value());
79  m_context->getTrackerTrackPropagator()->SetProjTrackBreaking(m_trackBreak.value());
80  m_context->getMuonTrackPropagator()->SetProjTrackBreaking(m_trackBreak.value());
81  gEve->Redraw3D();
82  }
83 }
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 105 of file CmsShowCommon.cc.

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

Referenced by CmsShowCommonPopup::switchBackground().

106 {
108  m_backgroundColor.set(colorManager()->background());
109 }
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