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::FWProxyBuilderConfiguration ( const FWConfiguration c,
const FWEventItem item 
)

Definition at line 32 of file FWProxyBuilderConfiguration.cc.

33  : m_txtConfig(c), m_item(item), m_keepEntries(false) {}

◆ ~FWProxyBuilderConfiguration()

FWProxyBuilderConfiguration::~FWProxyBuilderConfiguration ( )
override

Definition at line 35 of file FWProxyBuilderConfiguration.cc.

35 { delete m_txtConfig; }

References m_txtConfig.

Member Function Documentation

◆ addTo()

void FWProxyBuilderConfiguration::addTo ( FWConfiguration iTo) const
overridevirtual

Reimplemented from FWConfigurableParameterizable.

Definition at line 39 of file FWProxyBuilderConfiguration.cc.

39  {
40  if (begin() != end()) {
41  FWConfiguration vTmp;
43  iTo.addKeyValue("Var", vTmp, true);
44  }
45 }

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

◆ assertParam() [1/2]

template<class T >
FWGenericParameter< T > * FWProxyBuilderConfiguration::assertParam ( const std::string &  name,
T  def 
)

Definition at line 83 of file FWProxyBuilderConfiguration.cc.

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  }
98  mode->changed_.connect(std::bind(&FWEventItem::proxyConfigChanged, (FWEventItem*)m_item, m_keepEntries));
99  return mode;
100 }

References FWParameterizable::begin(), spu::def(), FWParameterizable::end(), mps_fire::i, FWConfiguration::keyValues(), m_item, m_keepEntries, m_txtConfig, ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, Skims_PA_cff::name, FWEventItem::proxyConfigChanged(), and FWConfiguration::valueForKey().

Referenced by FWCaloRecHitDigitSetProxyBuilder::setItem(), FWL1THGCalProxyTemplate< l1t::HGCalMulticluster >::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(), and FWHeatmapProxyBuilderTemplate< reco::CaloCluster >::setItem().

◆ assertParam() [2/2]

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.

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 
118  mode->changed_.connect(std::bind(&FWEventItem::proxyConfigChanged, (FWEventItem*)m_item, m_keepEntries));
119  return mode;
120 }

References FWParameterizable::begin(), spu::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(), and FWConfiguration::valueForKey().

◆ keepEntries()

void FWProxyBuilderConfiguration::keepEntries ( bool  b)

◆ makeSetter()

void FWProxyBuilderConfiguration::makeSetter ( TGCompositeFrame *  frame,
FWParameterBase pb 
)
private

Definition at line 56 of file FWProxyBuilderConfiguration.cc.

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 }

References amptDefault_cfi::frame, m_setters, and FWParameterSetterBase::makeSetterFor().

Referenced by populateFrame().

◆ populateFrame()

void FWProxyBuilderConfiguration::populateFrame ( TGCompositeFrame *  frame)

Definition at line 66 of file FWProxyBuilderConfiguration.cc.

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 }

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

Referenced by CmsShowEDI::fillEDIFrame().

◆ setFrom()

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 }

◆ value()

template<class T >
template double FWProxyBuilderConfiguration::value< double > ( const std::string &  name)

Definition at line 123 of file FWProxyBuilderConfiguration.cc.

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 }

References FWParameterizable::begin(), FWParameterizable::end(), mps_fire::i, unpackData-CaloStage2::pname, 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(), 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(), FWElectronProxyBuilder::requestCommon(), and FWJetProxyBuilder::setTextPos().

Member Data Documentation

◆ m_item

const FWEventItem* FWProxyBuilderConfiguration::m_item
private

Definition at line 65 of file FWProxyBuilderConfiguration.h.

Referenced by assertParam().

◆ m_keepEntries

bool FWProxyBuilderConfiguration::m_keepEntries
private

Definition at line 67 of file FWProxyBuilderConfiguration.h.

Referenced by assertParam(), and keepEntries().

◆ m_setters

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

Definition at line 69 of file FWProxyBuilderConfiguration.h.

Referenced by makeSetter().

◆ m_txtConfig

const FWConfiguration* FWProxyBuilderConfiguration::m_txtConfig
private

Definition at line 64 of file FWProxyBuilderConfiguration.h.

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

FWParameterizable::const_iterator
std::vector< FWParameterBase * >::const_iterator const_iterator
Definition: FWParameterizable.h:34
mps_fire.i
i
Definition: mps_fire.py:428
FWGenericParameterWithRange
Definition: FWGenericParameterWithRange.h:27
FWProxyBuilderConfiguration::m_setters
std::vector< std::shared_ptr< FWParameterSetterBase > > m_setters
Definition: FWProxyBuilderConfiguration.h:69
min
T min(T a, T b)
Definition: MathUtil.h:58
ALCARECOPromptCalibProdSiPixelAli0T_cff.mode
mode
Definition: ALCARECOPromptCalibProdSiPixelAli0T_cff.py:96
FWEventItem::proxyConfigChanged
void proxyConfigChanged(bool k=false)
Definition: FWEventItem.cc:330
FWParameterizable::end
const_iterator end() const
Definition: FWParameterizable.h:38
FWParameterizable::begin
const_iterator begin() const
Definition: FWParameterizable.h:36
FWGenericParameter
Definition: FWGenericParameter.h:31
FWConfiguration::valueForKey
const FWConfiguration * valueForKey(const std::string &iKey) const
Definition: FWConfiguration.cc:122
b
double b
Definition: hdecay.h:118
unpackData-CaloStage2.pname
pname
Definition: unpackData-CaloStage2.py:76
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
FWProxyBuilderConfiguration::m_keepEntries
bool m_keepEntries
Definition: FWProxyBuilderConfiguration.h:67
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
FWParameterSetterBase::makeSetterFor
static std::shared_ptr< FWParameterSetterBase > makeSetterFor(FWParameterBase *)
Definition: FWParameterSetterBase.cc:83
FWGenericParameter::value
T value() const
Definition: FWGenericParameter.h:50
FWConfiguration::addKeyValue
FWConfiguration & addKeyValue(const std::string &, const FWConfiguration &)
Definition: FWConfiguration.cc:58
FWEventItem
Definition: FWEventItem.h:56
FWConfigurableParameterizable::addTo
void addTo(FWConfiguration &) const override
Definition: FWConfigurableParameterizable.cc:67
amptDefault_cfi.frame
frame
Definition: amptDefault_cfi.py:12
FWConfiguration::keyValues
const KeyValues * keyValues() const
Definition: FWConfiguration.h:51
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
spu::def
int def(FILE *, FILE *, int)
Definition: SherpackUtilities.cc:14
FWConfiguration
Definition: FWConfiguration.h:31
FWProxyBuilderConfiguration::m_item
const FWEventItem * m_item
Definition: FWProxyBuilderConfiguration.h:65
FWProxyBuilderConfiguration::makeSetter
void makeSetter(TGCompositeFrame *, FWParameterBase *)
Definition: FWProxyBuilderConfiguration.cc:56
FWProxyBuilderConfiguration::m_txtConfig
const FWConfiguration * m_txtConfig
Definition: FWProxyBuilderConfiguration.h:64