CMS 3D CMS Logo

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

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

Inheritance diagram for FWViewEnergyScale:
FWConfigurableParameterizable FWParameterizable FWConfigurable

Public Types

enum  EScaleMode { kFixedScale, kAutoScale, kCombinedScale, kNone }
 
- Public Types inherited from FWParameterizable
typedef std::vector
< FWParameterBase * >
::const_iterator 
const_iterator
 

Public Member Functions

 FWViewEnergyScale (std::string name, int version)
 
bool getPlotEt () const
 
float getScaleFactor3D () const
 
float getScaleFactorLego () const
 
const std::string & name () const
 
void scaleParameterChanged () const
 
virtual void setFrom (const FWConfiguration &)
 
void SetFromCmsShowCommonConfig (long mode, float convert, float maxH, bool et)
 
void updateScaleFactors (float iMaxVal)
 
virtual ~FWViewEnergyScale ()
 
- Public Member Functions inherited from FWConfigurableParameterizable
virtual void addTo (FWConfiguration &) const
 
 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 ()
 

Public Attributes

sigc::signal< void > parameterChanged_
 

Protected Attributes

FWDoubleParameter m_fixedValToHeight
 
FWDoubleParameter m_maxTowerHeight
 
FWBoolParameter m_plotEt
 
FWEnumParameter m_scaleMode
 

Private Member Functions

float calculateScaleFactor (float iMaxVal, bool isLego) const
 
 FWViewEnergyScale (const FWViewEnergyScale &)
 
const FWViewEnergyScaleoperator= (const FWViewEnergyScale &)
 

Private Attributes

const std::string m_name
 
float m_scaleFactor3D
 
float m_scaleFactorLego
 

Friends

class FWViewEnergyScaleEditor
 

Detailed Description

Description: [one line class summary]

Usage: <usage>

Definition at line 35 of file FWViewEnergyScale.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

FWViewEnergyScale::FWViewEnergyScale ( std::string  name,
int  version 
)

Definition at line 26 of file FWViewEnergyScale.cc.

References FWEnumParameter::addEntry(), FWGenericParameter< T >::changed_, kAutoScale, kCombinedScale, kFixedScale, m_fixedValToHeight, m_maxTowerHeight, m_plotEt, m_scaleMode, and scaleParameterChanged().

26  :
28 m_scaleMode(this, "ScaleMode", 1l, 1l, 2l),
29 m_fixedValToHeight(this, "EnergyToLength [GeV/m]", 50.0, 1.0, 100.0),
30 m_maxTowerHeight(this, "MaximumLength [m]", 3.0, 0.01, 30.0 ),
31 m_plotEt(this, "PlotEt", true),
32 m_name(name),
35 {
36  m_scaleMode.addEntry(kFixedScale, "FixedScale");
37  m_scaleMode.addEntry(kAutoScale, "AutomaticScale");
38  m_scaleMode.addEntry(kCombinedScale,"CombinedScale");
39 
44 }
FWDoubleParameter m_fixedValToHeight
void scaleParameterChanged() const
FWConfigurableParameterizable(unsigned int iVersion=1)
FWBoolParameter m_plotEt
sigc::signal< void, T > changed_
const std::string m_name
bool addEntry(Long_t id, const std::string &txt)
double f[11][100]
FWDoubleParameter m_maxTowerHeight
FWEnumParameter m_scaleMode
const std::string & name() const
FWViewEnergyScale::~FWViewEnergyScale ( )
virtual

Definition at line 46 of file FWViewEnergyScale.cc.

47 {
48 }
FWViewEnergyScale::FWViewEnergyScale ( const FWViewEnergyScale )
private

Member Function Documentation

float FWViewEnergyScale::calculateScaleFactor ( float  iMaxVal,
bool  isLego 
) const
private

Definition at line 59 of file FWViewEnergyScale.cc.

References kAutoScale, kCombinedScale, kFixedScale, m_fixedValToHeight, m_maxTowerHeight, m_scaleMode, mode, Pi, and FWGenericParameter< T >::value().

Referenced by updateScaleFactors().

60 {
61  // check if in combined mode
62  int mode = m_scaleMode.value();
63  if (mode == kCombinedScale)
64  {
65  mode = (m_maxTowerHeight.value() > 100*iMaxVal/m_fixedValToHeight.value()) ? kFixedScale : kAutoScale;
66  // printf("COMBINED \n");
67  }
68  // get converison
69 
70  if (mode == kFixedScale)
71  {
72  // printf("fixed mode %f \n",m_fixedValToHeight.value());
73  // apply default constructor height
74  float length = isLego ? TMath::Pi() : 100;
75  return length / m_fixedValToHeight.value();
76  }
77  else
78  {
79  float length = isLego ? TMath::Pi() : (100*m_maxTowerHeight.value()) ;
80  // printf("[%d] length %f max %f \n", isLego, length, iMaxVal);
81  return length / iMaxVal;
82  }
83 }
const double Pi
FWDoubleParameter m_fixedValToHeight
FWDoubleParameter m_maxTowerHeight
FWEnumParameter m_scaleMode
int mode
Definition: AMPTWrapper.h:139
bool FWViewEnergyScale::getPlotEt ( ) const
inline
float FWViewEnergyScale::getScaleFactor3D ( ) const
inline
float FWViewEnergyScale::getScaleFactorLego ( ) const
inline
const std::string& FWViewEnergyScale::name ( void  ) const
inline

Definition at line 56 of file FWViewEnergyScale.h.

References m_name.

Referenced by python.Vispa.Views.PropertyView.Property::valueChanged().

56 { return m_name; }
const std::string m_name
const FWViewEnergyScale& FWViewEnergyScale::operator= ( const FWViewEnergyScale )
private
void FWViewEnergyScale::scaleParameterChanged ( ) const

Definition at line 53 of file FWViewEnergyScale.cc.

References parameterChanged_.

Referenced by FWViewEnergyScale().

54 {
55  parameterChanged_.emit();
56 }
sigc::signal< void > parameterChanged_
void FWViewEnergyScale::setFrom ( const FWConfiguration iFrom)
virtual

Reimplemented from FWConfigurableParameterizable.

Definition at line 94 of file FWViewEnergyScale.cc.

References FWParameterizable::begin(), and FWParameterizable::end().

95 {
96  for(const_iterator it =begin(), itEnd = end();
97  it != itEnd;
98  ++it) {
99  (*it)->setFrom(iFrom);
100  }
101 }
std::vector< FWParameterBase * >::const_iterator const_iterator
const_iterator begin() const
const_iterator end() const
void FWViewEnergyScale::SetFromCmsShowCommonConfig ( long  mode,
float  convert,
float  maxH,
bool  et 
)

Definition at line 104 of file FWViewEnergyScale.cc.

References m_fixedValToHeight, m_maxTowerHeight, m_plotEt, m_scaleMode, and FWGenericParameter< T >::set().

105 {
108  m_maxTowerHeight.set(maxH);
109  m_plotEt.set(et > 0);
110 }
FWDoubleParameter m_fixedValToHeight
FWBoolParameter m_plotEt
void convert(uint32 i, char_uint32 v)
Definition: MsgTools.h:46
FWDoubleParameter m_maxTowerHeight
FWEnumParameter m_scaleMode
int mode
Definition: AMPTWrapper.h:139
void FWViewEnergyScale::updateScaleFactors ( float  iMaxVal)

Definition at line 87 of file FWViewEnergyScale.cc.

References calculateScaleFactor(), m_scaleFactor3D, and m_scaleFactorLego.

Referenced by FWEveView::setupEnergyScale().

88 {
89  m_scaleFactor3D = calculateScaleFactor(iMaxVal, false);
90  m_scaleFactorLego = calculateScaleFactor(iMaxVal, true);
91 }
float calculateScaleFactor(float iMaxVal, bool isLego) const

Friends And Related Function Documentation

friend class FWViewEnergyScaleEditor
friend

Definition at line 37 of file FWViewEnergyScale.h.

Member Data Documentation

FWDoubleParameter FWViewEnergyScale::m_fixedValToHeight
protected
FWDoubleParameter FWViewEnergyScale::m_maxTowerHeight
protected
const std::string FWViewEnergyScale::m_name
private

Definition at line 73 of file FWViewEnergyScale.h.

Referenced by name().

FWBoolParameter FWViewEnergyScale::m_plotEt
protected
float FWViewEnergyScale::m_scaleFactor3D
private

Definition at line 76 of file FWViewEnergyScale.h.

Referenced by getScaleFactor3D(), and updateScaleFactors().

float FWViewEnergyScale::m_scaleFactorLego
private

Definition at line 77 of file FWViewEnergyScale.h.

Referenced by getScaleFactorLego(), and updateScaleFactors().

FWEnumParameter FWViewEnergyScale::m_scaleMode
protected
sigc::signal<void> FWViewEnergyScale::parameterChanged_

Definition at line 53 of file FWViewEnergyScale.h.

Referenced by scaleParameterChanged(), and FWEveViewManager::setContext().