Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
InttSurveyMapv1.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file InttSurveyMapv1.cc
1
#include "
InttSurveyMapv1.h
"
2
3
#include <
cdbobjects/CDBTTree.h
>
4
5
#include <boost/format.hpp>
6
7
InttSurveyMapv1::~InttSurveyMapv1
()
8
{
9
delete
m_absolute_transforms
;
10
delete
m_relative_transforms
;
11
}
12
13
void
InttSurveyMapv1::identify
(
14
std::ostream&
out
)
const
15
{
16
out <<
"InttSurveyMapv1"
17
<<
"\n"
18
<<
"\tsize: "
<<
size
() << std::endl;
19
}
20
21
std::size_t
InttSurveyMapv1::size
()
const
22
{
23
return
0;
24
}
25
26
int
InttSurveyMapv1::v_LoadFromCDBTTree
(
27
CDBTTree
& cdbttree)
28
{
29
Eigen::Affine3d aff;
30
InttMap::Offline_s
ofl;
31
32
if
(!
m_absolute_transforms
)
33
{
34
m_absolute_transforms
=
new
map_t
;
35
}
36
m_absolute_transforms
->clear();
37
38
if
(!
m_relative_transforms
)
39
{
40
m_relative_transforms
=
new
map_t
;
41
}
42
m_relative_transforms
->clear();
43
44
Int_t
N
= cdbttree.
GetSingleIntValue
(
"size"
);
45
for
(Int_t
n
= 0;
n
<
N
; ++
n
)
46
{
47
ofl.
layer
= cdbttree.
GetIntValue
(
n
,
"layer"
);
48
ofl.
ladder_phi
= cdbttree.
GetIntValue
(
n
,
"ladder_phi"
);
49
ofl.
ladder_z
= cdbttree.
GetIntValue
(
n
,
"ladder_z"
);
50
ofl.
strip_phi
= cdbttree.
GetIntValue
(
n
,
"strip_phi"
);
51
ofl.
strip_z
= cdbttree.
GetIntValue
(
n
,
"strip_z"
);
52
53
for
(
int
i
= 0;
i
< 16; ++
i
)
54
{
55
std::string
boost_formatted =
boost::str
(
boost::format
(
"m_rel_%01d_%01d"
) % (
i
/ 4) % (
i
%4));
56
aff.matrix()(
i
/ 4,
i
% 4) = cdbttree.
GetDoubleValue
(
n
,boost_formatted );
57
}
58
m_relative_transforms
->insert({ofl, aff});
59
60
for
(
int
i
= 0;
i
< 16; ++
i
)
61
{
62
std::string
boost_formatted =
boost::str
(
boost::format
(
"m_abs_%01d_%01d"
) % (
i
/ 4) % (
i
%4));
63
aff.matrix()(
i
/ 4,
i
% 4) = cdbttree.
GetDoubleValue
(
n
, boost_formatted);
64
}
65
m_absolute_transforms
->insert({ofl, aff});
66
}
67
68
return
0;
69
}
70
71
int
InttSurveyMapv1::v_LookupAbsoluteTransform
(
72
key_t
const
&
k
,
73
map_t::const_iterator& itr)
const
74
{
75
if
(!
m_absolute_transforms
)
76
{
77
return
0;
78
}
79
itr =
m_absolute_transforms
->find(k);
80
return
itr !=
m_absolute_transforms
->end();
81
}
82
83
int
InttSurveyMapv1::v_LookupRelativeTransform
(
84
key_t
const
&
k
,
85
map_t::const_iterator& itr)
const
86
{
87
if
(!
m_relative_transforms
)
88
{
89
return
0;
90
}
91
itr =
m_relative_transforms
->find(k);
92
return
itr !=
m_relative_transforms
->end();
93
}
coresoftware
blob
master
offline
packages
intt
InttSurveyMapv1.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:06
using
1.8.2 with
sPHENIX GitHub integration