//////////////////////////////////////////////////////////////////////// /// /// \class SNOAVBellyPlate /// /// \brief SphericalSubregion class to describe the belly plate geometry. /// /// \author Aksel Hallin aksel.hallin@ualberta.ca /// /// REVISION HISTORY:\n /// Jun 13, 2014 : Aksel Hallin \n /// /// \detail //// //////////////////////////////////////////////////////////////////////// #ifndef __RAT__SNOAVBellyPlate__ #define __RAT__SNOAVBellyPlate__ #include #include namespace RAT{ class SNOAVBellyPlate:public SphericalSubregion{ public: /// Constructor /// @param[in] rmin The outer radius of the normal acrylic vessel, which is the bellyplate outer radius outside of the bevel. /// @param[in] rmax The distance from the center of the AV to the outer surface of the belly plate. /// @param[in] xAxis The belly plate approximately lies in the x-z plane. xAxis is the horizontal unit vector. /// @param[in] yAxis A unit vector in the direction from the center of the AV to the center of the belly plate. /// @param[in] zaxis The vertical vector /// @param[in] zInner Half the height of the 4" thick section of the spherical belly plate /// @param[in] zOuter Half the distance between the points on the bevel where the sphere is 2" thick SNOAVBellyPlate(DBLinkPtr geoDimensionsTable, const G4double rmin, const G4double rmax, const G4ThreeVector&xAxis, const G4ThreeVector&yAxis, const G4ThreeVector &zAxis, const G4double zInner, const G4double zOuter); /// /// DistanceToIn implements SphericalSubregionn (G4VSolid) method, calculating the distance to the closest intersection from outside the solid /// @param[in] p Starting position of the track /// @param[in] n Unit vector in direction of the track /// @param[in] dInner The two solutions for the distances to the inside radius /// @param[in] dOuter The two solutions for the distances to the outer radius /// @returns The next intersection with the surface of the belly plate. G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &n, const G4double dInner[2], const G4double dOuter[2])const; /// /// DistanceToOut implements SphericalSubregionn (G4VSolid) method, calculating the distance to the closest intersection from inside the solid /// @param[in] p Starting position of the track /// @param[in] n Unit vector in direction of the track /// @param[in] dInner The two solutions for the distances to the inside radius /// @param[in] dOuter The two solutions for the distances to the outer radius /// @returns Either the qualified distance, or a distance to a closer intersection with the solid. G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &n, const G4double dInner[2], const G4double dOuter[2])const; /// /// DistanceToIn implements SphericalSubregionn (G4VSolid) method, /// independent of direction. /// @param[in] p Position of a point /// @returns A lower bound on the distance to the closest intersection from outside the solid G4double DistanceToIn(const G4ThreeVector &)const{ return 0; }; /// DistanceToOut implements SphericalSubregionn (G4VSolid) method, /// @param[in] p Position of a point /// @returns A lower bound on the distance to the closest intersection from inside the solid G4double DistanceToOut(const G4ThreeVector &)const{ return 0; }; /// CalculatePlaneIntersection method used to establish if the photon is going towards the rope groove or slot G4double CalculatePlaneIntersection(const G4ThreeVector &aPosition, const G4ThreeVector &aDirection, const G4ThreeVector &aPlaneNormal, const G4double &aRadius)const; /// Inside implements SphericalSubregionn (G4VSolid) method, /// @param[in] p Position of a point /// @returns Either kInside, kOutside, or kSurface, depending upon the location of the point with respect to the boundary of the solid. EInside Inside(const G4ThreeVector &p)const; /// OnTestSurfaceIn implements SphericalSubregionn (G4VSolid) method, /// @param[in] p Position of a point /// @returns True if the point is on a spherical surface of the belly plate. G4bool OnTestSurfaceIn(const G4ThreeVector &p)const; /// OnTestSurfaceOut implements SphericalSubregionn (G4VSolid) method, /// @param[in] p Position of a point /// @returns True if the point is on a spherical surface of the belly plate. G4bool OnTestSurfaceOut(const G4ThreeVector &p)const; /// OverlapsRegion calculates whether any point between the four corners lies within the belly plate. This is used to determine whether /// a particular section of the rope net needs to consider intersections with this section of the AV. /// @param[in] corners[4] Positions of 4 corners that bound the spherical-rectangular region that needs to be checked. /// @returns True if any point on the belly plate lies within the area specified by the 4 corners. G4bool OverlapsRegion(const G4ThreeVector corners[4])const; /// Calculates the distance to the z-axis of points on the surface of the belly plate. /// The cylidrical radius for all points on a belly plate that have spherical or conical symmetry with respect to the z-axis /// can be found by specifying only z- so this works for the spherical sections, upper and lower bevels. /// @param[in] z specifies a distance from the center of the bellyplate in the z or x directions. /// returns The cylindrical radius for that particular height. G4double Rho(G4double z); /// Calculates the spherical radius of points on the surface of the belly plate. /// The radius for all points on a belly plate that have spherical or conical symmetry with respect to the z-axis /// can be found by specifying only z- so this works for the spherical sections, upper and lower bevels. /// @param[in] z specifies a distance from the center of the bellyplate in the z or x directions. /// returns The spherical radius for that particular height. G4double Radius(G4double z)const; /// Implements SphericalPseudoregion(G4VSolid) method /// @param[in]p A position /// @param[out]isValid is set false if the point is not on the surface of the solid. /// @returns The outward unit vector normal to the solid through p. G4ThreeVector SurfaceNormal(const G4ThreeVector &p, G4bool &isValid)const; private: const G4ThreeVector fXaxis; ///< The belly plate horizontal axis (in AV coordinates) const G4ThreeVector fYaxis; ///< A unit vector in the direction from the center of the AV to the center of the belly plate. const G4ThreeVector fZaxis; ///< The vertical axis G4double fRmin; ///< The distance from the center of the AV to the outer surface of the 2" thick spherical section of the belly plate. G4double fRmax; ///< The distance from the center of the AV to the outer surface of the 4" thick spherical section of the belly plate. G4double fZInner; ///< The vertical distance from center of the belly plate to the start of bevel G4double fZOuter; ///< The vertical distance from the center of the belly plate to the end of the bevel. G4double fZOffset; ///< The value of z for which the cone-radius is zero (for the positive-z cone) G4double fRhoSlope; ///< The "slope" of the conical surface describing the belly plates. Ie. dRho/dz. G4double fRhomin; ///< The minimum cylindrical radius for the bevel, G4double fRhomax; ///< The maximum cylindrical radius for the bevel. G4double fThreshold; ///< Geant4 surface precision, which is used to determine the precision of geometry calculations G4double fGrooveRadius; ///< Cylindrical distance between center of panel and the center of the rope groove G4double fGrooveHalfWidth; ///< The groove is the wider part of the rope pene G4double fSlotRadius; ///