34#ifndef G4TWISTBOXSIDE_HH
35#define G4TWISTBOXSIDE_HH
63 G4bool isGlobal =
false)
override ;
76 G4int areacode[])
override;
86 G4bool withTol =
true)
override;
87 void SetCorners()
override;
88 void SetBoundaries()
override;
95 G4bool isGlobal =
false)
override;
98 inline G4double GetSurfaceArea()
override;
150 return ( fDx4plus2 + fDx4minus2 * ( 2 * phi ) / fPhiTwist ) ;
157 return ( fDy2plus1 + fDy2minus1 * ( 2 * phi ) / fPhiTwist ) ;
164 return GetValueA(phi)/2. + u*fTAlph ;
174 - u * std::sin(phi) + fdeltaX*phi/fPhiTwist,
175 Xcoef(u,phi) * std::sin(phi)
176 + u * std::cos(phi) + fdeltaY*phi/fPhiTwist,
177 2*fDz*phi/fPhiTwist );
179 if (isGlobal) {
return (
fRot * SurfPoint +
fTrans); }
186 return -0.5*GetValueB(phi) ;
192 return 0.5*GetValueB(phi) ;
196G4double G4TwistBoxSide::GetSurfaceArea()
198 return (fDz*(std::sqrt(16*fDy1*fDy1
199 + (fa1md1 + 4*fDy1*fTAlph)*(fa1md1 + 4*fDy1*fTAlph))
200 + std::sqrt(16*fDy1*fDy1 + (fa2md2 + 4*fDy1*fTAlph)
201 * (fa2md2 + 4*fDy1*fTAlph))))/2. ;
210 G4ThreeVector nvec( 4*fDz*(std::cos(phi) + fTAlph*std::sin(phi)) ,
211 4*fDz*(-(fTAlph*std::cos(phi)) + std::sin(phi)),
212 (fDx2 + fDx4)*fPhiTwist*fTAlph
213 + 2*fDx4minus2*(-1 + fTAlph*phi)
214 + 2*fPhiTwist*(1 + fTAlph*fTAlph)*u
215 - 2*(fdeltaX - fdeltaY*fTAlph)*std::cos(phi)
216 - 2*(fdeltaY + fdeltaX*fTAlph)*std::sin(phi) );
G4ThreeVector GetNormal(const G4ThreeVector &xx, G4bool isGlobal=false) override
G4int DistanceToSurface(const G4ThreeVector &gp, const G4ThreeVector &gv, G4ThreeVector gxx[], G4double distance[], G4int areacode[], G4bool isvalid[], EValidate validate=kValidateWithTol) override
~G4TwistBoxSide() override
G4TwistBoxSide(const G4String &name, G4double PhiTwist, G4double pDz, G4double pTheta, G4double pPhi, G4double pDy1, G4double pDx1, G4double pDx2, G4double pDy2, G4double pDx3, G4double pDx4, G4double pAlph, G4double AngleSide)