Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-05-14 07:56:51

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/Definitions/Algebra.hpp"
0012 #include "Acts/Definitions/Common.hpp"
0013 #include "ActsExamples/EventData/MuonSpacePoint.hpp"
0014 
0015 #include <cmath>
0016 #include <vector>
0017 
0018 namespace ActsExamples {
0019 class MuonSegment {
0020  public:
0021   using MuonId = MuonSpacePoint::MuonId;
0022   /** @brief Empty default constructor */
0023   MuonSegment() = default;
0024   /** @brief Standard copy constructor */
0025   MuonSegment(const MuonSegment& other) = default;
0026   /** @brief Standard move constructor */
0027   MuonSegment(MuonSegment&& other) = default;
0028   /** @brief Standard copy assignment */
0029   MuonSegment& operator=(const MuonSegment& other) = default;
0030 
0031   /** @brief Returns the reconstructed segment position in global coordinates */
0032   const Acts::Vector3& globalPosition() const { return m_globPos; }
0033   /** @brief Returns the reconstructed segment direction in global coordinates */
0034   const Acts::Vector3& globalDirection() const { return m_globDir; }
0035   /** @brief Returns the reconstructed segment position expressed in the local space point frame*/
0036   const Acts::Vector3& localPosition() const { return m_localPos; }
0037   /** @brief Returns the reconstructed segment direction expressed in the local space point frame*/
0038   const Acts::Vector3& localDirection() const { return m_localDir; }
0039   /** @brief Returns the associated MS sector identifier */
0040   const MuonId& id() const { return m_id; }
0041   /** @brief returns the fitted segment time & uncertainty */
0042   double time() const { return m_time; }
0043   double timeUncert() const { return m_timeError; }
0044   /** @brief Returns the chiSquared & degreed of freedom */
0045   double chiSquared() const { return m_chiSquared; }
0046   double nDoF() const { return m_nDoF; }
0047   /** @brief Returns the number of precision hits building the segment */
0048   unsigned nPrecisionHits() const { return m_precisionHits; }
0049   /** @brief Returns the number of complementary trigger hits in the bending plane */
0050   unsigned nTrigEtaLayers() const { return m_triEtaLayers; }
0051   /** @brief Returns the number of complementary trigger hits in the non-bending plane */
0052   unsigned nTrigPhiLayers() const { return m_phiLayers; }
0053   /** @brief Set the global segment position & direction */
0054   void setGlobalCoords(const Acts::Vector3& pos, const Acts::Vector3& dir) {
0055     m_globPos = pos;
0056     m_globDir = dir;
0057   }
0058   /** @brief Set the local segment position & direction */
0059   void setLocalCoords(const Acts::Vector3& pos, const Acts::Vector3& dir) {
0060     m_localPos = pos;
0061     m_localDir = dir;
0062   }
0063   /** @brief Set the Identifier */
0064   void setId(const MuonId& id) { m_id = id; }
0065   /** @brief Set the time & unceratinty */
0066   void setTime(const double time, const double timeError) {
0067     m_time = time;
0068     m_timeError = timeError;
0069   }
0070   /** @brief Set the chi2 & the number of degrees of freedom */
0071   void setFitQuality(const double chi2, const unsigned nDoF) {
0072     m_chiSquared = chi2;
0073     m_nDoF = nDoF;
0074   }
0075   /** @brief Set the segment hit summary in terms of precision hits (Straw/ Mm /sTgc)
0076    *         & trigger eta (Rpc /Tgc) & trigger phi (Rpc / Tgc) hits  */
0077   void setHitSummary(unsigned nPrec, unsigned nTrigEta, unsigned nTrigPhi) {
0078     m_precisionHits = nPrec;
0079     m_triEtaLayers = nTrigEta;
0080     m_phiLayers = nTrigPhi;
0081   }
0082 
0083  private:
0084   MuonId m_id{};
0085   Acts::Vector3 m_globPos{Acts::Vector3::Zero()};
0086   Acts::Vector3 m_globDir{Acts::Vector3::Zero()};
0087   Acts::Vector3 m_localPos{Acts::Vector3::Zero()};
0088   Acts::Vector3 m_localDir{Acts::Vector3::Zero()};
0089   /** @brief Fitted segment time of arrival */
0090   double m_time{0.f};
0091   /** @brief Uncertainty on the time of arrival */
0092   double m_timeError{0.f};
0093   /** @brief segment chi2 & number of degrees of freedom */
0094   double m_chiSquared{0.f};
0095   unsigned m_nDoF{0u};
0096   /** @brief how many precision hits are on the segment (Straw tubes or Mm) */
0097   unsigned m_precisionHits{0u};
0098   /** @brief  Complementary hits in the non-bending direction (Rpc / Tgc / sTgc) */
0099   unsigned m_phiLayers{0u};
0100   /** @brief  Complementary hits in the bending direction (Rpc / Tgc) */
0101   unsigned m_triEtaLayers{0u};
0102 };
0103 using MuonSegmentContainer = std::vector<MuonSegment>;
0104 
0105 }  // namespace ActsExamples