Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:09:58

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2016-2020 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 http://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include "Acts/Digitization/DigitizationCell.hpp"
0012 #include "Acts/Digitization/DigitizationModule.hpp"
0013 #include "Acts/Digitization/DigitizationSourceLink.hpp"
0014 #include "Acts/EventData/Measurement.hpp"
0015 
0016 #include <array>
0017 #include <cassert>
0018 
0019 namespace Acts {
0020 
0021 class PlanarModuleCluster : public Measurement<BoundIndices, 3> {
0022   using Base = Measurement<BoundIndices, 3>;
0023 
0024   static constexpr std::array<BoundIndices, 3> kIndices = {
0025       eBoundLoc0, eBoundLoc1, eBoundTime};
0026 
0027  public:
0028   /// Constructor from DigitizationCells
0029   ///
0030   /// @param [in] surface The surface the cluster is on
0031   /// @param [in] sourceLink is the link to the truth information
0032   /// @param [in] cov is the covariance matrix
0033   /// @param [in] loc0 is the local position in the first coordinate
0034   /// @param [in] loc1 is the local position in the second coordinate
0035   /// @param [in] t Timestamp of the cluster
0036   /// @param [in] dCells is the vector of digitization cells
0037   /// @param [in] dModule an optional pointer to a digitization configuration
0038   PlanarModuleCluster(std::shared_ptr<const Surface> surface,
0039                       SourceLink sourceLink, const Base::CovarianceMatrix& cov,
0040                       double loc0, double loc1, double t,
0041                       std::vector<DigitizationCell> dCells,
0042                       const DigitizationModule* dModule = nullptr)
0043       : Base(std::move(sourceLink), kIndices,
0044              Base::ParametersVector(loc0, loc1, t), cov),
0045         m_surface(std::move(surface)),
0046         m_digitizationCells(std::move(dCells)),
0047         m_digitizationModule(dModule) {
0048     assert(m_surface);
0049   }
0050 
0051   /// Module surface.
0052   const Surface& referenceObject() const { return *m_surface; }
0053 
0054   /// access to the digitization cells
0055   ///
0056   /// @return the vector to the digitization cells
0057   const std::vector<DigitizationCell>& digitizationCells() const;
0058 
0059   /// access to the digitization module
0060   ///
0061   /// @return the pointer to the digitization module
0062   const DigitizationModule* digitizationModule() const;
0063 
0064  private:
0065   std::shared_ptr<const Surface> m_surface;
0066   std::vector<DigitizationCell> m_digitizationCells;  /// the digitization cells
0067   const DigitizationModule* m_digitizationModule;  /// the digitization module
0068 };
0069 
0070 inline const std::vector<DigitizationCell>&
0071 PlanarModuleCluster::digitizationCells() const {
0072   return m_digitizationCells;
0073 }
0074 
0075 inline const DigitizationModule* PlanarModuleCluster::digitizationModule()
0076     const {
0077   return m_digitizationModule;
0078 }
0079 
0080 }  // namespace Acts