// // ******************************************************************** // * 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: G4Parabola.icc,v 1.5.4.1 2001/06/28 19:08:45 gunter Exp $ // GEANT4 tag $Name: $ // // -------------------------------------------------------------------- // GEANT 4 inline definitions file // // G4Parabola.icc // // Implementation of inline methods of G4Parabola // -------------------------------------------------------------------- inline void G4Parabola::Init(const G4Axis2Placement3D& position0, G4double focalDist0) { position= position0; focalDist= focalDist0; // focus F= position.GetLocation()+focalDist*position.GetPX(); // line L0= position.GetLocation()-focalDist*position.GetPX(); //l= position.GetPY(); } inline G4double G4Parabola::GetFocalDist() const { return focalDist; } ////////////////////////////////////////////////////////////////////////////// inline G4double G4Parabola::GetPMax() const { return -1; } inline G4Point3D G4Parabola::GetPoint(G4double param) const { return G4Point3D( position.GetLocation() + focalDist* (param*param*position.GetPX() + 2*param*position.GetPY()) ); } inline G4double G4Parabola::GetPPoint(const G4Point3D& pt) const { G4Point3D ptLocal= position.GetToPlacementCoordinates()*pt; return ptLocal.y()/(2*focalDist); } ////////////////////////////////////////////////////////////////////////////// /* #include "G4CurveRayIntersection.hh" inline void G4Parabola::IntersectRay2D(const G4Ray& ray, G4CurveRayIntersection& is) { is.Init(*this, ray); const G4Point3D& S= ray.GetStart(); const G4Vector3D& d= ray.GetDir(); const G4Vector3D& l= position.GetPY(); // a == 1 G4Vector3D SMinusF= S-F; G4double bHalf= SMinusF*d - (d.x()*l.y()-d.y()*l.x()); G4double c= SMinusF.mag2() + ( (S.x()-L0.x())*l.y() - (S.y()-L0.y())*l.x() ); G4double discr= bHalf*bHalf-c; if (discr >= 0) { // 2 intersections (maybe 1, but this case is rare) G4double sqrtdiscr= sqrt(discr); // find the smallest positive i G4double i= -bHalf-sqrtdiscr; if (i= 0) { // 2 intersections (maybe 1, but this case is rare) G4double sqrtdiscr= sqrt(discr); G4double i= -bHalf-sqrtdiscr; if (i>kCarTolerance) nbinter++; i= -bHalf+sqrtdiscr; if (i>kCarTolerance) nbinter++; } return nbinter++; }