1 #ifndef L1Trigger_L1TCommon_Setting_h
2 #define L1Trigger_L1TCommon_Setting_h
15 #include <boost/shared_ptr.hpp>
16 #include <boost/lexical_cast.hpp>
17 #include <boost/spirit/include/classic.hpp>
18 #include <boost/spirit/include/classic_push_back_actor.hpp>
28 void setRowTypes(
const std::vector<std::string>& types);
40 std::shared_ptr< std::vector<std::string> >
row_;
41 std::shared_ptr< std::vector<std::string> >
types_;
42 std::shared_ptr< std::vector<std::string> >
columns_;
43 std::shared_ptr< std::map<std::string,int> >
colDict_;
65 template <
class varType> std::vector<varType>
getVector();
81 if (
type_.find(
"vector") == std::string::npos )
82 throw std::runtime_error(
"The registered type: " +
type_ +
" is not vector so you need to call the getValue method");
84 std::vector<std::string>
vals;
87 std::vector<varType> newVals;
88 for(
auto it=vals.begin(); it!=vals.end(); it++)
89 newVals.push_back(convertVariable<varType>(*it));
93 std::ostringstream tempStr;
94 tempStr <<
"l1t::Setting::getVector\tReturning vector with values " << this->
getValueAsStr() <<
" from parameter with id: " << this->
getId() << std::endl;
103 if (
type_.find(
"vector") != std::string::npos )
104 throw std::runtime_error(
"The registered type: " +
type_ +
" is vector so you need to call the getVector method");
108 std::ostringstream tempStr;
109 tempStr <<
"l1t::Setting::getValue\tReturning value " << this->
getValueAsStr() <<
" from parameter with id: " << this->
getId() << std::endl;
112 return convertVariable<varType>(
value_);
117 std::map<std::string,int>::const_iterator it =
colDict_->find(col);
119 throw std::runtime_error (
"Column " + col +
"not found in table " +
tableId_);
123 std::ostringstream tempStr;
124 tempStr <<
"l1t::Setting::getRowValue\tReturning value " << convertVariable<varType>(
row_->at(it->second)) <<
" from table " <<
tableId_ <<
" and row " << this->
getRowAsStr() << std::endl;
127 return convertVariable<varType>(
row_->at(it->second));
std::shared_ptr< std::map< std::string, int > > colDict_
std::shared_ptr< std::vector< std::string > > types_
std::shared_ptr< std::vector< std::string > > row_
void setId(const std::string &id)
void setLogStringVar(std::string *strVar)
void addTableRow(const std::string &row, const std::vector< std::string > &types, const std::vector< std::string > &columns)
void setValue(const std::string &value)
void setRowTypes(const std::vector< std::string > &types)
Setting & operator=(const Setting &aSet)
std::vector< TableRow > getTableRows()
varType getRowValue(const std::string &col)
std::vector< std::string > str2VecStr_(const std::string &aStr, const std::string &delim)
void setProcRole(const std::string &procRole)
l1t::LUT getLUT(size_t addrWidth=0, size_t dataWidth=31, int padding=-1, std::string delim=",")
std::string getRowAsStr()
std::string getValueAsStr()
std::vector< std::string > getRow()
std::vector< varType > getVector()
std::string getProcRole()
std::shared_ptr< std::vector< std::string > > columns_
std::vector< TableRow > TableRows_
< trclass="colgroup">< tdclass="colgroup"colspan=5 > DT local reconstruction</td ></tr >< tr >< td >< ahref="classDTRecHit1DPair.html"> DTRecHit1DPair</a ></td >< td >< ahref="DataFormats_DTRecHit.html"> edm::RangeMap & lt
void setRowColumns(const std::vector< std::string > &columns)
void setLogStringVar(std::string *strVar)
std::vector< std::string > getColumnNames()
void setTableId(const std::string &id)