4#ifndef ACTSINTEROPS_UNITCONVERTER_H
5#define ACTSINTEROPS_UNITCONVERTER_H
9#include "GaudiKernel/SystemOfUnits.h"
12#include "Acts/Definitions/Units.hpp"
13#include "Acts/Definitions/Algebra.hpp"
14#include "Acts/Definitions/Common.hpp"
22 using namespace Acts::UnitLiterals;
23 constexpr double energyCnv = 1_MeV / Gaudi::Units::MeV;
24 return energyCnv * athenaE;
29 using namespace Acts::UnitLiterals;
30 constexpr double energyCnv = Gaudi::Units::MeV / 1_MeV;
31 return energyCnv * actsE;
36 using namespace Acts::UnitLiterals;
37 constexpr double lengthCnv = 1_mm / Gaudi::Units::mm;
38 return lengthCnv * athenaL;
43 using namespace Acts::UnitLiterals;
44 constexpr double lengthCnv = Gaudi::Units::mm / 1_mm;
45 return lengthCnv * actsL;
49 inline constexpr double timeToActs(
const double athenaT) {
50 using namespace Acts::UnitLiterals;
51 constexpr double timeCnv = 1_ns / Gaudi::Units::ns;
52 return timeCnv * athenaT;
57 using namespace Acts::UnitLiterals;
58 constexpr double timeCnv = Gaudi::Units::ns/ 1_ns;
59 return timeCnv * actsT;
75 const double athenaTime =0.) {
76 Acts::Vector4 pos{Acts::Vector4::Zero()};
91 return std::make_pair(std::move(pos),
timeToAthena(actsPos[Acts::eTime]));
98 using namespace Acts::UnitLiterals;
99 Acts::Vector4 fourMom{Acts::Vector4::Zero()};
100 fourMom[Acts::eEnergy] =
energyToActs(std::sqrt(threeMom.dot(threeMom) + mass*mass));
114 return std::make_pair(std::move(threeMom),
energyToAthena(actsMom[Acts::eEnergy]));
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
constexpr double energyToActs(const double athenaE)
Converts an energy scalar from Athena to Acts units.
constexpr double timeToAthena(const double actsT)
Converts a time unit from Acts to Athena units.
constexpr double lengthToActs(const double athenaL)
Converts a length scalar from Acts to Athena units.
Amg::Vector3D convertDirFromActs(const Acts::Vector3 &actsDir)
Converts a direction vector from acts units into athena units.
constexpr double energyToAthena(const double actsE)
Converts an energy scalar from Acts to Athena units.
std::pair< Amg::Vector3D, double > convertMomFromActs(const Acts::Vector4 &actsMom)
Converts an Acts four-momentum vector into an pair of an Athena three-momentum and the paritcle's ene...
std::pair< Amg::Vector3D, double > convertPosFromActs(const Acts::Vector4 &actsPos)
Converts an Acts 4-vector into a pair of an Athena spatial vector and the passed time.
constexpr double lengthToAthena(const double actsL)
Converts a length scalar from Acts to Athena units.
constexpr double timeToActs(const double athenaT)
Converts a time unit from Athena to Acts units.
Acts::Vector4 convertMomToActs(const Amg::Vector3D &threeMom, const double mass=0.)
Converts a three momentum vector from Athena together with the associated particle mass into an Acts ...
Acts::Vector3 convertDirToActs(const Amg::Vector3D &athenaDir)
Converts a direction vector from athena units into acts units.
Acts::Vector4 convertPosToActs(const Amg::Vector3D &athenaPos, const double athenaTime=0.)
Converts a position vector & time from Athena units into Acts units.
Eigen::Matrix< double, 3, 1 > Vector3D