#include <Fireworks/Core/interface/FWViewEnergyScale.h>
Public Types | |
enum | EScaleMode { kFixedScale, kAutoScale, kCombinedScale, kNone } |
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 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 FWViewEnergyScale & | operator= (const FWViewEnergyScale &) |
Private Attributes | |
const std::string | m_name |
float | m_scaleFactor3D |
float | m_scaleFactorLego |
Friends | |
class | FWViewEnergyScaleEditor |
Description: [one line class summary]
Usage: <usage>
Definition at line 35 of file FWViewEnergyScale.h.
Definition at line 40 of file FWViewEnergyScale.h.
{ kFixedScale, kAutoScale, kCombinedScale, kNone };
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().
: FWConfigurableParameterizable(version), m_scaleMode(this, "ScaleMode", 1l, 1l, 2l), m_fixedValToHeight(this, "EnergyToLength [GeV/m]", 50.0, 1.0, 100.0), m_maxTowerHeight(this, "MaximumLength [m]", 3.0, 0.01, 30.0 ), m_plotEt(this, "PlotEt", true), m_name(name), m_scaleFactor3D(1.f), m_scaleFactorLego(0.05f) { m_scaleMode.addEntry(kFixedScale, "FixedScale"); m_scaleMode.addEntry(kAutoScale, "AutomaticScale"); m_scaleMode.addEntry(kCombinedScale,"CombinedScale"); m_scaleMode.changed_.connect(boost::bind(&FWViewEnergyScale::scaleParameterChanged,this)); m_fixedValToHeight.changed_.connect(boost::bind(&FWViewEnergyScale::scaleParameterChanged,this)); m_maxTowerHeight.changed_.connect(boost::bind(&FWViewEnergyScale::scaleParameterChanged,this)); m_plotEt.changed_.connect(boost::bind(&FWViewEnergyScale::scaleParameterChanged,this)); }
FWViewEnergyScale::~FWViewEnergyScale | ( | ) | [virtual] |
Definition at line 46 of file FWViewEnergyScale.cc.
{ }
FWViewEnergyScale::FWViewEnergyScale | ( | const FWViewEnergyScale & | ) | [private] |
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().
{ // check if in combined mode int mode = m_scaleMode.value(); if (mode == kCombinedScale) { mode = (m_maxTowerHeight.value() > 100*iMaxVal/m_fixedValToHeight.value()) ? kFixedScale : kAutoScale; // printf("COMBINED \n"); } // get converison if (mode == kFixedScale) { // printf("fixed mode %f \n",m_fixedValToHeight.value()); // apply default constructor height float length = isLego ? TMath::Pi() : 100; return length / m_fixedValToHeight.value(); } else { float length = isLego ? TMath::Pi() : (100*m_maxTowerHeight.value()) ; // printf("[%d] length %f max %f \n", isLego, length, iMaxVal); return length / iMaxVal; } }
bool FWViewEnergyScale::getPlotEt | ( | ) | const [inline] |
Definition at line 49 of file FWViewEnergyScale.h.
References m_plotEt, and FWGenericParameter< T >::value().
Referenced by FWHBHERecHitProxyBuilder::build(), FWEcalRecHitProxyBuilder::build(), FWTauProxyBuilderBase::buildBaseTau(), FWPFRhoPhiRecHit::buildRecHit(), FWPFClusterRPZUtils::buildRhoPhiClusterLineSet(), FWPFClusterRPZUtils::buildRhoZClusterLineSet(), FWPFLegoRecHit::buildTower(), FWJetProxyBuilder::buildViewType(), FWLegoEvePFCandidate::FWLegoEvePFCandidate(), FWPFLegoCandidate::FWPFLegoCandidate(), FWEcalRecHitProxyBuilder::scaleProduct(), FWPFEcalRecHitLegoProxyBuilder::scaleProduct(), FWMETProxyBuilder::scaleProduct(), FWPFBlockProxyBuilder::scaleProduct(), FWPFClusterRPZProxyBuilder::scaleProduct(), FWTauProxyBuilderBase::scaleProduct(), FWHBHERecHitProxyBuilder::scaleProduct(), FWJetProxyBuilder::scaleProduct(), FWMET3DProxyBuilder::Arrow::setScale(), FWEveView::setupEnergyScale(), FWPFLegoRecHit::updateScale(), FWLegoEvePFCandidate::updateScale(), FWPFLegoCandidate::updateScale(), and FWPFRhoPhiRecHit::updateScale().
float FWViewEnergyScale::getScaleFactor3D | ( | ) | const [inline] |
Definition at line 46 of file FWViewEnergyScale.h.
References m_scaleFactor3D.
Referenced by FWTauProxyBuilderBase::buildBaseTau(), FWPFRhoPhiRecHit::buildRecHit(), FWPFClusterRPZUtils::buildRhoPhiClusterLineSet(), FWPFClusterRPZUtils::buildRhoZClusterLineSet(), FWJetProxyBuilder::buildViewType(), FWMETProxyBuilder::scaleProduct(), FWPFBlockProxyBuilder::scaleProduct(), FWPFClusterRPZProxyBuilder::scaleProduct(), FWTauProxyBuilderBase::scaleProduct(), FWJetProxyBuilder::scaleProduct(), FWMET3DProxyBuilder::Arrow::setScale(), FWEveView::setupEnergyScale(), and FWPFRhoPhiRecHit::updateScale().
{ return m_scaleFactor3D; }
float FWViewEnergyScale::getScaleFactorLego | ( | ) | const [inline] |
Definition at line 47 of file FWViewEnergyScale.h.
References m_scaleFactorLego.
Referenced by FWPFLegoRecHit::buildTower(), FWLegoEvePFCandidate::FWLegoEvePFCandidate(), FWPFLegoCandidate::FWPFLegoCandidate(), FWEveView::setupEnergyScale(), FWPFLegoRecHit::updateScale(), FWLegoEvePFCandidate::updateScale(), and FWPFLegoCandidate::updateScale().
{ return m_scaleFactorLego; }
const std::string& FWViewEnergyScale::name | ( | void | ) | const [inline] |
const FWViewEnergyScale& FWViewEnergyScale::operator= | ( | const FWViewEnergyScale & | ) | [private] |
void FWViewEnergyScale::scaleParameterChanged | ( | ) | const |
Definition at line 53 of file FWViewEnergyScale.cc.
References parameterChanged_.
Referenced by FWViewEnergyScale().
{ parameterChanged_.emit(); }
void FWViewEnergyScale::setFrom | ( | const FWConfiguration & | iFrom | ) | [virtual] |
Reimplemented from FWConfigurableParameterizable.
Definition at line 94 of file FWViewEnergyScale.cc.
References FWParameterizable::begin(), and FWParameterizable::end().
{ for(const_iterator it =begin(), itEnd = end(); it != itEnd; ++it) { (*it)->setFrom(iFrom); } }
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().
{ m_scaleMode.set(mode); m_fixedValToHeight.set(convert); m_maxTowerHeight.set(maxH); m_plotEt.set(et > 0); }
void FWViewEnergyScale::updateScaleFactors | ( | float | iMaxVal | ) |
Definition at line 87 of file FWViewEnergyScale.cc.
References calculateScaleFactor(), m_scaleFactor3D, and m_scaleFactorLego.
Referenced by FWEveView::setupEnergyScale().
{ m_scaleFactor3D = calculateScaleFactor(iMaxVal, false); m_scaleFactorLego = calculateScaleFactor(iMaxVal, true); }
friend class FWViewEnergyScaleEditor [friend] |
Definition at line 37 of file FWViewEnergyScale.h.
Definition at line 63 of file FWViewEnergyScale.h.
Referenced by calculateScaleFactor(), FWViewEnergyScale(), FWViewEnergyScaleEditor::FWViewEnergyScaleEditor(), and SetFromCmsShowCommonConfig().
FWDoubleParameter FWViewEnergyScale::m_maxTowerHeight [protected] |
Definition at line 64 of file FWViewEnergyScale.h.
Referenced by calculateScaleFactor(), FWViewEnergyScale(), FWViewEnergyScaleEditor::FWViewEnergyScaleEditor(), and SetFromCmsShowCommonConfig().
const std::string FWViewEnergyScale::m_name [private] |
Definition at line 73 of file FWViewEnergyScale.h.
Referenced by name().
FWBoolParameter FWViewEnergyScale::m_plotEt [protected] |
Definition at line 65 of file FWViewEnergyScale.h.
Referenced by FWViewEnergyScale(), FWViewEnergyScaleEditor::FWViewEnergyScaleEditor(), getPlotEt(), and SetFromCmsShowCommonConfig().
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] |
Definition at line 62 of file FWViewEnergyScale.h.
Referenced by calculateScaleFactor(), FWViewEnergyScale(), FWViewEnergyScaleEditor::FWViewEnergyScaleEditor(), and SetFromCmsShowCommonConfig().
sigc::signal<void> FWViewEnergyScale::parameterChanged_ |
Definition at line 53 of file FWViewEnergyScale.h.
Referenced by scaleParameterChanged(), and FWEveViewManager::setContext().