FairRoot/PandaRoot
Public Member Functions | Private Attributes | List of all members
PndRadMapPlane Class Reference

#include <PndRadMapPlane.h>

Public Member Functions

 PndRadMapPlane ()
 
 PndRadMapPlane (TVector3 _corner1, TVector3 _corner2, TVector3 _corner3, double dist=0)
 
 PndRadMapPlane (Double_t dist, Double_t rot, orientation plane, axis ax)
 
TVector3 LineIntersection (TVector3 begline, TVector3 endline)
 
void SetNormal (TVector3 n)
 
void SetDistance (double d)
 
TVector3 GetCorner (int i)
 
TVector3 Corner1 ()
 
TVector3 Corner2 ()
 
TVector3 Corner3 ()
 
double Distance ()
 
TVector3 Normal ()
 

Private Attributes

TVector3 normal
 
TVector3 corner1
 
TVector3 corner2
 
TVector3 corner3
 
TVector3 _axis
 
double distance
 

Detailed Description

Definition at line 12 of file PndRadMapPlane.h.

Constructor & Destructor Documentation

PndRadMapPlane::PndRadMapPlane ( )

Definition at line 17 of file PndRadMapPlane.cxx.

References corner1, corner2, corner3, SetDistance(), and SetNormal().

17  {
18  SetNormal(TVector3(0, 0, 0));
19  SetDistance(0);
20  corner1 = TVector3(0, 0, 0);
21  corner2 = TVector3(0, 0, 0);
22  corner3 = TVector3(0, 0, 0);
23 }
void SetNormal(TVector3 n)
TVector3 corner2
TVector3 corner3
void SetDistance(double d)
TVector3 corner1
PndRadMapPlane::PndRadMapPlane ( TVector3  _corner1,
TVector3  _corner2,
TVector3  _corner3,
double  dist = 0 
)

Definition at line 25 of file PndRadMapPlane.cxx.

References corner1, corner2, corner3, n, SetDistance(), and SetNormal().

26  {
27  corner1 = _corner1;
28  corner2 = _corner2;
29  corner3 = _corner3;
30  TVector3 dpv1 = corner2-corner1;
31  TVector3 dpv2 = corner3-corner1;
32  TVector3 n = (dpv1.Cross(dpv2)).Unit();
33  SetNormal(n);
34  SetDistance(dist);
35 }
int n
void SetNormal(TVector3 n)
TVector3 corner2
TVector3 corner3
void SetDistance(double d)
TVector3 corner1
PndRadMapPlane::PndRadMapPlane ( Double_t  dist,
Double_t  rot,
orientation  plane,
axis  ax 
)

Definition at line 37 of file PndRadMapPlane.cxx.

References _axis, corner1, corner2, corner3, n, SetNormal(), Xx, XY, XZ, YX, Yy, YZ, ZX, ZY, and Zz.

37  {
38 
39  // TVector3 corner1, corner2, corner3, axis;
40  switch (plane){
41  case XY: case YX:
42  corner1.SetXYZ( 1, 1, dist);
43  corner2.SetXYZ(-1, 1, dist);
44  corner3.SetXYZ(-1, -1, dist);
45  break;
46 
47  case XZ: case ZX:
48  corner1.SetXYZ( 1, dist, 1);
49  corner2.SetXYZ( -1, dist, 1);
50  corner3.SetXYZ( -1, dist, -1);
51  break;
52 
53  case YZ: case ZY:
54  corner1.SetXYZ(dist, 1, 1);
55  corner2.SetXYZ(dist, -1, 1);
56  corner3.SetXYZ(dist,- 1, -1);
57  break;
58  };
59 
60  switch (ax){
61  case Xx:
62  _axis.SetXYZ(1, 0, 0);
63  break;
64  case Yy:
65  _axis.SetXYZ(0, 1, 0);
66  break;
67  case Zz:
68  _axis.SetXYZ(0, 0, 1);
69  break;
70  };
71 
72  corner1.Rotate(rot, _axis);
73  corner2.Rotate(rot, _axis);
74  corner3.Rotate(rot, _axis);
75 
76  TVector3 dpv1 = corner2-corner1;
77  TVector3 dpv2 = corner3-corner1;
78  TVector3 n = (dpv1.Cross(dpv2)).Unit();
79  SetNormal(n);
80 }
int n
void SetNormal(TVector3 n)
TVector3 corner2
TVector3 corner3
TGeoRotation rot
TVector3 corner1

Member Function Documentation

TVector3 PndRadMapPlane::Corner1 ( )
inline

Definition at line 21 of file PndRadMapPlane.h.

References corner1.

Referenced by GetCorner().

21 {return corner1;};
TVector3 corner1
TVector3 PndRadMapPlane::Corner2 ( )
inline

Definition at line 22 of file PndRadMapPlane.h.

References corner2.

Referenced by GetCorner().

22 {return corner2;};
TVector3 corner2
TVector3 PndRadMapPlane::Corner3 ( )
inline

Definition at line 23 of file PndRadMapPlane.h.

References corner3.

Referenced by GetCorner().

23 {return corner3;};
TVector3 corner3
double PndRadMapPlane::Distance ( )
inline

Definition at line 24 of file PndRadMapPlane.h.

References distance.

24 {return distance;};
TVector3 PndRadMapPlane::GetCorner ( int  i)

Definition at line 82 of file PndRadMapPlane.cxx.

References Corner1(), Corner2(), and Corner3().

82  {
83  switch(i){
84  case 1:
85  return Corner1();
86  case 2:
87  return Corner2();
88  case 3:
89  return Corner3();
90  default:
91  return TVector3(0, 0, 0);
92  }
93 }
TVector3 Corner2()
Int_t i
Definition: run_full.C:25
TVector3 Corner3()
TVector3 Corner1()
TVector3 PndRadMapPlane::LineIntersection ( TVector3  begline,
TVector3  endline 
)

Definition at line 97 of file PndRadMapPlane.cxx.

References corner1, and normal.

Referenced by PndRadMapBoxMesh::CalcFluence(), and PndRadMapBoxMesh::Fill().

97  {
98  // plane: (p-corner1)*n = 0
99  // line: p=t*(end-beg)+beg
100  // (t*(end-beg) + beg - corner1)*n=0
101  // t*(end-beg)*n+(beg-corner1)*n=0
102  // n*(corner1-beg)/(n*(end-beg))=t
103  TVector3 diffl = endline-begline;
104  float nDotBeg = normal*(corner1-begline);
105  float nDotDiff = normal*diffl;
106  float tt = nDotBeg/nDotDiff;
107 
108  TVector3 ixp = begline + tt*diffl;
109 
110  return ixp;
111 
112 }
TVector3 corner1
TVector3 PndRadMapPlane::Normal ( )
inline

Definition at line 25 of file PndRadMapPlane.h.

25 {return normal;};
void PndRadMapPlane::SetDistance ( double  d)
inline

Definition at line 19 of file PndRadMapPlane.h.

References d, and distance.

Referenced by PndRadMapPlane().

19 {distance = d;};
TObjArray * d
void PndRadMapPlane::SetNormal ( TVector3  n)
inline

Definition at line 18 of file PndRadMapPlane.h.

References n, and normal.

Referenced by PndRadMapPlane().

18 {normal = n;};
int n

Member Data Documentation

TVector3 PndRadMapPlane::_axis
private

Definition at line 31 of file PndRadMapPlane.h.

Referenced by PndRadMapPlane().

TVector3 PndRadMapPlane::corner1
private

Definition at line 28 of file PndRadMapPlane.h.

Referenced by Corner1(), LineIntersection(), and PndRadMapPlane().

TVector3 PndRadMapPlane::corner2
private

Definition at line 29 of file PndRadMapPlane.h.

Referenced by Corner2(), and PndRadMapPlane().

TVector3 PndRadMapPlane::corner3
private

Definition at line 30 of file PndRadMapPlane.h.

Referenced by Corner3(), and PndRadMapPlane().

double PndRadMapPlane::distance
private

Definition at line 32 of file PndRadMapPlane.h.

Referenced by Distance(), and SetDistance().

TVector3 PndRadMapPlane::normal
private

Definition at line 25 of file PndRadMapPlane.h.

Referenced by LineIntersection(), and SetNormal().


The documentation for this class was generated from the following files: