Coordinate origin.
More...
#include <JHead.hh>
|
double | x |
|
double | y |
|
double | z |
|
Coordinate origin.
Definition at line 730 of file JHead.hh.
◆ coord_origin() [1/2]
JAANET::coord_origin::coord_origin |
( |
| ) |
|
|
inline |
Default constructor.
Definition at line 736 of file JHead.hh.
Vec()
Default constructor.
◆ coord_origin() [2/2]
JAANET::coord_origin::coord_origin |
( |
const double |
x, |
|
|
const double |
y, |
|
|
const double |
z |
|
) |
| |
|
inline |
Constructor.
- Parameters
-
x | x position |
y | y position |
z | z position |
Definition at line 747 of file JHead.hh.
◆ match()
bool JAANET::coord_origin::match |
( |
const coord_origin & |
object | ) |
const |
|
inline |
Test match.
- Parameters
-
- Returns
- true if matches; else false
Definition at line 759 of file JHead.hh.
761 return (
x ==
object.
x &&
◆ ClassDefNV()
◆ dot()
double Vec::dot |
( |
const Vec & |
v | ) |
const |
|
inlineinherited |
Get dot product.
- Parameters
-
- Returns
- dot product
Definition at line 36 of file Vec.hh.
36 {
return v.x*
x +
v.y*
y+
v.z*
z;}
◆ cross()
Vec Vec::cross |
( |
const Vec |
r | ) |
const |
|
inlineinherited |
Get cross product.
- Parameters
-
- Returns
- cross product
Definition at line 44 of file Vec.hh.
◆ operator+=()
Vec& Vec::operator+= |
( |
const Vec & |
v | ) |
|
|
inlineinherited |
Add vector.
- Parameters
-
- Returns
- this vector
Definition at line 52 of file Vec.hh.
52 {
x+=
v.x;
y+=
v.y;
z+=
v.z;
return *
this;}
◆ operator-=()
Vec& Vec::operator-= |
( |
const Vec & |
v | ) |
|
|
inlineinherited |
Subtract vector.
- Parameters
-
- Returns
- this vector
Definition at line 60 of file Vec.hh.
60 {
x-=
v.x;
y-=
v.y;
z-=
v.z;
return *
this;}
◆ operator*=()
Vec& Vec::operator*= |
( |
double |
d | ) |
|
|
inlineinherited |
Multiply vector.
- Parameters
-
- Returns
- this vector
Definition at line 68 of file Vec.hh.
68 {
x*=d;
y*=d;
z*=d;
return *
this;}
◆ operator/=()
Vec& Vec::operator/= |
( |
double |
d | ) |
|
|
inlineinherited |
Divide vector.
- Parameters
-
- Returns
- this vector
Definition at line 76 of file Vec.hh.
Vec & operator*=(double d)
Multiply vector.
◆ operator-()
Vec Vec::operator- |
( |
| ) |
const |
|
inlineinherited |
Negate vector.
- Returns
- vector
Definition at line 83 of file Vec.hh.
◆ operator==()
bool Vec::operator== |
( |
const Vec & |
v | ) |
const |
|
inlineinherited |
Check equality with given vector.
- Parameters
-
- Returns
- true if (x,y,z) positions of two vectors are equal; else false
Definition at line 91 of file Vec.hh.
91 {
return x==
v.x &&
y==
v.y &&
z==
v.z ; }
◆ operator!=()
bool Vec::operator!= |
( |
const Vec & |
v | ) |
const |
|
inlineinherited |
Check in-equality with given vector.
- Parameters
-
- Returns
- true if one of (x,y,z) positions of two vectors are not equal; else false
Definition at line 99 of file Vec.hh.
99 {
return x!=
v.x ||
y!=
v.y ||
z!=
v.z ; }
◆ set()
Vec& Vec::set |
( |
double |
xx, |
|
|
double |
yy, |
|
|
double |
zz |
|
) |
| |
|
inlineinherited |
Set vector.
- Parameters
-
xx | x position |
yy | y position |
zz | z position |
- Returns
- this vector
Definition at line 109 of file Vec.hh.
109 {
x=xx;
y=yy;
z=zz;
return *
this;}
◆ set_angles()
Vec& Vec::set_angles |
( |
double |
theta, |
|
|
double |
phi |
|
) |
| |
|
inlineinherited |
Set vector according given zenith and azimuth angles.
- Parameters
-
theta | zenith angle [rad] |
phi | azimuth angle [rad] |
- Returns
- this vector
Definition at line 118 of file Vec.hh.
double theta() const
Get zenith angle.
double phi() const
Get azimuth angle.
◆ phi()
double Vec::phi |
( |
| ) |
const |
|
inlineinherited |
Get azimuth angle.
- Returns
- angle [rad]
Definition at line 131 of file Vec.hh.
131 {
return atan2(
y,
x ); }
◆ theta()
double Vec::theta |
( |
| ) |
const |
|
inlineinherited |
Get zenith angle.
- Returns
- angle [rad]
Definition at line 138 of file Vec.hh.
◆ len()
double Vec::len |
( |
| ) |
const |
|
inlineinherited |
Get length.
- Returns
- length
Definition at line 145 of file Vec.hh.
145 {
double l =
dot(*
this);
return (l > 0)? sqrt(l) : 0; }
double dot(const Vec &v) const
Get dot product.
◆ lenxy()
double Vec::lenxy |
( |
| ) |
const |
|
inlineinherited |
Get length of (x,y) component.
- Returns
- length
Definition at line 152 of file Vec.hh.
152 {
const double r2 =
x*
x +
y*
y;
return (r2>0) ? sqrt(r2) :0; }
◆ normalize()
Normalise this vector.
- Returns
- this vector
Definition at line 159 of file Vec.hh.
double len() const
Get length.
Vec & operator/=(double d)
Divide vector.
◆ print()
void Vec::print |
( |
std::ostream & |
out = std::cout | ) |
const |
|
inlineinherited |
Print vector.
- Parameters
-
Definition at line 166 of file Vec.hh.
168 out <<
"Vec:" <<
x <<
" " <<
y <<
" " <<
z;
◆ __repr__()
const char* Vec::__repr__ |
( |
| ) |
const |
|
inlineinherited |
Get string representation of this vector.
- Returns
- string
Definition at line 176 of file Vec.hh.
178 static std::string buffer;
180 std::ostringstream s;
186 return buffer.c_str();
void print(std::ostream &out=std::cout) const
Print vector.
◆ __add__()
Vec Vec::__add__ |
( |
const Vec & |
v | ) |
const |
|
inlineinherited |
Add vector.
- Parameters
-
- Returns
- vector
Definition at line 195 of file Vec.hh.
195 {
Vec r=*
this;
return r+=
v; }
The Vec class is a straightforward 3-d vector, which also works in pyroot.
◆ __sub__()
Vec Vec::__sub__ |
( |
const Vec & |
v | ) |
const |
|
inlineinherited |
Subtract vector.
- Parameters
-
- Returns
- vector
Definition at line 203 of file Vec.hh.
203 {
Vec r=*
this;
return r-=
v; }
◆ __mul__()
Vec Vec::__mul__ |
( |
double |
d | ) |
const |
|
inlineinherited |
Multiply vector.
- Parameters
-
- Returns
- vector
Definition at line 211 of file Vec.hh.
211 {
Vec r=*
this;
return r*=d; }
◆ __rmul__()
Vec Vec::__rmul__ |
( |
double |
d | ) |
const |
|
inlineinherited |
Multiply vector.
- Parameters
-
- Returns
- vector
Definition at line 219 of file Vec.hh.
Vec __mul__(double d) const
Multiply vector.
◆ __div__()
Vec Vec::__div__ |
( |
double |
d | ) |
const |
|
inlineinherited |
Divide vector.
- Parameters
-
- Returns
- vector
Definition at line 227 of file Vec.hh.
227 {
Vec r=*
this;
return r/=d; }
◆ rotate_z()
Vec& Vec::rotate_z |
( |
double |
ang | ) |
|
|
inlineinherited |
Rotate around z-axis with given angle.
- Parameters
-
- Returns
- this vector
Definition at line 235 of file Vec.hh.
238 x = o.
x *cos(ang) - o.
y * sin(ang);
239 y = o.
x *sin(ang) + o.
y * cos(ang);
◆ rotate_x()
Vec& Vec::rotate_x |
( |
double |
ang | ) |
|
|
inlineinherited |
Rotate around x-axis with given angle.
- Parameters
-
- Returns
- this vector
Definition at line 250 of file Vec.hh.
254 y = o.
y *cos(ang) + o.
z * -sin(ang);
255 z = o.
y *sin(ang) + o.
z * cos(ang);
◆ rotate_y()
Vec& Vec::rotate_y |
( |
double |
ang | ) |
|
|
inlineinherited |
Rotate around y-axis with given angle.
- Parameters
-
- Returns
- this vector
Definition at line 265 of file Vec.hh.
268 x = o.
x *cos(ang) + o.
z * sin(ang);
270 z = -o.
x *sin(ang) + o.
z * cos(ang);
The documentation for this struct was generated from the following file: