FairRoot/PandaRoot
PndSttGeomPoint.cxx
Go to the documentation of this file.
1 #include "PndSttGeomPoint.h"
2 // #include "PndSttGeomHelix.h"
3 #include "TPolyLine3D.h"
4 
6 {
7  fX = other.fX;
8  fY = other.fY;
9  fZ = other.fZ;
10 
11  fErrorX = other.fErrorX;
12  fErrorY = other.fErrorY;
13  fErrorZ = other.fErrorZ;
14 }
15 
17 {
18 }
19 
21  fX(other.fX),
22  fY(other.fY),
23  fZ(other.fZ),
24  fErrorX(other.fErrorX),
25  fErrorY(other.fErrorY),
26  fErrorZ(other.fErrorZ)
27 {
28 }
29 
30 /* ???
31 void PndSttGeomPoint::operator=(PndSttGeomPoint const &other)
32 {
33  return *this;
34 }
35 */
36 
38  fX(0),
39  fY(0),
40  fZ(0),
41  fErrorX(0),
42  fErrorY(0),
43  fErrorZ(0)
44 {
45 }
46 
48  fX(x),
49  fY(y),
50  fZ(z),
51  fErrorX(dx),
52  fErrorY(dy),
53  fErrorZ(dz)
54 {
55 }
56 
57 
59 {
60  fX += x;
61  fY += y;
62  fZ += z;
63 }
64 
66 {
67 }
68 
70 {
71  Bool_t
72  retval = kTRUE;
73 
74  if (fabs(fZ) > 0.)
75  retval = kFALSE;
76 
77  return retval;
78 }
79 
80 void PndSttGeomPoint::Draw(Double_t size, Int_t color) const
81 {
82  Double_t
83  xstartx[2] = {fX - size, fX + size},
84  ystartx[2] = {fX, fX},
85  zstartx[2] = {fX, fX};
86 
87  Double_t
88  xstarty[2] = {fY, fY},
89  ystarty[2] = {fY - size, fY + size},
90  zstarty[2] = {fY, fY};
91 
92  Double_t
93  xstartz[2] = {fZ, fZ},
94  ystartz[2] = {fZ, fZ},
95  zstartz[2] = {fZ - size, fZ + size};
96 
97 
98  TPolyLine3D
99  *xstart = new TPolyLine3D(2, xstartx, xstarty, xstartz),
100  *ystart = new TPolyLine3D(2, ystartx, ystarty, ystartz),
101  *zstart = new TPolyLine3D(2, zstartx, zstarty, zstartz);
102 
103  xstart->SetLineColor(color);
104  xstart->Draw();
105  ystart->SetLineColor(color);
106  ystart->Draw();
107  zstart->SetLineColor(color);
108  zstart->Draw();
109 }
110 
112 {
113  Bool_t
114  betweenX = kFALSE,
115  betweenY = kFALSE,
116  betweenZ = kFALSE,
117  retval = kFALSE;
118 
119  if (((firstPoint.GetX() < fX) && (fX < secondPoint.GetX())) ||
120  ((firstPoint.GetX() > fX) && (fX > secondPoint.GetX())))
121  {
122  betweenX = kTRUE;
123  }
124 
125  if (((firstPoint.GetY() < fY) && (fY < secondPoint.GetY())) ||
126  ((firstPoint.GetY() > fY) && (fY > secondPoint.GetY())))
127  {
128  betweenY = kTRUE;
129  }
130 
131  if (((firstPoint.GetZ() < fZ) && (fZ < secondPoint.GetZ())) ||
132  ((firstPoint.GetZ() > fZ) && (fZ > secondPoint.GetZ())))
133  {
134  betweenZ = kTRUE;
135  }
136 
137  if (betweenX && betweenY && betweenZ)
138  {
139  retval = kTRUE;
140  }
141 
142  return retval;
143 }
144 
145 // Double_t PndSttGeomPoint::DistanceTo(PndSttGeomHelix myHelix) const
146 // {
147 // return myHelix.DistanceTo(*this);
148 // }
149 
151 {
152  return sqrt(((myPoint.GetX() - fX) * (myPoint.GetX() - fX)) +
153  ((myPoint.GetY() - fY) * (myPoint.GetY() - fY)) +
154  ((myPoint.GetZ() - fZ) * (myPoint.GetZ() - fZ)));
155 }
156 
157 // Double_t PndSttGeomPoint::DistanceTo(PndSttGeomLine myLine) const
158 // {
159 // return myLine.DistanceTo(*this);
160 // }
161 
163 
164 
double dy
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
Double_t fX
Definition: PndCaloDraw.cxx:34
Double_t DistanceTo(PndSttGeomPoint myPoint) const
Double_t fZ
Definition: PndCaloDraw.cxx:34
virtual ~PndSttGeomPoint()
void Transform(Double_t x, Double_t y, Double_t z)
void Draw(Double_t size=0.5, Int_t color=1) const
Double_t
Bool_t IsBetween(PndSttGeomPoint thisCenter, PndSttGeomPoint otherCenter) const
Double_t GetY() const
Double_t z
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
void Copy(PndSttGeomPoint const &other)
double dx
Double_t fY
Definition: PndCaloDraw.cxx:34
Double_t x
ClassImp(PndAnaContFact)
Double_t GetX() const
Double_t GetZ() const
Double_t y
Bool_t Is2D() const