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 
)
FWProxyBuilderConfiguration::~FWProxyBuilderConfiguration ( )
override

Definition at line 35 of file FWProxyBuilderConfiguration.cc.

References m_txtConfig.

35 { delete m_txtConfig; }

Member Function Documentation

void FWProxyBuilderConfiguration::addTo ( FWConfiguration iTo) const
overridevirtual

Reimplemented from FWConfigurableParameterizable.

Definition at line 39 of file FWProxyBuilderConfiguration.cc.

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

39  {
40  if (begin() != end()) {
41  FWConfiguration vTmp;
43  iTo.addKeyValue("Var", vTmp, true);
44  }
45 }
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 83 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, Skims_PA_cff::name, FWEventItem::proxyConfigChanged(), FWGenericParameter< T >::setFrom(), and FWConfiguration::valueForKey().

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

83  {
84  for (const_iterator i = begin(); i != end(); ++i) {
85  if ((*i)->name() == name) {
86  return nullptr;
87  }
88  }
89 
91 
92  // std::cout << "FWProxyBuilderConfiguration::getVarParameter(). No parameter with name " << name << std::endl;
93  if (m_txtConfig) {
94  const FWConfiguration* varConfig = m_txtConfig->keyValues() ? m_txtConfig->valueForKey("Var") : nullptr;
95  if (varConfig)
96  mode->setFrom(*varConfig);
97  }
99  return mode;
100 }
void proxyConfigChanged(bool k=false)
Definition: FWEventItem.cc:330
const KeyValues * keyValues() const
const_iterator begin() const
void setFrom(const FWConfiguration &iFrom) override
std::vector< FWParameterBase * >::const_iterator const_iterator
const_iterator end() const
sigc::signal< void, T > changed_
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 103 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, Skims_PA_cff::name, FWEventItem::proxyConfigChanged(), FWGenericParameter< T >::setFrom(), and FWConfiguration::valueForKey().

103  {
104  for (const_iterator i = begin(); i != end(); ++i) {
105  if ((*i)->name() == name) {
106  return nullptr;
107  }
108  }
109 
111 
112  // std::cout << "FWProxyBuilderConfiguration::getVarParameter(). No parameter with name " << name << std::endl;
113  const FWConfiguration* varConfig =
114  m_txtConfig && m_txtConfig->keyValues() ? m_txtConfig->valueForKey("Var") : nullptr;
115  if (varConfig)
116  mode->setFrom(*varConfig);
117 
119  return mode;
120 }
void proxyConfigChanged(bool k=false)
Definition: FWEventItem.cc:330
const KeyValues * keyValues() const
const_iterator begin() const
void setFrom(const FWConfiguration &iFrom) override
std::vector< FWParameterBase * >::const_iterator const_iterator
const_iterator end() const
T min(T a, T b)
Definition: MathUtil.h:58
sigc::signal< void, T > changed_
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 56 of file FWProxyBuilderConfiguration.cc.

References m_setters, and FWParameterSetterBase::makeSetterFor().

Referenced by populateFrame().

56  {
57  // std::cout << "make setter " << pb->name() << std::endl;
58 
59  std::shared_ptr<FWParameterSetterBase> ptr(FWParameterSetterBase::makeSetterFor(pb));
60  ptr->attach(pb, this);
61  TGFrame* tmpFrame = ptr->build(frame, false);
62  frame->AddFrame(tmpFrame, new TGLayoutHints(kLHintsExpandX));
63  m_setters.push_back(ptr);
64 }
std::vector< std::shared_ptr< FWParameterSetterBase > > m_setters
static std::shared_ptr< FWParameterSetterBase > makeSetterFor(FWParameterBase *)
void FWProxyBuilderConfiguration::populateFrame ( TGCompositeFrame *  frame)

Definition at line 66 of file FWProxyBuilderConfiguration.cc.

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

Referenced by CmsShowEDI::fillEDIFrame().

66  {
67  // std::cout << "populate \n";
68 
69  TGCompositeFrame* frame = new TGVerticalFrame(settersFrame);
70  settersFrame->AddFrame(frame, new TGLayoutHints(kLHintsExpandX)); //|kLHintsExpandY
71 
72  for (const_iterator it = begin(); it != end(); ++it)
73  makeSetter(frame, *it);
74 
75  settersFrame->MapSubwindows();
76 }
const_iterator begin() const
std::vector< FWParameterBase * >::const_iterator const_iterator
const_iterator end() const
void makeSetter(TGCompositeFrame *, FWParameterBase *)
void FWProxyBuilderConfiguration::setFrom ( const FWConfiguration iFrom)
overridevirtual

Reimplemented from FWConfigurableParameterizable.

Definition at line 47 of file FWProxyBuilderConfiguration.cc.

47  {
48  /*
49  for(FWConfiguration::KeyValuesIt it = keyVals->begin(); it!= keyVals->end(); ++it)
50  std::cout << it->first << "FWProxyBuilderConfiguration::setFrom " << std::endl;
51  }*/
52 }
template<class T >
template double FWProxyBuilderConfiguration::value< double > ( const std::string &  name)

Definition at line 123 of file FWProxyBuilderConfiguration.cc.

References assertParam(), FWParameterizable::begin(), def, FWParameterizable::end(), mps_fire::i, SiStripPI::max, min(), Skims_PA_cff::name, unpackData-CaloStage2::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(), FWHGCalTriggerCellProxyBuilder::build(), FWHGCalTriggerClusterProxyBuilder::build(), FWMuonRhoPhiProxyBuilder::build(), FWCaloParticleProxyBuilder::build(), FWCaloClusterProxyBuilder::build(), FWGenParticleLegoProxyBuilder::build(), FWMuonProxyBuilder::build(), FWTrackProxyBuilder::build(), FWTrackProxyBuilderFullFramework::build(), FWHGCRecHitProxyBuilder::build(), FWVertexCandidateProxyBuilder::build(), FWVertexProxyBuilder::build(), FWJetProxyBuilder::buildViewType(), Vispa.Views.PropertyView.FileProperty::buttonClicked(), Types.string::configValue(), Types.FileInPath::configValue(), Mixins.UsingBlock::dumpPython(), Mixins.UsingBlock::insertInto(), Types.int32::insertInto(), Types.uint32::insertInto(), Types.int64::insertInto(), Types.uint64::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(), FWElectronProxyBuilder::requestCommon(), and FWJetProxyBuilder::setTextPos().

123  {
124  FWGenericParameter<T>* param = nullptr;
125 
127  if ((*i)->name() == pname) {
128  param = (FWGenericParameter<T>*)(*i);
129  break;
130  }
131  }
132 
133  if (param)
134  return param->value();
135  else
136  throw std::runtime_error("Invalid parameter request.");
137 }
const_iterator begin() const
std::vector< FWParameterBase * >::const_iterator const_iterator
const_iterator end() const

Member Data Documentation

const FWEventItem* FWProxyBuilderConfiguration::m_item
private

Definition at line 65 of file FWProxyBuilderConfiguration.h.

Referenced by assertParam().

bool FWProxyBuilderConfiguration::m_keepEntries
private

Definition at line 67 of file FWProxyBuilderConfiguration.h.

Referenced by assertParam(), and keepEntries().

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

Definition at line 69 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().