// // ******************************************************************** // * DISCLAIMER * // * * // * The following disclaimer summarizes all the specific disclaimers * // * of contributors to this software. The specific disclaimers,which * // * govern, are listed with their locations in: * // * http://cern.ch/geant4/license * // * * // * 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. * // * * // * This code implementation is the intellectual property of the * // * GEANT4 collaboration. * // * By copying, distributing or modifying the Program (or any work * // * based on the Program) you indicate your acceptance of this * // * statement, and all its terms. * // ******************************************************************** // // // $Id: G4PolyPhiFace.icc,v 1.4 2002/10/28 11:47:50 gcosmo Exp $ // GEANT4 tag $Name: geant4-05-02 $ // // // -------------------------------------------------------------------- // GEANT 4 inline definitions file // // G4PolyPhiFace.icc // // Implementation of inline methods of G4PolyPhiFace // -------------------------------------------------------------------- inline G4VCSGface* G4PolyPhiFace::Clone() { return new G4PolyPhiFace(*this); } // ExactZOrder // // Decide precisely whether a trajectory passes to the left, right, or exactly // passes through the z position of a vertex point in our face. // // Result is only determined within an arbitrary (positive) factor. // > 0 to the right // < 0 to the left // = 0 exactly on top of // In 99.9999% of the cases, a trivial calculation is used. In difficult // cases, a precise, compliant calculation is relied on. // inline G4double G4PolyPhiFace::ExactZOrder( G4double z, G4double qx, G4double qy, G4double qz, const G4ThreeVector &v, G4double normSign, const G4PolyPhiFaceVertex *vert ) const { G4double answer = vert->z - z; if (fabs(answer) < kCarTolerance) { G4ThreeVector qa( qx - vert->x + radial.x(), qy - vert->y + radial.y(), qz - vert->z ), qb( qx - vert->x, qy - vert->y, qz - vert->z ); G4ThreeVector qacb = qa.cross(qb); answer = normSign*qacb.dot(v)*(normal.y()*radial.x()-normal.x()*radial.y()); } return answer; }