CMS 3D CMS Logo

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

void addTo (FWConfiguration &iTo) const override
 
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 keepEntries (bool b)
 
void populateFrame (TGCompositeFrame *frame)
 
void setFrom (const FWConfiguration &iFrom) override
 
template<class T >
T value (const std::string &name)
 
 ~FWProxyBuilderConfiguration () override
 
- Public Member Functions inherited from FWConfigurableParameterizable
 FWConfigurableParameterizable (unsigned int iVersion=1)
 
unsigned int version () const
 
 ~FWConfigurableParameterizable () override
 
- 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
 
bool m_keepEntries
 
std::vector< std::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 42 of file FWProxyBuilderConfiguration.h.

Constructor & Destructor Documentation

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

Definition at line 33 of file FWProxyBuilderConfiguration.cc.

33  :
34  m_txtConfig(c),
35  m_item(item),
36  m_keepEntries(false)
37 {
38 }
FWProxyBuilderConfiguration::~FWProxyBuilderConfiguration ( )
override

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
overridevirtual

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 }
void addTo(FWConfiguration &) const override
const_iterator begin() const
const_iterator end() const
FWConfiguration & addKeyValue(const std::string &, const FWConfiguration &)
template<class T >
FWGenericParameter< T > * FWProxyBuilderConfiguration::assertParam ( const std::string &  name,
T  def 
)

Definition at line 104 of file FWProxyBuilderConfiguration.cc.

References FWParameterizable::begin(), FWGenericParameter< T >::changed_, def, FWParameterizable::end(), mps_fire::i, FWConfiguration::keyValues(), m_item, m_keepEntries, m_txtConfig, ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, dataset::name, FWEventItem::proxyConfigChanged(), FWGenericParameter< T >::setFrom(), and FWConfiguration::valueForKey().

Referenced by FWCaloRecHitDigitSetProxyBuilder::setItem(), FWGenParticleLegoProxyBuilder::setItem(), FWMuonRhoPhiProxyBuilder::setItem(), FWMuonProxyBuilder::setItem(), FWTrackingParticleProxyBuilder::setItem(), FWHGCRecHitProxyBuilder::setItem(), FWCaloClusterProxyBuilder::setItem(), FWCandidateProxyBuilder::setItem(), FWTrackProxyBuilder::setItem(), FWTrackProxyBuilderFullFramework::setItem(), FWVertexCandidateProxyBuilder::setItem(), FWVertexProxyBuilder::setItem(), FWElectronProxyBuilder::setItem(), FWTauProxyBuilderBase::setItem(), FWJetProxyBuilder::setItem(), FWHeatmapProxyBuilderTemplate< reco::CaloCluster >::setItem(), and value().

105 {
106  for ( const_iterator i = begin(); i != end(); ++i) {
107  if ((*i)->name() == name) {
108  return nullptr;
109  }
110  }
111 
113 
114  // std::cout << "FWProxyBuilderConfiguration::getVarParameter(). No parameter with name " << name << std::endl;
115  if ( m_txtConfig) {
116  const FWConfiguration* varConfig = m_txtConfig->keyValues() ? m_txtConfig->valueForKey("Var") : nullptr;
117  if (varConfig) mode->setFrom(*varConfig);
118  }
120  return mode;
121 }
void proxyConfigChanged(bool k=false)
Definition: FWEventItem.cc:370
std::vector< FWParameterBase * >::const_iterator const_iterator
const KeyValues * keyValues() const
const_iterator begin() const
void setFrom(const FWConfiguration &iFrom) override
sigc::signal< void, T > changed_
const_iterator end() const
const FWConfiguration * valueForKey(const std::string &iKey) const
JetCorrectorParameters::Definitions def
Definition: classes.h:6
template<class T >
FWGenericParameterWithRange< T > * FWProxyBuilderConfiguration::assertParam ( const std::string &  name,
T  def,
T  min,
T  max 
)

Definition at line 125 of file FWProxyBuilderConfiguration.cc.

References FWParameterizable::begin(), FWGenericParameter< T >::changed_, def, FWParameterizable::end(), mps_fire::i, FWConfiguration::keyValues(), m_item, m_keepEntries, m_txtConfig, SiStripPI::max, min(), ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, dataset::name, FWEventItem::proxyConfigChanged(), FWGenericParameter< T >::setFrom(), and FWConfiguration::valueForKey().

126 {
127  for ( const_iterator i = begin(); i != end(); ++i) {
128  if ((*i)->name() == name) {
129  return nullptr;
130  }
131  }
132 
134 
135  // std::cout << "FWProxyBuilderConfiguration::getVarParameter(). No parameter with name " << name << std::endl;
136  const FWConfiguration* varConfig = m_txtConfig && m_txtConfig->keyValues() ? m_txtConfig->valueForKey("Var") : nullptr;
137  if (varConfig) mode->setFrom(*varConfig);
138 
140  return mode;
141 }
void proxyConfigChanged(bool k=false)
Definition: FWEventItem.cc:370
std::vector< FWParameterBase * >::const_iterator const_iterator
const KeyValues * keyValues() const
const_iterator begin() const
void setFrom(const FWConfiguration &iFrom) override
sigc::signal< void, T > changed_
const_iterator end() const
T min(T a, T b)
Definition: MathUtil.h:58
const FWConfiguration * valueForKey(const std::string &iKey) const
JetCorrectorParameters::Definitions def
Definition: classes.h:6
void FWProxyBuilderConfiguration::keepEntries ( bool  b)
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  std::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 }
std::vector< std::shared_ptr< FWParameterSetterBase > > m_setters
static std::shared_ptr< FWParameterSetterBase > makeSetterFor(FWParameterBase *)
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)
overridevirtual

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 143 of file FWProxyBuilderConfiguration.cc.

References assertParam(), FWParameterizable::begin(), def, FWParameterizable::end(), mps_fire::i, SiStripPI::max, min(), dataset::name, BPhysicsValidation_cfi::pname, AlCaHLTBitMon_QueryRunRegistry::string, and FWGenericParameter< T >::value().

Referenced by Types.int32::__nonzero__(), Types.uint32::__nonzero__(), Types.int64::__nonzero__(), Types.uint64::__nonzero__(), Types.double::__nonzero__(), Types.bool::__nonzero__(), Types.string::__nonzero__(), average.Average::average(), FWCaloRecHitDigitSetProxyBuilder::build(), FWHGCalMultiClusterProxyBuilder::build(), FWHGCRecHitProxyBuilder::build(), FWMuonRhoPhiProxyBuilder::build(), FWCaloParticleProxyBuilder::build(), FWCaloClusterProxyBuilder::build(), FWGenParticleLegoProxyBuilder::build(), FWMuonProxyBuilder::build(), FWTrackProxyBuilder::build(), FWTrackProxyBuilderFullFramework::build(), FWVertexCandidateProxyBuilder::build(), FWVertexProxyBuilder::build(), FWJetProxyBuilder::buildViewType(), Vispa.Views.PropertyView.FileProperty::buttonClicked(), Types.string::configValue(), Types.FileInPath::configValue(), Mixins.UsingBlock::dumpPython(), Types.int32::insertInto(), Types.uint32::insertInto(), Types.int64::insertInto(), Types.uint64::insertInto(), Types.double::insertInto(), Mixins.UsingBlock::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(), FWElectronProxyBuilder::requestCommon(), and FWJetProxyBuilder::setTextPos().

144 {
145  FWGenericParameter<T>* param = nullptr;
146 
148  {
149  if ((*i)->name() == pname)
150  {
151  param = (FWGenericParameter<T>* )(*i);
152  break;
153  }
154  }
155 
156  if (param)
157  return param->value();
158  else
159  throw std::runtime_error("Invalid parameter request.");
160 }
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 66 of file FWProxyBuilderConfiguration.h.

Referenced by assertParam().

bool FWProxyBuilderConfiguration::m_keepEntries
private

Definition at line 68 of file FWProxyBuilderConfiguration.h.

Referenced by assertParam(), and keepEntries().

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

Definition at line 70 of file FWProxyBuilderConfiguration.h.

Referenced by makeSetter().

const FWConfiguration* FWProxyBuilderConfiguration::m_txtConfig
private

Definition at line 65 of file FWProxyBuilderConfiguration.h.

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