Warning, file /include/Geant4/G4TwistTubsHypeSide.hh was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
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 G4TWISTTUBSHYPESIDE_HH
0037 #define G4TWISTTUBSHYPESIDE_HH
0038
0039 #include "G4VTwistSurface.hh"
0040 #include "G4Integrator.hh"
0041 #include "G4SimpleIntegration.hh"
0042
0043 class G4TwistTubsHypeSide : public G4VTwistSurface
0044 {
0045 public:
0046
0047 G4TwistTubsHypeSide(const G4String& name,
0048 const G4RotationMatrix& rot,
0049 const G4ThreeVector& tlate,
0050 const G4int handedness,
0051 const G4double kappa,
0052 const G4double tanstereo,
0053 const G4double r0,
0054 const EAxis axis0 = kPhi,
0055 const EAxis axis1 = kZAxis,
0056 G4double axis0min = -kInfinity,
0057 G4double axis1min = -kInfinity,
0058 G4double axis0max = kInfinity,
0059 G4double axis1max = kInfinity);
0060
0061 G4TwistTubsHypeSide(const G4String& name,
0062 G4double EndInnerRadius[2],
0063 G4double EndOuterRadius[2],
0064 G4double DPhi,
0065 G4double EndPhi[2],
0066 G4double EndZ[2],
0067 G4double InnerRadius,
0068 G4double OuterRadius,
0069 G4double Kappa,
0070 G4double TanInnerStereo,
0071 G4double TanOuterStereo,
0072 G4int handedness) ;
0073
0074 ~G4TwistTubsHypeSide() override;
0075
0076 G4int DistanceToSurface(const G4ThreeVector& gp,
0077 const G4ThreeVector& gv,
0078 G4ThreeVector gxx[],
0079 G4double distance[],
0080 G4int areacode[],
0081 G4bool isvalid[],
0082 EValidate validate = kValidateWithTol) override;
0083
0084 G4int DistanceToSurface(const G4ThreeVector& gp,
0085 G4ThreeVector gxx[],
0086 G4double distance[],
0087 G4int areacode[]) override;
0088
0089 G4ThreeVector GetNormal(const G4ThreeVector& xx,
0090 G4bool isGlobal = false) override ;
0091 EInside Inside(const G4ThreeVector& gp) ;
0092
0093 inline G4double GetRhoAtPZ(const G4ThreeVector& p,
0094 G4bool isglobal = false) const ;
0095
0096 inline G4ThreeVector SurfacePoint(G4double, G4double,
0097 G4bool isGlobal = false) override ;
0098 inline G4double GetBoundaryMin(G4double phi) override ;
0099 inline G4double GetBoundaryMax(G4double phi) override ;
0100 inline G4double GetSurfaceArea() override ;
0101 void GetFacets( G4int m, G4int n, G4double xyz[][3],
0102 G4int faces[][4], G4int iside ) override ;
0103
0104 G4TwistTubsHypeSide(__void__&);
0105
0106
0107
0108
0109 private:
0110
0111 G4int GetAreaCode(const G4ThreeVector& xx,
0112 G4bool withTol = true) override;
0113 G4int GetAreaCodeInPhi(const G4ThreeVector& xx,
0114 G4bool withTol = true);
0115 void SetCorners() override;
0116
0117 void SetCorners(G4double EndInnerRadius[2],
0118 G4double EndOuterRadius[2],
0119 G4double DPhi,
0120 G4double EndPhi[2],
0121 G4double EndZ[2]);
0122 void SetBoundaries() override;
0123
0124 private:
0125
0126 G4double fKappa;
0127 G4double fTanStereo;
0128 G4double fTan2Stereo;
0129 G4double fR0;
0130 G4double fR02;
0131 G4double fDPhi ;
0132
0133 class Insidetype
0134 {
0135 public:
0136 G4ThreeVector gp;
0137 EInside inside;
0138 };
0139 Insidetype fInside;
0140 };
0141
0142
0143
0144
0145
0146 inline
0147 G4double G4TwistTubsHypeSide::GetRhoAtPZ(const G4ThreeVector& p,
0148 G4bool isglobal) const
0149 {
0150
0151 G4ThreeVector tmpp;
0152 if (isglobal) { tmpp = fRot.inverse()*p - fTrans; }
0153 else { tmpp = p; }
0154
0155 return std::sqrt(fR02 + tmpp.z() * tmpp.z() * fTan2Stereo);
0156 }
0157
0158 inline
0159 G4ThreeVector G4TwistTubsHypeSide::
0160 SurfacePoint(G4double phi , G4double z , G4bool isGlobal)
0161 {
0162 G4double rho = std::sqrt(fR02 + z * z * fTan2Stereo) ;
0163
0164 G4ThreeVector SurfPoint (rho*std::cos(phi), rho*std::sin(phi), z) ;
0165
0166 if (isGlobal) { return (fRot * SurfPoint + fTrans); }
0167 return SurfPoint;
0168 }
0169
0170 inline
0171 G4double G4TwistTubsHypeSide::GetBoundaryMin(G4double z)
0172 {
0173 G4ThreeVector ptmp(0,0,z) ;
0174 G4ThreeVector lowerlimit;
0175 lowerlimit = GetBoundaryAtPZ(sAxis0 & sAxisMin, ptmp);
0176 return std::atan2( lowerlimit.y(), lowerlimit.x() ) ;
0177 }
0178
0179 inline
0180 G4double G4TwistTubsHypeSide::GetBoundaryMax(G4double z )
0181 {
0182 G4ThreeVector ptmp(0,0,z) ;
0183 G4ThreeVector upperlimit;
0184 upperlimit = GetBoundaryAtPZ(sAxis0 & sAxisMax, ptmp);
0185 return std::atan2( upperlimit.y(), upperlimit.x() ) ;
0186 }
0187
0188 inline
0189 G4double G4TwistTubsHypeSide::GetSurfaceArea()
0190 {
0191
0192
0193 return ( fAxisMax[1] - fAxisMin[1] ) * fR0 * fDPhi ;
0194 }
0195
0196 #endif