All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sbncode/sbncode/OpT0Finder/flashmatch/GeoAlgo/GeoCone.cxx
Go to the documentation of this file.
1 #ifndef BASICTOOL_GEOCONE_CXX
2 #define BASICTOOL_GEOCONE_CXX
3 
4 #include "GeoCone.h"
5 #include <sstream>
6 namespace geoalgo {
7 
8  Cone::Cone() : HalfLine()
9  {
10  _length = 1;
11  _radius = 1;
12  _angle = atan(_radius/_length);
13  }
14 
15  Cone::Cone(const double x, const double y, const double z,
16  const double dirx, const double diry, const double dirz,
17  const double length, const double radius)
18  : HalfLine(x, y, z, dirx, diry, dirz)
19  {
20  if (length == 0){
21  std::ostringstream msg;
22  msg << "<<" << __FUNCTION__ << ">>"
23  << " Cone Length cannot be 0." << std::endl;
24  throw GeoAlgoException(msg.str());
25  }
26  _length = length;
27  _radius = radius;
28  _angle = atan(_radius/_length);
29  }
30 
31  Cone::Cone(const Point_t& start, const Vector_t& dir,
32  const double length, const double radius)
33  : HalfLine( start, dir )
34  {
35  if (length == 0){
36  std::ostringstream msg;
37  msg << "<<" << __FUNCTION__ << ">>"
38  << " Cone Length cannot be 0." << std::endl;
39  throw GeoAlgoException(msg.str());
40  }
41  _length = length;
42  _radius = radius;
43  _angle = atan(_radius/_length);
44  }
45 
46  double Cone::Length() const { return _length; }
47 
48  double Cone::Radius() const { return _radius; }
49 
50  double Cone::Angle() const { return _angle; }
51 
52  void Cone::Length(const double l)
53  {
54  if (l == 0){
55  std::ostringstream msg;
56  msg << "<<" << __FUNCTION__ << ">>"
57  << " Cone Length cannot be 0." << std::endl;
58  throw GeoAlgoException(msg.str());
59  }
60  _length = l;
61  _angle = atan(_radius/_length);
62  }
63 
64  void Cone::Radius(const double r) { _radius = r; _angle = atan(_radius/_length); }
65 }
66 #endif
67 
68 
process_name opflash particleana ie ie ie z
double _radius
Radius of the cone at the base.
process_name opflash particleana ie x
double _length
Helight (length) of the cone.
double Length() const
Length getter.
recob::tracking::Point_t Point_t
process_name opflash particleana ie ie y
tuple dir
Definition: dropbox.py:28
double Angle() const
Angle getter.
double Radius() const
Length getter.
esac echo uname r
recob::tracking::Vector_t Vector_t