CMS 3D CMS Logo

UnitConverter Class Reference

#include <Alignment/CocoaToDDL/interface/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 18 of file UnitConverter.cc.

References angl_.

00019  : bu_(new CocoaBestUnit(val,category)), angl_(false)
00020 { 
00021    if (category=="Angle")
00022     angl_=true;
00023 }

UnitConverter::~UnitConverter (  ) 

Definition at line 25 of file UnitConverter.cc.

References bu_.

00026 {
00027   delete bu_;
00028 }  


Member Function Documentation

std::string UnitConverter::ucstring (  ) 

Definition at line 30 of file UnitConverter.cc.

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

00031 {
00032 
00033    std::ostrstream str;
00034    
00035    if (angl_) {
00036      str.precision(11);
00037      double x = ( *(bu_->GetValue()) ) / deg;
00038      str << x << std::string("*deg") << '\0';
00039      return std::string(str.str());
00040    
00041    }
00042    else {
00043      str << *bu_ << '\0';
00044      std::string s(str.str());
00045      return s.replace(s.find(" "),1,"*");
00046    }  
00047    //return s;
00048 
00049 }


Member Data Documentation

bool UnitConverter::angl_

Definition at line 24 of file UnitConverter.h.

Referenced by ucstring(), and UnitConverter().

CocoaBestUnit* UnitConverter::bu_

Definition at line 23 of file UnitConverter.h.

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


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:34:51 2009 for CMSSW by  doxygen 1.5.4