CondFormats
Calibration
src
BlobComplex.cc
Go to the documentation of this file.
1
#include <iostream>
2
3
#include "
CondFormats/Calibration/interface/BlobComplex.h
"
4
5
void
BlobComplexData::fill
(
unsigned
int
&serial) {
6
a
= ++serial;
7
b
= ++serial;
8
for
(
unsigned
int
i
= 0;
i
< 10;
i
++)
9
values
.push_back(++serial);
10
}
11
12
void
BlobComplexData::print
()
const
{
13
std::cout
<<
" a = "
<<
a
<< std::endl;
14
std::cout
<<
" b = "
<<
b
<< std::endl;
15
for
(std::vector<unsigned int>::const_iterator iter =
values
.begin(); iter !=
values
.end(); iter++)
16
std::cout
<<
" value["
<< (iter -
values
.begin()) <<
"] = "
<< *iter << std::endl;
17
}
18
19
bool
BlobComplexData::operator==
(
const
BlobComplexData
&rhs)
const
{
20
if
(
a
!= rhs.
a
)
21
return
false
;
22
if
(
b
!= rhs.
b
)
23
return
false
;
24
if
(
values
.size() != rhs.
values
.size())
25
return
false
;
26
std::vector<unsigned int>::const_iterator iter1 =
values
.begin();
27
std::vector<unsigned int>::const_iterator iter2 = rhs.
values
.begin();
28
while
(iter1 !=
values
.end())
29
if
(*iter1++ != *iter2++)
30
return
false
;
31
return
true
;
32
}
33
34
void
BlobComplexContent::fill
(
unsigned
int
&serial) {
35
data1
.first.fill(serial);
36
data1
.second = ++serial;
37
data2
.first.fill(serial);
38
data2
.second = ++serial;
39
data3
.first.fill(serial);
40
data3
.second = ++serial;
41
}
42
43
static
void
printBlobComplexContentData
(
const
BlobComplexContent::Data
&
data
) {
44
std::cout
<<
" first = "
<< std::endl;
45
data
.first.print();
46
std::cout
<<
" second = "
<<
data
.second << std::endl;
47
}
48
49
void
BlobComplexContent::print
()
const
{
50
std::cout
<<
" data1 = "
<< std::endl;
51
printBlobComplexContentData
(
data1
);
52
std::cout
<<
" data2 = "
<< std::endl;
53
printBlobComplexContentData
(
data2
);
54
std::cout
<<
" data3 = "
<< std::endl;
55
printBlobComplexContentData
(
data3
);
56
}
57
58
bool
BlobComplexContent::operator==
(
const
BlobComplexContent
&rhs)
const
{
59
if
(
data1
.first != rhs.
data1
.first ||
data1
.second != rhs.
data1
.second)
60
return
false
;
61
if
(
data2
.first != rhs.
data2
.first ||
data2
.second != rhs.
data2
.second)
62
return
false
;
63
if
(
data3
.first != rhs.
data3
.first ||
data3
.second != rhs.
data3
.second)
64
return
false
;
65
return
true
;
66
}
67
68
void
BlobComplexObjects::fill
(
unsigned
int
&serial) {
69
a
= ++serial;
70
b
= ++serial;
71
for
(
unsigned
int
i
= 0;
i
< 3;
i
++) {
72
content
.push_back(
BlobComplexContent
());
73
content
.back().fill(serial);
74
}
75
}
76
77
void
BlobComplexObjects::print
()
const
{
78
std::cout
<<
" a = "
<<
a
<< std::endl;
79
std::cout
<<
" b = "
<<
b
<< std::endl;
80
for
(std::vector<BlobComplexContent>::const_iterator iter =
content
.begin(); iter !=
content
.end(); iter++) {
81
std::cout
<<
" content["
<< (iter -
content
.begin()) <<
"] ="
<< std::endl;
82
iter->print();
83
}
84
}
85
86
bool
BlobComplexObjects::operator==
(
const
BlobComplexObjects
&rhs)
const
{
87
if
(
a
!= rhs.
a
)
88
return
false
;
89
if
(
b
!= rhs.
b
)
90
return
false
;
91
if
(
content
.size() != rhs.
content
.size())
92
return
false
;
93
std::vector<BlobComplexContent>::const_iterator iter1 =
content
.begin();
94
std::vector<BlobComplexContent>::const_iterator iter2 = rhs.
content
.begin();
95
while
(iter1 !=
content
.end())
96
if
(*iter1++ != *iter2++)
97
return
false
;
98
return
true
;
99
}
100
101
void
BlobComplex::fill
(
unsigned
int
&serial) {
102
for
(
unsigned
int
i
= 0;
i
< 3;
i
++) {
103
objects
.push_back(
BlobComplexObjects
());
104
objects
.back().fill(serial);
105
}
106
}
107
108
void
BlobComplex::print
()
const
{
109
for
(std::vector<BlobComplexObjects>::const_iterator iter =
objects
.begin(); iter !=
objects
.end(); iter++) {
110
std::cout
<<
"objects["
<< (iter -
objects
.begin()) <<
"] ="
<< std::endl;
111
iter->print();
112
}
113
}
114
115
bool
BlobComplex::operator==
(
const
BlobComplex
&rhs)
const
{
116
if
(
objects
.size() != rhs.
objects
.size())
117
return
false
;
118
std::vector<BlobComplexObjects>::const_iterator iter1 =
objects
.begin();
119
std::vector<BlobComplexObjects>::const_iterator iter2 = rhs.
objects
.begin();
120
while
(iter1 !=
objects
.end())
121
if
(*iter1++ != *iter2++)
122
return
false
;
123
return
true
;
124
}
BlobComplexObjects::a
unsigned int a
Definition:
BlobComplex.h:54
BlobComplexObjects::fill
void fill(unsigned int &serial)
Definition:
BlobComplex.cc:68
mps_fire.i
i
Definition:
mps_fire.py:355
BlobComplexData::b
unsigned int b
Definition:
BlobComplex.h:20
BlobComplexContent
Definition:
BlobComplex.h:26
BlobComplexObjects::content
std::vector< BlobComplexContent > content
Definition:
BlobComplex.h:55
BlobComplex
Definition:
BlobComplex.h:60
BlobComplexObjects::b
unsigned int b
Definition:
BlobComplex.h:54
BlobComplexData::fill
void fill(unsigned int &serial)
Definition:
BlobComplex.cc:5
BlobComplexContent::data3
Data data3
Definition:
BlobComplex.h:38
printBlobComplexContentData
static void printBlobComplexContentData(const BlobComplexContent::Data &data)
Definition:
BlobComplex.cc:43
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
objects
Definition:
__init__.py:1
BlobComplexData::print
void print() const
Definition:
BlobComplex.cc:12
BlobComplexObjects
Definition:
BlobComplex.h:43
BlobComplexContent::fill
void fill(unsigned int &serial)
Definition:
BlobComplex.cc:34
BlobComplexContent::print
void print() const
Definition:
BlobComplex.cc:49
BlobComplex::objects
std::vector< BlobComplexObjects > objects
Definition:
BlobComplex.h:68
BlobComplexData::a
unsigned int a
Definition:
BlobComplex.h:20
BlobComplex::operator==
bool operator==(const BlobComplex &rhs) const
Definition:
BlobComplex.cc:115
BlobComplexData
Definition:
BlobComplex.h:9
BlobComplexContent::Data
std::pair< BlobComplexData, unsigned int > Data
Definition:
BlobComplex.h:34
BlobComplexContent::data2
Data data2
Definition:
BlobComplex.h:37
BlobComplexData::values
std::vector< unsigned int > values
Definition:
BlobComplex.h:21
BlobComplex::print
void print() const
Definition:
BlobComplex.cc:108
BlobComplexData::operator==
bool operator==(const BlobComplexData &rhs) const
Definition:
BlobComplex.cc:19
BlobComplexContent::operator==
bool operator==(const BlobComplexContent &rhs) const
Definition:
BlobComplex.cc:58
BlobComplexObjects::print
void print() const
Definition:
BlobComplex.cc:77
BlobComplexContent::data1
Data data1
Definition:
BlobComplex.h:36
BlobComplexObjects::operator==
bool operator==(const BlobComplexObjects &rhs) const
Definition:
BlobComplex.cc:86
data
char data[epos_bytes_allocation]
Definition:
EPOS_Wrapper.h:79
BlobComplex::fill
void fill(unsigned int &serial)
Definition:
BlobComplex.cc:101
BlobComplex.h
Generated for CMSSW Reference Manual by
1.8.16