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