PandaRoot
GFDetPlane.h
Go to the documentation of this file.
1 /* Copyright 2008-2010, Technische Universitaet Muenchen,
2  Authors: Christian Hoeppner & Sebastian Neubert
3 
4  This file is part of GENFIT.
5 
6  GENFIT is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published
8  by the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  GENFIT is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with GENFIT. If not, see <http://www.gnu.org/licenses/>.
18 */
19 // Description:
20 // Detector plane - a geometric object
31 #ifndef GFDETPLANE_H
32 #define GFDETPLANE_H
33 
34 #include "GFAbsFinitePlane.h"
35 
36 #include "TObject.h"
37 
38 #include "TVector3.h"
39 #include "TPolyMarker3D.h"
40 #include "TPolyLine3D.h"
41 
58 class GFDetPlane : public TObject {
59  public:
60  // Constructors/Destructors ---------
61  GFDetPlane(GFAbsFinitePlane *finite = nullptr);
62  GFDetPlane(const TVector3 &o, const TVector3 &u, const TVector3 &v, GFAbsFinitePlane *finite = nullptr);
63  GFDetPlane(const TVector3 &o, const TVector3 &n, GFAbsFinitePlane *finite = nullptr);
64  virtual ~GFDetPlane();
65  GFDetPlane(const GFDetPlane &);
67  // Accessors -----------------------
68  TVector3 getO() const { return fO; }
69  TVector3 getU() const { return fU; }
70  TVector3 getV() const { return fV; }
71 
72  // Modifiers -----------------------
73  void set(const TVector3 &o, const TVector3 &u, const TVector3 &v);
74 
75  void setO(const TVector3 &o);
76  void setO(double, double, double);
77  void setU(const TVector3 &u);
78  void setU(double, double, double);
79  void setV(const TVector3 &v);
80  void setV(double, double, double);
81  void setUV(const TVector3 &u, const TVector3 &v);
82  void setON(const TVector3 &o, const TVector3 &n);
83 
87  void setFinitePlane(GFAbsFinitePlane *finite) { fFinitePlane = finite; }
88 
89  // Operations ----------------------
90  TVector3 getNormal() const;
91  void setNormal(TVector3 n);
92  void setNormal(double, double, double);
93  void setNormal(const double &theta, const double &phi);
95  TVector2 project(const TVector3 &x) const;
97  TVector2 LabToPlane(const TVector3 &x) const;
99  TVector3 toLab(const TVector2 &x) const;
100  // get vector from point to plane (normal)
101  TVector3 dist(const TVector3 &point) const;
102 
104  TVector2 straightLineToPlane(const TVector3 &point, const TVector3 &dir) const;
105 
106  void Print() const;
107 
109  void getGraphics(double mesh, double length, TPolyMarker3D **pl, TPolyLine3D **plLine, TPolyLine3D **u, TPolyLine3D **v, TPolyLine3D **n = nullptr);
110 
113  friend bool operator==(const GFDetPlane &lhs, const GFDetPlane &rhs);
115  friend bool operator!=(const GFDetPlane &lhs, const GFDetPlane &rhs);
116 
117  double distance(TVector3 &) const;
118  double distance(double, double, double) const;
119 
121  bool inActive(const TVector3 &point, const TVector3 &dir) const { return this->inActive(this->straightLineToPlane(point, dir)); }
122 
124  bool inActive(double u, double v) const
125  {
126  if (fFinitePlane == nullptr)
127  return true;
128  return fFinitePlane->inActive(u, v);
129  }
130 
132  bool inActive(const TVector2 &v) const { return inActive(v.X(), v.Y()); }
133 
134  private:
135  // Private Data Members ------------
136  // origin
137  TVector3 fO;
138  // Vectors spanning the plane
139  TVector3 fU;
140  TVector3 fV;
141 
142  GFAbsFinitePlane *fFinitePlane;
143 
144  // Private Methods -----------------
145 
146  void sane(); // ensures orthnormal coordinates
147  public:
148  ClassDef(GFDetPlane, 2)
149 };
150 
151 #endif
152 
void setFinitePlane(GFAbsFinitePlane *finite)
Definition: GFDetPlane.h:87
TVector2 straightLineToPlane(const TVector3 &point, const TVector3 &dir) const
gives u,v coordinates of the intersection point of a straight line with plane
void getGraphics(double mesh, double length, TPolyMarker3D **pl, TPolyLine3D **plLine, TPolyLine3D **u, TPolyLine3D **v, TPolyLine3D **n=nullptr)
for poor attempts of making an event display. There is a lot of room for improvements.
Detector plane genfit geometry class.
Definition: GFDetPlane.h:58
void setU(const TVector3 &u)
void setON(const TVector3 &o, const TVector3 &n)
void setO(const TVector3 &o)
TVector3 getV() const
Definition: GFDetPlane.h:70
TVector2 LabToPlane(const TVector3 &x) const
transform from Lab system into plane
TVector3 getU() const
Definition: GFDetPlane.h:69
__m128 v
Definition: P4_F32vec4.h:3
GFDetPlane & operator=(const GFDetPlane &)
TVector3 toLab(const TVector2 &x) const
transform from plane coordinates to lab system
void setNormal(TVector3 n)
bool inActive(double u, double v) const
inActive methods refer to finite plane. C.f. GFAbsFinitePlane
Definition: GFDetPlane.h:124
TVector3 getO() const
Definition: GFDetPlane.h:68
TVector2 project(const TVector3 &x) const
projecting a direction onto the plane:
friend bool operator==(const GFDetPlane &lhs, const GFDetPlane &rhs)
TVector3 dist(const TVector3 &point) const
GFDetPlane(GFAbsFinitePlane *finite=nullptr)
double distance(TVector3 &) const
void setUV(const TVector3 &u, const TVector3 &v)
bool inActive(const TVector3 &point, const TVector3 &dir) const
intersect in the active area? C.f. GFAbsFinitePlane
Definition: GFDetPlane.h:121
void setV(const TVector3 &v)
virtual ~GFDetPlane()
friend bool operator!=(const GFDetPlane &lhs, const GFDetPlane &rhs)
returns NOT ==
void Print() const
virtual bool inActive(const double &u, const double &v) const =0
TVector3 getNormal() const
bool inActive(const TVector2 &v) const
inActive methods refer to finite plane. C.f. GFAbsFinitePlane
Definition: GFDetPlane.h:132
Abstract base class for implementing arbitrarily shaped finite detector planes.