@@ -36,19 +36,19 @@ inline TRACCC_HOST_DEVICE vector2 uv_transform(const scalar& x,
3636// / helper functions (for both cpu and gpu) to calculate bound track parameter
3737// / at the bottom spacepoint
3838// /
39- // / @param measurements is the measurement collection
40- // / @param spacepoints is the spacepoint collection
41- // / @param seed is the input seed
42- // / @param bfield is the magnetic field
39+ // / @param [out] params the bound track parameter vector to be filled
40+ // / @param [in] measurements is the measurement collection
41+ // / @param [in] spacepoints is the spacepoint collection
42+ // / @param [in] seed is the input seed
43+ // / @param [in] bfield is the magnetic field
4344// /
4445template <typename T>
45- inline TRACCC_HOST_DEVICE bound_vector<> seed_to_bound_vector (
46+ inline TRACCC_HOST_DEVICE void seed_to_bound_param_vector (
47+ bound_track_parameters<>& params,
4648 const measurement_collection_types::const_device& measurements,
4749 const edm::spacepoint_collection::const_device& spacepoints,
4850 const edm::seed<T>& seed, const vector3& bfield) {
4951
50- bound_vector<> params = matrix::zero<bound_vector<>>();
51-
5252 const edm::spacepoint_collection::const_device::const_proxy_type spB =
5353 spacepoints.at (seed.bottom_index ());
5454 const edm::spacepoint_collection::const_device::const_proxy_type spM =
@@ -70,9 +70,9 @@ inline TRACCC_HOST_DEVICE bound_vector<> seed_to_bound_vector(
7070 vector3 newXAxis = vector::cross (newYAxis, newZAxis);
7171
7272 // The center of the new frame is at the bottom space point
73- vector3 translation = sp_global_positions[0 ];
73+ const vector3& translation = sp_global_positions[0 ];
7474
75- transform3 trans (translation, newZAxis, newXAxis );
75+ transform3 trans (translation, newXAxis, newYAxis, newZAxis );
7676
7777 // The coordinate of the middle and top space point in the new frame
7878 const point3 local1 = trans.point_to_local (sp_global_positions[1 ]);
@@ -102,28 +102,25 @@ inline TRACCC_HOST_DEVICE bound_vector<> seed_to_bound_vector(
102102 transform3::rotate (trans._data , vector::normalize (transDirection));
103103
104104 // The estimated phi and theta
105- getter::element ( params, e_bound_phi, 0 ) = vector::phi (direction);
106- getter::element ( params, e_bound_theta, 0 ) = vector::theta (direction);
105+ params. set_phi ( vector::phi (direction) );
106+ params. set_theta ( vector::theta (direction) );
107107
108108 // The measured loc0 and loc1
109109 assert (spB.measurement_index_2 () ==
110110 edm::spacepoint_collection::device::INVALID_MEASUREMENT_INDEX);
111111 const measurement& meas_for_spB =
112112 measurements.at (spB.measurement_index_1 ());
113- getter::element ( params, e_bound_loc0, 0 ) = meas_for_spB.local [ 0 ] ;
114- getter::element ( params, e_bound_loc1, 0 ) = meas_for_spB.local [ 1 ] ;
113+ params. set_surface_link ( meas_for_spB.surface_link ) ;
114+ params. set_bound_local ( meas_for_spB.local ) ;
115115
116116 // The estimated q/pt in [GeV/c]^-1 (note that the pt is the
117117 // projection of momentum on the transverse plane of the new frame)
118118 scalar qOverPt = 1 .f / (R * vector::norm (bfield));
119119 // The estimated q/p in [GeV/c]^-1
120- getter::element (params, e_bound_qoverp, 0 ) =
121- qOverPt / vector::perp (vector2{1 .f , invTanTheta});
120+ params.set_qop (qOverPt / vector::perp (vector2{1 .f , invTanTheta}));
122121
123122 // Make sure the time is a finite value
124- assert (std::isfinite (getter::element (params, e_bound_time, 0 )));
125-
126- return params;
123+ assert (std::isfinite (params.time ()));
127124}
128125
129126} // namespace traccc
0 commit comments