CMS 3D CMS Logo

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::UnitConverter ( ALIdouble  val,
const ALIstring category 
)

Definition at line 17 of file UnitConverter.cc.

References angl_, and validateAlignments::category.

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

◆ ~UnitConverter()

UnitConverter::~UnitConverter ( )

Definition at line 23 of file UnitConverter.cc.

References bu_.

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

Member Function Documentation

◆ ucstring()

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

◆ angl_

bool UnitConverter::angl_

Definition at line 23 of file UnitConverter.h.

Referenced by ucstring(), and UnitConverter().

◆ bu_

CocoaBestUnit* UnitConverter::bu_

Definition at line 22 of file UnitConverter.h.

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