Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
larevt
larevt
CalibrationDBI
IOVData
CalibrationExtraInfo.cxx
Go to the documentation of this file.
1
#include "
CalibrationExtraInfo.h
"
2
#include "
IOVDataError.h
"
3
4
namespace
lariov
{
5
6
void
CalibrationExtraInfo::AddOrReplaceBoolData
(
std::string
const
&
label
,
bool
const
data
) {
7
fBoolData
[
label
] =
data
;
8
}
9
10
void
CalibrationExtraInfo::AddOrReplaceIntData
(
std::string
const
&
label
,
int
const
data
) {
11
fIntData
[
label
] =
data
;
12
}
13
14
void
CalibrationExtraInfo::AddOrReplaceVecIntData
(
std::string
const
&
label
, std::vector<int>
const
&
data
) {
15
fVecIntData
[
label
] =
data
;
16
}
17
18
void
CalibrationExtraInfo::AddOrReplaceFloatData
(
std::string
const
&
label
,
float
const
data
) {
19
fFloatData
[
label
] =
data
;
20
}
21
22
void
CalibrationExtraInfo::AddOrReplaceVecFloatData
(
std::string
const
&
label
, std::vector<float>
const
&
data
) {
23
fVecFloatData
[
label
] =
data
;
24
}
25
26
void
CalibrationExtraInfo::AddOrReplaceStringData
(
std::string
const
&
label
,
std::string
const
&
data
) {
27
fStringData
[
label
] =
data
;
28
}
29
30
void
CalibrationExtraInfo::ClearDataByLabel
(
std::string
const
&
label
) {
31
unsigned
int
n_erased = 0;
32
33
n_erased +=
fBoolData
.erase(label);
34
n_erased +=
fIntData
.erase(label);
35
n_erased +=
fVecIntData
.erase(label);
36
n_erased +=
fFloatData
.erase(label);
37
n_erased +=
fVecFloatData
.erase(label);
38
n_erased +=
fStringData
.erase(label);
39
40
if
(n_erased > 1) {
41
std::cout<<
"INFO(CalibrationExtraInfo): Erased more than one entry with label "
<<label<<
". Recommend that you do not use identical labels"
<<
std::endl
;
42
}
43
}
44
45
void
CalibrationExtraInfo::ClearAllData
() {
46
fBoolData
.clear();
47
fIntData
.clear();
48
fVecIntData
.clear();
49
fFloatData
.clear();
50
fVecFloatData
.clear();
51
fStringData
.clear();
52
}
53
54
bool
CalibrationExtraInfo::GetBoolData
(
std::string
const
&
label
)
const
{
55
if
(
fBoolData
.find(label) !=
fBoolData
.end()) {
56
return
fBoolData
.at(label);
57
}
58
59
throw
IOVDataError
(
"CalibrationExtraInfo: Could not find extra bool data "
+label+
" for calibration "
+
fName
);
60
61
}
62
63
int
CalibrationExtraInfo::GetIntData
(
std::string
const
&
label
)
const
{
64
if
(
fIntData
.find(label) !=
fIntData
.end()) {
65
return
fIntData
.at(label);
66
}
67
68
throw
IOVDataError
(
"CalibrationExtraInfo: Could not find extra int data "
+label+
" for calibration "
+
fName
);
69
70
}
71
72
std::vector<int>
const
&
CalibrationExtraInfo::GetVecIntData
(
std::string
const
&
label
)
const
{
73
if
(
fVecIntData
.find(label) !=
fVecIntData
.end()) {
74
return
fVecIntData
.at(label);
75
}
76
77
throw
IOVDataError
(
"CalibrationExtraInfo: Could not find extra vector int data "
+label+
" for calibration "
+
fName
);
78
79
}
80
81
float
CalibrationExtraInfo::GetFloatData
(
std::string
const
&
label
)
const
{
82
if
(
fFloatData
.find(label) !=
fFloatData
.end()) {
83
return
fFloatData
.at(label);
84
}
85
86
throw
IOVDataError
(
"CalibrationExtraInfo: Could not find extra float data "
+label+
" for calibration "
+
fName
);
87
88
}
89
90
std::vector<float>
const
&
CalibrationExtraInfo::GetVecFloatData
(
std::string
const
&
label
)
const
{
91
if
(
fVecFloatData
.find(label) !=
fVecFloatData
.end()) {
92
return
fVecFloatData
.at(label);
93
}
94
95
throw
IOVDataError
(
"CalibrationExtraInfo: Could not find extra vector float data "
+label+
" for calibration "
+
fName
);
96
97
}
98
99
std::string
const
&
CalibrationExtraInfo::GetStringData
(
std::string
const
&
label
)
const
{
100
if
(
fStringData
.find(label) !=
fStringData
.end()) {
101
return
fStringData
.at(label);
102
}
103
104
throw
IOVDataError
(
"CalibrationExtraInfo: Could not find extra string data "
+label+
" for calibration "
+
fName
);
105
106
}
107
}
//end namesplace lariov
lariov::CalibrationExtraInfo::AddOrReplaceVecIntData
void AddOrReplaceVecIntData(std::string const &label, std::vector< int > const &data)
Definition:
CalibrationExtraInfo.cxx:14
lariov::CalibrationExtraInfo::fVecFloatData
std::map< std::string, std::vector< float > > fVecFloatData
Definition:
CalibrationExtraInfo.h:52
string
std::string string
Definition:
nybbler.cc:12
lariov::CalibrationExtraInfo::GetFloatData
float GetFloatData(std::string const &label) const
Definition:
CalibrationExtraInfo.cxx:81
lariov::CalibrationExtraInfo::ClearAllData
void ClearAllData()
Definition:
CalibrationExtraInfo.cxx:45
lariov::CalibrationExtraInfo::ClearDataByLabel
void ClearDataByLabel(std::string const &label)
Definition:
CalibrationExtraInfo.cxx:30
test_nxdot.label
label
Definition:
test_nxdot.py:6
lariov::CalibrationExtraInfo::GetVecFloatData
std::vector< float > const & GetVecFloatData(std::string const &label) const
Definition:
CalibrationExtraInfo.cxx:90
lariov::CalibrationExtraInfo::fStringData
std::map< std::string, std::string > fStringData
Definition:
CalibrationExtraInfo.h:54
lariov::CalibrationExtraInfo::fIntData
std::map< std::string, int > fIntData
Definition:
CalibrationExtraInfo.h:48
lariov::CalibrationExtraInfo::GetStringData
std::string const & GetStringData(std::string const &label) const
Definition:
CalibrationExtraInfo.cxx:99
lariov::CalibrationExtraInfo::AddOrReplaceBoolData
void AddOrReplaceBoolData(std::string const &label, bool const data)
Definition:
CalibrationExtraInfo.cxx:6
lariov::CalibrationExtraInfo::AddOrReplaceVecFloatData
void AddOrReplaceVecFloatData(std::string const &label, std::vector< float > const &data)
Definition:
CalibrationExtraInfo.cxx:22
lariov::CalibrationExtraInfo::AddOrReplaceIntData
void AddOrReplaceIntData(std::string const &label, int const data)
Definition:
CalibrationExtraInfo.cxx:10
lariov::CalibrationExtraInfo::AddOrReplaceStringData
void AddOrReplaceStringData(std::string const &label, std::string const &data)
Definition:
CalibrationExtraInfo.cxx:26
lariov::IOVDataError
Definition:
IOVDataError.h:25
CalibrationExtraInfo.h
lariov
Filters for channels, events, etc.
Definition:
ChannelStatusServiceTool.h:19
make_THn_beam_input.data
data
Definition:
make_THn_beam_input.py:80
lariov::CalibrationExtraInfo::fBoolData
std::map< std::string, bool > fBoolData
Definition:
CalibrationExtraInfo.h:46
lariov::CalibrationExtraInfo::GetBoolData
bool GetBoolData(std::string const &label) const
Definition:
CalibrationExtraInfo.cxx:54
lariov::CalibrationExtraInfo::AddOrReplaceFloatData
void AddOrReplaceFloatData(std::string const &label, float const data)
Definition:
CalibrationExtraInfo.cxx:18
IOVDataError.h
Collection of exception classes for IOVData.
lariov::CalibrationExtraInfo::fVecIntData
std::map< std::string, std::vector< int > > fVecIntData
Definition:
CalibrationExtraInfo.h:49
lariov::CalibrationExtraInfo::GetIntData
int GetIntData(std::string const &label) const
Definition:
CalibrationExtraInfo.cxx:63
lariov::CalibrationExtraInfo::GetVecIntData
std::vector< int > const & GetVecIntData(std::string const &label) const
Definition:
CalibrationExtraInfo.cxx:72
lariov::CalibrationExtraInfo::fFloatData
std::map< std::string, float > fFloatData
Definition:
CalibrationExtraInfo.h:51
lariov::CalibrationExtraInfo::fName
std::string fName
Definition:
CalibrationExtraInfo.h:44
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
Generated by
1.8.11