36 for (
auto it=rows.begin(); it!=rows.end(); ++it)
62 if (
type_.find(
"bool") != std::string::npos )
64 std::ostringstream convString;
66 if (
type_.find(
"vector") != std::string::npos )
71 std::vector<std::string>
vals;
74 for(std::vector<std::string>::iterator it=vals.begin(); it!=vals.end(); ++it)
76 if ( it->find(
"true") != std::string::npos )
84 if ( value.find(
"true") != std::string::npos )
97 if (
type_.find(
"vector:uint") == std::string::npos )
98 throw std::runtime_error(
"Cannot build LUT from type: " +
type_ +
". Only vector:uint is allowed.");
103 std::vector<unsigned int> vec = getVector<unsigned int>();
106 if (addrWidth == 0) {
107 size_t nEntries = vec.size();
108 while (nEntries >>= 1) {
114 std::stringstream
ss;
115 ss <<
"#<header> V1 " << addrWidth <<
" " << dataWidth <<
" </header>" << std::endl;
117 for (; i < vec.size() && i < (size_t)(1<<addrWidth); ++
i) {
118 ss << i <<
" " << vec[
i] << std::endl;
121 if (padding >= 0 && i < (
size_t)(1<<addrWidth)) {
122 for (; i < (size_t)(1<<addrWidth); ++
i) {
123 ss << i <<
" " << padding << std::endl;
144 if (
type_.find(
"table") == std::string::npos)
145 throw std::runtime_error(
"You cannot add a table row in type: " +
type_ +
". Type is not table.");
147 std::vector<std::string>
vals;
180 row_ = std::shared_ptr< std::vector<std::string> >(
new std::vector<std::string>(row));
187 columns_ = std::shared_ptr< std::vector<std::string> >(
new std::vector<std::string>(columns));
192 colDict_ = std::shared_ptr< std::map<std::string,int> >(
new std::map<std::string,int>());
196 for(
unsigned int i=0;
i<columns.size();
i++)
203 types_ = std::shared_ptr< std::vector<std::string> >(
new std::vector<std::string>(types));
210 std::ostringstream str;
211 for (
auto it=
row_->begin(); it!=
row_->end(); ++it)
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 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)
int read(std::istream &stream)
std::vector< std::string > str2VecStr_(const std::string &aStr, const std::string &delim)
l1t::LUT getLUT(size_t addrWidth=0, size_t dataWidth=31, int padding=-1, std::string delim=",")
std::string getRowAsStr()
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)