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/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  public:
0027   /// Construct the drift circle from the drift radius and tube location
0028   ///
0029   /// @param tubePos position of the tube in the station frame
0030   /// @param driftRadius measured drift radius
0031   /// @param driftRadiusError error on drift radius
0032   /// @param stationName station name index
0033   /// @param stationEta station eta index
0034   /// @param stationPhi station phi index
0035   /// @param multilayer multilayer index
0036   /// @param tubeLayer tube layer index
0037   /// @param tube tube index
0038   DriftCircle(const Acts::Vector3&& tubePos, float driftRadius,
0039               float driftRadiusError, int stationName, int stationEta,
0040               int stationPhi, int multilayer, int tubeLayer, int tube)
0041       : m_x(tubePos[Acts::ePos0]),
0042         m_y(tubePos[Acts::ePos1]),
0043         m_z(tubePos[Acts::ePos2]),
0044         m_rho(driftRadius),
0045         m_sigmaRho(driftRadiusError),
0046         m_stationName(stationName),
0047         m_stationEta(stationEta),
0048         m_stationPhi(stationPhi),
0049         m_multilayer(multilayer),
0050         m_tubeLayer(tubeLayer),
0051         m_tube(tube) {}
0052 
0053   constexpr double x() const { return m_x; }
0054   constexpr double y() const { return m_y; }
0055   constexpr double z() const { return m_z; }
0056   constexpr double rDrift() const { return m_rho; }
0057   constexpr double rDriftError() const { return m_sigmaRho; }
0058   constexpr int stationName() const { return m_stationName; }
0059   constexpr int stationEta() const { return m_stationEta; }
0060   constexpr int stationPhi() const { return m_stationPhi; }
0061   constexpr int multilayer() const { return m_multilayer; }
0062   constexpr int tubeLayer() const { return m_tubeLayer; }
0063   constexpr int tube() const { return m_tube; }
0064 
0065  private:
0066   // Global position
0067   double m_x = 0.;
0068   double m_y = 0.;
0069   double m_z = 0.;
0070   double m_rho = 0.;
0071   double m_sigmaRho = 0.;
0072   int m_stationName = 0;
0073   int m_stationEta = 0;
0074   int m_stationPhi = 0;
0075   int m_multilayer = 0;
0076   int m_tubeLayer = 0;
0077   int m_tube = 0;
0078 };
0079 
0080 inline bool operator==(const DriftCircle& lhs, const DriftCircle& rhs) {
0081   return (lhs.stationName() == rhs.stationName() &&
0082           lhs.stationEta() == rhs.stationEta() &&
0083           lhs.stationPhi() == rhs.stationPhi() &&
0084           lhs.multilayer() == rhs.multilayer() &&
0085           lhs.tubeLayer() == rhs.tubeLayer() && lhs.tube() == rhs.tube() &&
0086           std::abs(rhs.rDrift() - lhs.rDrift()) < 1.e-8 &&
0087           std::abs(rhs.rDriftError() - lhs.rDriftError()) < 1.e-8);
0088 }
0089 
0090 /// Container of space points.
0091 using DriftCircleContainer = std::vector<DriftCircle>;
0092 
0093 }  // namespace ActsExamples