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 16 of file UnitConverter.cc.

References angl_, and validateAlignments::category.

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

◆ ~UnitConverter()

UnitConverter::~UnitConverter ( )

Definition at line 22 of file UnitConverter.cc.

References bu_.

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

Member Function Documentation

◆ ucstring()

std::string UnitConverter::ucstring ( )

Definition at line 24 of file UnitConverter.cc.

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

24  {
25  std::ostringstream str;
26 
27  if (angl_) {
28  str.precision(11);
29  double x = (*(bu_->GetValue())) / deg;
30  str << x << std::string("*deg") << '\0';
31  return std::string(str.str());
32 
33  } else {
34  str << *bu_ << '\0';
35  std::string s(str.str());
36  return s.replace(s.find(' '), 1, "*");
37  }
38  //return s;
39 }
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().