Skip to content
Snippets Groups Projects

Draft: Fixed AlignmentUseCase when changing ROOT Unit

Closed Ben Couturier requested to merge fix_unit_alignmentusecase into master
1 unresolved thread
Files
3
+ 10
10
@@ -18,22 +18,22 @@
namespace LHCb::Detector::detail {
inline static constexpr double GaudiCentimeter = 10.0;
inline static constexpr double GaudiCentimeter = 10.0; // Gaudi/G4 units are mm
inline static constexpr double DD4hepToLHCbCm = GaudiCentimeter / dd4hep::centimeter;
inline static constexpr double LHCbToDD4hepCm = dd4hep::centimeter / GaudiCentimeter;
inline static constexpr double GaudiTeV = 1.0;
inline static constexpr double DD4hepToLHCbEnergy = dd4hep::TeV / GaudiTeV;
inline static constexpr double GaudiTeV = 1.0e6; // Gaudi/G4 units are MeV
inline static constexpr double DD4hepToLHCbEnergy = GaudiTeV / dd4hep::TeV;
template <typename TYPE>
inline TYPE toLHCbLengthUnits( const TYPE length ) {
inline TYPE toLHCbLengthUnits( const TYPE& length ) {
return DD4hepToLHCbCm * length;
}
template <typename TYPE>
inline TYPE toLHCbAreaUnits( const TYPE area ) {
inline TYPE toLHCbAreaUnits( const TYPE& area ) {
return DD4hepToLHCbCm * DD4hepToLHCbCm * area;
}
template <typename TYPE>
inline TYPE toLHCbEnergyUnits( const TYPE energy ) {
inline TYPE toLHCbEnergyUnits( const TYPE& energy ) {
return DD4hepToLHCbEnergy * energy;
}
inline ROOT::Math::Transform3D toLHCbLengthUnits( const ROOT::Math::Transform3D& t ) {
@@ -48,8 +48,8 @@ namespace LHCb::Detector::detail {
t.GetComponents( dx, dy, dz );
return {toLHCbLengthUnits( dx ), toLHCbLengthUnits( dy ), toLHCbLengthUnits( dz )};
}
inline auto toLHCbLengthUnits( const ROOT::Math::XYZVector& v ) { return DD4hepToLHCbCm * v; }
inline auto toDD4hepUnits( const ROOT::Math::XYZVector& v ) { return LHCbToDD4hepCm * v; }
inline auto toDD4hepUnits( const ROOT::Math::XYZPoint& p ) { return LHCbToDD4hepCm * p; }
template <typename T>
inline auto toDD4hepUnits( const T& d ) {
return LHCbToDD4hepCm * d;
}
} // End namespace LHCb::Detector::detail
Loading