// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration. It is provided under the terms and * // * conditions of the Geant4 Software License, included in the file * // * LICENSE and available at http://cern.ch/geant4/license . These * // * include a list of copyright holders. * // * * // * Neither the authors of this software system, nor their employing * // * institutes,nor the agencies providing financial support for this * // * work make any representation or warranty, express or implied, * // * regarding this software system or assume any liability for its * // * use. Please see the license in the file LICENSE and URL above * // * for the full disclaimer and the limitation of liability. * // * * // * This code implementation is the result of the scientific and * // * technical work of the GEANT4 collaboration. * // * By using, copying, modifying or distributing the software (or * // * any work based on the software) you agree to acknowledge its * // * use in resulting scientific publications, and indicate your * // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** // // Implementation of inline methods of G4TwistTrapAlphaSide. // -------------------------------------------------------------------- inline G4double G4TwistTrapAlphaSide::GetValueA(G4double phi) { return ( fDx4plus2 + fDx4minus2 * ( 2 * phi ) / fPhiTwist ) ; } inline G4double G4TwistTrapAlphaSide::GetValueD(G4double phi) { return ( fDx3plus1 + fDx3minus1 * ( 2 * phi) / fPhiTwist ) ; } inline G4double G4TwistTrapAlphaSide::GetValueB(G4double phi) { return ( fDy2plus1 + fDy2minus1 * ( 2 * phi ) / fPhiTwist ) ; } inline G4double G4TwistTrapAlphaSide::Xcoef(G4double u, G4double phi) { return GetValueA(phi)/2. + (GetValueD(phi)-GetValueA(phi))/4. - u*( ( GetValueD(phi)-GetValueA(phi) )/( 2 * GetValueB(phi) ) - fTAlph ); } inline G4ThreeVector G4TwistTrapAlphaSide::SurfacePoint(G4double phi, G4double u , G4bool isGlobal) { // function to calculate a point on the surface, given by parameters phi,u G4ThreeVector SurfPoint ( Xcoef(u,phi) * std::cos(phi) - u * std::sin(phi) + fdeltaX*phi/fPhiTwist, Xcoef(u,phi) * std::sin(phi) + u * std::cos(phi) + fdeltaY*phi/fPhiTwist, 2*fDz*phi/fPhiTwist ); if (isGlobal) { return (fRot * SurfPoint + fTrans); } return SurfPoint; } inline G4double G4TwistTrapAlphaSide::GetBoundaryMin(G4double phi) { return -0.5*GetValueB(phi) ; } inline G4double G4TwistTrapAlphaSide::GetBoundaryMax(G4double phi) { return 0.5*GetValueB(phi) ; } inline G4double G4TwistTrapAlphaSide::GetSurfaceArea() { return (fDz*(std::sqrt(16*fDy1*fDy1 + (fa1md1 + 4*fDy1*fTAlph)*(fa1md1 + 4*fDy1*fTAlph)) + std::sqrt(16*fDy2*fDy2 + (fa2md2 + 4*fDy2*fTAlph) * (fa2md2 + 4*fDy2*fTAlph))))/2. ; } inline G4ThreeVector G4TwistTrapAlphaSide::NormAng( G4double phi, G4double u ) { // function to calculate the norm at a given point on the surface // replace a1-d1 G4ThreeVector nvec ( fDy1* fDz*(4*fDy1*std::cos(phi) + (fa1md1 + 4*fDy1*fTAlph)*std::sin(phi)), -(fDy1* fDz*((fa1md1 + 4*fDy1*fTAlph)*std::cos(phi) - 4*fDy1*std::sin(phi))), (fDy1*(-8*(fDx3minus1 + fDx4minus2)*fDy1 + fa1md1*(fDx2 + fDx3plus1 + fDx4)*fPhiTwist + 4*(fDx2 + fDx3plus1 + fDx4)*fDy1*fPhiTwist *fTAlph + 2*(fDx3minus1 + fDx4minus2) *(fa1md1 + 4*fDy1*fTAlph)*phi) + fPhiTwist*(16*fDy1*fDy1 + (fa1md1 + 4*fDy1*fTAlph) *(fa1md1 + 4*fDy1*fTAlph))*u + 4*fDy1*(fa1md1*fdeltaY - 4*fdeltaX*fDy1 + 4*fdeltaY*fDy1*fTAlph)* std::cos(phi) - 4*fDy1*(fa1md1*fdeltaX + 4*fDy1*(fdeltaY + fdeltaX*fTAlph))*std::sin(phi))/ 8. ) ; return nvec.unit(); }