35 :fO(o),fU(u),fV(v),fFinitePlane(finite)
44 fU.SetXYZ(r.Uniform(),r.Uniform(),0.);
45 fV.SetXYZ(r.Uniform(),r.Uniform(),0.);
68 if (
this == &rhs)
return *
this;
142 TVector3 result=
fU.Cross(
fV);
160 if( fabs(n.X()) > 0.1 ){
161 fU.SetXYZ(1./n.X()*(-1.*n.Y()-1.*n.Z()),1.,1.);
165 if(fabs(n.Y()) > 0.1){
166 fU.SetXYZ(1.,1./n.Y()*(-1.*n.X()-1.*n.Z()),1.);
170 fU.SetXYZ(1.,1.,1./n.Z()*(-1.*n.X()-1.*n.Y()));
178 TVector3
n(TMath::Sin(theta)*TMath::Cos(phi),TMath::Sin(theta)*TMath::Sin(phi),TMath::Cos(theta));
187 return TVector2(xfU,xfV);
212 TVector3 xplane=
toLab(p);
221 throw GFException(
"genf::GFDetPlane::sane() sanity check failed", __LINE__, __FILE__).
setFatal();
233 v.Rotate(TMath::Pi()*0.5,n);
235 if (null.Mag() >= 1
E-6)
236 throw GFException(
"genf::GFDetPlane::sane(): non orthogonal!", __LINE__, __FILE__).
setFatal();
245 <<
"O("<<
fO.X()<<
","<<
fO.Y()<<
","<<
fO.Z()<<
") " 246 <<
"u("<<
fU.X()<<
","<<
fU.Y()<<
","<<
fU.Z()<<
") " 247 <<
"v("<<
fV.X()<<
","<<
fV.Y()<<
","<<
fV.Z()<<
") " 264 #define DETPLANE_EPSILON 1.E-5 285 return !(lhs == rhs);
290 *pl =
new TPolyMarker3D(21*21,24);
291 (*pl)->SetMarkerSize(0.1);
292 (*pl)->SetMarkerColor(kBlue);
295 *plLine =
new TPolyLine3D(5);
301 linevec=(
fO+(mesh*i)*
fU+(mesh*j)*
fV);
302 (*plLine)->SetPoint(0,linevec.X(),linevec.Y(),linevec.Z());
304 linevec=(
fO+(mesh*i)*
fU+(mesh*j)*
fV);
305 (*plLine)->SetPoint(0,linevec.X(),linevec.Y(),linevec.Z());
307 linevec=(
fO+(mesh*i)*
fU+(mesh*j)*
fV);
308 (*plLine)->SetPoint(2,linevec.X(),linevec.Y(),linevec.Z());
310 linevec=(
fO+(mesh*i)*
fU+(mesh*j)*
fV);
311 (*plLine)->SetPoint(1,linevec.X(),linevec.Y(),linevec.Z());
313 linevec=(
fO+(mesh*i)*
fU+(mesh*j)*
fV);
314 (*plLine)->SetPoint(4,linevec.X(),linevec.Y(),linevec.Z());
317 for (
int i=-1*nI;i<=nI;++i){
318 for (
int j=-1*nJ;j<=nJ;++j){
319 TVector3 vec(
fO+(mesh*i)*
fU+(mesh*j)*
fV);
320 int id=(i+10)*21+j+10;
321 (*pl)->SetPoint(
id,vec.X(),vec.Y(),vec.Z());
326 *u =
new TPolyLine3D(2);
327 (*u)->SetPoint(0,
fO.X(),
fO.Y(),
fO.Z());
328 (*u)->SetPoint(1,
fO.X()+length*
fU.X(),
fO.Y()+length*
fU.Y(),
fO.Z()+length*
fU.Z());
329 (*u)->SetLineWidth(2);
330 (*u)->SetLineColor(kGreen);
333 *v =
new TPolyLine3D(2);
334 (*v)->SetPoint(0,
fO.X(),
fO.Y(),
fO.Z());
335 (*v)->SetPoint(1,
fO.X()+length*
fV.X(),
fO.Y()+length*
fV.Y(),
fO.Z()+length*
fV.Z());
336 (*v)->SetLineWidth(2);
337 (*v)->SetLineColor(kRed);
340 *n =
new TPolyLine3D(2);
342 (*n)->SetPoint(0,
fO.X(),
fO.Y(),
fO.Z());
343 (*n)->SetPoint(1,
fO.X()+length*_n.X(),
fO.Y()+length*_n.Y(),
fO.Z()+length*_n.Z());
344 (*n)->SetLineWidth(2);
345 (*n)->SetLineColor(kBlue);
350 double s = (v -
fO)*
fU;
351 double t = (v -
fO)*
fV;
352 TVector3 distanceVector = v -
fO - (s*
fU) - (t*
fV);
353 return distanceVector.Mag();
357 double s = (v -
fO)*
fU;
358 double t = (v -
fO)*
fV;
359 TVector3 distanceVector = v -
fO - (s*
fU) - (t*
fV);
360 return distanceVector.Mag();
364 TVector3 dirNorm(dir);
367 double dirTimesN = dirNorm*normal;
368 if(fabs(dirTimesN)<1.
E-6){
370 return TVector2(1.E100,1.E100);
372 double t = 1/dirTimesN * ((
fO-point)*normal);
373 return project(point -
fO + t * dirNorm);
void set(const TVector3 &o, const TVector3 &u, const TVector3 &v)
void setON(const TVector3 &o, const TVector3 &n)
void setU(const TVector3 &u)
GFDetPlane & operator=(const genf::GFDetPlane &)
bool operator!=(const genf::GFDetPlane &, const genf::GFDetPlane &)
void getGraphics(double mesh, double length, TPolyMarker3D **pl, TPolyLine3D **plLine, TPolyLine3D **u, TPolyLine3D **v, TPolyLine3D **n=NULL)
for poor attempts of making an event display. There is a lot of room for improvements.
TVector3 dist(const TVector3 &point) const
void setO(const TVector3 &o)
void setUV(const TVector3 &u, const TVector3 &v)
void Print(std::ostream &out=std::cout) const
TVector2 project(const TVector3 &x) const
projecting a direction onto the plane:
virtual void Print(std::ostream &out=std::cout) const =0
TVector3 getNormal() const
void setV(const TVector3 &v)
double distance(TVector3 &) const
bool operator==(const genf::GFDetPlane &, const genf::GFDetPlane &)
genf::GFAbsFinitePlane * fFinitePlane
TVector3 toLab(const TVector2 &x) const
transform from plane coordinates to lab system
TVector2 LabToPlane(const TVector3 &x) const
transform from Lab system into plane
TVector2 straightLineToPlane(const TVector3 &point, const TVector3 &dir) const
gives u,v coordinates of the intersection point of a straight line with plane
Exception class for error handling in GENFIT (provides storage for diagnostic information) ...
void setNormal(TVector3 n)
GFException & setFatal(bool b=true)
set fatal flag. if this is true, the fit stops for this current track repr.
virtual GFAbsFinitePlane * clone() const =0
Deep copy ctor for polymorphic class.
GFDetPlane(genf::GFAbsFinitePlane *finite=NULL)