BmnRoot
26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
L1Portion.h
Go to the documentation of this file.
1
#ifndef L1Portion_H
2
#define L1Portion_H
3
4
#include "
L1TrackPar.h
"
5
6
#include <vector>
7
using
std::vector;
8
// class for portions organization
9
10
template
<
typename
T>
11
class
L1Portion
;
12
13
template
<>
14
class
L1Portion
<
L1TrackPar
>
15
{
16
public
:
17
typedef
L1TrackPar
T
;
18
// typedef vector<T> vType;
19
typedef
nsL1::vector<T>::TSimd
vType
;
20
21
L1Portion
()
22
:
a
()
23
,
dataSize
(0) {};
24
L1Portion
(
int
size)
25
:
a
()
26
,
dataSize
(0)
27
{
28
reserve
(size);
29
};
30
L1Portion
(
int
size,
int
size2)
31
:
a
()
32
,
dataSize
(size2)
33
{
34
reserve
(size);
35
// reserve2(size2);
36
};
37
vType
&
operator[]
(
int
i
) {
return
a
[
i
]; }
38
void
resize
(
int
size) {
a
.resize(size); };
39
void
reserve
(
int
size) {
a
.reserve(size); };
40
void
reserve2
(
int
size)
41
{
42
for
(
unsigned
int
i
= 0;
i
<
a
.size();
i
++)
43
a
[
i
].
reserve
(size);
44
};
45
void
push_back
(
vType
&
v
) {
a
.push_back(
v
); };
46
void
add_void
()
47
{
48
vType
v
;
49
// v.resize(dataSize);
50
a
.push_back(
v
);
51
a
[
a
.size() - 1].reserve(
dataSize
);
52
};
53
void
add_void
(
int
i
)
54
{
55
T
t;
56
a
[
i
].push_back(t);
57
};
58
59
int
CalcSize
()
60
{
61
int
size = 0;
62
for
(
unsigned
int
i
= 0;
i
<
a
.size();
i
++)
63
size +=
a
[
i
].size();
64
return
size *
sizeof
(
T
);
65
};
66
67
private
:
68
vector<vType>
a
;
69
// int mainSize; // size of a
70
int
dataSize
;
// size of vType
71
};
72
73
template
<>
74
class
L1Portion
<
L1FieldRegion
>
75
{
76
public
:
77
typedef
L1FieldRegion
T
;
78
typedef
nsL1::vector<T>::TSimd
vType
;
79
// typedef std::vector<T, nsL1::SimdAlloc<T> > vType;
80
81
L1Portion
()
82
:
a
()
83
,
dataSize
(0) {};
84
L1Portion
(
int
size)
85
:
a
()
86
,
dataSize
(0)
87
{
88
reserve
(size);
89
};
90
L1Portion
(
int
size,
int
size2)
91
:
a
()
92
,
dataSize
(size2)
93
{
94
reserve
(size);
95
// reserve2(size2);
96
};
97
98
vType
&
operator[]
(
int
i
) {
return
a
[
i
]; }
99
void
resize
(
int
size) {
a
.resize(size); };
100
void
reserve
(
int
size) {
a
.reserve(size); };
101
void
reserve2
(
int
size)
102
{
103
for
(
unsigned
int
i
= 0;
i
<
a
.size();
i
++)
104
a
[
i
].
reserve
(size);
105
};
106
void
push_back
(
vType
&
v
) {
a
.push_back(
v
); };
107
void
add_void
()
108
{
109
vType
v
;
110
// v.resize(dataSize);
111
a
.push_back(
v
);
112
a
[
a
.size() - 1].reserve(
dataSize
);
113
};
114
void
add_void
(
int
i
)
115
{
116
T
t;
117
a
[
i
].push_back(t);
118
};
119
120
int
CalcSize
()
121
{
122
int
size = 0;
123
for
(
unsigned
int
i
= 0;
i
<
a
.size();
i
++)
124
size +=
a
[
i
].size();
125
return
size *
sizeof
(
T
);
126
};
127
128
private
:
129
vector<vType>
a
;
130
// int mainSize; // size of a
131
int
dataSize
;
// size of vType
132
};
133
134
template
<
typename
T>
135
class
L1Portion
136
{
137
public
:
138
typedef
vector<T>
vType
;
139
140
L1Portion
()
141
:
a
()
142
,
dataSize
(0) {};
143
L1Portion
(
int
size)
144
:
a
()
145
,
dataSize
(0)
146
{
147
reserve
(size);
148
};
149
L1Portion
(
int
size,
int
size2)
150
:
a
()
151
,
dataSize
(size2)
152
{
153
reserve
(size);
154
// reserve2(size2);
155
};
156
vType
&
operator[]
(
int
i
) {
return
a
[
i
]; }
157
void
resize
(
int
size) {
a
.resize(size); };
158
void
reserve
(
int
size) {
a
.reserve(size); };
159
void
reserve2
(
int
size)
160
{
161
for
(
int
i
= 0;
i
<
a
.size();
i
++)
162
a
[
i
].
reserve
(size);
163
};
164
void
push_back
(
vType
&
v
) {
a
.push_back(
v
); };
165
void
add_void
()
166
{
167
vType
v
;
168
// v.resize(dataSize);
169
a
.push_back(
v
);
170
a
[
a
.size() - 1].reserve(
dataSize
);
171
};
172
void
add_void
(
int
i
)
173
{
174
T t;
175
a
[
i
].push_back(t);
176
};
177
178
int
CalcSize
()
179
{
180
int
size = 0;
181
for
(
int
i
= 0;
i
<
a
.size();
i
++)
182
size +=
a
[
i
].size();
183
return
size *
sizeof
(T);
184
};
185
186
private
:
187
vector<vType>
a
;
188
// int mainSize; // size of a
189
int
dataSize
;
// size of vType
190
};
191
192
#endif
// L1Portion_H
L1TrackPar.h
v
__m128 v
Definition
P4_F32vec4.h:1
i
int i
Definition
P4_F32vec4.h:22
L1FieldRegion
Definition
L1Field.h:86
L1Portion< L1FieldRegion >::CalcSize
int CalcSize()
Definition
L1Portion.h:120
L1Portion< L1FieldRegion >::vType
nsL1::vector< T >::TSimd vType
Definition
L1Portion.h:78
L1Portion< L1FieldRegion >::T
L1FieldRegion T
Definition
L1Portion.h:77
L1Portion< L1FieldRegion >::a
vector< vType > a
Definition
L1Portion.h:129
L1Portion< L1FieldRegion >::reserve2
void reserve2(int size)
Definition
L1Portion.h:101
L1Portion< L1FieldRegion >::push_back
void push_back(vType &v)
Definition
L1Portion.h:106
L1Portion< L1FieldRegion >::add_void
void add_void()
Definition
L1Portion.h:107
L1Portion< L1FieldRegion >::operator[]
vType & operator[](int i)
Definition
L1Portion.h:98
L1Portion< L1FieldRegion >::reserve
void reserve(int size)
Definition
L1Portion.h:100
L1Portion< L1FieldRegion >::L1Portion
L1Portion(int size)
Definition
L1Portion.h:84
L1Portion< L1FieldRegion >::resize
void resize(int size)
Definition
L1Portion.h:99
L1Portion< L1FieldRegion >::dataSize
int dataSize
Definition
L1Portion.h:131
L1Portion< L1FieldRegion >::L1Portion
L1Portion()
Definition
L1Portion.h:81
L1Portion< L1FieldRegion >::add_void
void add_void(int i)
Definition
L1Portion.h:114
L1Portion< L1FieldRegion >::L1Portion
L1Portion(int size, int size2)
Definition
L1Portion.h:90
L1Portion< L1TrackPar >::resize
void resize(int size)
Definition
L1Portion.h:38
L1Portion< L1TrackPar >::L1Portion
L1Portion(int size, int size2)
Definition
L1Portion.h:30
L1Portion< L1TrackPar >::a
vector< vType > a
Definition
L1Portion.h:68
L1Portion< L1TrackPar >::add_void
void add_void()
Definition
L1Portion.h:46
L1Portion< L1TrackPar >::vType
nsL1::vector< T >::TSimd vType
Definition
L1Portion.h:19
L1Portion< L1TrackPar >::L1Portion
L1Portion(int size)
Definition
L1Portion.h:24
L1Portion< L1TrackPar >::reserve
void reserve(int size)
Definition
L1Portion.h:39
L1Portion< L1TrackPar >::push_back
void push_back(vType &v)
Definition
L1Portion.h:45
L1Portion< L1TrackPar >::T
L1TrackPar T
Definition
L1Portion.h:17
L1Portion< L1TrackPar >::reserve2
void reserve2(int size)
Definition
L1Portion.h:40
L1Portion< L1TrackPar >::dataSize
int dataSize
Definition
L1Portion.h:70
L1Portion< L1TrackPar >::add_void
void add_void(int i)
Definition
L1Portion.h:53
L1Portion< L1TrackPar >::CalcSize
int CalcSize()
Definition
L1Portion.h:59
L1Portion< L1TrackPar >::L1Portion
L1Portion()
Definition
L1Portion.h:21
L1Portion< L1TrackPar >::operator[]
vType & operator[](int i)
Definition
L1Portion.h:37
L1Portion
Definition
L1Portion.h:136
L1Portion::a
vector< vType > a
Definition
L1Portion.h:187
L1Portion::operator[]
vType & operator[](int i)
Definition
L1Portion.h:156
L1Portion::push_back
void push_back(vType &v)
Definition
L1Portion.h:164
L1Portion::vType
vector< T > vType
Definition
L1Portion.h:138
L1Portion::reserve
void reserve(int size)
Definition
L1Portion.h:158
L1Portion::L1Portion
L1Portion()
Definition
L1Portion.h:140
L1Portion::L1Portion
L1Portion(int size)
Definition
L1Portion.h:143
L1Portion::add_void
void add_void(int i)
Definition
L1Portion.h:172
L1Portion::reserve2
void reserve2(int size)
Definition
L1Portion.h:159
L1Portion::resize
void resize(int size)
Definition
L1Portion.h:157
L1Portion::add_void
void add_void()
Definition
L1Portion.h:165
L1Portion::L1Portion
L1Portion(int size, int size2)
Definition
L1Portion.h:149
L1Portion::dataSize
int dataSize
Definition
L1Portion.h:189
L1Portion::CalcSize
int CalcSize()
Definition
L1Portion.h:178
L1TrackPar
Definition
L1TrackPar.h:7
nsL1::vector::TSimd
std::vector< T > TSimd
Definition
PSEUDO_F32vec1.h:148
reconstruction
cat
L1Algo
L1Portion.h
Generated on
for BmnRoot by
1.17.0