src
Alignment
CocoaToDDL
src
UnitConverter.cc
Go to the documentation of this file.
1
#include "
Alignment/CocoaToDDL/interface/UnitConverter.h
"
2
#include "
Alignment/CocoaToDDL/interface/CocoaUnitsTable.h
"
3
#include <CLHEP/Units/SystemOfUnits.h>
4
#include <sstream>
5
6
/*
7
UnitConverter::UnitConverter(const G4BestUnit & bu)
8
: bu_(bu)
9
{
10
//ostrstream s;
11
//s << bu;
12
13
}
14
*/
15
16
UnitConverter::UnitConverter
(
ALIdouble
val
,
const
ALIstring
&
category
)
17
: bu_(new
CocoaBestUnit
(
val
,
category
)), angl_(
false
) {
18
if
(
category
==
"Angle"
)
19
angl_
=
true
;
20
}
21
22
UnitConverter::~UnitConverter
() {
delete
bu_
; }
23
24
std::string
UnitConverter::ucstring
() {
25
std::ostringstream
str
;
26
27
if
(
angl_
) {
28
str
.precision(11);
29
double
x
= (*(
bu_
->
GetValue
())) / CLHEP::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
}
40
41
/*
42
ostream & operator<<(ostream & os, const UnitConverter & uc)
43
{
44
std::ostringstream temp;
45
//temp << uc.bu_;
46
//temp << '\0';
47
//string s(temp.str());
48
//cout << "NOW: " << s << endl;
49
os << *(uc.bu_);
50
}
51
52
*/
UnitConverter.h
ALIdouble
long double ALIdouble
Definition:
CocoaGlobals.h:11
funct::false
false
Definition:
Factorize.h:29
CocoaBestUnit
Definition:
CocoaUnitsTable.h:94
alignCSCRings.s
s
Definition:
alignCSCRings.py:92
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
UnitConverter::~UnitConverter
~UnitConverter()
Definition:
UnitConverter.cc:22
UnitConverter::bu_
CocoaBestUnit * bu_
Definition:
UnitConverter.h:22
validateAlignments.category
category
Definition:
validateAlignments.py:130
UnitConverter::ucstring
std::string ucstring()
Definition:
UnitConverter.cc:24
ALIstring
std::string ALIstring
Definition:
CocoaGlobals.h:9
CocoaBestUnit::GetValue
ALIdouble * GetValue()
Definition:
CocoaUnitsTable.h:105
UnitConverter::UnitConverter
UnitConverter(ALIdouble val, const ALIstring &category)
Definition:
UnitConverter.cc:16
UnitConverter::angl_
bool angl_
Definition:
UnitConverter.h:23
CocoaUnitsTable.h
str
#define str(s)
Definition:
TestProcessor.cc:56
DDAxes::x
heppy_batch.val
val
Definition:
heppy_batch.py:351
Generated for CMSSW Reference Manual by
1.8.14