Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:11:46

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 Acts {
0022 class VectorMultiTrajectory;
0023 }  // namespace Acts
0024 
0025 namespace ActsExamples {
0026 
0027 /// Abstract base class for measurement-based calibration
0028 class MeasurementCalibrator {
0029  public:
0030   virtual void calibrate(
0031       const MeasurementContainer& measurements,
0032       const ClusterContainer* clusters, const Acts::GeometryContext& gctx,
0033       const Acts::CalibrationContext& cctx, const Acts::SourceLink& sourceLink,
0034       Acts::VectorMultiTrajectory::TrackStateProxy& trackState) const = 0;
0035 
0036   virtual ~MeasurementCalibrator() = default;
0037   virtual bool needsClusters() const { return false; }
0038 };
0039 
0040 // Calibrator to convert an index source link to a measurement as-is
0041 class PassThroughCalibrator : public MeasurementCalibrator {
0042  public:
0043   /// Find the measurement corresponding to the source link.
0044   ///
0045   /// @tparam parameters_t Track parameters type
0046   /// @param gctx The geometry context (unused)
0047   /// @param trackState The track state to calibrate
0048   void calibrate(
0049       const MeasurementContainer& measurements,
0050       const ClusterContainer* clusters, const Acts::GeometryContext& gctx,
0051       const Acts::CalibrationContext& cctx, const Acts::SourceLink& sourceLink,
0052       Acts::VectorMultiTrajectory::TrackStateProxy& trackState) const override;
0053 };
0054 
0055 // Adapter class that wraps a MeasurementCalibrator to conform to the
0056 // core ACTS calibration interface
0057 class MeasurementCalibratorAdapter {
0058  public:
0059   MeasurementCalibratorAdapter(const MeasurementCalibrator& calibrator,
0060                                const MeasurementContainer& measurements,
0061                                const ClusterContainer* clusters = nullptr);
0062 
0063   MeasurementCalibratorAdapter() = delete;
0064 
0065   void calibrate(const Acts::GeometryContext& gctx,
0066                  const Acts::CalibrationContext& cctx,
0067                  const Acts::SourceLink& sourceLink,
0068                  Acts::VectorMultiTrajectory::TrackStateProxy trackState) const;
0069 
0070  private:
0071   const MeasurementCalibrator& m_calibrator;
0072   const MeasurementContainer& m_measurements;
0073   const ClusterContainer* m_clusters;
0074 };
0075 
0076 }  // namespace ActsExamples