LArSoft
v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
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
x
Float_t x
Definition:
compare.C:6
geoalgo::Cone::_radius
double _radius
Radius of the cone at the base.
Definition:
GeoCone.h:62
geoalgo::Cone::_angle
double _angle
Opening Angle.
Definition:
GeoCone.h:63
geoalgo::Cone::_length
double _length
Helight (length) of the cone.
Definition:
GeoCone.h:61
y
Float_t y
Definition:
compare.C:6
z
Double_t z
Definition:
plot.C:279
geoalgo::Cone::Length
double Length() const
Length getter.
Definition:
GeoCone.cxx:46
GeoCone.h
Class def header for a class HalfLine.
geoalgo::Cone::Cone
Cone()
Default constructor.
Definition:
GeoCone.cxx:8
radius
Double_t radius
Definition:
TG43_relative_dose.C:19
geoalgo::HalfLine
Representation of a 3D semi-infinite line. Defines a semi-infinite 3D line by having a start point (P...
Definition:
GeoHalfLine.h:26
dir
TDirectory * dir
Definition:
macro.C:5
geoalgo
Definition:
GeoAABox.cxx:6
geoalgo::Cone::Angle
double Angle() const
Angle getter.
Definition:
GeoCone.cxx:50
geoalgo::Cone::Radius
double Radius() const
Length getter.
Definition:
GeoCone.cxx:48
geoalgo::Vector
Definition:
GeoVector.h:35
geoalgo::GeoAlgoException
Definition:
GeoAlgoException.h:27
larcorealg
v07_03_00
source
larcorealg
GeoAlgo
GeoCone.cxx
Generated on Wed Dec 12 2018 14:42:40 for LArSoft by
1.8.11