CMS 3D CMS Logo

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

#include <ParameterCollector.h>

Classes

class  const_iterator
 

Public Member Functions

const_iterator begin () const
 
const_iterator begin (std::ostream &dump) const
 
const_iterator begin (const std::string &block) const
 
const_iterator begin (const std::string &block, std::ostream &dump) const
 
const_iterator end () const
 
 ParameterCollector ()
 
 ParameterCollector (const edm::ParameterSet &pset)
 
 ~ParameterCollector ()
 

Static Public Member Functions

static std::string resolve (const std::string &line)
 

Private Attributes

std::map< std::string,
std::vector< std::string > > 
contents_
 

Friends

class const_iterator
 

Detailed Description

Definition at line 26 of file ParameterCollector.h.

Constructor & Destructor Documentation

ParameterCollector::ParameterCollector ( )

Definition at line 14 of file ParameterCollector.cc.

14 {}
ParameterCollector::ParameterCollector ( const edm::ParameterSet pset)

Definition at line 16 of file ParameterCollector.cc.

References contents_, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterNamesForType(), and names.

16  {
17  std::vector<std::string> names = pset.getParameterNamesForType<std::vector<std::string> >();
18 
19  for (std::vector<std::string>::const_iterator it = names.begin(); it != names.end(); ++it)
20  contents_[*it] = pset.getParameter<std::vector<std::string> >(*it);
21 }
const std::string names[nVars_]
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:179
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::map< std::string, std::vector< std::string > > contents_
ParameterCollector::~ParameterCollector ( )

Definition at line 23 of file ParameterCollector.cc.

23 {}

Member Function Documentation

ParameterCollector::const_iterator ParameterCollector::begin ( void  ) const

Definition at line 83 of file ParameterCollector.cc.

References edm::errors::Configuration, const_iterator, and contents_.

Referenced by Herwig7Interface::createInputFile(), Herwig6Hadronizer::initialize(), gen::PomwigHadronizer::readSettings(), gen::Py8InterfaceBase::readSettings(), and Herwig6Hadronizer::readSettings().

83  {
84  std::map<std::string, std::vector<std::string> >::const_iterator pos = contents_.find("parameterSets");
85  if (pos == contents_.end())
86  throw edm::Exception(edm::errors::Configuration) << "ParameterCollector could not find \"parameterSets\" block.";
87 
88  return const_iterator(this, pos->second.begin(), pos->second.end(), true);
89 }
std::map< std::string, std::vector< std::string > > contents_
ParameterCollector::const_iterator ParameterCollector::begin ( std::ostream &  dump) const

Definition at line 91 of file ParameterCollector.cc.

References edm::errors::Configuration, const_iterator, contents_, and remoteMonitoring_LASER_era2018_cfg::dump.

91  {
92  std::map<std::string, std::vector<std::string> >::const_iterator pos = contents_.find("parameterSets");
93  if (pos == contents_.end())
94  throw edm::Exception(edm::errors::Configuration) << "ParameterCollector could not find \"parameterSets\" block.";
95 
96  return const_iterator(this, pos->second.begin(), pos->second.end(), true, &dump);
97 }
std::map< std::string, std::vector< std::string > > contents_
tuple dump
OutputFilePath = cms.string(&#39;/tmp/zhokin/&#39;), OutputFileExt = cms.string(&#39;&#39;),.
ParameterCollector::const_iterator ParameterCollector::begin ( const std::string &  block) const

Definition at line 99 of file ParameterCollector.cc.

References edm::errors::Configuration, const_iterator, and contents_.

99  {
100  std::map<std::string, std::vector<std::string> >::const_iterator pos = contents_.find(block);
101  if (pos == contents_.end())
102  throw edm::Exception(edm::errors::Configuration) << "ParameterCollector could not find \"" << block << "\" block.";
103 
104  return const_iterator(this, pos->second.begin(), pos->second.end());
105 }
std::map< std::string, std::vector< std::string > > contents_
ParameterCollector::const_iterator ParameterCollector::begin ( const std::string &  block,
std::ostream &  dump 
) const

Definition at line 107 of file ParameterCollector.cc.

References edm::errors::Configuration, const_iterator, contents_, and remoteMonitoring_LASER_era2018_cfg::dump.

107  {
108  std::map<std::string, std::vector<std::string> >::const_iterator pos = contents_.find(block);
109  if (pos == contents_.end())
110  throw edm::Exception(edm::errors::Configuration) << "ParameterCollector could not find \"" << block << "\" block.";
111 
112  dump << "\n####### " << block << " #######" << std::endl;
113 
114  return const_iterator(this, pos->second.begin(), pos->second.end(), false, &dump);
115 }
std::map< std::string, std::vector< std::string > > contents_
tuple dump
OutputFilePath = cms.string(&#39;/tmp/zhokin/&#39;), OutputFileExt = cms.string(&#39;&#39;),.
const_iterator gen::ParameterCollector::end ( void  ) const
inline
std::string ParameterCollector::resolve ( const std::string &  line)
static

Definition at line 117 of file ParameterCollector.cc.

References fed_dqm_sourceclient-live_cfg::path, mps_fire::result, AlCaHLTBitMon_QueryRunRegistry::string, and isotrackApplyRegressor::var.

Referenced by Herwig::HerwigUIProvider::HerwigUIProvider().

117  {
119 
120  for (;;) {
121  std::string::size_type pos = result.find("${");
122  if (pos == std::string::npos)
123  break;
124 
125  std::string::size_type endpos = result.find('}', pos);
126  if (endpos == std::string::npos)
127  break;
128  else
129  ++endpos;
130 
131  std::string var = result.substr(pos + 2, endpos - pos - 3);
132  const char *path = std::getenv(var.c_str());
133 
134  result.replace(pos, endpos - pos, path ? path : "");
135  }
136 
137  return result;
138 }
uint16_t size_type
tuple result
Definition: mps_fire.py:311
list var
if using global norm cols_to_minmax = [&#39;t_delta&#39;, &#39;t_hmaxNearP&#39;,&#39;t_emaxNearP&#39;, &#39;t_hAnnular&#39;, &#39;t_eAnnular&#39;,&#39;t_pt&#39;,&#39;t_nVtx&#39;,&#39;t_ieta&#39;,&#39;t_eHcal10&#39;, &#39;t_eHcal30&#39;,&#39;t_rhoh&#39;,&#39;t_eHcal&#39;] df[cols_to_minmax] = df[cols_to_minmax].apply(lambda x: (x - x.min()) / (x.max() - x.min()) if (x.max() - x.min() &gt; 0) else 1.0/200.0)

Friends And Related Function Documentation

friend class const_iterator
friend

Definition at line 83 of file ParameterCollector.h.

Referenced by begin(), and end().

Member Data Documentation

std::map<std::string, std::vector<std::string> > gen::ParameterCollector::contents_
private

Definition at line 85 of file ParameterCollector.h.

Referenced by begin(), and ParameterCollector().