File indexing completed on 2025-01-18 09:59:15
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036 #ifndef G4TWISTTUBSFLATSIDE_HH
0037 #define G4TWISTTUBSFLATSIDE_HH
0038
0039 #include "G4VTwistSurface.hh"
0040
0041 class G4TwistTubsFlatSide : public G4VTwistSurface
0042 {
0043 public:
0044
0045 G4TwistTubsFlatSide(const G4String& name,
0046 const G4RotationMatrix& rot,
0047 const G4ThreeVector& tlate,
0048 const G4ThreeVector& n,
0049 const EAxis axis1 = kRho,
0050 const EAxis axis2 = kPhi,
0051 G4double axis0min = -kInfinity,
0052 G4double axis1min = -kInfinity,
0053 G4double axis0max = kInfinity,
0054 G4double axis1max = kInfinity);
0055
0056 G4TwistTubsFlatSide(const G4String& name,
0057 G4double EndInnerRadius[2],
0058 G4double EndOuterRadius[2],
0059 G4double DPhi,
0060 G4double EndPhi[2],
0061 G4double EndZ[2],
0062 G4int handedness);
0063
0064 ~G4TwistTubsFlatSide() override;
0065 G4ThreeVector GetNormal(const G4ThreeVector& ,
0066 G4bool isGlobal = false) override;
0067 G4int DistanceToSurface(const G4ThreeVector& gp,
0068 const G4ThreeVector& gv,
0069 G4ThreeVector gxx[],
0070 G4double distance[],
0071 G4int areacode[],
0072 G4bool isvalid[],
0073 EValidate validate = kValidateWithTol) override;
0074
0075 G4int DistanceToSurface(const G4ThreeVector& gp,
0076 G4ThreeVector gxx[],
0077 G4double distance[],
0078 G4int areacode[]) override;
0079
0080 inline G4ThreeVector SurfacePoint(G4double, G4double,
0081 G4bool isGlobal = false) override;
0082 inline G4double GetBoundaryMin(G4double phi) override;
0083 inline G4double GetBoundaryMax(G4double phi) override;
0084 inline G4double GetSurfaceArea() override { return fSurfaceArea ; }
0085 void GetFacets( G4int m, G4int n, G4double xyz[][3],
0086 G4int faces[][4], G4int iside ) override;
0087
0088 G4TwistTubsFlatSide(__void__&);
0089
0090
0091
0092
0093 protected:
0094
0095 G4int GetAreaCode(const G4ThreeVector& xx,
0096 G4bool withTol = true) override ;
0097
0098 private:
0099
0100 void SetCorners() override;
0101 void SetBoundaries() override;
0102
0103 private:
0104
0105 G4double fSurfaceArea = 0.0;
0106 };
0107
0108 inline G4ThreeVector G4TwistTubsFlatSide::
0109 SurfacePoint(G4double phi , G4double rho , G4bool isGlobal )
0110 {
0111 G4ThreeVector SurfPoint (rho*std::cos(phi) , rho*std::sin(phi) , 0);
0112
0113 if (isGlobal) { return (fRot * SurfPoint + fTrans); }
0114 return SurfPoint;
0115 }
0116
0117 inline
0118 G4double G4TwistTubsFlatSide::GetBoundaryMin(G4double)
0119 {
0120 G4ThreeVector dphimin = GetCorner(sC0Max1Min);
0121 return std::atan2( dphimin.y(), dphimin.x() );
0122 }
0123
0124 inline
0125 G4double G4TwistTubsFlatSide::GetBoundaryMax(G4double)
0126 {
0127 G4ThreeVector dphimax = GetCorner(sC0Max1Max);
0128 return std::atan2( dphimax.y(), dphimax.x() );
0129 }
0130
0131 #endif