FairRoot/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
32 #ifndef GFDETPLANE_H
33 #define GFDETPLANE_H
34 
35 #include"GFAbsFinitePlane.h"
36 
37 #include "TObject.h"
38 
39 #include "TVector3.h"
40 #include "TPolyMarker3D.h"
41 #include "TPolyLine3D.h"
42 
59 class GFDetPlane : public TObject {
60 public:
61 
62  // Constructors/Destructors ---------
63  GFDetPlane(GFAbsFinitePlane* finite=NULL);
64  GFDetPlane(const TVector3& o,
65  const TVector3& u,
66  const TVector3& v,
67  GFAbsFinitePlane* finite=NULL);
68  GFDetPlane(const TVector3& o,
69  const TVector3& n,
70  GFAbsFinitePlane* finite=NULL);
71  virtual ~GFDetPlane();
72  GFDetPlane(const GFDetPlane&);
74  // Accessors -----------------------
75  TVector3 getO() const {return fO;}
76  TVector3 getU() const {return fU;}
77  TVector3 getV() const {return fV;}
78 
79  // Modifiers -----------------------
80  void set(const TVector3& o,
81  const TVector3& u,
82  const TVector3& v);
83 
84  void setO(const TVector3& o);
85  void setO(double,double,double);
86  void setU(const TVector3& u);
87  void setU(double,double,double);
88  void setV(const TVector3& v);
89  void setV(double,double,double);
90  void setUV(const TVector3& u,const TVector3& v);
91  void setON(const TVector3& o,const TVector3& n);
92 
97 
98  // Operations ----------------------
99  TVector3 getNormal() const;
100  void setNormal(TVector3 n);
101  void setNormal(double,double,double);
102  void setNormal(const double& theta, const double& phi);
104  TVector2 project(const TVector3& x) const;
106  TVector2 LabToPlane(const TVector3& x) const;
108  TVector3 toLab(const TVector2& x) const;
109  // get vector from point to plane (normal)
110  TVector3 dist(const TVector3& point) const;
111 
113  TVector2 straightLineToPlane(const TVector3& point,const TVector3& dir) const;
114 
115 
116  void Print() const;
117 
119  void getGraphics(double mesh, double length, TPolyMarker3D **pl, TPolyLine3D **plLine,TPolyLine3D **u, TPolyLine3D **v, TPolyLine3D **n=NULL);
120 
123  friend bool operator== (const GFDetPlane& lhs, const GFDetPlane& rhs);
125  friend bool operator!= (const GFDetPlane& lhs, const GFDetPlane& rhs);
126 
127  double distance(TVector3&) const;
128  double distance(double,double,double) const;
129 
130 
132  bool inActive(const TVector3& point, const TVector3& dir) const{
133  return this->inActive( this->straightLineToPlane(point,dir));
134  }
135 
137  bool inActive(double u, double v) const{
138  if(fFinitePlane==NULL) return true;
139  return fFinitePlane->inActive(u,v);
140  }
141 
143  bool inActive(const TVector2& v) const{
144  return inActive(v.X(),v.Y());
145  }
146 
147 private:
148 
149  // Private Data Members ------------
150  // origin
151  TVector3 fO;
152  // Vectors spanning the plane
153  TVector3 fU;
154  TVector3 fV;
155 
157 
158  // Private Methods -----------------
159 
160  void sane(); // ensures orthnormal coordinates
161 public:
162  ClassDef(GFDetPlane,2)
163 
164 };
165 
166 #endif
167 
virtual ~GFDetPlane()
Definition: GFDetPlane.cxx:54
void setFinitePlane(GFAbsFinitePlane *finite)
Definition: GFDetPlane.h:96
TVector3 getV() const
Definition: GFDetPlane.h:77
GFDetPlane & operator=(const GFDetPlane &)
Definition: GFDetPlane.cxx:65
void set(const TVector3 &o, const TVector3 &u, const TVector3 &v)
Definition: GFDetPlane.cxx:83
Detector plane genfit geometry class.
Definition: GFDetPlane.h:59
void setU(const TVector3 &u)
Definition: GFDetPlane.cxx:105
GFDetPlane(GFAbsFinitePlane *finite=NULL)
Definition: GFDetPlane.cxx:37
void setON(const TVector3 &o, const TVector3 &n)
Definition: GFDetPlane.cxx:145
int n
void setO(const TVector3 &o)
Definition: GFDetPlane.cxx:92
double distance(TVector3 &) const
Definition: GFDetPlane.cxx:343
GFAbsFinitePlane * fFinitePlane
Definition: GFDetPlane.h:156
bool inActive(const TVector2 &v) const
inActive methods refer to finite plane. C.f. GFAbsFinitePlane
Definition: GFDetPlane.h:143
TVector3 fO
Definition: GFDetPlane.h:151
TVector3 fV
Definition: GFDetPlane.h:154
__m128 v
Definition: P4_F32vec4.h:4
void setNormal(TVector3 n)
Definition: GFDetPlane.cxx:156
void sane()
Definition: GFDetPlane.cxx:217
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.
Definition: GFDetPlane.cxx:283
TVector3 fU
Definition: GFDetPlane.h:153
TVector2 project(const TVector3 &x) const
projecting a direction onto the plane:
Definition: GFDetPlane.cxx:181
friend bool operator==(const GFDetPlane &lhs, const GFDetPlane &rhs)
Definition: GFDetPlane.cxx:259
TVector2 straightLineToPlane(const TVector3 &point, const TVector3 &dir) const
gives u,v coordinates of the intersection point of a straight line with plane
Definition: GFDetPlane.cxx:357
TVector3 toLab(const TVector2 &x) const
transform from plane coordinates to lab system
Definition: GFDetPlane.cxx:196
void setUV(const TVector3 &u, const TVector3 &v)
Definition: GFDetPlane.cxx:130
TVector2 LabToPlane(const TVector3 &x) const
transform from Lab system into plane
Definition: GFDetPlane.cxx:189
void setV(const TVector3 &v)
Definition: GFDetPlane.cxx:118
Double_t x
friend bool operator!=(const GFDetPlane &lhs, const GFDetPlane &rhs)
returns NOT ==
Definition: GFDetPlane.cxx:278
TVector3 getU() const
Definition: GFDetPlane.h:76
bool inActive(const TVector3 &point, const TVector3 &dir) const
intersect in the active area? C.f. GFAbsFinitePlane
Definition: GFDetPlane.h:132
void Print() const
Definition: GFDetPlane.cxx:238
TVector3 getNormal() const
Definition: GFDetPlane.cxx:138
virtual bool inActive(const double &u, const double &v) const =0
Abstract base class for implementing arbitrarily shaped finite detector planes.
TVector3 getO() const
Definition: GFDetPlane.h:75
bool inActive(double u, double v) const
inActive methods refer to finite plane. C.f. GFAbsFinitePlane
Definition: GFDetPlane.h:137
PndSdsMCPoint * point
Definition: anaLmdCluster.C:72
TVector3 dist(const TVector3 &point) const
Definition: GFDetPlane.cxx:207