Garfield++ 3.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
|
#include <vec.h>
Public Member Functions | |
vec (vfloat xx, vfloat yy, vfloat zz) | |
Constructor. | |
vec ()=default | |
Default constructor. | |
virtual | ~vec () |
Destructor. | |
vfloat | length () const |
vfloat | length2 () const |
vec | down_new (const basis *fabas) |
vec | up_new (const basis *fabas_new) |
void | down (const basis *fabas) |
void | up (const basis *fabas_new) |
vec | down_new (const abssyscoor *fasc) |
vec | up_new (const abssyscoor *fasc) |
void | down (const abssyscoor *fasc) override |
Convert numbering representation of object to basical system of fasc. | |
void | up (const abssyscoor *fasc) override |
Convert numbering representation of objects to new system. | |
vec | turn_new (const vec &dir, vfloat angle) |
Make new turned vector and leave this one unchanged. | |
void | turn (const vec &dir, vfloat angle) override |
Turn this vector. | |
void | shift (const vec &dir) override |
void | random_round_vec () |
Generate random unit vector in plane perpendicular to z-axis. | |
void | random_conic_vec (double theta) |
void | random_sfer_vec () |
vec | operator/ (vfloat p) const |
Public Member Functions inherited from Heed::absref | |
virtual | ~absref () |
Destructor. | |
virtual void | down (const abssyscoor *fasc) |
Convert numbering representation of object to basical system of fasc. | |
virtual void | up (const abssyscoor *fasc) |
Convert numbering representation of objects to new system. | |
virtual void | turn (const vec &dir, vfloat angle) |
Turn around axis doing via center of coordinate system along dir. | |
virtual void | shift (const vec &dir) |
Public Attributes | |
vfloat | x = 0. |
vfloat | y = 0. |
vfloat | z = 0. |
Friends | |
vec | operator* (const vec &v, vfloat p) |
vec | operator*= (vec &v, vfloat p) |
vec | operator* (vfloat p, const vec &v) |
vec | operator/= (vec &v, vfloat p) |
vec | operator+ (const vec &r1, const vec &r2) |
vec & | operator+= (vec &r1, const vec &r2) |
vec | operator- (const vec &r1, const vec &r2) |
vec | operator-= (vec &r1, const vec &r2) |
vec | operator- (const vec &r) |
vfloat | operator* (const vec &r1, const vec &r2) |
vec | operator|| (const vec &r1, const vec &r2) |
Vector product. | |
int | operator== (const vec &r1, const vec &r2) |
Return 1 if precisely the same vectors and 0 otherwise. | |
int | operator!= (const vec &r1, const vec &r2) |
Return 0 if precisely the same vectors and 1 otherwise. | |
bool | apeq (const vec &r1, const vec &r2, vfloat prec) |
Return true if two vectors are approximately the same. | |
vec | unit_vec (const vec &v) |
vfloat | cos2vec (const vec &r1, const vec &r2) |
vfloat | ang2vec (const vec &r1, const vec &r2) |
vec | project_to_plane (const vec &r, const vec &normal) |
vfloat | ang2projvec (const vec &r1, const vec &r2, const vec &normal) |
vfloat | sin2vec (const vec &r1, const vec &r2) |
int | check_par (const vec &r1, const vec &r2, vfloat prec) |
int | check_perp (const vec &r1, const vec &r2, vfloat prec) |
vec | switch_xyz (const vec &) |
Vector. Each vector is presented by three components and corresponds to some basis. // The components are a projection of the vector to unit basis vectors. If bas==NULL then it is the primary basis. So the concept of vector is more primary concept with comparison of basis, since one can not postulate basis while vectors do not exist.
|
default |
Default constructor.
Referenced by operator/(), and turn_new().
|
overridevirtual |
Convert numbering representation of object to basical system of fasc.
Reimplemented from Heed::absref.
Definition at line 225 of file vec.cpp.
void Heed::vec::down | ( | const basis * | fabas | ) |
Definition at line 168 of file vec.cpp.
Referenced by down(), Heed::point::down(), Heed::HeedParticle::physics(), Heed::HeedParticle_BGM::physics(), and Heed::HeedDeltaElectron::physics_after_new_speed().
vec Heed::vec::down_new | ( | const abssyscoor * | fasc | ) |
|
inline |
Definition at line 194 of file vec.h.
Referenced by Heed::basis::basis(), Heed::circumf::check_point_in(), Heed::circumf::circumf(), Heed::plane::cross(), Heed::polyline::cross(), Heed::mparticle::curvature(), Heed::straight::distance(), Heed::trajestep::Gnextpoint(), Heed::gparticle::gparticle(), Heed::HeedPhoton::HeedPhoton(), Heed::polygon::range(), Heed::splane::range(), Heed::trajestep::trajestep(), and turn_new().
|
inline |
void Heed::vec::random_conic_vec | ( | double | theta | ) |
Generate random unit vector in any direction in conus with symmetry axis along z-axis and with angle theta (radian).
Definition at line 236 of file vec.cpp.
Referenced by Heed::HeedParticle::physics(), and Heed::HeedParticle_BGM::physics().
void Heed::vec::random_round_vec | ( | ) |
void Heed::vec::random_sfer_vec | ( | ) |
Definition at line 244 of file vec.cpp.
Referenced by Heed::HeedPhoton::physics_after_new_speed().
|
overridevirtual |
Reimplemented from Heed::absref.
Definition at line 220 of file vec.cpp.
Turn this vector.
Reimplemented from Heed::absref.
Definition at line 216 of file vec.cpp.
Referenced by Heed::trajestep::Gnextpoint(), Heed::spquadr::pt_angle_rad(), and Heed::splane::range().
Make new turned vector and leave this one unchanged.
Definition at line 192 of file vec.cpp.
Referenced by turn().
|
overridevirtual |
Convert numbering representation of objects to new system.
Reimplemented from Heed::absref.
Definition at line 227 of file vec.cpp.
void Heed::vec::up | ( | const basis * | fabas_new | ) |
Definition at line 190 of file vec.cpp.
Referenced by Heed::manip_absvol::m_check_point_inside(), up(), and Heed::point::up().
vec Heed::vec::up_new | ( | const abssyscoor * | fasc | ) |
Definition at line 170 of file vec.cpp.
Definition at line 136 of file vec.cpp.
Definition at line 89 of file vec.cpp.
Return true if two vectors are approximately the same.
Check whether two vectors are parallel, or anti-parallel. Returns: 1 - parallel, -1 - antiparallel, 0 not parallel. Also returns 0 if one or both vectors have zero length. Thus, if angle between vectors < prec, they are parallel.
Referenced by turn_new().
Check whether two vectors are perpendicular. Returns: 1 perpendicular, 0 not perpendicular. Also returns 0 if one or both vectors have zero length. Thus, if angle between vectors a > 0.5 * M_PI - max(prec, vprecision) and a < 0.5 * M_PI + max(prec, vprecision), they are perpendicular.
Definition at line 66 of file vec.cpp.
Return 0 if precisely the same vectors and 1 otherwise.
Return 1 if precisely the same vectors and 0 otherwise.
Definition at line 107 of file vec.cpp.
Referenced by turn_new().
vfloat Heed::vec::x = 0. |
Definition at line 190 of file vec.h.
Referenced by Heed::box::check_point_inside(), Heed::gparticle::curvature(), down_new(), Heed::HeedFieldMap::field_map(), Heed::mparticle::force(), Garfield::TrackHeed::GetCluster(), Heed::HeedFieldMap::inside(), length(), length2(), operator/(), Heed::operator<<(), Heed::HeedDeltaElectron::physics_after_new_speed(), random_conic_vec(), random_round_vec(), Heed::box::range_ext(), Heed::straight::straight(), up_new(), and vec().
vfloat Heed::vec::y = 0. |
Definition at line 191 of file vec.h.
Referenced by Heed::box::check_point_inside(), Heed::gparticle::curvature(), down_new(), Heed::HeedFieldMap::field_map(), Heed::mparticle::force(), Garfield::TrackHeed::GetCluster(), Heed::HeedFieldMap::inside(), length(), length2(), operator/(), Heed::operator<<(), Heed::HeedDeltaElectron::physics_after_new_speed(), random_conic_vec(), random_round_vec(), Heed::box::range_ext(), Heed::straight::straight(), up_new(), vec(), and Heed::straight::vecdistance().
vfloat Heed::vec::z = 0. |
Definition at line 192 of file vec.h.
Referenced by Heed::box::check_point_inside(), Heed::gparticle::curvature(), down_new(), Heed::HeedFieldMap::field_map(), Heed::mparticle::force(), Garfield::TrackHeed::GetCluster(), Heed::HeedFieldMap::inside(), length(), length2(), operator/(), Heed::operator<<(), random_conic_vec(), random_round_vec(), random_sfer_vec(), Heed::box::range_ext(), Heed::straight::straight(), up_new(), and vec().