CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes
UnitConverter Class Reference

#include <UnitConverter.h>

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_.

18  : bu_(new CocoaBestUnit(val, category)), angl_(false) {
19  if (category == "Angle")
20  angl_ = true;
21 }
static const char category[]
CocoaBestUnit * bu_
Definition: UnitConverter.h:22
UnitConverter::~UnitConverter ( )

Definition at line 23 of file UnitConverter.cc.

References bu_.

23 { delete bu_; }
CocoaBestUnit * bu_
Definition: UnitConverter.h:22

Member Function Documentation

std::string UnitConverter::ucstring ( )

Definition at line 25 of file UnitConverter.cc.

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

25  {
26  std::ostrstream str;
27 
28  if (angl_) {
29  str.precision(11);
30  double x = (*(bu_->GetValue())) / deg;
31  str << x << std::string("*deg") << '\0';
32  return std::string(str.str());
33 
34  } else {
35  str << *bu_ << '\0';
36  std::string s(str.str());
37  return s.replace(s.find(' '), 1, "*");
38  }
39  //return s;
40 }
CocoaBestUnit * bu_
Definition: UnitConverter.h:22
ALIdouble * GetValue()
#define str(s)

Member Data Documentation

bool UnitConverter::angl_

Definition at line 23 of file UnitConverter.h.

Referenced by ucstring(), and UnitConverter().

CocoaBestUnit* UnitConverter::bu_

Definition at line 22 of file UnitConverter.h.

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