CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
FWViewEnergyScaleEditor.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Core
4 // Class : FWViewEnergyScaleEditor
5 //
6 // Implementation:
7 // [Notes on implementation]
8 //
9 // Original Author: Alja Mrak-Tadel
10 // Created: Fri Sep 24 18:52:19 CEST 2010
11 //
12 
13 // system include files
14 
15 // user include files
16 #include "TGButton.h"
17 #include "TGLabel.h"
22 
23 //
24 // constants, enums and typedefs
25 //
26 
27 //
28 // static data member definitions
29 //
30 
31 //
32 // constructors and destructor
33 //
34 FWViewEnergyScaleEditor::FWViewEnergyScaleEditor(FWViewEnergyScale* s, TGCompositeFrame* w, bool addAutoScaleControll)
35  : TGVerticalFrame(w), m_scale(s), m_enabled(true) {
38  addParam(&m_scale->m_fixedValToHeight, "FixedScaleMode");
39  if (addAutoScaleControll)
40  addParam(&m_scale->m_maxTowerHeight, "AutomaticScaleMode");
41 }
42 
44 
45 //
46 // member functions
47 //
49  m_enabled = x;
50  typedef std::vector<std::shared_ptr<FWParameterSetterBase> > sList;
51  for (sList::iterator i = m_setters.begin(); i != m_setters.end(); ++i) {
52  (*i)->setEnabled(m_enabled);
53  }
54 }
55 
57  int leftPad = 0;
58  if (title) {
59  leftPad = 10;
60  AddFrame(new TGLabel(this, title), new TGLayoutHints(kLHintsLeft, leftPad, 0, 0, 0));
61  leftPad *= 2;
62  }
63 
64  std::shared_ptr<FWParameterSetterBase> ptr(FWParameterSetterBase::makeSetterFor(param));
65  ptr->attach((FWParameterBase*)param, this);
66  TGFrame* pframe = ptr->build(this);
67  AddFrame(pframe, new TGLayoutHints(kLHintsLeft, leftPad, 0, 0, 0));
68  m_setters.push_back(ptr);
69 }
FWDoubleParameter m_fixedValToHeight
const double w
Definition: UKUtility.cc:23
void addParam(FWParameterBase *, const char *title=nullptr)
FWBoolParameter m_plotEt
uint16_t const *__restrict__ x
Definition: gpuClustering.h:39
std::vector< std::shared_ptr< FWParameterSetterBase > > m_setters
FWDoubleParameter m_maxTowerHeight
FWEnumParameter m_scaleMode
FWViewEnergyScaleEditor(FWViewEnergyScale *s, TGCompositeFrame *w, bool addAutoScaleControll=true)
static std::shared_ptr< FWParameterSetterBase > makeSetterFor(FWParameterBase *)