#include <cmath>
#include <iostream>
#include <sstream>
#include "Rtypes.h"
Go to the source code of this file.
|
struct | Vec |
| The Vec class is a straightforward 3-d vector, which also works in pyroot. More...
|
|
◆ operator<<()
std::ostream& operator<< |
( |
std::ostream & |
out, |
|
|
const Vec & |
v |
|
) |
| |
|
inline |
Write vector to output stream.
- Parameters
-
- Returns
- output stream
Definition at line 284 of file Vec.hh.
286 out <<
v.x <<
" " <<
v.y <<
" " <<
v.z <<
" ";
◆ operator>>()
std::istream& operator>> |
( |
std::istream & |
in, |
|
|
Vec & |
v |
|
) |
| |
|
inline |
Read vector from input stream.
- Parameters
-
- Returns
- input stream
Definition at line 297 of file Vec.hh.
299 in >>
v.x >>
v.y >>
v.z ;
return in;
◆ cos_angle_between()
double cos_angle_between |
( |
const Vec & |
a, |
|
|
const Vec & |
b |
|
) |
| |
|
inline |
Get cosine of space angle between two vectors.
- Parameters
-
a | first vector |
b | second vector |
- Returns
- cosine
Definition at line 309 of file Vec.hh.
311 const double n =
a.len() * b.
len();
double len() const
Get length.
◆ angle_between()
double angle_between |
( |
const Vec & |
a, |
|
|
const Vec & |
b |
|
) |
| |
|
inline |
Get space angle between two vectors.
- Parameters
-
a | first vector |
b | second vector |
- Returns
- angle [rad]
Definition at line 322 of file Vec.hh.
325 if ( c < -1 )
return M_PI;
326 if ( c > 1 )
return 0;
double cos_angle_between(const Vec &a, const Vec &b)
Get cosine of space angle between two vectors.
◆ operator+()
Vec operator+ |
( |
const Vec & |
a, |
|
|
const Vec & |
b |
|
) |
| |
|
inline |
Add two vectors.
- Parameters
-
a | first vector |
b | second vector |
- Returns
- vector
Definition at line 337 of file Vec.hh.
The Vec class is a straightforward 3-d vector, which also works in pyroot.
◆ operator-()
Vec operator- |
( |
const Vec & |
a, |
|
|
const Vec & |
b |
|
) |
| |
|
inline |
Subtract two vectors.
- Parameters
-
a | first vector |
b | second vector |
- Returns
- vector
Definition at line 346 of file Vec.hh.
◆ operator*() [1/2]
Vec operator* |
( |
double |
a, |
|
|
const Vec & |
v |
|
) |
| |
|
inline |
Multiply vector.
- Parameters
-
- Returns
- vector
Definition at line 355 of file Vec.hh.
◆ operator*() [2/2]
Vec operator* |
( |
const Vec & |
v, |
|
|
double |
a |
|
) |
| |
|
inline |
Multiply vector.
- Parameters
-
- Returns
- vector
Definition at line 364 of file Vec.hh.
◆ operator/()
Vec operator/ |
( |
const Vec & |
v, |
|
|
double |
a |
|
) |
| |
|
inline |
Divide vector.
- Parameters
-
- Returns
- vector
Definition at line 373 of file Vec.hh.