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