BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
L1AlgoTBB.h
Go to the documentation of this file.
1#ifndef L1AlgoTBB_h
2#define L1AlgoTBB_h
3
4#include "L1Algo.h"
5
6#ifdef TBB
7
8#include "tbb/blocked_range.h"
9#include "tbb/parallel_for.h"
10#include "tbb/task_scheduler_init.h"
11using namespace tbb;
12
13class ParalleledDup
14{
15 // input
16 int isec;
17 L1Station* vStations;
18 int NStations;
19 int* StsHitsStartIndex;
20 int* StsHitsStopIndex;
21 vector<unsigned char>& vSFlag;
22 vector<unsigned char>& vSFlagB;
23 std::vector<L1HitPoint>& vStsHits;
24 double Pick_r;
25 double Pick_m;
26 double MaxInvMom;
27 fvec targX;
28 fvec targY;
29 fvec targZ;
30 L1FieldValue& targB;
31 L1XYMeasurementInfo& TargetXYInfo;
32
33 int* n_g1;
34 unsigned* portionStopIndex;
35 L1TrackPar* T_g1;
36 L1FieldRegion* fld_g1;
37 THitI* hitsl_g1;
38 // fvec *x_minusV_g1; fvec *x_plusV_g1; fvec *y_minusV_g1; fvec *y_plusV_g1;
39 // output
40 THitI* Duplets_start;
41 THitI* Duplets_hits;
42
43 int* n_g2;
44 THitI* i1_g2;
45 // L1TrackPar *T_g2;
46 // L1FieldRegion *fld_g2;
47 // fvec *u_front_g2; fvec *u_back_g2;
48 // THitI *hitsl_g2;
49 THitI* hitsm_g2;
50 // fvec *x_minusV_g2; fvec *x_plusV_g2; fvec *y_minusV_g2; fvec *y_plusV_g2;
51
52 public:
53 void operator()(const blocked_range<size_t>& r) const;
54
55 ParalleledDup(
56 // input
57 int isec_,
58 L1Station* vStations_,
59 int NStations_,
60 int* StsHitsStartIndex_,
61 int* StsHitsStopIndex_,
62 vector<unsigned char>& vSFlag_,
63 vector<unsigned char>& vSFlagB_,
64 std::vector<L1HitPoint>& vStsHits_,
65 double Pick_r_,
66 double Pick_m_,
67 double MaxInvMom_,
68 fvec targX_,
69 fvec targY_,
70 fvec targZ_,
71 L1FieldValue& targB_,
72 L1XYMeasurementInfo& TargetXYInfo_,
73
74 int* n_g1_,
75 unsigned* portionStopIndex_,
76 L1TrackPar* T_g1_,
77 L1FieldRegion* fld_g1_,
78 THitI* hitsl_g1_,
79 // fvec *x_minusV_g1_, fvec *x_plusV_g1_, fvec *y_minusV_g1_, fvec *y_plusV_g1_,
80 // output
81 THitI* Duplets_start_,
82 THitI* Duplets_hits_,
83
84 int* n_g2_,
85 THitI* i1_g2_,
86 // L1TrackPar *T_g2_,
87 // L1FieldRegion *fld_g2_,
88 // fvec *u_front_g2_, fvec *u_back_g2_,
89 // THitI *hitsl_g2_,
90 THitI* hitsm_g2_
91 // fvec *x_minusV_g2_, fvec *x_plusV_g2_, fvec *y_minusV_g2_, fvec *y_plusV_g2_
92 )
93 : isec(isec_)
94 , vStations(vStations_)
95 , NStations(NStations_)
96 , StsHitsStartIndex(StsHitsStartIndex_)
97 , StsHitsStopIndex(StsHitsStopIndex_)
98 , vSFlag(vSFlag_)
99 , vSFlagB(vSFlagB_)
100 , vStsHits(vStsHits_)
101 , Pick_r(Pick_r_)
102 , Pick_m(Pick_m_)
103 , MaxInvMom(MaxInvMom_)
104 , targX(targX_)
105 , targY(targY_)
106 , targZ(targZ_)
107 , targB(targB_)
108 , TargetXYInfo(TargetXYInfo_)
109 ,
110
111 n_g1(n_g1_)
112 , portionStopIndex(portionStopIndex_)
113 , T_g1(T_g1_)
114 , fld_g1(fld_g1_)
115 , hitsl_g1(hitsl_g1_)
116 ,
117 // x_minusV_g1(x_minusV_g1_), x_plusV_g1(x_plusV_g1_),
118 // y_minusV_g1(y_minusV_g1_), y_plusV_g1(y_plusV_g1_), output
119 Duplets_start(Duplets_start_)
120 , Duplets_hits(Duplets_hits_)
121 ,
122
123 n_g2(n_g2_)
124 , i1_g2(i1_g2_)
125 ,
126 // T_g2(T_g2_),
127 // fld_g2(fld_g2_),
128 // u_front_g2(u_front_g2_), u_back_g2(u_back_g2_),
129 // hitsl_g2(hitsl_g2_),
130 hitsm_g2(hitsm_g2_)
131 // x_minusV_g2(x_minusV_g2_), x_plusV_g2(x_plusV_g2_),
132 // y_minusV_g2(y_minusV_g2_), y_plusV_g2(y_plusV_g2_)
133 {};
134
135 ~ParalleledDup() {};
136};
137
138void ParalleledDup::operator()(const blocked_range<size_t>& r) const
139{
140
141 for (int istal = r.begin(); istal < (int)r.end(); ++istal) {
142 // cout<< " ParalleledDup::operator(). Station: " << istal << endl;
143 DupletsStaPort( // input
144 isec, istal, vStsHits, targX, targY, targZ, targB, TargetXYInfo,
145
146 n_g1, portionStopIndex, T_g1, fld_g1, hitsl_g1,
147 // x_minusV_g1, x_plusV_g1, y_minusV_g1, y_plusV_g1,
148 // output
149 Duplets_start, Duplets_hits,
150
151 n_g2, i1_g2,
152 // T_g2,
153 // fld_g2,
154 // u_front_g2, u_back_g2,
155 // hitsl_g2,
156 hitsm_g2
157 // x_minusV_g2, x_plusV_g2, y_minusV_g2, y_plusV_g2
158 );
159 }
160}
161
162class ParalleledTrip
163{
164 // input
165 int isec;
166 L1Station* vStations;
167 int NStations;
168 int* StsHitsStartIndex;
169 int* StsHitsStopIndex;
170 std::vector<L1HitPoint>& svStsHits;
171 double Pick_r;
172 double TRACK_CHI2_CUT;
173 double MaxInvMom;
174
175 int* n_g1;
176 L1TrackPar* T_g1;
177 L1FieldRegion* fld_g1;
178 THitI* hitsl_g1;
179
180 int* n_g2;
181 unsigned* portionStopIndex;
182 THitI* i1_g2;
183 /* L1FieldRegion *fld_g2;
184 fvec *u_front_g2; fvec *u_back_g2;
185 L1TrackPar *T_g2;*/
186 // THitI *hitsl_g2;
187 THitI* hitsm_g2;
188 // fvec *x_minusV_g2; fvec *x_plusV_g2; fvec *y_minusV_g2; fvec *y_plusV_g2;
189 // output
190 THitI* Duplets_start;
191 THitI* Duplets_hits;
192 std::vector<L1Triplet>* vTriplets_part;
193 unsigned* TripStartIndexH;
194 unsigned* TripStopIndexH;
195
196 public:
197 void operator()(const blocked_range<size_t>& r) const;
198
199 ParalleledTrip(
200 // input
201 int isec_,
202 L1Station* vStations_,
203 int NStations_,
204 int* StsHitsStartIndex_,
205 int* StsHitsStopIndex_,
206 std::vector<L1HitPoint>& vStsHits_,
207 double Pick_r_,
208 double TRACK_CHI2_CUT_,
209 double MaxInvMom_,
210
211 int* n_g1_,
212 L1TrackPar* T_g1_,
213 L1FieldRegion* fld_g1_,
214 THitI* hitsl_g1_,
215
216 int* n_g2_,
217 unsigned* portionStopIndex_,
218 THitI* i1_g2_,
219 /*L1FieldRegion *fld_g2_,
220 fvec *u_front_g2_, fvec *u_back_g2_,
221 L1TrackPar *T_g2_,*/
222 // THitI *hitsl_g2_,
223 THitI* hitsm_g2_,
224 // fvec *x_minusV_g2_, fvec *x_plusV_g2_, fvec *y_minusV_g2_, fvec *y_plusV_g2_,
225 // output
226 THitI* Duplets_start_,
227 THitI* Duplets_hits_,
228 std::vector<L1Triplet>* vTriplets_part_,
229 unsigned* TripStartIndexH_,
230 unsigned* TripStopIndexH_)
231 : // input
232 isec(isec_)
233 , vStations(vStations_)
234 , NStations(NStations_)
235 , StsHitsStartIndex(StsHitsStartIndex_)
236 , StsHitsStopIndex(StsHitsStopIndex_)
237 , svStsHits(vStsHits_)
238 , Pick_r(Pick_r_)
239 , TRACK_CHI2_CUT(TRACK_CHI2_CUT_)
240 , MaxInvMom(MaxInvMom_)
241 ,
242
243 n_g1(n_g1_)
244 , T_g1(T_g1_)
245 , fld_g1(fld_g1_)
246 , hitsl_g1(hitsl_g1_)
247 ,
248
249 n_g2(n_g2_)
250 , portionStopIndex(portionStopIndex_)
251 , i1_g2(i1_g2_)
252 ,
253 /* fld_g2(fld_g2_),
254 u_front_g2(u_front_g2_), u_back_g2(u_back_g2_),
255 T_g2(T_g2_),*/
256 // hitsl_g2(hitsl_g2_),
257 hitsm_g2(hitsm_g2_)
258 ,
259 // x_minusV_g2(x_minusV_g2_), x_plusV_g2(x_plusV_g2_),
260 // y_minusV_g2(y_minusV_g2_), y_plusV_g2(y_plusV_g2_), output
261 Duplets_start(Duplets_start_)
262 , Duplets_hits(Duplets_hits_)
263 , vTriplets_part(vTriplets_part_)
264 , TripStartIndexH(TripStartIndexH_)
265 , TripStopIndexH(TripStopIndexH_) {};
266
267 ~ParalleledTrip() {};
268};
269
270void ParalleledTrip::operator()(const blocked_range<size_t>& r) const
271{
272
273 for (int istal = r.begin(); istal < (int)r.end(); ++istal) {
274 // cout<< " ParalleledTrip::operator(). Station: " << istal << endl;
275 TripletsStaPort( // input
276 isec, istal, svStsHits, n_g1, T_g1, fld_g1, hitsl_g1,
277
278 n_g2, portionStopIndex, i1_g2,
279 /* fld_g2,
280 u_front_g2, u_back_g2,
281 T_g2,*/
282 // hitsl_g2,
283 hitsm_g2,
284 // x_minusV_g2, x_plusV_g2, y_minusV_g2, y_plusV_g2,
285 // output
286 Duplets_start, Duplets_hits, vTriplets_part, TripStartIndexH, TripStopIndexH);
287 }
288}
289#endif // TBB
290
291#endif
unsigned int THitI
Definition L1StsHit.h:6
F32vec4 fvec
Definition P4_F32vec4.h:231
TRObject operator()(const T1 &t1) const