#include using std::cout; using std::cerr; using std::cin; using std::endl; #include using std::valarray; #include using std::fstream; #include using std::string; #include using std::list; #include using std::vector; #include "TVector3.h" #include "TRotation.h" #include "TRandom.h" #include "TMatrixD.h" #include "TVectorD.h" #include "TDecompSVD.h" #include "Math/Vector3D.h" using ROOT::Math::XYZVector; #include "Math/Point3D.h" using ROOT::Math::XYZPoint; #include "Math/Transform3D.h" using ROOT::Math::Transform3D; #include "Math/RotationX.h" using ROOT::Math::RotationX; #include "Math/RotationY.h" using ROOT::Math::RotationY; #include "Math/RotationZ.h" using ROOT::Math::RotationZ; #include "Math/Rotation3D.h" using ROOT::Math::Rotation3D; #include "DrcPhoton.h" #include "DrcOptReflAbs.h" #include "DrcSurfAbs.h" #include "DrcSurfPolyFlat.h" #include "DrcSurfPolySphere.h" #include "DrcSurfPolyPara.h" #include "DrcOptMatAbs.h" #include "DrcOptDev.h" //---------------------------------------------------------------------- DrcSurfPolyPara::DrcSurfPolyPara() { m_radius = -999; m_checked = false; } //---------------------------------------------------------------------- DrcSurfPolyPara* DrcSurfPolyPara::clone() const { return new DrcSurfPolyPara(*this); } //---------------------------------------------------------------------- void DrcSurfPolyPara::copy(const DrcSurfPolyPara& s) { m_radius = s.m_radius; m_checked = s.m_checked; m_trans = s.m_trans; m_transInv = s.m_transInv; } //---------------------------------------------------------------------- DrcSurfPolyPara::DrcSurfPolyPara(const DrcSurfPolyPara& s) : DrcSurfPolyFlat(s) { if (s.m_verbosity>=1) cout<<" DrcSurfPolyPara::DrcSurfPolyPara" <<"(const DrcSurfPolyPara&) name,copy: " <=1) cout<<" DrcSurfPolyPara::operator=" <<"(const DrcSurfPolyPara&) name,copy: " <((*this)) = s; // assignment of base class part. copy(s); } return *this; } //---------------------------------------------------------------------- XYZVector DrcSurfPolyPara::normal(const XYZPoint& point) const { if (!m_checked) m_checked = check();// check dimensions // transform point back, where paraboloid was defined. XYZPoint p1(m_transInv*point); // unit vector from focal point to point XYZVector v1 = (p1 - XYZPoint(0,0,m_radius/2)).Unit(); // unit vector parallel to z-axis hitting point XYZVector v2 = XYZVector(0,0,fabs(p1.Z())).Unit(); XYZVector pn(v1+v2); return (m_trans*pn).Unit(); } //---------------------------------------------------------------------- bool DrcSurfPolyPara::surfaceHit(DrcPhoton& ph, XYZPoint& pos_new, double& path_length) const { //cout<<" DrcSurfPolyPara::surfaceHit"<eps && lambda2>eps) { // check both solutions XYZPoint pos_new1 = pos + lambda1*dir; XYZPoint pos_check(pos_new); pos_check.SetZ(0); bool hit1 = withinSurface(pos_check); XYZPoint pos_new2 = pos + lambda2*dir; pos_check = pos_new2; pos_check.SetZ(0); bool hit2 = withinSurface(pos_check); if (hit1 && hit2) { // take closest lambda = (lambda1eps && lambda2<=eps) { lambda = lambda1; } else if (lambda1<=eps && lambda2>eps) { lambda = lambda2; } else { //cout<<" both lambdas <0"<=3) cout<<" DrcSurfPolyPara::addTransform() name="<(m_p.size()-1) || i<0) { cerr<<" *** DrcSurfPolyPara::limitingPoint: index out of range, i="<SetPoint("<<(icnt++)<<"," <SetPoint("<<(icnt++)<<"," <SetLineColor("<Draw();"<