CMS 3D CMS Logo

Public Member Functions | Public Attributes

UnitConverter Class Reference

#include <UnitConverter.h>

List of all members.

Public Member Functions

std::string ucstring ()
 UnitConverter (ALIdouble val, const ALIstring &category)
 ~UnitConverter ()

Public Attributes

bool angl_
CocoaBestUnitbu_

Detailed Description

Definition at line 15 of file UnitConverter.h.


Constructor & Destructor Documentation

UnitConverter::UnitConverter ( ALIdouble  val,
const ALIstring category 
)

Definition at line 17 of file UnitConverter.cc.

References angl_.

 : bu_(new CocoaBestUnit(val,category)), angl_(false)
{ 
   if (category=="Angle")
    angl_=true;
}
UnitConverter::~UnitConverter ( )

Definition at line 24 of file UnitConverter.cc.

References bu_.

{
  delete bu_;
}  

Member Function Documentation

std::string UnitConverter::ucstring ( )

Definition at line 29 of file UnitConverter.cc.

References angl_, bu_, CocoaBestUnit::GetValue(), alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, and x.

{

   std::ostrstream str;
   
   if (angl_) {
     str.precision(11);
     double x = ( *(bu_->GetValue()) ) / deg;
     str << x << std::string("*deg") << '\0';
     return std::string(str.str());
   
   }
   else {
     str << *bu_ << '\0';
     std::string s(str.str());
     return s.replace(s.find(" "),1,"*");
   }  
   //return s;

}

Member Data Documentation

Definition at line 24 of file UnitConverter.h.

Referenced by ucstring(), and UnitConverter().

Definition at line 23 of file UnitConverter.h.

Referenced by ucstring(), and ~UnitConverter().