BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
vector3.h File Reference

Go to the source code of this file.

Classes

struct  vector3

Functions

vector3 InitV (float x, float y, float z)
vector3 InitV1 (float phi, float cosTheta, float magnitude)
float Mag (vector3 v)
float Mag2 (vector3 v)
float Dot (vector3 v1, vector3 v2)
vector3 Cross (vector3 v1, vector3 v2)
vector3 Unit (vector3 v)
vector3 Intersection (float z0, vector3 vec, vector3 pos)
vector3 TimesA (float a, vector3 v)
vector3 AddV (vector3 v1, vector3 v2)
vector3 SubV (vector3 v1, vector3 v2)
vector3 TransformFrom (vector3 v, vector3 ux, vector3 uy, vector3 uz)
vector3 TransformTo (vector3 v, vector3 ux, vector3 uy, vector3 uz)

Variables

const float pi = 3.1415926536
const float rad = 57.29578

Function Documentation

◆ AddV()

vector3 AddV ( vector3 v1,
vector3 v2 )

Definition at line 74 of file EventDisplay/BesVisLib/include/BesVisLib/vector3.h.

74 {
75 vector3 v;
76 v.x = v1.x + v2.x;
77 v.y = v1.y + v2.y;
78 v.z = v1.z + v2.z;
79 return v;
80}
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
Definition KarLud.h:35

Referenced by TransformFrom().

◆ Cross()

vector3 Cross ( vector3 v1,
vector3 v2 )

Definition at line 36 of file EventDisplay/BesVisLib/include/BesVisLib/vector3.h.

36 {
37 vector3 v;
38 v.x = v1.y * v2.z - v1.z * v2.y;
39 v.y = v1.z * v2.x - v1.x * v2.z;
40 v.z = v1.x * v2.y - v1.y * v2.x;
41 return v;
42}

◆ Dot()

float Dot ( vector3 v1,
vector3 v2 )

Definition at line 33 of file EventDisplay/BesVisLib/include/BesVisLib/vector3.h.

33{ return v1.x * v2.x + v1.y * v2.y + v1.z * v2.z; }

Referenced by TransformTo().

◆ InitV()

vector3 InitV ( float x,
float y,
float z )

Definition at line 8 of file EventDisplay/BesVisLib/include/BesVisLib/vector3.h.

8 {
10 v.x = x;
11 v.y = y;
12 v.z = z;
13 return v;
14}

◆ InitV1()

vector3 InitV1 ( float phi,
float cosTheta,
float magnitude )

Definition at line 17 of file EventDisplay/BesVisLib/include/BesVisLib/vector3.h.

17 {
18 vector3 v;
19 float sinTheta = sqrt( 1.0 - cosTheta * cosTheta );
20 v.z = magnitude * cosTheta;
21 v.y = magnitude * sinTheta * sin( phi );
22 v.x = magnitude * sinTheta * cos( phi );
23 return v;
24}

◆ Intersection()

vector3 Intersection ( float z0,
vector3 vec,
vector3 pos )

Definition at line 56 of file EventDisplay/BesVisLib/include/BesVisLib/vector3.h.

56 {
57 vector3 vz0;
58 vz0.z = z0;
59 vz0.x = ( vz0.z - pos.z ) * vec.x / vec.z + pos.x;
60 vz0.y = ( vz0.z - pos.z ) * vec.y / vec.z + pos.y;
61 return vz0;
62}
dble_vec_t vec[12]

◆ Mag()

float Mag ( vector3 v)

Definition at line 27 of file EventDisplay/BesVisLib/include/BesVisLib/vector3.h.

27{ return sqrt( v.x * v.x + v.y * v.y + v.z * v.z ); }

Referenced by Unit().

◆ Mag2()

float Mag2 ( vector3 v)

Definition at line 30 of file EventDisplay/BesVisLib/include/BesVisLib/vector3.h.

30{ return v.x * v.x + v.y * v.y + v.z * v.z; }

◆ SubV()

vector3 SubV ( vector3 v1,
vector3 v2 )

Definition at line 83 of file EventDisplay/BesVisLib/include/BesVisLib/vector3.h.

83 {
84 vector3 v;
85 v.x = v1.x - v2.x;
86 v.y = v1.y - v2.y;
87 v.z = v1.z - v2.z;
88 return v;
89}

◆ TimesA()

vector3 TimesA ( float a,
vector3 v )

Definition at line 65 of file EventDisplay/BesVisLib/include/BesVisLib/vector3.h.

65 {
66 vector3 vv;
67 vv.x = a * v.x;
68 vv.y = a * v.y;
69 vv.z = a * v.z;
70 return vv;
71}

Referenced by TransformFrom().

◆ TransformFrom()

vector3 TransformFrom ( vector3 v,
vector3 ux,
vector3 uy,
vector3 uz )

Definition at line 92 of file EventDisplay/BesVisLib/include/BesVisLib/vector3.h.

92 {
93 ux = TimesA( v.x, ux );
94 uy = TimesA( v.y, uy );
95 uz = TimesA( v.z, uz );
96 v = AddV( AddV( ux, uy ), uz );
97 return v;
98}
vector3 AddV(vector3 v1, vector3 v2)
vector3 TimesA(float a, vector3 v)

◆ TransformTo()

vector3 TransformTo ( vector3 v,
vector3 ux,
vector3 uy,
vector3 uz )

Definition at line 101 of file EventDisplay/BesVisLib/include/BesVisLib/vector3.h.

101 {
102 vector3 vv;
103 vv.x = Dot( v, ux );
104 vv.y = Dot( v, uy );
105 vv.z = Dot( v, uz );
106 return vv;
107}
float Dot(vector3 v1, vector3 v2)

◆ Unit()

vector3 Unit ( vector3 v)

Definition at line 45 of file EventDisplay/BesVisLib/include/BesVisLib/vector3.h.

45 {
46 vector3 vv;
47 float p = Mag( v );
48 vv.x = v.x / p;
49 vv.y = v.y / p;
50 vv.z = v.z / p;
51 return vv;
52}

Variable Documentation

◆ pi

const float pi = 3.1415926536

◆ rad