Skip to content

Commit

Permalink
Add missing ACTS extensions to ACTSTruthTrackingProc.
Browse files Browse the repository at this point in the history
  • Loading branch information
kkrizka committed Aug 12, 2024
1 parent 994f078 commit a5c56d0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ACTSTracking/SourceLink.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,16 @@ struct SourceLinkAccessor : GeometryIdMultisetAccessor<SourceLink> {
}
};

/// Access for the surface associated to a source link
struct SurfaceAccessor {
const std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry;

const Acts::Surface* operator()(const Acts::SourceLink& sourceLink) const {
const auto& mySourceLink = sourceLink.get<SourceLink>();
return trackingGeometry->findSurface(mySourceLink.geometryId());
}
};


} // namespace ACTSTracking

11 changes: 11 additions & 0 deletions src/ACTSTruthTrackingProc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ void ACTSTruthTrackingProc::processEvent(LCEvent* evt) {

// Make container
// MeasurementContainer track;
ACTSTracking::MeasurementContainer measurements;
std::vector<Acts::SourceLink> trackSourceLinks;
ACTSTracking::MeasurementContainer track;
for (EVENT::TrackerHit* hit : trackFilteredByRHits) {
Expand Down Expand Up @@ -263,6 +264,7 @@ void ACTSTruthTrackingProc::processEvent(LCEvent* evt) {
sourceLink, loc, cov, Acts::eBoundLoc0, Acts::eBoundLoc1);

track.push_back(meas);
measurements.push_back(meas);
trackSourceLinks.push_back(sourceLink);
}

Expand All @@ -276,13 +278,22 @@ void ACTSTruthTrackingProc::processEvent(LCEvent* evt) {
Updater kfUpdater;
Smoother kfSmoother;

ACTSTracking::MeasurementCalibrator measCal { measurements };
ACTSTracking::SurfaceAccessor surfaceAccessor {trackingGeometry()};

Acts::KalmanFitterExtensions<Acts::VectorMultiTrajectory> extensions;
extensions.calibrator.connect<
&ACTSTracking::MeasurementCalibrator::calibrate>(
&measCal);
extensions.updater.connect<
&Acts::GainMatrixUpdater::operator()<Acts::VectorMultiTrajectory>>(
&kfUpdater);
extensions.smoother.connect<
&Acts::GainMatrixSmoother::operator()<Acts::VectorMultiTrajectory>>(
&kfSmoother);
extensions.surfaceAccessor.connect<
&ACTSTracking::SurfaceAccessor::operator()>(
&surfaceAccessor);

// Set the KalmanFitter options
// std::unique_ptr<const Acts::Logger>
Expand Down

0 comments on commit a5c56d0

Please sign in to comment.