74 steering_file.close();
118 std::cout <<
"state map size " <<
_state_map->
size() << std::endl;
142 std::cout << std::endl
143 << __LINE__ <<
": Processing track itrack: " << key <<
": nhits: " << track->
size_cluster_keys()
153 fabs(track->
get_z() - eventVertex.z()) < 0.2 &&
154 fabs(track->
get_x()) < 0.2 &&
155 fabs(track->
get_y()) < 0.2)
159 eventVertex(0) = 0; eventVertex(1) = 0;
162 Acts::Vector2 vtx_residual(-dcapair.first.first, -dcapair.second.first);
167 eventVertex, lclvtx_derivative);
175 std::cout <<
"vertex info for trakc " << track->
get_id() <<
" with charge " << track->
get_charge() << std::endl;
176 std::cout <<
"vertex is " << eventVertex.transpose()<<std::endl;
177 std::cout <<
"vertex residuals " << vtx_residual.transpose()
179 std::cout <<
"global vtx derivatives " << std::endl;
180 for(
int i=0;
i<2;
i++) {
181 for(
int j=0;
j<3;
j++) {
182 std::cout << glblvtx_derivative[
i][
j] <<
", ";
184 std::cout << std::endl;
189 for(
int i=0;
i<2;
i++)
191 if(!isnan(vtx_residual(
i)))
208 std::cout <<
"Finished processing mille file " << std::endl;
224 _cluster_map = findNode::getClass<TrkrClusterContainer>(topNode,
"TRKR_CLUSTER");
227 std::cout <<
PHWHERE <<
" ERROR: Can't find node TRKR_CLUSTER" << std::endl;
231 _track_map = findNode::getClass<SvtxTrackMap>(topNode,
"SvtxTrackMap");
234 std::cout <<
PHWHERE <<
" ERROR: Can't find SvtxTrackMap: " << std::endl;
238 _tGeometry = findNode::getClass<ActsGeometry>(topNode,
"ActsGeometry");
241 std::cout <<
PHWHERE <<
"Error, can't find acts tracking geometry" << std::endl;
245 _state_map = findNode::getClass<SvtxAlignmentStateMap>(topNode,
"SvtxAlignmentStateMap");
248 std::cout <<
PHWHERE <<
"Error, can't find alignment state map" << std::endl;
276 auto result = actspropagator.propagate(param, *perigee,
options);
280 auto jacobian = *result.value().transportJacobian;
282 Eigen::Matrix<double,2,6> projector = Eigen::Matrix<double,2,6>::Zero();
285 auto deriv = projector * jacobian;
288 std::cout <<
"local vtxderiv " << std::endl <<
deriv << std::endl;
315 glblvtx_derivative[0][0] = identity.col(0).dot(projx);
316 glblvtx_derivative[0][1] = identity.col(1).dot(projx);
317 glblvtx_derivative[0][2] = identity.col(2).dot(projx);
318 glblvtx_derivative[1][0] = identity.col(0).dot(projy);
319 glblvtx_derivative[1][1] = identity.col(1).dot(projy);
320 glblvtx_derivative[1][2] = identity.col(2).dot(projy);
324 for(
int i=0;
i<2;
i++) {
325 for(
int j=0;
j<3;
j++) {
326 glblvtx_derivative[
i][
j] *= -1;
338 tangent /= tangent.norm();
339 normal /= normal.norm();
351 projx = X - (tangent.dot(X) / tangent.dot(normal)) * normal;
352 projy = Y - (tangent.dot(Y) / tangent.dot(normal)) * normal;
366 float phi = atan2(
r(1),
r(0));
371 rot(0,1) = -sin(phi);
380 rot_T = rot.transpose();
398 int nacceptedtracks = 0;
412 xsum += track->
get_x();
413 ysum += track->
get_y();
414 zsum += track->
get_z();
420 ysum/nacceptedtracks,
421 zsum/nacceptedtracks);
426 for (
auto state : statevec)
432 std::cout <<
"adding state for ckey " << ckey <<
" with hitsetkey "
447 double clusRadius = sqrt(global[0] * global[0] + global[1] * global[1]);
449 double phierror = sqrt(para_errors.first);
450 double zerror = sqrt(para_errors.second);
455 if (std::isnan(clus_sigma(0)) ||
456 std::isnan(clus_sigma(1)))
468 else if(layer > 2 && layer < 7)
483 std::cout << std::endl;
493 glbl_derivative[
j] =
state->get_global_derivative_matrix()(
i,
j);
498 glbl_derivative[
j] = 0.;
509 glbl_derivative[
j] = 0;
517 glbl_derivative[
j] = 0;
528 glbl_derivative[
j] = 0.0;
536 lcl_derivative[
j] =
state->get_local_derivative_matrix()(
i,
j);
540 lcl_derivative[
j] = 0.;
545 std::cout <<
"coordinate " <<
i <<
" has residual " << residual(
i) <<
" and clus_sigma " << clus_sigma(
i) << std::endl
546 <<
"global deriv " << std::endl;
550 if (glbl_derivative[
k] > 0 || glbl_derivative[
k] < 0)
551 std::cout <<
"NONZERO GLOBAL DERIVATIVE" << std::endl;
552 std::cout << glbl_derivative[
k] <<
", ";
554 std::cout << std::endl
555 <<
"local deriv " << std::endl;
558 std::cout << lcl_derivative[
k] <<
", ";
560 std::cout << std::endl;
563 if (clus_sigma(
i) < 1.0)
567 std::cout <<
"ckey " << ckey <<
" and layer " << layer <<
" buffers:" << std::endl;
576 _mille->
mille(SvtxAlignmentState::NLOC, lcl_derivative, SvtxAlignmentState::NGL, glbl_derivative, glbl_label, residual(
i), errinf * clus_sigma(
i));
595 unsigned int maxlayer)
597 for (
unsigned int i = minlayer;
i < maxlayer;
i++)
611 std::pair pair = std::make_pair(layer,clamshell);
625 std::pair<unsigned int, unsigned int> pair = std::make_pair(layer, param);
626 auto it = param_fixed.find(pair);
627 if (
it != param_fixed.end())
645 unsigned int subsector = region * 24 + side * 12 + sector;