CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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.

15 {
16 }
ParameterCollector::ParameterCollector ( const edm::ParameterSet pset)

Definition at line 18 of file ParameterCollector.cc.

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

19 {
20  std::vector<std::string> names =
21  pset.getParameterNamesForType<std::vector<std::string> >();
22 
23  for(std::vector<std::string>::const_iterator it = names.begin();
24  it != names.end(); ++it)
25  contents_[*it] = pset.getParameter<std::vector<std::string> >(*it);
26 }
T getParameter(std::string const &) const
static const HistoName names[]
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:192
std::map< std::string, std::vector< std::string > > contents_
ParameterCollector::~ParameterCollector ( )

Definition at line 28 of file ParameterCollector.cc.

29 {
30 }

Member Function Documentation

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

Definition at line 95 of file ParameterCollector.cc.

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

Referenced by Herwig6Hadronizer::initialize(), ThePEGInterface::initRepository(), gen::PomwigHadronizer::readSettings(), gen::Py8InterfaceBase::readSettings(), and Herwig6Hadronizer::readSettings().

96 {
97  std::map<std::string, std::vector<std::string> >::const_iterator
98  pos = contents_.find("parameterSets");
99  if (pos == contents_.end())
101  << "ParameterCollector could not find \"parameterSets\" block.";
102 
103  return const_iterator(this, pos->second.begin(), pos->second.end(), true);
104 }
std::map< std::string, std::vector< std::string > > contents_
ParameterCollector::const_iterator ParameterCollector::begin ( std::ostream &  dump) const

Definition at line 106 of file ParameterCollector.cc.

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

107 {
108  std::map<std::string, std::vector<std::string> >::const_iterator
109  pos = contents_.find("parameterSets");
110  if (pos == contents_.end())
112  << "ParameterCollector could not find \"parameterSets\" block.";
113 
114  return const_iterator(this, pos->second.begin(), pos->second.end(),
115  true, &dump);
116 }
std::map< std::string, std::vector< std::string > > contents_
ParameterCollector::const_iterator ParameterCollector::begin ( const std::string &  block) const

Definition at line 118 of file ParameterCollector.cc.

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

119 {
120  std::map<std::string, std::vector<std::string> >::const_iterator
121  pos = contents_.find(block);
122  if (pos == contents_.end())
124  << "ParameterCollector could not find \"" << block << "\" block.";
125 
126  return const_iterator(this, pos->second.begin(), pos->second.end());
127 }
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 129 of file ParameterCollector.cc.

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

130 {
131  std::map<std::string, std::vector<std::string> >::const_iterator
132  pos = contents_.find(block);
133  if (pos == contents_.end())
135  << "ParameterCollector could not find \"" << block << "\" block.";
136 
137  dump << "\n####### " << block << " #######" << std::endl;
138 
139  return const_iterator(this, pos->second.begin(), pos->second.end(),
140  false, &dump);
141 }
std::map< std::string, std::vector< std::string > > contents_
const_iterator gen::ParameterCollector::end ( void  ) const
inline
std::string ParameterCollector::resolve ( const std::string &  line)
static

Definition at line 143 of file ParameterCollector.cc.

References cmsHarvester::path, query::result, and AlCaHLTBitMon_QueryRunRegistry::string.

144 {
146 
147  for(;;) {
148  std::string::size_type pos = result.find("${");
149  if (pos == std::string::npos)
150  break;
151 
152  std::string::size_type endpos = result.find('}', pos);
153  if (endpos == std::string::npos)
154  break;
155  else
156  ++endpos;
157 
158  std::string var = result.substr(pos + 2, endpos - pos - 3);
159  const char *path = std::getenv(var.c_str());
160 
161  result.replace(pos, endpos - pos, path ? path : "");
162  }
163 
164  return result;
165 }
uint16_t size_type
tuple path
else: Piece not in the list, fine.
tuple result
Definition: query.py:137

Friends And Related Function Documentation

friend class const_iterator
friend

Definition at line 85 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 87 of file ParameterCollector.h.

Referenced by begin(), and ParameterCollector().