#ifndef TUnitsTableParser_hxx #define TUnitsTableParser_hxx #include "TString.h" #include #include #include #include /// This class provides a method for converting a /// string like "1.5 cm" into a double with the /// appropriate unit. To do so it defines a set /// of units, using the same base units as in /// oaEvent/src/HEPUnits.hxx: ie mm, ns, MeV... /// Only a fairly limited set of units is defined. class TUnitsTableParser { public: /// Constructor. Creates list of units. TUnitsTableParser(); ~TUnitsTableParser(); /// Converts a string like "1.5 cm" into a double /// with the appropriate units. // double Convert2DoubleWithUnit(std::string line); std::string Convert2DoubleWithUnit(std::string line); /// Prints all the defined units. void PrintListOfUnits(); private: std::map units; }; #endif