38 inline constexpr
T get_r(
const T&
x,
const T&
y)
45 const std::vector<Acts::MultiTrajectoryTraits::IndexType>& tips,
49 const auto& mj = tracks.trackStateContainer();
50 const auto& trackTip = tips.front();
54 if (
m_fieldMap.find(
".root") == std::string::npos)
63 std::cout <<
"Beginning alignment state creation for track "
64 << track->
get_id() << std::endl;
72 for (
auto iter = silseed->begin_cluster_keys();
73 iter != silseed->end_cluster_keys();
87 if (nmaps < 2 or nintt < 2)
99 mj.visitBackwards(trackTip, [&](
const auto&
state)
102 if (not
state.hasSmoothed() or
109 auto sl =
state.getUncalibratedSourceLink().template get<ActsSourceLink>();
110 auto ckey = sl.cluskey();
113 std::visit([&](
const auto& meas) {
114 localMeas(0) = meas.parameters()[0];
115 localMeas(1) = meas.parameters()[1];
116 }, measurements[sl.index()]);
120 std::cout <<
"sl index and ckey " << sl.index() <<
", "
121 << sl.cluskey() <<
" with local position "
122 << localMeas.transpose() << std::endl;
152 std::cout <<
"clus global is " << clusGlobal.transpose() << std::endl
153 <<
"state global is " << stateGlobal.transpose() << std::endl;
154 std::cout <<
" clus errors are " << clus_sigma.transpose() << std::endl;
155 std::cout <<
" clus loc is " << localMeas.transpose() << std::endl;
156 std::cout <<
" state loc is " << localState << std::endl;
157 std::cout <<
" local residual is " << localResidual.transpose() << std::endl;
171 std::cout <<
"tangent vector to track state is " << tangent.transpose() << std::endl;
174 std::pair<Acts::Vector3, Acts::Vector3> projxy =
184 std::cout <<
" global deriv calcs" << std::endl
185 <<
"stateGlobal: " << stateGlobal.transpose()
186 <<
", sensor center " << sensorCenter.transpose() << std::endl
187 <<
", OM " << OM.transpose() << std::endl <<
" projxy "
188 << projxy.first.transpose() <<
", "
189 << projxy.second.transpose() << std::endl
190 <<
"global derivatives " << std::endl << globDeriv << std::endl;
195 auto localDeriv =
state.effectiveProjector() *
state.jacobian();
198 std::cout <<
"local deriv " << std::endl << localDeriv << std::endl;
201 auto svtxstate = std::make_unique<SvtxAlignmentState_v1>();
203 svtxstate->set_residual(localResidual);
204 svtxstate->set_local_derivative_matrix(localDeriv);
205 svtxstate->set_global_derivative_matrix(globDeriv);
206 svtxstate->set_cluster_key(ckey);
208 statevec.push_back(svtxstate.release());
213 std::cout <<
"Inserting track " << track->
get_id() <<
" with nstates "
214 << statevec.size() << std::endl;
224 const std::pair<Acts::Vector3, Acts::Vector3>& projxy)
230 globalder(0, 0) = ((unit.col(0)).
cross(OM)).dot(projxy.first);
231 globalder(0, 1) = ((unit.col(1)).
cross(OM)).dot(projxy.first);
232 globalder(0, 2) = ((unit.col(2)).
cross(OM)).dot(projxy.first);
234 globalder(0, 3) = unit.col(0).dot(projxy.first);
235 globalder(0, 4) = unit.col(1).dot(projxy.first);
236 globalder(0, 5) = unit.col(2).dot(projxy.first);
239 globalder(1, 0) = ((unit.col(0)).
cross(OM)).dot(projxy.second);
240 globalder(1, 1) = ((unit.col(1)).
cross(OM)).dot(projxy.second);
241 globalder(1, 2) = ((unit.col(2)).
cross(OM)).dot(projxy.second);
243 globalder(1, 3) = unit.col(0).dot(projxy.second);
244 globalder(1, 4) = unit.col(1).dot(projxy.second);
245 globalder(1, 5) = unit.col(2).dot(projxy.second);
268 Acts::Vector3 X = (xglob - sensorCenter) / (xglob - sensorCenter).norm();
269 Acts::Vector3 Y = (yglob - sensorCenter) / (yglob - sensorCenter).norm();
271 projx = X - (tangent.dot(X) / tangent.dot(Z)) * Z;
272 projy = Y - (tangent.dot(Y) / tangent.dot(Z)) * Z;
274 std::cout <<
"projxy " << projx.transpose() <<
", " << projy.transpose() << std::endl;
275 return std::make_pair(projx, projy);