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)
 
 FWViewEnergyScale (const FWViewEnergyScale &)=delete
 
bool getPlotEt () const
 
float getScaleFactor3D () const
 
float getScaleFactorLego () const
 
const std::string & name () const
 
const FWViewEnergyScaleoperator= (const FWViewEnergyScale &)=delete
 
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)
 
 FWConfigurableParameterizable (const FWConfigurableParameterizable &)=delete
 
const FWConfigurableParameterizableoperator= (const FWConfigurableParameterizable &)=delete
 
unsigned int version () const
 
 ~FWConfigurableParameterizable () override
 
- Public Member Functions inherited from FWParameterizable
void add (FWParameterBase *)
 
const_iterator begin () const
 
const_iterator end () const
 
 FWParameterizable ()
 
 FWParameterizable (const FWParameterizable &)=delete
 
const FWParameterizableoperator= (const FWParameterizable &)=delete
 
virtual ~FWParameterizable ()
 
- Public Member Functions inherited from FWConfigurable
 FWConfigurable ()
 
 FWConfigurable (const FWConfigurable &)=delete
 
const FWConfigurableoperator= (const FWConfigurable &)=delete
 
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
 

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

◆ EScaleMode

Constructor & Destructor Documentation

◆ FWViewEnergyScale() [1/2]

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

Definition at line 24 of file FWViewEnergyScale.cc.

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

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

◆ ~FWViewEnergyScale()

FWViewEnergyScale::~FWViewEnergyScale ( )
override

Definition at line 43 of file FWViewEnergyScale.cc.

43 {}

◆ FWViewEnergyScale() [2/2]

FWViewEnergyScale::FWViewEnergyScale ( const FWViewEnergyScale )
delete

Member Function Documentation

◆ calculateScaleFactor()

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

Definition at line 49 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().

49  {
50  // check if in combined mode
51  int mode = m_scaleMode.value();
52  if (mode == kCombinedScale) {
54  // printf("COMBINED \n");
55  }
56  // get converison
57 
58  if (mode == kFixedScale) {
59  // printf("fixed mode %f \n",m_fixedValToHeight.value());
60  // apply default constructor height
61  float length = isLego ? TMath::Pi() : 100;
62  return length / m_fixedValToHeight.value();
63  } else {
64  float length = isLego ? TMath::Pi() : (100 * m_maxTowerHeight.value());
65  // printf("[%d] length %f max %f \n", isLego, length, iMaxVal);
66  return length / iMaxVal;
67  }
68 }
const double Pi
FWDoubleParameter m_fixedValToHeight
Definition: value.py:1
FWDoubleParameter m_maxTowerHeight
FWEnumParameter m_scaleMode

◆ getPlotEt()

bool FWViewEnergyScale::getPlotEt ( ) const
inline

◆ getScaleFactor3D()

float FWViewEnergyScale::getScaleFactor3D ( ) const
inline

◆ getScaleFactorLego()

float FWViewEnergyScale::getScaleFactorLego ( ) const
inline

◆ name()

const std::string& FWViewEnergyScale::name ( void  ) const
inline

Definition at line 54 of file FWViewEnergyScale.h.

References m_name.

Referenced by config.CFG::__str__(), validation.Sample::digest(), and VIDSelectorBase.VIDSelectorBase::initialize().

54 { return m_name; }
const std::string m_name

◆ operator=()

const FWViewEnergyScale& FWViewEnergyScale::operator= ( const FWViewEnergyScale )
delete

◆ scaleParameterChanged()

void FWViewEnergyScale::scaleParameterChanged ( ) const

Definition at line 47 of file FWViewEnergyScale.cc.

References parameterChanged_.

Referenced by FWViewEnergyScale().

47 { parameterChanged_.emit(); }
sigc::signal< void()> parameterChanged_

◆ setFrom()

void FWViewEnergyScale::setFrom ( const FWConfiguration iFrom)
overridevirtual

Reimplemented from FWConfigurableParameterizable.

Definition at line 75 of file FWViewEnergyScale.cc.

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

75  {
76  for (const_iterator it = begin(), itEnd = end(); it != itEnd; ++it) {
77  (*it)->setFrom(iFrom);
78  }
79 }
const_iterator begin() const
std::vector< FWParameterBase * >::const_iterator const_iterator
const_iterator end() const

◆ SetFromCmsShowCommonConfig()

void FWViewEnergyScale::SetFromCmsShowCommonConfig ( long  mode,
float  convert,
float  maxH,
bool  et 
)

◆ updateScaleFactors()

void FWViewEnergyScale::updateScaleFactors ( float  iMaxVal)

Definition at line 70 of file FWViewEnergyScale.cc.

References calculateScaleFactor(), m_scaleFactor3D, and m_scaleFactorLego.

Referenced by FWEveView::setupEnergyScale().

70  {
71  m_scaleFactor3D = calculateScaleFactor(iMaxVal, false);
72  m_scaleFactorLego = calculateScaleFactor(iMaxVal, true);
73 }
float calculateScaleFactor(float iMaxVal, bool isLego) const

Friends And Related Function Documentation

◆ FWViewEnergyScaleEditor

friend class FWViewEnergyScaleEditor
friend

Definition at line 35 of file FWViewEnergyScale.h.

Member Data Documentation

◆ m_fixedValToHeight

FWDoubleParameter FWViewEnergyScale::m_fixedValToHeight
protected

◆ m_maxTowerHeight

FWDoubleParameter FWViewEnergyScale::m_maxTowerHeight
protected

◆ m_name

const std::string FWViewEnergyScale::m_name
private

Definition at line 72 of file FWViewEnergyScale.h.

Referenced by name().

◆ m_plotEt

FWBoolParameter FWViewEnergyScale::m_plotEt
protected

◆ m_scaleFactor3D

float FWViewEnergyScale::m_scaleFactor3D
private

Definition at line 75 of file FWViewEnergyScale.h.

Referenced by getScaleFactor3D(), and updateScaleFactors().

◆ m_scaleFactorLego

float FWViewEnergyScale::m_scaleFactorLego
private

Definition at line 76 of file FWViewEnergyScale.h.

Referenced by getScaleFactorLego(), and updateScaleFactors().

◆ m_scaleMode

FWEnumParameter FWViewEnergyScale::m_scaleMode
protected

◆ parameterChanged_

sigc::signal<void()> FWViewEnergyScale::parameterChanged_

Definition at line 51 of file FWViewEnergyScale.h.

Referenced by scaleParameterChanged().