CMS 3D CMS Logo

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
 
void setFrom (const FWConfiguration &) override
 
void SetFromCmsShowCommonConfig (long mode, float convert, float maxH, bool et)
 
void updateScaleFactors (float iMaxVal)
 
 ~FWViewEnergyScale () override
 
- Public Member Functions inherited from FWConfigurableParameterizable
void addTo (FWConfiguration &) const override
 
 FWConfigurableParameterizable (unsigned int iVersion=1)
 
unsigned int version () const
 
 ~FWConfigurableParameterizable () override
 
- 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 &)=delete
 
const FWViewEnergyScaleoperator= (const FWViewEnergyScale &)=delete
 

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 34 of file FWViewEnergyScale.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

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

Definition at line 25 of file FWViewEnergyScale.cc.

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

25  :
27 m_scaleMode(this, "ScaleMode", 1l, 1l, 2l),
28 m_fixedValToHeight(this, "EnergyToLength [GeV/m]", 50.0, 1.0, 100.0),
29 m_maxTowerHeight(this, "MaximumLength [m]", 3.0, 0.01, 30.0 ),
30 m_plotEt(this, "PlotEt", true),
31 m_name(name),
34 {
35  m_scaleMode.addEntry(kFixedScale, "FixedScale");
36  m_scaleMode.addEntry(kAutoScale, "AutomaticScale");
37  m_scaleMode.addEntry(kCombinedScale,"CombinedScale");
38 
43 }
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 ( )
override

Definition at line 45 of file FWViewEnergyScale.cc.

46 {
47 }
FWViewEnergyScale::FWViewEnergyScale ( const FWViewEnergyScale )
privatedelete

Member Function Documentation

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

Definition at line 58 of file FWViewEnergyScale.cc.

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

Referenced by updateScaleFactors().

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

Definition at line 52 of file FWViewEnergyScale.cc.

References parameterChanged_.

Referenced by FWViewEnergyScale(), and getPlotEt().

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

Reimplemented from FWConfigurableParameterizable.

Definition at line 93 of file FWViewEnergyScale.cc.

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

Referenced by name().

94 {
95  for(const_iterator it =begin(), itEnd = end();
96  it != itEnd;
97  ++it) {
98  (*it)->setFrom(iFrom);
99  }
100 }
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 103 of file FWViewEnergyScale.cc.

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

Referenced by name(), and CmsShowCommon::setFrom().

104 {
107  m_maxTowerHeight.set(maxH);
108  m_plotEt.set(et > 0);
109 }
FWDoubleParameter m_fixedValToHeight
FWBoolParameter m_plotEt
def convert(infile, ofile)
FWDoubleParameter m_maxTowerHeight
FWEnumParameter m_scaleMode
et
define resolution functions of each parameter
void FWViewEnergyScale::updateScaleFactors ( float  iMaxVal)

Definition at line 86 of file FWViewEnergyScale.cc.

References calculateScaleFactor(), m_scaleFactor3D, and m_scaleFactorLego.

Referenced by FWEveView::setupEnergyScale().

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

Friends And Related Function Documentation

friend class FWViewEnergyScaleEditor
friend

Definition at line 36 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 72 of file FWViewEnergyScale.h.

Referenced by name().

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

Definition at line 75 of file FWViewEnergyScale.h.

Referenced by getScaleFactor3D(), and updateScaleFactors().

float FWViewEnergyScale::m_scaleFactorLego
private

Definition at line 76 of file FWViewEnergyScale.h.

Referenced by getScaleFactorLego(), and updateScaleFactors().

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

Definition at line 52 of file FWViewEnergyScale.h.

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