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.

18  : bu_(new CocoaBestUnit(val, category)), angl_(false) {
19  if (category == "Angle")
20  angl_ = true;
21 }

References angl_, and taus_updatedMVAIds_cff::category.

◆ ~UnitConverter()

UnitConverter::~UnitConverter ( )

Definition at line 23 of file UnitConverter.cc.

23 { delete bu_; }

References bu_.

Member Function Documentation

◆ ucstring()

std::string UnitConverter::ucstring ( )

Definition at line 25 of file UnitConverter.cc.

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 }

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

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().

UnitConverter::bu_
CocoaBestUnit * bu_
Definition: UnitConverter.h:22
taus_updatedMVAIds_cff.category
category
Definition: taus_updatedMVAIds_cff.py:31
CocoaBestUnit::GetValue
ALIdouble * GetValue()
Definition: CocoaUnitsTable.h:105
CocoaBestUnit
Definition: CocoaUnitsTable.h:94
UnitConverter::angl_
bool angl_
Definition: UnitConverter.h:23
DDAxes::x
alignCSCRings.s
s
Definition: alignCSCRings.py:92
str
#define str(s)
Definition: TestProcessor.cc:52
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
heppy_batch.val
val
Definition: heppy_batch.py:351