Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-12-14 11:45:01

0001 #ifndef Fireworks_Core_FWViewEnergyScale_h
0002 #define Fireworks_Core_FWViewEnergyScale_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     Core
0006 // Class  :     FWViewEnergyScale
0007 //
0008 /**\class FWViewEnergyScale FWViewEnergyScale.h Fireworks/Core/interface/FWViewEnergyScale.h
0009 
0010  Description: [one line class summary]
0011 
0012  Usage:
0013     <usage>
0014 
0015 */
0016 //
0017 // Original Author:  Alja Mrak-Tadel
0018 //         Created:  Fri Jun 18 20:37:55 CEST 2010
0019 //
0020 
0021 // system include files
0022 
0023 // user include files
0024 
0025 #include "Fireworks/Core/interface/FWDoubleParameter.h"
0026 #include "Fireworks/Core/interface/FWBoolParameter.h"
0027 #include "Fireworks/Core/interface/FWLongParameter.h"
0028 #include "Fireworks/Core/interface/FWEnumParameter.h"
0029 #include "Fireworks/Core/interface/FWConfigurableParameterizable.h"
0030 
0031 // forward declarations
0032 class FWEveView;
0033 
0034 class FWViewEnergyScale : public FWConfigurableParameterizable {
0035   friend class FWViewEnergyScaleEditor;
0036 
0037 public:
0038   enum EScaleMode { kFixedScale, kAutoScale, kCombinedScale, kNone };
0039   FWViewEnergyScale(std::string name, int version);
0040   ~FWViewEnergyScale() override;
0041 
0042   void updateScaleFactors(float iMaxVal);
0043 
0044   float getScaleFactor3D() const { return m_scaleFactor3D; }
0045   float getScaleFactorLego() const { return m_scaleFactorLego; }
0046 
0047   bool getPlotEt() const { return m_plotEt.value(); }
0048 
0049   void scaleParameterChanged() const;
0050 
0051   sigc::signal<void()> parameterChanged_;
0052 
0053   // added for debug
0054   const std::string& name() const { return m_name; }
0055 
0056   void setFrom(const FWConfiguration&) override;
0057   void SetFromCmsShowCommonConfig(long mode, float convert, float maxH, bool et);
0058 
0059 protected:
0060   FWEnumParameter m_scaleMode;
0061   FWDoubleParameter m_fixedValToHeight;
0062   FWDoubleParameter m_maxTowerHeight;
0063   FWBoolParameter m_plotEt;
0064 
0065 public:
0066   FWViewEnergyScale(const FWViewEnergyScale&) = delete;                   // stop default
0067   const FWViewEnergyScale& operator=(const FWViewEnergyScale&) = delete;  // stop default
0068 
0069 private:
0070   float calculateScaleFactor(float iMaxVal, bool isLego) const;
0071 
0072   const std::string m_name;
0073 
0074   // cached
0075   float m_scaleFactor3D;
0076   float m_scaleFactorLego;
0077 };
0078 
0079 #endif