EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SingleCurvilinearTrackParameters.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SingleCurvilinearTrackParameters.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2016-2020 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 #pragma once
10 
13 
14 namespace Acts {
15 
26 template <typename charge_t>
28  : public SingleBoundTrackParameters<charge_t> {
30 
31  public:
35 
44  const Vector4D& pos4, const Vector3D& dir, Scalar p, Scalar q,
45  std::optional<CovarianceMatrix> cov = std::nullopt)
46  : Base(Surface::makeShared<PlaneSurface>(pos4.segment<3>(ePos0), dir),
48  pos4[eTime], dir, (q != Scalar(0)) ? (q / p) : (1 / p)),
49  q, std::move(cov)) {
50  assert((0 <= p) and "Absolute momentum must be positive");
51  }
52 
62  template <typename T = charge_t,
63  std::enable_if_t<std::is_default_constructible_v<T>, int> = 0>
65  const Vector4D& pos4, const Vector3D& dir, Scalar qOverP,
66  std::optional<CovarianceMatrix> cov = std::nullopt)
67  : Base(Surface::makeShared<PlaneSurface>(pos4.segment<3>(ePos0), dir),
69  qOverP),
70  std::move(cov)) {}
71 
82  std::optional<CovarianceMatrix> cov = std::nullopt)
83  : Base(Surface::makeShared<PlaneSurface>(
84  pos4.segment<3>(ePos0),
85  makeDirectionUnitFromPhiTheta(phi, theta)),
87  pos4[eTime], phi, theta, (q != Scalar(0)) ? (q / p) : (1 / p)),
88  q, std::move(cov)) {
89  assert((0 <= p) and "Absolute momentum must be positive");
90  }
91 
102  template <typename T = charge_t,
103  std::enable_if_t<std::is_default_constructible_v<T>, int> = 0>
105  const Vector4D& pos4, Scalar phi, Scalar theta, Scalar qOverP,
106  std::optional<CovarianceMatrix> cov = std::nullopt)
107  : Base(Surface::makeShared<PlaneSurface>(
108  pos4.segment<3>(ePos0),
109  makeDirectionUnitFromPhiTheta(phi, theta)),
110  detail::transformFreeToCurvilinearParameters(pos4[eTime], phi,
111  theta, qOverP),
112  std::move(cov)) {}
113 
114  // this class does not have a custom default constructor and thus should not
115  // provide any custom default cstors, dstor, or assignment. see ISOCPP C.20.
116 };
117 
118 } // namespace Acts