19 #include <Acts/Geometry/GeometryIdentifier.hpp>
26 #include <ActsExamples/Plugins/BField/ScalableBField.hpp>
30 , m_trajectories(nullptr)
49 std::vector<unsigned int> deletedKeys;
57 deletedKeys.push_back(trackKey);
62 { svtxTrack->identify(); }
64 const auto &[trackTips, mj] = trajectory.trajectory();
66 if(trackTips.size() > 1 and
Verbosity() > 0)
69 <<
"More than 1 track tip per track. Should never happen..."
73 for(
const auto& trackTip : trackTips)
75 const auto& boundParams = trajectory.trackParameters(trackTip);
77 auto propresult =
propagateTrack(boundParams, svtxTrack->get_vertex_id());
81 auto paramsAtVertex = std::move(**propresult);
88 for(
auto& key : deletedKeys)
90 m_trajectories->erase(key);
103 std::cout <<
"Updating position track parameters from " << track->
get_x()
104 <<
", " << track->
get_y() <<
", " << track->
get_z() <<
" to "
115 if(params.covariance())
120 for(
int i = 0; i < 3; i++) {
121 for(
int j = 0; j < 3; j++) {
146 svtxVertex->get_z());
151 for(
int i = 0; i < 3; ++i)
153 for(
int j = 0; j < 3; ++j)
160 float phi = atan2(
r(1),
r(0));
165 rot(0,1) = -sin(phi);
174 rot_T = rot.transpose();
179 const auto dca3Dxy = pos_R(0);
180 const auto dca3Dz = pos_R(2);
181 const auto dca3DxyCov = rotCov(0,0);
182 const auto dca3DzCov = rotCov(2,2);
192 const unsigned int vtxid)
197 auto perigee = Acts::Surface::makeShared<Acts::PerigeeSurface>(actsVertex);
200 [params, perigee,
this]
202 using InputMagneticField =
203 typename std::decay_t<decltype(inputField)>::element_type;
208 MagneticField field(inputField);
221 Acts::LoggerWrapper{*logger});
223 auto result = propagator.propagate(params, *perigee,
226 {
return std::move((*result).endParameters); }
228 return result.error();
230 m_tGeometry->magField);
244 auto vertex = std::make_unique<SvtxVertex_v1>();
245 vertex->set_chisq(0.);
252 for(
int i=0; i<3; i++) {
253 for(
int j=0; j<3; j++) {
254 vertex->set_error(i,j, 20.);
262 track->set_vertex_id(0);
275 m_tGeometry = findNode::getClass<ActsTrackingGeometry>(topNode,
"ActsTrackingGeometry");
278 std::cout <<
PHWHERE <<
"Acts tracking geometry not on node tree, exiting."
283 m_trajectories = findNode::getClass<std::map<const unsigned int, Trajectory>>(topNode,
"ActsTrajectories");
287 std::cout <<
PHWHERE <<
"No acts trajectories on node tree, exiting. "
292 m_vertexMap = findNode::getClass<SvtxVertexMap>(topNode,
"SvtxVertexMap");
295 std::cout <<
PHWHERE <<
"No svtx vertex map, exiting." << std::endl;
299 m_trackMap = findNode::getClass<SvtxTrackMap>(topNode,
"SvtxTrackMap");
302 std::cout <<
PHWHERE <<
"No svtx track map, exiting. " << std::endl;