diff --git a/Tracking/Acts/FaserActsKalmanFilter/FaserActsKalmanFilter/ITrackFinderTool.h b/Tracking/Acts/FaserActsKalmanFilter/FaserActsKalmanFilter/ITrackFinderTool.h index af5eb919cdf3e3b0d36353e4e07aa2d024c11c4d..5b0d7097f2bcb9f95376b9bf323c408072e63df3 100644 --- a/Tracking/Acts/FaserActsKalmanFilter/FaserActsKalmanFilter/ITrackFinderTool.h +++ b/Tracking/Acts/FaserActsKalmanFilter/FaserActsKalmanFilter/ITrackFinderTool.h @@ -21,7 +21,7 @@ public: // TODO use Acts::BoundTrackParameters instead? virtual StatusCode run() = 0; - virtual const std::shared_ptr<std::vector<Acts::CurvilinearTrackParameters>> initialTrackParameters() const = 0; + virtual const std::shared_ptr<std::vector<Acts::BoundTrackParameters>> initialTrackParameters() const = 0; virtual const std::shared_ptr<const Acts::Surface> initialSurface() const = 0; virtual const std::shared_ptr<std::vector<std::vector<IndexSourceLink>>> sourceLinks() const = 0; virtual const std::shared_ptr<std::vector<IdentifierLink>> idLinks() const = 0; @@ -30,4 +30,4 @@ public: virtual const std::shared_ptr<std::vector<std::vector<const Tracker::FaserSCT_Cluster*>>> clusters() const = 0; }; -#endif // FASERACTSKALMANFILTER_ITRACKFINDERTOOL_H \ No newline at end of file +#endif // FASERACTSKALMANFILTER_ITRACKFINDERTOOL_H diff --git a/Tracking/Acts/FaserActsKalmanFilter/src/SegmentFitClusterTrackFinderTool.cxx b/Tracking/Acts/FaserActsKalmanFilter/src/SegmentFitClusterTrackFinderTool.cxx index c0a0512179aea73eb45f852c4317fa1140a67b83..06071c25e9e9475bbe342a04b5cb0f333a524057 100644 --- a/Tracking/Acts/FaserActsKalmanFilter/src/SegmentFitClusterTrackFinderTool.cxx +++ b/Tracking/Acts/FaserActsKalmanFilter/src/SegmentFitClusterTrackFinderTool.cxx @@ -40,7 +40,7 @@ StatusCode SegmentFitClusterTrackFinderTool::run() { // create source links and measurements const int kSize = 1; - using ThisMeasurement = Acts::Measurement<IndexSourceLink, Acts::BoundIndices, kSize>; + using ThisMeasurement = Acts::Measurement<Acts::BoundIndices, kSize>; std::array<Acts::BoundIndices, kSize> Indices = {Acts::eBoundLoc0}; std::vector<IndexSourceLink> sourceLinks; std::vector<Measurement> measurements; @@ -76,7 +76,8 @@ StatusCode SegmentFitClusterTrackFinderTool::run() { const auto& par = cluster->localPosition(); const auto& cov = cluster->localCovariance(); Eigen::Matrix<double, 1, 1> myCov {m_sigmaCluster * m_sigmaCluster,}; - ThisMeasurement meas(sourceLink, Indices, par.head(1), myCov); + Acts::SourceLink sl{sourceLink}; + ThisMeasurement meas(std::move(sl), Indices, par.head(1), myCov); // ThisMeasurement meas(sourceLink, Indices, par.head(1), cov.block<1,1>(0,0)); sourceLinks.push_back(sourceLink); measurements.emplace_back(std::move(meas)); @@ -124,10 +125,23 @@ StatusCode SegmentFitClusterTrackFinderTool::run() { cov(Acts::eBoundQOverP, Acts::eBoundQOverP) = m_covQOverP; cov(Acts::eBoundTime, Acts::eBoundTime) = m_covTime; - auto initialParameters = Acts::CurvilinearTrackParameters( - pos4, dir, abs_momentum, charge, cov); - std::vector<Acts::CurvilinearTrackParameters> paramVector {initialParameters}; - m_initialTrackParameters = std::make_shared<std::vector<Acts::CurvilinearTrackParameters>>(paramVector); + + const auto surface = Acts::Surface::makeShared<Acts::PlaneSurface>( + Acts::Vector3 {0, 0, pos.z()}, Acts::Vector3{0, 0, -1}); + + Acts::BoundVector params = Acts::BoundVector::Zero(); + params[Acts::eBoundLoc0] = pos.x(); + params[Acts::eBoundLoc1] = pos.y(); + params[Acts::eBoundPhi] = Acts::VectorHelpers::phi(dir.normalized()); + params[Acts::eBoundTheta] = Acts::VectorHelpers::theta(dir.normalized()); + params[Acts::eBoundQOverP] = charge/abs_momentum; + params[Acts::eBoundTime] = 0; + + //@todo: make the particle hypothesis configurable + auto initialParameters = Acts::BoundTrackParameters( + surface, params, cov, Acts::ParticleHypothesis::muon()); + std::vector<Acts::BoundTrackParameters> paramVector {initialParameters}; + m_initialTrackParameters = std::make_shared<std::vector<Acts::BoundTrackParameters>>(paramVector); return StatusCode::SUCCESS; } diff --git a/Tracking/Acts/FaserActsKalmanFilter/src/SegmentFitClusterTrackFinderTool.h b/Tracking/Acts/FaserActsKalmanFilter/src/SegmentFitClusterTrackFinderTool.h index d42ab5a241e51700351399b2dd196030bcde1d0b..95196ad6b6b92acd0b758ef54cae7ef484b2e02c 100644 --- a/Tracking/Acts/FaserActsKalmanFilter/src/SegmentFitClusterTrackFinderTool.h +++ b/Tracking/Acts/FaserActsKalmanFilter/src/SegmentFitClusterTrackFinderTool.h @@ -31,7 +31,7 @@ public: virtual StatusCode finalize() override; virtual StatusCode run() override; - virtual const std::shared_ptr<std::vector<Acts::CurvilinearTrackParameters>> initialTrackParameters() const override; + virtual const std::shared_ptr<std::vector<Acts::BoundTrackParameters>> initialTrackParameters() const override; virtual const std::shared_ptr<const Acts::Surface> initialSurface() const override; virtual const std::shared_ptr<std::vector<std::vector<IndexSourceLink>>> sourceLinks() const override; virtual const std::shared_ptr<std::vector<IdentifierLink>> idLinks() const override; @@ -40,7 +40,7 @@ public: virtual const std::shared_ptr<std::vector<std::vector<const Tracker::FaserSCT_Cluster*>>> clusters() const override; private: - std::shared_ptr<std::vector<Acts::CurvilinearTrackParameters>> m_initialTrackParameters; + std::shared_ptr<std::vector<Acts::BoundTrackParameters>> m_initialTrackParameters; std::shared_ptr<const Acts::Surface> m_initialSurface; std::shared_ptr<std::vector<std::vector<IndexSourceLink>>> m_sourceLinks {}; std::shared_ptr<std::vector<IdentifierLink>> m_idLinks {}; @@ -68,7 +68,7 @@ private: }; -inline const std::shared_ptr<std::vector<Acts::CurvilinearTrackParameters>> +inline const std::shared_ptr<std::vector<Acts::BoundTrackParameters>> SegmentFitClusterTrackFinderTool::initialTrackParameters() const { return m_initialTrackParameters; } diff --git a/Tracking/Acts/FaserActsKalmanFilter/src/SegmentFitTrackFinderTool.cxx b/Tracking/Acts/FaserActsKalmanFilter/src/SegmentFitTrackFinderTool.cxx index d1db42f936959115970b3133e772a2a0d47cae00..52a2e0a664f1d2e2c5e6455b1b4f3c16d1da74ec 100644 --- a/Tracking/Acts/FaserActsKalmanFilter/src/SegmentFitTrackFinderTool.cxx +++ b/Tracking/Acts/FaserActsKalmanFilter/src/SegmentFitTrackFinderTool.cxx @@ -69,7 +69,7 @@ StatusCode SegmentFitTrackFinderTool::run() { // create source links and measurements const int kSize = 2; - using ThisMeasurement = Acts::Measurement<IndexSourceLink, Acts::BoundIndices, kSize>; + using ThisMeasurement = Acts::Measurement<Acts::BoundIndices, kSize>; std::array<Acts::BoundIndices, kSize> Indices = {Acts::eBoundLoc0, Acts::eBoundLoc1}; std::vector<IndexSourceLink> sourceLinks; std::vector<Measurement> measurements; @@ -89,7 +89,8 @@ StatusCode SegmentFitTrackFinderTool::run() { // create measurement const auto& par = spacePoint->localParameters(); const auto& cov = spacePoint->localCovariance(); - ThisMeasurement meas(sourceLink, Indices, par, cov); + Acts::SourceLink sl{sourceLink}; + ThisMeasurement meas(std::move(sl), Indices, par, cov); sourceLinks.push_back(sourceLink); measurements.emplace_back(std::move(meas)); } @@ -127,9 +128,21 @@ StatusCode SegmentFitTrackFinderTool::run() { cov(Acts::eBoundQOverP, Acts::eBoundQOverP) = m_covQOverP; cov(Acts::eBoundTime, Acts::eBoundTime) = m_covTime; - auto initialParameters = Acts::CurvilinearTrackParameters( - pos4, dir, abs_momentum, charge, cov); - m_initialTrackParameters = std::make_shared<const Acts::CurvilinearTrackParameters>(initialParameters); + const auto surface = Acts::Surface::makeShared<Acts::PlaneSurface>( + Acts::Vector3 {0, 0, pos.z()}, Acts::Vector3{0, 0, -1}); + + Acts::BoundVector params = Acts::BoundVector::Zero(); + params[Acts::eBoundLoc0] = pos.x(); + params[Acts::eBoundLoc1] = pos.y(); + params[Acts::eBoundPhi] = Acts::VectorHelpers::phi(dir.normalized()); + params[Acts::eBoundTheta] = Acts::VectorHelpers::theta(dir.normalized()); + params[Acts::eBoundQOverP] = charge/abs_momentum; + params[Acts::eBoundTime] = 0; + + //@todo: make the particle hypothesis configurable + auto initialParameters = Acts::BoundTrackParameters( + surface, params, cov, Acts::ParticleHypothesis::muon()); + m_initialTrackParameters = std::make_shared<const Acts::BoundTrackParameters>(initialParameters); return StatusCode::SUCCESS; } diff --git a/Tracking/Acts/FaserActsKalmanFilter/src/SegmentFitTrackFinderTool.h b/Tracking/Acts/FaserActsKalmanFilter/src/SegmentFitTrackFinderTool.h index fa34f94c67def0746214cd84b4467d7391707e3b..9bd536fb3af68ba985210cc99b004954ad045587 100644 --- a/Tracking/Acts/FaserActsKalmanFilter/src/SegmentFitTrackFinderTool.h +++ b/Tracking/Acts/FaserActsKalmanFilter/src/SegmentFitTrackFinderTool.h @@ -30,7 +30,7 @@ public: virtual StatusCode finalize() override; virtual StatusCode run() override; - virtual const std::shared_ptr<const Acts::CurvilinearTrackParameters> initialTrackParameters() const override; + virtual const std::shared_ptr<const Acts::BoundTrackParameters> initialTrackParameters() const override; virtual const std::shared_ptr<const Acts::Surface> initialSurface() const override; virtual const std::shared_ptr<std::vector<IndexSourceLink>> sourceLinks() const override; virtual const std::shared_ptr<IdentifierLink> idLinks() const override; @@ -38,7 +38,7 @@ public: virtual const std::shared_ptr<std::vector<Tracker::FaserSCT_SpacePoint*>> spacePoints() const override; private: - std::shared_ptr<const Acts::CurvilinearTrackParameters> m_initialTrackParameters; + std::shared_ptr<const Acts::BoundTrackParameters> m_initialTrackParameters; std::shared_ptr<const Acts::Surface> m_initialSurface; std::shared_ptr<std::vector<IndexSourceLink>> m_sourceLinks {}; std::shared_ptr<IdentifierLink> m_idLinks {}; @@ -66,7 +66,7 @@ private: }; -inline const std::shared_ptr<const Acts::CurvilinearTrackParameters> +inline const std::shared_ptr<const Acts::BoundTrackParameters> SegmentFitTrackFinderTool::initialTrackParameters() const { return m_initialTrackParameters; } diff --git a/Tracking/Acts/FaserActsKalmanFilter/src/TruthSeededTrackFinderTool.cxx b/Tracking/Acts/FaserActsKalmanFilter/src/TruthSeededTrackFinderTool.cxx index 7f9f427960ba221d8fd3f489cbb0e38d627ffc9f..4f68cd4407423d3c838abf1c9802927209aed13a 100644 --- a/Tracking/Acts/FaserActsKalmanFilter/src/TruthSeededTrackFinderTool.cxx +++ b/Tracking/Acts/FaserActsKalmanFilter/src/TruthSeededTrackFinderTool.cxx @@ -52,7 +52,7 @@ StatusCode TruthSeededTrackFinderTool::run() { = m_trackingGeometryTool->trackingGeometry(); const int kSize = 2; - using ThisMeasurement = Acts::Measurement<IndexSourceLink, Acts::BoundIndices, kSize>; + using ThisMeasurement = Acts::Measurement<Acts::BoundIndices, kSize>; std::array<Acts::BoundIndices, kSize> myIndices = {Acts::eBoundLoc0, Acts::eBoundLoc1}; std::map<int, Acts::Vector3> spacePoints; @@ -71,14 +71,15 @@ StatusCode TruthSeededTrackFinderTool::run() { auto cov = spacePoint->localCovariance(); ATH_MSG_DEBUG("cov " << cov); ATH_MSG_DEBUG(cov(0, 0) << ", " << cov(0, 1) << ", " << cov(1, 0) << ", " << cov(1, 1)); - Acts::ActsSymMatrix<2> myCov = Acts::ActsSymMatrix<2>::Zero(); + Acts::ActsSquareMatrix<2> myCov = Acts::ActsSquareMatrix<2>::Zero(); myCov(0, 0) = m_covMeas00; myCov(1, 1) = m_covMeas11; myCov(0, 1) = m_covMeas01; myCov(1, 0) = m_covMeas10; IndexSourceLink sourceLink(geoId, measurements.size()); - ThisMeasurement meas(sourceLink, myIndices, par, myCov); + Acts::SourceLink sl{sourceLink}; + ThisMeasurement meas(std::move(sl), myIndices, par, myCov); sourcelinks.push_back(sourceLink); measurements.emplace_back(std::move(meas)); @@ -169,9 +170,18 @@ StatusCode TruthSeededTrackFinderTool::run() { cov(Acts::eBoundQOverP, Acts::eBoundQOverP) = m_covQOverP; cov(Acts::eBoundTime, Acts::eBoundTime) = m_covTime; - // auto initialParameters = Acts::BoundTrackParameters(surface->getSharedPtr(), params, charge, cov); - auto initialParameters = Acts::CurvilinearTrackParameters( - smearedPosition4, smearedDirection, smearedAbsoluteMomentum, charge, cov); + const auto surface = Acts::Surface::makeShared<Acts::PlaneSurface>( + Acts::Vector3 {0, 0, initPos.z()}, Acts::Vector3{0, 0, -1}); + Acts::BoundVector params = Acts::BoundVector::Zero(); + params[Acts::eBoundLoc0] = initPos.x(); + params[Acts::eBoundLoc1] = initPos.y(); + params[Acts::eBoundPhi] = Acts::VectorHelpers::phi(smearedDirection.normalized()); + params[Acts::eBoundTheta] = Acts::VectorHelpers::theta(smearedDirection.normalized()); + params[Acts::eBoundQOverP] = charge/smearedAbsoluteMomentum; + params[Acts::eBoundTime] = 0; + + //@todo: make the particle hypothesis configurable + auto initialParameters = Acts::BoundTrackParameters(surface, params, cov, Acts::ParticleHypothesis::muon()); // write out double initialCharge = initialParameters.charge(); @@ -182,7 +192,7 @@ StatusCode TruthSeededTrackFinderTool::run() { ATH_MSG_DEBUG("initial absolute momentum: " << initialAbsoluteMomentum); ATH_MSG_DEBUG("initial position: x=" << initialPosition.x() << ", y=" << initialPosition.y() << ", z=" << initialPosition.z()); ATH_MSG_DEBUG("initial momentum: x=" << initialMomentum.x() << ", y=" << initialMomentum.y() << ", z=" << initialMomentum.z()); - m_initialTrackParameters = std::make_shared<const Acts::CurvilinearTrackParameters>(initialParameters); + m_initialTrackParameters = std::make_shared<const Acts::BoundTrackParameters>(initialParameters); m_sourceLinks = std::make_shared<std::vector<IndexSourceLink>>(sourcelinks); m_measurements = std::make_shared<std::vector<Measurement>>(measurements); diff --git a/Tracking/Acts/FaserActsKalmanFilter/src/TruthSeededTrackFinderTool.h b/Tracking/Acts/FaserActsKalmanFilter/src/TruthSeededTrackFinderTool.h index d07fcde1431a7651c10de46a38bba96553a5d25b..52c24336e9dd2f981c5b3cc2cef381698d126afd 100644 --- a/Tracking/Acts/FaserActsKalmanFilter/src/TruthSeededTrackFinderTool.h +++ b/Tracking/Acts/FaserActsKalmanFilter/src/TruthSeededTrackFinderTool.h @@ -32,7 +32,8 @@ public: virtual StatusCode finalize() override; virtual StatusCode run() override; - virtual const std::shared_ptr<const Acts::CurvilinearTrackParameters> initialTrackParameters() const override { + //@todo: this should return a set of bound track parameters + virtual const std::shared_ptr<const Acts::BoundTrackParameters> initialTrackParameters() const override { return m_initialTrackParameters; } @@ -53,7 +54,7 @@ public: virtual const std::shared_ptr<std::vector<Tracker::FaserSCT_SpacePoint*>> spacePoints() const override; private: - std::shared_ptr<const Acts::CurvilinearTrackParameters> m_initialTrackParameters; + std::shared_ptr<const Acts::BoundTrackParameters> m_initialTrackParameters; std::shared_ptr<const Acts::Surface> m_initialSurface; std::shared_ptr<std::vector<IndexSourceLink>> m_sourceLinks {}; std::shared_ptr<IdentifierLink> m_idLinks {};