test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DDutils.cc
Go to the documentation of this file.
2 #include <sstream>
3 
4 std::vector<int> dbl_to_int ( const std::vector<double> & vecdbl) {
5  std::vector<int> tInt;
6  for (std::vector<double>::const_iterator vd_it = vecdbl.begin(); vd_it != vecdbl.end(); ++vd_it) {
7  tInt.push_back(int(*vd_it));
8  }
9  return tInt;
10 }
11 
12 std::string dbl_to_string (const double& in) {
13  return int_to_string( int (in) );
14 }
15 
17 
18  std::ostringstream ostr;
19  ostr << in;
20  return ostr.str();
21 
22 }
std::string dbl_to_string(const double &in)
Converts only the integer part of a double to a string.
Definition: DDutils.cc:12
std::vector< int > dbl_to_int(const std::vector< double > &vecdbl)
Converts a std::vector of doubles to a std::vector of int.
Definition: DDutils.cc:4
std::string int_to_string(const int &in)
Definition: DDutils.cc:16