Type definition for position.
More...
#include <JAAnetTestkit.hh>
|
double | x |
|
double | y |
|
double | z |
|
Type definition for position.
Definition at line 41 of file JAAnetTestkit.hh.
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;}
Vec Vec::cross |
( |
const Vec |
r | ) |
const |
|
inlineinherited |
Get cross product.
- Parameters
-
- Returns
- cross product
Definition at line 44 of file Vec.hh.
Vec()
Default constructor.
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;}
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;}
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;}
then print_variable DETECTOR INPUT_FILE INTERMEDIATE_FILE check_input_file $DETECTOR $INPUT_FILE check_output_file $INTERMEDIATE_FILE $OUTPUT_FILE JMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Vec& Vec::operator/= |
( |
double |
d | ) |
|
|
inlineinherited |
Divide vector.
- Parameters
-
- Returns
- this vector
Definition at line 76 of file Vec.hh.
then print_variable DETECTOR INPUT_FILE INTERMEDIATE_FILE check_input_file $DETECTOR $INPUT_FILE check_output_file $INTERMEDIATE_FILE $OUTPUT_FILE JMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Vec & operator*=(double d)
Multiply vector.
Vec Vec::operator- |
( |
| ) |
const |
|
inlineinherited |
Negate vector.
- Returns
- vector
Definition at line 83 of file Vec.hh.
Vec()
Default constructor.
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 ; }
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 ; }
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;}
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 phi() const
Get azimuth angle.
double theta() const
Get zenith angle.
double Vec::phi |
( |
| ) |
const |
|
inlineinherited |
Get azimuth angle.
- Returns
- angle [rad]
Definition at line 131 of file Vec.hh.
131 {
return atan2(
y,
x ); }
double Vec::theta |
( |
| ) |
const |
|
inlineinherited |
Get zenith angle.
- Returns
- angle [rad]
Definition at line 138 of file Vec.hh.
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.
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; }
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.
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;
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.
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.
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; }
The Vec class is a straightforward 3-d vector, which also works in pyroot.
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; }
The Vec class is a straightforward 3-d vector, which also works in pyroot.
then print_variable DETECTOR INPUT_FILE INTERMEDIATE_FILE check_input_file $DETECTOR $INPUT_FILE check_output_file $INTERMEDIATE_FILE $OUTPUT_FILE JMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Vec Vec::__rmul__ |
( |
double |
d | ) |
const |
|
inlineinherited |
Multiply vector.
- Parameters
-
- Returns
- vector
Definition at line 219 of file Vec.hh.
then print_variable DETECTOR INPUT_FILE INTERMEDIATE_FILE check_input_file $DETECTOR $INPUT_FILE check_output_file $INTERMEDIATE_FILE $OUTPUT_FILE JMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Vec __mul__(double d) const
Multiply vector.
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; }
The Vec class is a straightforward 3-d vector, which also works in pyroot.
then print_variable DETECTOR INPUT_FILE INTERMEDIATE_FILE check_input_file $DETECTOR $INPUT_FILE check_output_file $INTERMEDIATE_FILE $OUTPUT_FILE JMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
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);
The Vec class is a straightforward 3-d vector, which also works in pyroot.
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);
The Vec class is a straightforward 3-d vector, which also works in pyroot.
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 Vec class is a straightforward 3-d vector, which also works in pyroot.
The documentation for this struct was generated from the following file: