Skip to content
Snippets Groups Projects

Add support for performing volume intersections, as required by the RICH

Merged Ben Couturier requested to merge test_rich_intersections into master
Compare and
22 files
+ 916
213
Compare changes
  • Side-by-side
  • Inline
Files
22
+ 2
23
@@ -10,6 +10,8 @@
\*****************************************************************************/
#pragma once
#include "Core/Units.h"
#include "DD4hep/ConditionDerived.h"
#include "DD4hep/Conditions.h"
#include "DD4hep/ConditionsMap.h"
@@ -23,29 +25,6 @@ namespace LHCb::Detector {
namespace detail {
struct DeIOVObject;
inline static constexpr double GaudiCentimeter = 10.0;
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 auto toLHCbLengthUnits( const double length ) { return DD4hepToLHCbCm * length; }
inline auto toLHCbAreaUnits( const double area ) { return DD4hepToLHCbCm * DD4hepToLHCbCm * area; }
inline auto toLHCbEnergyUnits( const double energy ) { return DD4hepToLHCbEnergy * energy; }
inline ROOT::Math::Transform3D toLHCbLengthUnits( const ROOT::Math::Transform3D& t ) {
double xx{}, xy{}, xz{}, dx{}, yx{}, yy{}, yz{}, dy{}, zx{}, zy{}, zz{}, dz{};
t.GetComponents( xx, xy, xz, dx, yx, yy, yz, dy, zx, zy, zz, dz );
return {xx, xy, xz, toLHCbLengthUnits( dx ), //
yx, yy, yz, toLHCbLengthUnits( dy ), //
zx, zy, zz, toLHCbLengthUnits( dz )};
}
inline ROOT::Math::Translation3D toLHCbLengthUnits( const ROOT::Math::Translation3D& t ) {
double dx{}, dy{}, dz{};
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; }
} // namespace detail
// We need a forward declaration as IAlignable uses it
Loading