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
InttSurveyMap.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file InttSurveyMap.cc
1
#include "
InttSurveyMap.h
"
2
3
#include <
cdbobjects/CDBTTree.h
>
4
5
#include <
ffamodules/CDBInterface.h
>
6
7
#include <filesystem>
// for exists
8
#include <utility>
// for pair
9
10
void
InttSurveyMap::identify
(
11
std::ostream&
out
)
const
12
{
13
out <<
"InttSurveyMap"
14
<<
"\n"
15
<<
"\tBase Version"
16
<<
"\n"
17
<<
"\tUnimplemented"
<< std::endl;
18
}
19
20
std::size_t
InttSurveyMap::size
()
const
21
{
22
return
0;
23
}
24
25
int
InttSurveyMap::LoadFromFile
(
26
std::string
const
&
filename
)
27
{
28
if
(filename.empty())
29
{
30
std::cout <<
"int InttSurveyMap::LoadFromFile(std::string const& filename)"
<< std::endl;
31
std::cout <<
"\tArgument 'filename' is empty string"
<< std::endl;
32
return
1;
33
}
34
35
if
(!
std::filesystem::exists
(filename))
36
{
37
std::cout <<
"int InttSurveyMap::LoadFromFile(std::string const& filename)"
<< std::endl;
38
std::cout <<
"\tFile '"
<< filename <<
"' does not exist"
<< std::endl;
39
return
1;
40
}
41
42
CDBTTree
cdbttree(filename);
43
cdbttree.
LoadCalibrations
();
44
45
return
v_LoadFromCDBTTree
(cdbttree);
46
}
47
48
int
InttSurveyMap::LoadFromCDB
(
49
std::string
const
&
name
)
50
{
51
if
(name.empty())
52
{
53
std::cout <<
"int InttSurveyMap::LoadFromCDB(std::string const& name)"
<< std::endl;
54
std::cout <<
"\tArgument 'name' is empty string"
<< std::endl;
55
return
1;
56
}
57
58
std::string
database =
CDBInterface::instance
()->
getUrl
(name);
59
CDBTTree
cdbttree(database);
60
cdbttree.
LoadCalibrations
();
61
62
return
v_LoadFromCDBTTree
(cdbttree);
63
}
64
65
int
InttSurveyMap::v_LoadFromCDBTTree
(
66
CDBTTree
&
67
/*unused*/
)
68
{
69
return
0;
70
}
71
72
InttSurveyMap::val_t
const
*
InttSurveyMap::GetAbsoluteTransform
(
73
key_t
k
)
const
74
{
75
map_t::const_iterator itr;
76
77
if
(
v_LookupAbsoluteTransform
(k, itr))
78
{
79
return
&(itr->second);
80
}
81
82
k.
strip_z
=
InttMap::Wildcard
;
83
if
(
v_LookupAbsoluteTransform
(k, itr))
84
{
85
return
&(itr->second);
86
}
87
88
k.
strip_phi
=
InttMap::Wildcard
;
89
if
(
v_LookupAbsoluteTransform
(k, itr))
90
{
91
return
&(itr->second);
92
}
93
94
k.
ladder_z
=
InttMap::Wildcard
;
95
if
(
v_LookupAbsoluteTransform
(k, itr))
96
{
97
return
&(itr->second);
98
}
99
100
k.
ladder_phi
=
InttMap::Wildcard
;
101
if
(
v_LookupAbsoluteTransform
(k, itr))
102
{
103
return
&(itr->second);
104
}
105
106
k.
layer
=
InttMap::Wildcard
;
107
if
(
v_LookupAbsoluteTransform
(k, itr))
108
{
109
return
&(itr->second);
110
}
111
112
return
(
val_t
const
*)
nullptr
;
113
}
114
115
InttSurveyMap::val_t
const
*
InttSurveyMap::GetRelativeTransform
(
116
key_t
k
)
const
117
{
118
map_t::const_iterator itr;
119
120
if
(
v_LookupRelativeTransform
(k, itr))
121
{
122
return
&(itr->second);
123
}
124
125
k.
strip_z
=
InttMap::Wildcard
;
126
if
(
v_LookupRelativeTransform
(k, itr))
127
{
128
return
&(itr->second);
129
}
130
131
k.
strip_phi
=
InttMap::Wildcard
;
132
if
(
v_LookupRelativeTransform
(k, itr))
133
{
134
return
&(itr->second);
135
}
136
137
k.
ladder_z
=
InttMap::Wildcard
;
138
if
(
v_LookupRelativeTransform
(k, itr))
139
{
140
return
&(itr->second);
141
}
142
143
k.
ladder_phi
=
InttMap::Wildcard
;
144
if
(
v_LookupRelativeTransform
(k, itr))
145
{
146
return
&(itr->second);
147
}
148
149
k.
layer
=
InttMap::Wildcard
;
150
if
(
v_LookupRelativeTransform
(k, itr))
151
{
152
return
&(itr->second);
153
}
154
155
return
(
val_t
const
*)
nullptr
;
156
}
157
158
int
InttSurveyMap::v_LookupAbsoluteTransform
(
159
key_t
const
&
/*unused*/
, map_t::const_iterator&
160
/*unused*/
)
const
161
{
162
return
0;
163
}
164
165
int
InttSurveyMap::v_LookupRelativeTransform
(
166
key_t
const
&
/*unused*/
, map_t::const_iterator&
167
/*unused*/
)
const
168
{
169
return
0;
170
}
coresoftware
blob
master
offline
packages
intt
InttSurveyMap.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:06
using
1.8.2 with
sPHENIX GitHub integration