Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:28:01

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2023 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/Definitions/Algebra.hpp"
0012 #include "Acts/Definitions/Common.hpp"
0013 #include "Acts/EventData/SourceLink.hpp"
0014 #include "ActsExamples/EventData/Index.hpp"
0015 #include "ActsExamples/EventData/IndexSourceLink.hpp"
0016 
0017 #include <cmath>
0018 #include <vector>
0019 
0020 #include <boost/container/static_vector.hpp>
0021 
0022 namespace ActsExamples {
0023 
0024 /// representation of a drift circle measurement used for track finding
0025 class DriftCircle {
0026   using Scalar = Acts::ActsScalar;
0027 
0028  public:
0029   /// Construct the drift circle from the drift radius and tube location
0030   ///
0031   /// @param tubePos position of the tube in the station frame
0032   /// @param driftRadius measured drift radius
0033   /// @param driftRadiusError error on drift radius
0034   /// @param stationName station name index
0035   /// @param stationEta station eta index
0036   /// @param stationPhi station phi index
0037   /// @param multilayer multilayer index
0038   /// @param tubeLayer tube layer index
0039   /// @param tube tube index
0040   DriftCircle(const Acts::Vector3&& tubePos, float driftRadius,
0041               float driftRadiusError, int stationName, int stationEta,
0042               int stationPhi, int multilayer, int tubeLayer, int tube)
0043       : m_x(tubePos[Acts::ePos0]),
0044         m_y(tubePos[Acts::ePos1]),
0045         m_z(tubePos[Acts::ePos2]),
0046         m_rho(driftRadius),
0047         m_sigmaRho(driftRadiusError),
0048         m_stationName(stationName),
0049         m_stationEta(stationEta),
0050         m_stationPhi(stationPhi),
0051         m_multilayer(multilayer),
0052         m_tubeLayer(tubeLayer),
0053         m_tube(tube) {}
0054 
0055   constexpr Scalar x() const { return m_x; }
0056   constexpr Scalar y() const { return m_y; }
0057   constexpr Scalar z() const { return m_z; }
0058   constexpr Scalar rDrift() const { return m_rho; }
0059   constexpr Scalar rDriftError() const { return m_sigmaRho; }
0060   constexpr int stationName() const { return m_stationName; }
0061   constexpr int stationEta() const { return m_stationEta; }
0062   constexpr int stationPhi() const { return m_stationPhi; }
0063   constexpr int multilayer() const { return m_multilayer; }
0064   constexpr int tubeLayer() const { return m_tubeLayer; }
0065   constexpr int tube() const { return m_tube; }
0066 
0067  private:
0068   // Global position
0069   Scalar m_x = 0.0f;
0070   Scalar m_y = 0.0f;
0071   Scalar m_z = 0.0f;
0072   Scalar m_rho = 0.0f;
0073   Scalar m_sigmaRho = 0.0f;
0074   int m_stationName = 0;
0075   int m_stationEta = 0;
0076   int m_stationPhi = 0;
0077   int m_multilayer = 0;
0078   int m_tubeLayer = 0;
0079   int m_tube = 0;
0080 };
0081 
0082 inline bool operator==(const DriftCircle& lhs, const DriftCircle& rhs) {
0083   return (lhs.stationName() == rhs.stationName() &&
0084           lhs.stationEta() == rhs.stationEta() &&
0085           lhs.stationPhi() == rhs.stationPhi() &&
0086           lhs.multilayer() == rhs.multilayer() &&
0087           lhs.tubeLayer() == rhs.tubeLayer() && lhs.tube() == rhs.tube() &&
0088           std::abs(rhs.rDrift() - lhs.rDrift()) < 1.e-8 &&
0089           std::abs(rhs.rDriftError() - lhs.rDriftError()) < 1.e-8);
0090 }
0091 
0092 /// Container of space points.
0093 using DriftCircleContainer = std::vector<DriftCircle>;
0094 
0095 }  // namespace ActsExamples