GENFIT
Rev:NoNumberAvailable
|
Go to the documentation of this file.
47 :o_(o), u_(u), v_(v), finitePlane_(finite)
55 :o_(o), finitePlane_(finite)
87 std::swap(this->
o_, other.
o_);
88 std::swap(this->
u_, other.
u_);
89 std::swap(this->
v_, other.
v_);
173 setNormal( TVector3(TMath::Sin(theta)*TMath::Cos(phi),TMath::Sin(theta)*TMath::Sin(phi),TMath::Cos(theta)) );
179 return TVector2(
u_*x,
v_*x);
212 if (
u_.Dot(
v_) < 1.E-5)
return;
222 <<
"O("<<
o_.X()<<
", "<<
o_.Y()<<
", "<<
o_.Z()<<
") "
223 <<
"u("<<
u_.X()<<
", "<<
u_.Y()<<
", "<<
u_.Z()<<
") "
224 <<
"v("<<
v_.X()<<
", "<<
v_.Y()<<
", "<<
v_.Z()<<
") "
243 static const double detplaneEpsilon = 1.E-5;
245 fabs( (lhs.
o_.X()-rhs.
o_.X()) ) > detplaneEpsilon ||
246 fabs( (lhs.
o_.Y()-rhs.
o_.Y()) ) > detplaneEpsilon ||
247 fabs( (lhs.
o_.Z()-rhs.
o_.Z()) ) > detplaneEpsilon
250 fabs( (lhs.
u_.X()-rhs.
u_.X()) ) > detplaneEpsilon ||
251 fabs( (lhs.
u_.Y()-rhs.
u_.Y()) ) > detplaneEpsilon ||
252 fabs( (lhs.
u_.Z()-rhs.
u_.Z()) ) > detplaneEpsilon
255 fabs( (lhs.
v_.X()-rhs.
v_.X()) ) > detplaneEpsilon ||
256 fabs( (lhs.
v_.Y()-rhs.
v_.Y()) ) > detplaneEpsilon ||
257 fabs( (lhs.
v_.Z()-rhs.
v_.Z()) ) > detplaneEpsilon
269 return fabs( (point.X()-
o_.X()) * (
u_.Y()*
v_.Z() -
u_.Z()*
v_.Y()) +
270 (point.Y()-
o_.Y()) * (
u_.Z()*
v_.X() -
u_.X()*
v_.Z()) +
271 (point.Z()-
o_.Z()) * (
u_.X()*
v_.Y() -
u_.Y()*
v_.X()));
276 return fabs( (x-
o_.X()) * (
u_.Y()*
v_.Z() -
u_.Z()*
v_.Y()) +
277 (y-
o_.Y()) * (
u_.Z()*
v_.X() -
u_.X()*
v_.Z()) +
278 (z-
o_.Z()) * (
u_.X()*
v_.Y() -
u_.Y()*
v_.X()));
283 TVector3 dirNorm(dir.Unit());
285 double dirTimesN = dirNorm*normal;
286 if(fabs(dirTimesN)<1.E-6){
287 return TVector2(1.E100,1.E100);
289 double t = 1./dirTimesN * ((
o_-point)*normal);
290 return project(point -
o_ + t * dirNorm);
296 const double& dirX,
const double& dirY,
const double& dirZ,
297 double& u,
double& v)
const {
300 double dirTimesN = dirX*W.X() + dirY*W.Y() + dirZ*W.Z();
301 if(fabs(dirTimesN)<1.E-6){
306 double t = 1./dirTimesN * ((
o_.X()-posX)*W.X() +
307 (
o_.Y()-posY)*W.Y() +
308 (
o_.Z()-posZ)*W.Z());
310 double posOnPlaneX = posX-
o_.X() + t*dirX;
311 double posOnPlaneY = posY-
o_.Y() + t*dirY;
312 double posOnPlaneZ = posZ-
o_.Z() + t*dirZ;
314 u =
u_.X()*posOnPlaneX +
u_.Y()*posOnPlaneY +
u_.Z()*posOnPlaneZ;
315 v =
v_.X()*posOnPlaneX +
v_.Y()*posOnPlaneY +
v_.Z()*posOnPlaneZ;
321 u_.Rotate(angle, normal);
322 v_.Rotate(angle, normal);
336 void DetPlane::Streamer(TBuffer &R__b)
342 typedef ::genfit::DetPlane thisClass;
344 if (R__b.IsReading()) {
345 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
if (R__v) { }
356 TClass* cl = TClass::Load(R__b);
357 AbsFinitePlane *p = (AbsFinitePlane*)(cl->New());
358 cl->Streamer(p, R__b);
361 R__b.CheckByteCount(R__s, R__c, thisClass::IsA());
363 R__c = R__b.WriteVersion(thisClass::IsA(), kTRUE);
404 R__b.SetByteCount(R__c, kTRUE);
void Print(const Option_t *="") const
TVector2 straightLineToPlane(const TVector3 &point, const TVector3 &dir) const
gives u,v coordinates of the intersection point of a straight line with plane
TVector2 LabToPlane(const TVector3 &x) const
transform from Lab system into plane
TVector3 getNormal() const
void setV(const TVector3 &v)
Defines for I/O streams used for error and debug printing.
bool operator!=(const DetPlane &lhs, const DetPlane &rhs)
void set(const TVector3 &o, const TVector3 &u, const TVector3 &v)
void rotate(double angle)
rotate u and v around normal. Angle is in rad. More for debugging than for actual use.
boost::scoped_ptr< AbsFinitePlane > finitePlane_
double distance(const TVector3 &point) const
absolute distance from a point to the plane
TVector3 dist(const TVector3 &point) const
void reset()
delete finitePlane_ and set O, U, V to default values
void setON(const TVector3 &o, const TVector3 &n)
void setO(const TVector3 &o)
DetPlane(AbsFinitePlane *finite=NULL)
DetPlane & operator=(DetPlane)
void sane()
ensures orthonormal coordinates
Abstract base class for finite detector planes.
TVector3 toLab(const TVector2 &x) const
transform from plane coordinates to lab system
bool operator==(const DetPlane &lhs, const DetPlane &rhs)
void swap(DetPlane &other)
void setU(const TVector3 &u)
void setNormal(const TVector3 &n)
TVector2 project(const TVector3 &x) const
projecting a direction onto the plane:
void setUV(const TVector3 &u, const TVector3 &v)