14#include "MucGeomSvc/MucGeometron.h"
28 const Hep3Vector vectLine,
35 Hep3Vector lineDir = vectLine;
38 Hep3Vector planeDir(plane.a(), plane.b(), plane.c());
46 double distance, denominator;
48 denominator = planeDir.dot(lineDir);
50 if( denominator != 0 ) {
53 (planeDir.dot(basePoint)) / denominator;
54 cross = linePoint + lineDir * distance;
67 const Hep3Vector vectLine,
69 const Hep3Vector vectLineSigma,
75 Hep3Vector lineDir = vectLine;
78 Hep3Vector planeDir(plane.a(), plane.b(), plane.c());
84 double distance, denominator;
86 denominator = planeDir.dot(lineDir);
87 if( denominator != 0 ) {
89 (planeDir.dot(basePoint)) / denominator;
90 cross = linePoint + lineDir * distance;
94 double x0 = pLine.x();
95 double y0 = pLine.y();
96 double z0 = pLine.z();
98 double vx = vectLine.x();
99 double vy = vectLine.y();
100 double vz = vectLine.z();
102 double dx0 = pLineSigma.x();
103 double dy0 = pLineSigma.y();
104 double dz0 = pLineSigma.z();
106 double dvx = vectLineSigma.x();
107 double dvy = vectLineSigma.y();
108 double dvz = vectLineSigma.z();
110 double pa = plane.a();
111 double pb = plane.b();
112 double pc = plane.c();
114 double Const1 = planeDir.dot(planePoint);
115 double Const2 = pa*vx + pb*vy + pc*vz;
116 double Const3 = pa*x0 + pb*y0 + pc*z0;
119 double sigmaX_1 = dx0 * dx0 * ( pb * vy + pc * vz ) / Const2;
120 double sigmaX_2 = (-1) * dy0 * dy0 * pb * vx / Const2;
121 double sigmaX_3 = (-1) * dz0 * dz0 * pc * vx / Const2;
122 double sigmaX_4 = dvx * dvx * ( Const1 - Const3) * ( pb * vy + pc * vz) / Const2 / Const2;
123 double sigmaX_5 = (-1) * dvy * dvy * vx * ( Const1 - Const3) * pb / Const2 / Const2;
124 double sigmaX_6 = (-1) * dvz * dvz * vx * ( Const1 - Const3) * pc / Const2 / Const2;
126 double sigmaX = sigmaX_1 + sigmaX_2 + sigmaX_3 + sigmaX_4 + sigmaX_5 + sigmaX_6;
128 double sigmaY_1 = (-1) * dx0 * dx0 * pa * vy / Const2;
129 double sigmaY_2 = dy0 * dy0 * ( 1 - pb * vy / Const2);
130 double sigmaY_3 = (-1) * dz0 * dz0 * pc * vy / Const2;
131 double sigmaY_4 = (-1) * dvx * dvx * ( Const1 - Const3) * pa * vy / Const2 / Const2;
132 double sigmaY_5 = dvy * dvy * ( Const1 - Const3) * ( pa * vx + pc * vz) / Const2 / Const2;
133 double sigmaY_6 = (-1) * dvz * dvz * ( Const1 - Const3) * pc * vy / Const2 / Const2;
135 double sigmaY = sigmaY_1 + sigmaY_2 + sigmaY_3 + sigmaY_4 + sigmaY_5 + sigmaY_6;
137 double sigmaZ_1 = (-1) * dx0 * dx0 * pa * vz / Const2;
138 double sigmaZ_2 = (-1) * dy0 * dy0 * pb * vz / Const2;
139 double sigmaZ_3 = dz0 * dz0 * ( 1 - pc * vz / Const2);
140 double sigmaZ_4 = (-1) * dvx * dvx * ( Const1 - Const3) * pa * vz / Const2 / Const2;
141 double sigmaZ_5 = (-1) * dvy * dvy * ( Const1 - Const3) * pb * vz / Const2 / Const2;
142 double sigmaZ_6 = dvz * dvz * ( Const1 - Const3) * ( pa * vx + pb * vy) / Const2 / Const2;
144 double sigmaZ = sigmaZ_1 + sigmaZ_2 + sigmaZ_3 + sigmaZ_4 + sigmaZ_5 + sigmaZ_6;
174 Hep3Vector planeDir(plane.a(), plane.b(), plane.c());
177 A = plane.a(); B = plane.b();
C = plane.c();
178 D = planeDir.dot(planePoint);
188 float b2sub4ac = b1*b1 - 4*a1*c1;
192 float x1, x2, y1, y2, z1, z2;
196 x1 = (-b1+sqrt(b2sub4ac))/(2*a1);
197 x2 = (-b1-sqrt(b2sub4ac))/(2*a1);
198 y1 = a*x1*x1 + b*x1 + c;
199 y2 = a*x2*x2 + b*x2 + c;
202 cross1.set(x1, y1, z1);
203 cross2.set(x2, y2, z2);
208 cross1.set(-9999,-9999,-9999);
209 cross2.set(-9999,-9999,-9999);
214 y1 = a*x1*x1 + b*x1 + c;
216 cross1.set(x1, y1, z1);
217 cross2.set(x1, y1, z1);
247 Hep3Vector planeDir(plane.a(), plane.b(), plane.c());
250 A = plane.a(); B = plane.b();
C = plane.c();
251 D = planeDir.dot(planePoint);
255 float a1 = (B+
C/vy)*a;
256 float b1 = (B+
C/vy)*b + A;
257 float c1 = (B+
C/vy)*c -
C/y0 - D;
259 float b2sub4ac = b1*b1 - 4*a1*c1;
261 float x1, x2, y1, y2, z1, z2;
265 x1 = (-b1+sqrt(b2sub4ac))/(2*a1);
266 x2 = (-b1-sqrt(b2sub4ac))/(2*a1);
267 y1 = a*x1*x1 + b*x1 + c;
268 y2 = a*x2*x2 + b*x2 + c;
273 cross1.set(x1, y1, z1);
274 cross2.set(x2, y2, z2);
279 cross1.set(-9999,-9999,-9999);
280 cross2.set(-9999,-9999,-9999);
285 y1 = a*x1*x1 + b*x1 + c;
288 cross1.set(x1, y1, z1);
289 cross2.set(x1, y1, z1);
EvtVector3R cross(const EvtVector3R &p1, const EvtVector3R &p2)
HepGeom::Plane3D< double > HepPlane3D
***************************************************************************************Pseudo Class RRes *****************************************************************************************Parameters and physical constants **Maarten sept ************************************************************************DOUBLE PRECISION xsmu **************************************************************************PARTICLE DATA all others are from PDG *Only resonances with known widths into electron pairs are sept ************************************************************************C Declarations C
MucGeometron()
Constructor.
bool GetIntersectionQuadPlane(const HepPoint3D pLine, const float vy, const float y0, const float a, const float b, const float c, const HepPlane3D plane, HepPoint3D &cross1, HepPoint3D &cross2)
bool GetIntersectionLinePlane(const HepPoint3D pLine, const Hep3Vector vectLine, const HepPlane3D plane, HepPoint3D &cross)
Get intersection of a line and a plane.
bool GetIntersectionQuadPlaneLocal(const int part, const int orient, const float a, const float b, const float c, const HepPlane3D plane, HepPoint3D &cross1, HepPoint3D &cross2)
bool GetIntersectionLinePlaneWithSigma(const HepPoint3D pLine, const Hep3Vector vectLine, const HepPoint3D pLineSigma, const Hep3Vector vectLineSigma, const HepPlane3D plane, HepPoint3D &cross, HepPoint3D &crossSigma)
~MucGeometron()
Destructor.