Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-15 08:20:17

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include "Acts/EventData/MultiTrajectory.hpp"
0012 #include "Acts/EventData/SourceLink.hpp"
0013 #include "Acts/EventData/VectorMultiTrajectory.hpp"
0014 #include "Acts/Geometry/GeometryContext.hpp"
0015 #include "Acts/Utilities/CalibrationContext.hpp"
0016 #include "ActsExamples/EventData/Cluster.hpp"
0017 #include "ActsExamples/EventData/Measurement.hpp"
0018 
0019 #include <cassert>
0020 
0021 namespace ActsExamples {
0022 
0023 /// Abstract base class for measurement-based calibration
0024 class MeasurementCalibrator {
0025  public:
0026   virtual void calibrate(
0027       const MeasurementContainer& measurements,
0028       const ClusterContainer* clusters, const Acts::GeometryContext& gctx,
0029       const Acts::CalibrationContext& cctx, const Acts::SourceLink& sourceLink,
0030       Acts::VectorMultiTrajectory::TrackStateProxy& trackState) const = 0;
0031 
0032   virtual ~MeasurementCalibrator() = default;
0033   virtual bool needsClusters() const { return false; }
0034 };
0035 
0036 // Calibrator to convert an index source link to a measurement as-is
0037 class PassThroughCalibrator : public MeasurementCalibrator {
0038  public:
0039   /// Find the measurement corresponding to the source link.
0040   ///
0041   /// @tparam parameters_t Track parameters type
0042   /// @param gctx The geometry context (unused)
0043   /// @param trackState The track state to calibrate
0044   void calibrate(
0045       const MeasurementContainer& measurements,
0046       const ClusterContainer* clusters, const Acts::GeometryContext& gctx,
0047       const Acts::CalibrationContext& cctx, const Acts::SourceLink& sourceLink,
0048       Acts::VectorMultiTrajectory::TrackStateProxy& trackState) const override;
0049 };
0050 
0051 // Adapter class that wraps a MeasurementCalibrator to conform to the
0052 // core ACTS calibration interface
0053 class MeasurementCalibratorAdapter {
0054  public:
0055   MeasurementCalibratorAdapter(const MeasurementCalibrator& calibrator,
0056                                const MeasurementContainer& measurements,
0057                                const ClusterContainer* clusters = nullptr);
0058 
0059   MeasurementCalibratorAdapter() = delete;
0060 
0061   void calibrate(const Acts::GeometryContext& gctx,
0062                  const Acts::CalibrationContext& cctx,
0063                  const Acts::SourceLink& sourceLink,
0064                  Acts::VectorMultiTrajectory::TrackStateProxy trackState) const;
0065 
0066  private:
0067   const MeasurementCalibrator& m_calibrator;
0068   const MeasurementContainer& m_measurements;
0069   const ClusterContainer* m_clusters;
0070 };
0071 
0072 }  // namespace ActsExamples