CMS 3D CMS Logo

/data/git/CMSSW_5_3_11_patch5/src/Fireworks/Core/interface/FWViewEnergyScale.h

Go to the documentation of this file.
00001 #ifndef Fireworks_Core_FWViewEnergyScale_h
00002 #define Fireworks_Core_FWViewEnergyScale_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     Core
00006 // Class  :     FWViewEnergyScale
00007 // 
00016 //
00017 // Original Author:  Alja Mrak-Tadel
00018 //         Created:  Fri Jun 18 20:37:55 CEST 2010
00019 // $Id: FWViewEnergyScale.h,v 1.8 2010/11/27 22:08:23 amraktad Exp $
00020 //
00021 
00022 // system include files
00023 
00024 // user include files
00025 
00026 #include "Fireworks/Core/interface/FWDoubleParameter.h"
00027 #include "Fireworks/Core/interface/FWBoolParameter.h"
00028 #include "Fireworks/Core/interface/FWLongParameter.h"
00029 #include "Fireworks/Core/interface/FWEnumParameter.h"
00030 #include "Fireworks/Core/interface/FWConfigurableParameterizable.h"
00031 
00032 // forward declarations
00033 class FWEveView;
00034 
00035 class FWViewEnergyScale : public FWConfigurableParameterizable
00036 {
00037    friend class FWViewEnergyScaleEditor;
00038    
00039 public:
00040    enum EScaleMode { kFixedScale, kAutoScale, kCombinedScale, kNone };
00041    FWViewEnergyScale(std::string name, int version);
00042    virtual ~FWViewEnergyScale();
00043 
00044    void updateScaleFactors(float iMaxVal);
00045 
00046    float getScaleFactor3D()   const { return m_scaleFactor3D;   }
00047    float getScaleFactorLego() const { return m_scaleFactorLego; }
00048 
00049    bool  getPlotEt() const { return m_plotEt.value(); }
00050 
00051    void scaleParameterChanged() const;
00052 
00053    sigc::signal<void> parameterChanged_;
00054 
00055    // added for debug
00056    const std::string& name() const { return m_name; } 
00057 
00058    virtual void setFrom(const FWConfiguration&);
00059    void SetFromCmsShowCommonConfig(long mode, float convert, float maxH, bool et);
00060 
00061 protected:
00062    FWEnumParameter    m_scaleMode;
00063    FWDoubleParameter  m_fixedValToHeight;
00064    FWDoubleParameter  m_maxTowerHeight;
00065    FWBoolParameter    m_plotEt;
00066    
00067 private:
00068    FWViewEnergyScale(const FWViewEnergyScale&); // stop default
00069    const FWViewEnergyScale& operator=(const FWViewEnergyScale&); // stop default
00070 
00071    float calculateScaleFactor(float iMaxVal, bool isLego) const;
00072 
00073    const std::string m_name;
00074 
00075    // cached
00076    float m_scaleFactor3D;
00077    float m_scaleFactorLego;
00078 };
00079 
00080 #endif