CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions
SiStripConfObject.h File Reference
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <iterator>
#include <sstream>
#include "FWCore/MessageLogger/interface/MessageLogger.h"

Go to the source code of this file.

Classes

class  SiStripConfObject
 

Functions

template<>
std::vector< int > SiStripConfObject::get< std::vector< int > > (const std::string &name) const
 
template<>
std::vector< std::string > SiStripConfObject::get< std::vector< std::string > > (const std::string &name) const
 
template<>
bool SiStripConfObject::put< std::vector< int > > (const std::string &name, const std::vector< int > &inputValue)
 
template<>
bool SiStripConfObject::put< std::vector< std::string > > (const std::string &name, const std::vector< std::string > &inputValue)
 
template<>
bool SiStripConfObject::update< std::vector< int > > (const std::string &name, const std::vector< int > &inputValue)
 
template<>
bool SiStripConfObject::update< std::vector< std::string > > (const std::string &name, const std::vector< std::string > &inputValue)
 

Function Documentation

template<>
std::vector<int> SiStripConfObject::get< std::vector< int > > ( const std::string &  name) const

Definition at line 33 of file SiStripConfObject.cc.

References gather_cfg::cout, HTMLExport::elem(), mergeVDriftHistosByStation::name, and Parameters::parameters.

34 {
35  std::vector<int> returnValue;
36  parMap::const_iterator it = parameters.find(name);
37  std::stringstream ss;
38  if( it != parameters.end() ) {
39  ss << it->second;
40  int elem;
41  while(ss >> elem) returnValue.push_back(elem);
42  }
43  else {
44  std::cout << "WARNING: parameter " << name << " not found. Returning default value" << std::endl;
45  }
46  return returnValue;
47 }
dictionary parameters
Definition: Parameters.py:2
tuple cout
Definition: gather_cfg.py:121
template<>
std::vector<std::string> SiStripConfObject::get< std::vector< std::string > > ( const std::string &  name) const

Definition at line 79 of file SiStripConfObject.cc.

References gather_cfg::cout, HTMLExport::elem(), mergeVDriftHistosByStation::name, Parameters::parameters, and AlCaHLTBitMon_QueryRunRegistry::string.

80 {
81  std::vector<std::string> returnValue;
82  parMap::const_iterator it = parameters.find(name);
83  std::stringstream ss;
84  if( it != parameters.end() ) {
85  ss << it->second;
87  while(ss >> elem) returnValue.push_back(elem);
88  }
89  else {
90  std::cout << "WARNING: parameter " << name << " not found. Returning default value" << std::endl;
91  }
92  return returnValue;
93 }
dictionary parameters
Definition: Parameters.py:2
tuple cout
Definition: gather_cfg.py:121
template<>
bool SiStripConfObject::put< std::vector< int > > ( const std::string &  name,
const std::vector< int > &  inputValue 
)

Definition at line 4 of file SiStripConfObject.cc.

References HTMLExport::elem(), mergeVDriftHistosByStation::name, and Parameters::parameters.

5 {
6  std::stringstream ss;
7  for(std::vector<int>::const_iterator elem=inputValue.begin();elem!=inputValue.end();++elem) {
8  ss << *elem << " ";
9  }
10  if( parameters.insert(std::make_pair(name, ss.str())).second ) return true;
11  return false;
12 }
dictionary parameters
Definition: Parameters.py:2
template<>
bool SiStripConfObject::put< std::vector< std::string > > ( const std::string &  name,
const std::vector< std::string > &  inputValue 
)

Definition at line 50 of file SiStripConfObject.cc.

References HTMLExport::elem(), mergeVDriftHistosByStation::name, and Parameters::parameters.

51 {
52  std::stringstream ss;
53  for(std::vector<std::string>::const_iterator elem=inputValue.begin();elem!=inputValue.end();++elem) {
54  ss << *elem << " ";
55  }
56  if( parameters.insert(std::make_pair(name, ss.str())).second ) return true;
57  return false;
58 }
dictionary parameters
Definition: Parameters.py:2
template<>
bool SiStripConfObject::update< std::vector< int > > ( const std::string &  name,
const std::vector< int > &  inputValue 
)

Definition at line 15 of file SiStripConfObject.cc.

References gather_cfg::cout, HTMLExport::elem(), mergeVDriftHistosByStation::name, and Parameters::parameters.

16 {
17  parMap::iterator it = parameters.find(name);
18  if (it == parameters.end()) {
19  std::cout << "WARNING in SiStripConfObject::update: parameter " << name << " not found, "
20  << "so cannot be updated to the vector of int of size'" << inputValue.size() << "'." << std::endl;
21  return false;
22  } else {
23  std::stringstream ss;
24  for(std::vector<int>::const_iterator elem=inputValue.begin();elem!=inputValue.end();++elem) {
25  ss << *elem << " ";
26  }
27  it->second = ss.str();
28  return true;
29  }
30 }
dictionary parameters
Definition: Parameters.py:2
tuple cout
Definition: gather_cfg.py:121
template<>
bool SiStripConfObject::update< std::vector< std::string > > ( const std::string &  name,
const std::vector< std::string > &  inputValue 
)

Definition at line 61 of file SiStripConfObject.cc.

References gather_cfg::cout, HTMLExport::elem(), mergeVDriftHistosByStation::name, and Parameters::parameters.

62 {
63  parMap::iterator it = parameters.find(name);
64  if (it == parameters.end()) {
65  std::cout << "WARNING in SiStripConfObject::update: parameter " << name << " not found, "
66  << "so cannot be updated to the vector of std::string of size'" << inputValue.size() << "'." << std::endl;
67  return false;
68  } else {
69  std::stringstream ss;
70  for(std::vector<std::string>::const_iterator elem=inputValue.begin();elem!=inputValue.end();++elem) {
71  ss << *elem << " ";
72  }
73  it->second = ss.str();
74  return true;
75  }
76 }
dictionary parameters
Definition: Parameters.py:2
tuple cout
Definition: gather_cfg.py:121