CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
FWProxyBuilderConfiguration Class Reference

#include <Fireworks/Core/interface/FWProxyBuilderConfiguration.h>

Inheritance diagram for FWProxyBuilderConfiguration:
FWConfigurableParameterizable FWParameterSetterEditorBase FWParameterizable FWConfigurable

Public Member Functions

virtual void addTo (FWConfiguration &iTo) const
 
template<class T >
FWGenericParameter< T > * assertParam (const std::string &name, T def)
 
template<class T >
FWGenericParameterWithRange< T > * assertParam (const std::string &name, T def, T min, T max)
 
 FWProxyBuilderConfiguration (const FWConfiguration *c, const FWEventItem *item)
 
void populateFrame (TGCompositeFrame *frame)
 
virtual void setFrom (const FWConfiguration &iFrom)
 
template<class T >
T value (const std::string &name)
 
virtual ~FWProxyBuilderConfiguration ()
 
- Public Member Functions inherited from FWConfigurableParameterizable
 FWConfigurableParameterizable (unsigned int iVersion=1)
 
unsigned int version () const
 
virtual ~FWConfigurableParameterizable ()
 
- Public Member Functions inherited from FWParameterizable
void add (FWParameterBase *)
 
const_iterator begin () const
 
const_iterator end () const
 
 FWParameterizable ()
 
virtual ~FWParameterizable ()
 
- Public Member Functions inherited from FWConfigurable
 FWConfigurable ()
 
virtual ~FWConfigurable ()
 
- Public Member Functions inherited from FWParameterSetterEditorBase
 FWParameterSetterEditorBase ()
 
virtual void updateEditor ()
 
virtual ~FWParameterSetterEditorBase ()
 

Private Member Functions

void makeSetter (TGCompositeFrame *, FWParameterBase *)
 

Private Attributes

const FWEventItemm_item
 
std::vector< boost::shared_ptr
< FWParameterSetterBase > > 
m_setters
 
const FWConfigurationm_txtConfig
 

Additional Inherited Members

- Public Types inherited from FWParameterizable
typedef std::vector
< FWParameterBase * >
::const_iterator 
const_iterator
 

Detailed Description

Description: [one line class summary]

Usage: <usage>

Definition at line 43 of file FWProxyBuilderConfiguration.h.

Constructor & Destructor Documentation

FWProxyBuilderConfiguration::FWProxyBuilderConfiguration ( const FWConfiguration c,
const FWEventItem item 
)

Definition at line 34 of file FWProxyBuilderConfiguration.cc.

34  :
35  m_txtConfig(c),
36  m_item(item)
37 {
38 }
FWProxyBuilderConfiguration::~FWProxyBuilderConfiguration ( )
virtual

Definition at line 40 of file FWProxyBuilderConfiguration.cc.

References m_txtConfig.

41 {
42  delete m_txtConfig;
43 }

Member Function Documentation

void FWProxyBuilderConfiguration::addTo ( FWConfiguration iTo) const
virtual

Reimplemented from FWConfigurableParameterizable.

Definition at line 49 of file FWProxyBuilderConfiguration.cc.

References FWConfiguration::addKeyValue(), FWConfigurableParameterizable::addTo(), FWParameterizable::begin(), and FWParameterizable::end().

50 {
51  if (begin() != end()) {
52  FWConfiguration vTmp;
54  iTo.addKeyValue("Var",vTmp, true);
55  }
56 }
const_iterator begin() const
const_iterator end() const
FWConfiguration & addKeyValue(const std::string &, const FWConfiguration &)
virtual void addTo(FWConfiguration &) const
template<class T >
FWGenericParameter< T > * FWProxyBuilderConfiguration::assertParam ( const std::string &  name,
T  def 
)

Definition at line 99 of file FWProxyBuilderConfiguration.cc.

References FWGenericParameter< T >::changed_, def, FWConfiguration::keyValues(), m_item, m_txtConfig, alignBH_cfg::mode, mergeVDriftHistosByStation::name, FWEventItem::proxyConfigChanged(), FWGenericParameter< T >::setFrom(), and FWConfiguration::valueForKey().

Referenced by FWGenParticleLegoProxyBuilder::setItem(), FWPFCandidateWithHitsProxyBuilder::setItem(), FWTrackingParticleProxyBuilder::setItem(), FWTrackProxyBuilderFF::setItem(), FWVertexProxyBuilder::setItem(), and FWJetProxyBuilder::setItem().

100 {
102 
103  // std::cout << "FWProxyBuilderConfiguration::getVarParameter(). No parameter with name " << name << std::endl;
104  if ( m_txtConfig) {
105  const FWConfiguration* varConfig = m_txtConfig->keyValues() ? m_txtConfig->valueForKey("Var") : 0;
106  if (varConfig) mode->setFrom(*varConfig);
107  }
108  mode->changed_.connect(boost::bind(&FWEventItem::proxyConfigChanged, (FWEventItem*)m_item));
109  return mode;
110 }
const KeyValues * keyValues() const
void proxyConfigChanged()
Definition: FWEventItem.cc:369
sigc::signal< void, T > changed_
virtual void setFrom(const FWConfiguration &iFrom)
const FWConfiguration * valueForKey(const std::string &iKey) const
JetCorrectorParameters::Definitions def
Definition: classes.h:12
template<class T >
FWGenericParameterWithRange< T > * FWProxyBuilderConfiguration::assertParam ( const std::string &  name,
T  def,
T  min,
T  max 
)

Definition at line 114 of file FWProxyBuilderConfiguration.cc.

References FWGenericParameter< T >::changed_, def, FWConfiguration::keyValues(), m_item, m_txtConfig, max(), min, alignBH_cfg::mode, mergeVDriftHistosByStation::name, FWEventItem::proxyConfigChanged(), FWGenericParameter< T >::setFrom(), and FWConfiguration::valueForKey().

115 {
117 
118  // std::cout << "FWProxyBuilderConfiguration::getVarParameter(). No parameter with name " << name << std::endl;
119  const FWConfiguration* varConfig = m_txtConfig && m_txtConfig->keyValues() ? m_txtConfig->valueForKey("Var") : 0;
120  if (varConfig) mode->setFrom(*varConfig);
121 
122  mode->changed_.connect(boost::bind(&FWEventItem::proxyConfigChanged, (FWEventItem*)m_item));
123  return mode;
124 }
const KeyValues * keyValues() const
void proxyConfigChanged()
Definition: FWEventItem.cc:369
#define min(a, b)
Definition: mlp_lapack.h:161
sigc::signal< void, T > changed_
const T & max(const T &a, const T &b)
virtual void setFrom(const FWConfiguration &iFrom)
const FWConfiguration * valueForKey(const std::string &iKey) const
JetCorrectorParameters::Definitions def
Definition: classes.h:12
void FWProxyBuilderConfiguration::makeSetter ( TGCompositeFrame *  frame,
FWParameterBase pb 
)
private

Definition at line 72 of file FWProxyBuilderConfiguration.cc.

References m_setters, and FWParameterSetterBase::makeSetterFor().

Referenced by populateFrame().

73 {
74  // std::cout << "make setter " << pb->name() << std::endl;
75 
76  boost::shared_ptr<FWParameterSetterBase> ptr( FWParameterSetterBase::makeSetterFor(pb) );
77  ptr->attach(pb, this);
78  TGFrame* tmpFrame = ptr->build(frame, false);
79  frame->AddFrame(tmpFrame, new TGLayoutHints(kLHintsExpandX));
80  m_setters.push_back(ptr);
81 }
static boost::shared_ptr< FWParameterSetterBase > makeSetterFor(FWParameterBase *)
std::vector< boost::shared_ptr< FWParameterSetterBase > > m_setters
void FWProxyBuilderConfiguration::populateFrame ( TGCompositeFrame *  frame)

Definition at line 84 of file FWProxyBuilderConfiguration.cc.

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

Referenced by CmsShowEDI::fillEDIFrame().

85 {
86  // std::cout << "populate \n";
87 
88  TGCompositeFrame* frame = new TGVerticalFrame(settersFrame);
89  settersFrame->AddFrame(frame, new TGLayoutHints(kLHintsExpandX) );//|kLHintsExpandY
90 
91  for(const_iterator it =begin(); it != end(); ++it)
92  makeSetter(frame, *it);
93 
94  settersFrame->MapSubwindows();
95 }
std::vector< FWParameterBase * >::const_iterator const_iterator
const_iterator begin() const
const_iterator end() const
void makeSetter(TGCompositeFrame *, FWParameterBase *)
void FWProxyBuilderConfiguration::setFrom ( const FWConfiguration iFrom)
virtual

Reimplemented from FWConfigurableParameterizable.

Definition at line 60 of file FWProxyBuilderConfiguration.cc.

61 {
62  /*
63  for(FWConfiguration::KeyValuesIt it = keyVals->begin(); it!= keyVals->end(); ++it)
64  std::cout << it->first << "FWProxyBuilderConfiguration::setFrom " << std::endl;
65  }*/
66 }
template<class T >
template double FWProxyBuilderConfiguration::value< double > ( const std::string &  name)

Definition at line 126 of file FWProxyBuilderConfiguration.cc.

References FWParameterizable::begin(), FWParameterizable::end(), i, and FWGenericParameter< T >::value().

Referenced by FWGenParticleLegoProxyBuilder::build(), FWTrackProxyBuilderFF::build(), FWVertexProxyBuilder::build(), FWJetProxyBuilder::buildViewType(), Vispa.Views.PropertyView.FileProperty::buttonClicked(), Types.string::configValue(), Types.FileInPath::configValue(), Mixins.UsingBlock::dumpPython(), FWPFCandidateWithHitsProxyBuilder::initPFRecHitsCollections(), Types.int32::insertInto(), Types.uint32::insertInto(), Types.int64::insertInto(), Types.uint64::insertInto(), Mixins.UsingBlock::insertInto(), Types.double::insertInto(), Types.bool::insertInto(), Types.string::insertInto(), Types.FileInPath::insertInto(), Types.vint32::insertInto(), Types.vuint32::insertInto(), Types.vint64::insertInto(), Types.vuint64::insertInto(), Types.vdouble::insertInto(), Types.vbool::insertInto(), Types.vstring::insertInto(), Vispa.Views.PropertyView.FileProperty::labelDoubleClicked(), and FWJetProxyBuilder::setTextPos().

127 {
128  FWGenericParameter<T>* param = 0;
129 
131  {
132  if ((*i)->name() == pname)
133  {
134  param = (FWGenericParameter<T>* )(*i);
135  break;
136  }
137  }
138 
139  if (param)
140  return param->value();
141  else
142  throw std::runtime_error("Invalid parameter request.");
143 }
int i
Definition: DBlmapReader.cc:9
std::vector< FWParameterBase * >::const_iterator const_iterator
const_iterator begin() const
const_iterator end() const

Member Data Documentation

const FWEventItem* FWProxyBuilderConfiguration::m_item
private

Definition at line 65 of file FWProxyBuilderConfiguration.h.

Referenced by assertParam().

std::vector<boost::shared_ptr<FWParameterSetterBase> > FWProxyBuilderConfiguration::m_setters
private

Definition at line 68 of file FWProxyBuilderConfiguration.h.

Referenced by makeSetter().

const FWConfiguration* FWProxyBuilderConfiguration::m_txtConfig
private

Definition at line 64 of file FWProxyBuilderConfiguration.h.

Referenced by assertParam(), and ~FWProxyBuilderConfiguration().