Main Page
Namespaces
Classes
Package Documentation
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/GlobalSystemOfUnits.h"
4
#include <sstream>
5
#include <strstream>
6
7
/*
8
UnitConverter::UnitConverter(const G4BestUnit & bu)
9
: bu_(bu)
10
{
11
//ostrstream s;
12
//s << bu;
13
14
}
15
*/
16
17
UnitConverter::UnitConverter
(
ALIdouble
val
,
const
ALIstring
&
category
)
18
: bu_(new
CocoaBestUnit
(val,category)), angl_(
false
)
19
{
20
if
(category==
"Angle"
)
21
angl_
=
true
;
22
}
23
24
UnitConverter::~UnitConverter
()
25
{
26
delete
bu_
;
27
}
28
29
std::string
UnitConverter::ucstring
()
30
{
31
32
std::ostrstream
str
;
33
34
if
(
angl_
) {
35
str.precision(11);
36
double
x
= ( *(
bu_
->
GetValue
()) ) / deg;
37
str << x <<
std::string
(
"*deg"
) <<
'\0'
;
38
return
std::string
(str.str());
39
40
}
41
else
{
42
str << *
bu_
<<
'\0'
;
43
std::string
s
(str.str());
44
return
s
.replace(
s
.find(
" "
),1,
"*"
);
45
}
46
//return s;
47
48
}
49
50
/*
51
ostream & operator<<(ostream & os, const UnitConverter & uc)
52
{
53
ostrstream temp;
54
//temp << uc.bu_;
55
//temp << '\0';
56
//string s(temp.str());
57
//cout << "NOW: " << s << endl;
58
os << *(uc.bu_);
59
}
60
61
*/
UnitConverter.h
ALIdouble
long double ALIdouble
Definition:
CocoaGlobals.h:11
funct::false
false
Definition:
Factorize.h:36
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
CocoaBestUnit
Definition:
CocoaUnitsTable.h:103
alignCSCRings.s
s
Definition:
alignCSCRings.py:92
UnitConverter::~UnitConverter
~UnitConverter()
Definition:
UnitConverter.cc:24
UnitConverter::bu_
CocoaBestUnit * bu_
Definition:
UnitConverter.h:23
UnitConverter::ucstring
std::string ucstring()
Definition:
UnitConverter.cc:29
ALIstring
std::string ALIstring
Definition:
CocoaGlobals.h:9
CocoaBestUnit::GetValue
ALIdouble * GetValue()
Definition:
CocoaUnitsTable.h:117
UnitConverter::UnitConverter
UnitConverter(ALIdouble val, const ALIstring &category)
Definition:
UnitConverter.cc:17
UnitConverter::angl_
bool angl_
Definition:
UnitConverter.h:24
CocoaUnitsTable.h
str
#define str(s)
Definition:
TestProcessor.cc:48
DDAxes::x
taus_updatedMVAIds_cff.category
category
Definition:
taus_updatedMVAIds_cff.py:31
heppy_batch.val
val
Definition:
heppy_batch.py:351
Generated for CMSSW Reference Manual by
1.8.11