diff --git a/GeoModel2G4/GeoModel2G4/G4ShiftedCone_wrapper.h b/GeoModel2G4/GeoModel2G4/G4ShiftedCone_wrapper.h index 0221d9923b6e08c3ad6ed5c06de3109ac8c2da10..205e56e5ce3c0f2501d35d5a689932c555e5a93d 100644 --- a/GeoModel2G4/GeoModel2G4/G4ShiftedCone_wrapper.h +++ b/GeoModel2G4/GeoModel2G4/G4ShiftedCone_wrapper.h @@ -40,13 +40,12 @@ public: double DistanceToOut(const GeoTrf::Vector3D& p, const GeoTrf::Vector3D& v, - const bool calcNorm=bool(false), + const bool calcNorm=(false), bool *validNorm=0, GeoTrf::Vector3D *n=0) const; double DistanceToOut(const GeoTrf::Vector3D& p) const; GeoTrf::Vector3D GetPointOnSurface() const; - GeoTrf::Vector3D ApproxSurfaceNormal(const GeoTrf::Vector3D& p) const; private: G4ShiftedCone* fG4ShiftedCone; diff --git a/GeoModel2G4/GeoModel2G4/LArWheelSliceSolid_wrapper.h b/GeoModel2G4/GeoModel2G4/LArWheelSliceSolid_wrapper.h index aab6253f27c11ede5daccebd4bf06be33ed5518f..6398a5555eef7ea545409f313a56fe2d34df9d38 100644 --- a/GeoModel2G4/GeoModel2G4/LArWheelSliceSolid_wrapper.h +++ b/GeoModel2G4/GeoModel2G4/LArWheelSliceSolid_wrapper.h @@ -11,21 +11,14 @@ #include <stdio.h> #include "GeoModelKernel/GeoDefinitions.h" -#include "GeoModel2G4/LArWheelSliceSolid" #include "CLHEP/Vector/ThreeVector.h" +#include "GeoModel2G4/LArWheelSliceSolid.h" class LArWheelSliceSolid; class LArWheelSliceSolid_wrapper { public: - LArWheelSliceSolid_wrapper(const std::string& pName, - double pZ1, double pZ2, - double pRmin1, double pRmax1, - double pRmin2, double pRmax2); - // double pSPhi, double pDPhi); - // - // Constructs a cone with the given name and dimensions - + LArWheelSliceSolid_wrapper(); ~LArWheelSliceSolid_wrapper() ; enum EInside {kOutside,kSurface,kInside}; @@ -46,13 +39,11 @@ public: GeoTrf::Vector3D *n=0) const; double DistanceToOut(const GeoTrf::Vector3D& p) const;\ - GeoTrf::Vector3D SurfaceNormal (const GeoTrf::Vector3D&) const; GeoTrf::Vector3D GetPointOnSurface(void) const; - GeoTrf::Vector3D ApproxSurfaceNormal(const GeoTrf::Vector3D& p) const; private: - G4ShiftedCone* fG4ShiftedCone; + LArWheelSliceSolid* fLArWheelSliceSolid; }; diff --git a/GeoModel2G4/src/G4ShiftedCone_wrapper.cxx b/GeoModel2G4/src/G4ShiftedCone_wrapper.cxx index 3f2638b4c89208f757aa1c022c9258f220a26e95..d9b6e7bff7a05533e1469a4cb62c0bab560a2bd5 100644 --- a/GeoModel2G4/src/G4ShiftedCone_wrapper.cxx +++ b/GeoModel2G4/src/G4ShiftedCone_wrapper.cxx @@ -5,7 +5,7 @@ // Created by Marilena Bandieramonte on 07.02.20. // -#include "G4ShiftedCone_wrapper.h" +#include "GeoModel2G4/G4ShiftedCone_wrapper.h" G4ShiftedCone_wrapper::G4ShiftedCone_wrapper(const std::string& pName, @@ -59,17 +59,13 @@ double G4ShiftedCone_wrapper::DistanceToIn (const GeoTrf::Vector3D& p) const{ return fG4ShiftedCone->DistanceToIn(lp); } -double G4ShiftedCone_wrapper::DistanceToOut(const GeoTrf::Vector3D& p, - const GeoTrf::Vector3D& v, - const bool calcNorm=false, - bool *validNorm=0, - GeoTrf::Vector3D *n=0) const{ - - CLHEP::Hep3Vector lp (p(0), p(1), p(2)); - CLHEP::Hep3Vector lv (v(0), v(1), v(2)); - CLHEP::Hep3Vector ln (n(0), n(1), n(2)); - fG4ShiftedCone->DistanceToOut(lp, lv,calcNorm,validNorm,ln); +double G4ShiftedCone_wrapper::DistanceToOut(const GeoTrf::Vector3D& , + const GeoTrf::Vector3D& , + const bool , + bool *, + GeoTrf::Vector3D *) const{ + } double G4ShiftedCone_wrapper::DistanceToOut(const GeoTrf::Vector3D& p) const{ @@ -87,13 +83,4 @@ GeoTrf::Vector3D G4ShiftedCone_wrapper::GetPointOnSurface() const{ reigen(2) = rclhep.z(); return reigen; } -GeoTrf::Vector3D G4ShiftedCone_wrapper::ApproxSurfaceNormal(const GeoTrf::Vector3D& p) const{ - - CLHEP::Hep3Vector lp (p(0), p(1), p(2)); - CLHEP::Hep3Vector rclhep = fG4ShiftedCone->ApproxSurfaceNormal(lp); - GeoTrf::Vector3D reigen; - reigen(0) = rclhep.x(); - reigen(1) = rclhep.y(); - reigen(2) = rclhep.z(); - return reigen; -} + diff --git a/GeoModel2G4/src/LArWheelSliceSolid_wrapper.cxx b/GeoModel2G4/src/LArWheelSliceSolid_wrapper.cxx index faeb04f2c975e171c8331383a910520524d2454b..a21adaf281d68bde2a0eaff937fc734912841605 100644 --- a/GeoModel2G4/src/LArWheelSliceSolid_wrapper.cxx +++ b/GeoModel2G4/src/LArWheelSliceSolid_wrapper.cxx @@ -5,18 +5,14 @@ // Created by Marilena Bandieramonte on 07.02.20. // -#include "LArWheelSliceSolid_wrapper.h" +#include "GeoModel2G4/LArWheelSliceSolid_wrapper.h" -LArWheelSliceSolid_wrapper::LArWheelSliceSolid_wrapper(const std::string& pName, - double pZ1, double pZ2, - double pRmin1, double pRmax1, - double pRmin2, double pRmax2) +LArWheelSliceSolid_wrapper::LArWheelSliceSolid_wrapper() { - fG4ShiftedCone = new G4ShiftedCone(pName, pZ1, pZ2, pRmin1, pRmax1,pRmin2, pRmax2); } LArWheelSliceSolid_wrapper::~LArWheelSliceSolid_wrapper(){ - if (fG4ShiftedCone) delete fG4ShiftedCone; + if (fLArWheelSliceSolid) delete fLArWheelSliceSolid; } void LArWheelSliceSolid_wrapper::BoundingLimits(GeoTrf::Vector3D& pMin, GeoTrf::Vector3D& pMax) const{ @@ -24,75 +20,52 @@ void LArWheelSliceSolid_wrapper::BoundingLimits(GeoTrf::Vector3D& pMin, GeoTrf:: CLHEP::Hep3Vector lpMin(pMin(0), pMin(1), pMin(2)); CLHEP::Hep3Vector lpMax (pMax(0), pMax(1), pMax(2)); - fG4ShiftedCone->BoundingLimits (lpMin, lpMax); + fLArWheelSliceSolid->BoundingLimits (lpMin, lpMax); } -LArWheelSliceSolid_wrapper::EInside G4ShiftedCone_wrapper::Inside( const GeoTrf::Vector3D& p ) const{ +LArWheelSliceSolid_wrapper::EInside LArWheelSliceSolid_wrapper::Inside( const GeoTrf::Vector3D& p ) const{ CLHEP::Hep3Vector lp(p(0), p(1), p(2)); - return (G4ShiftedCone_wrapper::EInside)fG4ShiftedCone->Inside(lp); + return (LArWheelSliceSolid_wrapper::EInside)fLArWheelSliceSolid->Inside(lp); } -GeoTrf::Vector3D LArWheelSliceSolid_wrapper::SurfaceNormal( const GeoTrf::Vector3D& p ) const{ - - CLHEP::Hep3Vector lp(p(0), p(1), p(2)); - CLHEP::Hep3Vector rclhep = fG4ShiftedCone->SurfaceNormal(lp); - GeoTrf::Vector3D reigen; - reigen(0) = rclhep.x(); - reigen(1) = rclhep.y(); - reigen(2) = rclhep.z(); - return reigen; -} double LArWheelSliceSolid_wrapper::DistanceToIn (const GeoTrf::Vector3D& p, const GeoTrf::Vector3D& v) const{ CLHEP::Hep3Vector lp (p(0), p(1), p(2)); CLHEP::Hep3Vector lv (v(0), v(1), v(2)); - return fG4ShiftedCone->DistanceToIn(lp,lv); + return fLArWheelSliceSolid->DistanceToIn(lp,lv); } double LArWheelSliceSolid_wrapper::DistanceToIn (const GeoTrf::Vector3D& p) const{ CLHEP::Hep3Vector lp (p(0), p(1), p(2)); - return fG4ShiftedCone->DistanceToIn(lp); + return fLArWheelSliceSolid->DistanceToIn(lp); } -double LArWheelSliceSolid_wrapper::DistanceToOut(const GeoTrf::Vector3D& p, - const GeoTrf::Vector3D& v, - const bool calcNorm=false, - bool *validNorm=0, - GeoTrf::Vector3D *n=0) const{ - - CLHEP::Hep3Vector lp (p(0), p(1), p(2)); - CLHEP::Hep3Vector lv (v(0), v(1), v(2)); - CLHEP::Hep3Vector ln (n(0), n(1), n(2)); - fG4ShiftedCone->DistanceToOut(lp, lv,calcNorm,validNorm,ln); - +double LArWheelSliceSolid_wrapper::DistanceToOut(const GeoTrf::Vector3D&, + const GeoTrf::Vector3D& , + const bool , + bool *, + GeoTrf::Vector3D *) const{ + double temp = 0; + return temp; } double LArWheelSliceSolid_wrapper::DistanceToOut(const GeoTrf::Vector3D& p) const{ CLHEP::Hep3Vector lp (p(0), p(1), p(2)); - return fG4ShiftedCone->DistanceToOut(lp); + return fLArWheelSliceSolid->DistanceToOut(lp); } GeoTrf::Vector3D LArWheelSliceSolid_wrapper::GetPointOnSurface() const{ - CLHEP::Hep3Vector rclhep = fG4ShiftedCone->GetPointOnSurface(); - GeoTrf::Vector3D reigen; - reigen(0) = rclhep.x(); - reigen(1) = rclhep.y(); - reigen(2) = rclhep.z(); - return reigen; -} -GeoTrf::Vector3D LArWheelSliceSolid_wrapper::ApproxSurfaceNormal(const GeoTrf::Vector3D& p) const{ - - CLHEP::Hep3Vector lp (p(0), p(1), p(2)); - CLHEP::Hep3Vector rclhep = fG4ShiftedCone->ApproxSurfaceNormal(lp); + CLHEP::Hep3Vector rclhep = fLArWheelSliceSolid->GetPointOnSurface(); GeoTrf::Vector3D reigen; reigen(0) = rclhep.x(); reigen(1) = rclhep.y(); reigen(2) = rclhep.z(); return reigen; } +