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

Go to the source code of this file.

Classes

struct  vector3
 
struct  polar
 

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)
 
polar XYZ2Polar (vector3 v)
 

Variables

const float pi = 3.1415926536
 
const float rad = 57.29578
 

Function Documentation

◆ AddV()

vector3 AddV ( vector3 v1,
vector3 v2 )

Definition at line 93 of file vector3.h.

94{
95 vector3 v;
96 v.x = v1.x + v2.x;
97 v.y = v1.y + v2.y;
98 v.z = v1.z + v2.z;
99 return v;
100}
**********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
float y
Definition vector3.h:3
float z
Definition vector3.h:4
float x
Definition vector3.h:2

Referenced by TransformFrom().

◆ Cross()

vector3 Cross ( vector3 v1,
vector3 v2 )

Definition at line 49 of file vector3.h.

50{
51 vector3 v;
52 v.x = v1.y*v2.z - v1.z*v2.y;
53 v.y = v1.z*v2.x - v1.x*v2.z;
54 v.z = v1.x*v2.y - v1.y*v2.x;
55 return v;
56}

◆ Dot()

float Dot ( vector3 v1,
vector3 v2 )

Definition at line 42 of file vector3.h.

43{
44 return v1.x*v2.x+v1.y*v2.y+v1.z*v2.z;
45}

Referenced by TransformTo().

◆ InitV()

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

Definition at line 9 of file vector3.h.

10{
11 vector3 v;
12 v.x = x;
13 v.y = y;
14 v.z = z;
15 return v;
16}
Double_t x[10]

◆ InitV1()

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

Definition at line 19 of file vector3.h.

20{
21 vector3 v;
22 float sinTheta = sqrt(1.0-cosTheta*cosTheta);
23 v.z = magnitude*cosTheta;
24 v.y = magnitude*sinTheta*sin(phi);
25 v.x = magnitude*sinTheta*cos(phi);
26 return v;
27}
double sin(const BesAngle a)
Definition BesAngle.h:210
double cos(const BesAngle a)
Definition BesAngle.h:213

◆ Intersection()

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

Definition at line 72 of file vector3.h.

73{
74 vector3 vz0;
75 vz0.z = z0;
76 vz0.x = (vz0.z - pos.z)*vec.x/vec.z + pos.x;
77 vz0.y = (vz0.z - pos.z)*vec.y/vec.z + pos.y;
78 return vz0;
79}
dble_vec_t vec[12]
Definition ranlxd.c:372

◆ Mag()

float Mag ( vector3 v)

Definition at line 30 of file vector3.h.

31{
32 return sqrt(v.x*v.x+v.y*v.y+v.z*v.z);
33}

Referenced by Unit().

◆ Mag2()

float Mag2 ( vector3 v)

Definition at line 36 of file vector3.h.

37{
38 return v.x*v.x+v.y*v.y+v.z*v.z;
39}

◆ SubV()

vector3 SubV ( vector3 v1,
vector3 v2 )

Definition at line 103 of file vector3.h.

104{
105 vector3 v;
106 v.x = v1.x - v2.x;
107 v.y = v1.y - v2.y;
108 v.z = v1.z - v2.z;
109 return v;
110}

◆ TimesA()

vector3 TimesA ( float a,
vector3 v )

Definition at line 83 of file vector3.h.

84{
85 vector3 vv;
86 vv.x = a*v.x;
87 vv.y = a*v.y;
88 vv.z = a*v.z;
89 return vv;
90}

Referenced by TransformFrom().

◆ TransformFrom()

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

Definition at line 113 of file vector3.h.

114{
115 ux = TimesA(v.x,ux);
116 uy = TimesA(v.y,uy);
117 uz = TimesA(v.z,uz);
118 v = AddV(AddV(ux, uy), uz);
119 return v;
120}
vector3 AddV(vector3 v1, vector3 v2)
Definition vector3.h:93
vector3 TimesA(float a, vector3 v)
Definition vector3.h:83

◆ TransformTo()

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

Definition at line 124 of file vector3.h.

125{
126 vector3 vv;
127 vv.x = Dot(v,ux);
128 vv.y = Dot(v,uy);
129 vv.z = Dot(v,uz);
130 return vv;
131}
float Dot(vector3 v1, vector3 v2)
Definition vector3.h:42

◆ Unit()

vector3 Unit ( vector3 v)

Definition at line 59 of file vector3.h.

60{
61 vector3 vv;
62 float p = Mag(v);
63 vv.x = v.x/p;
64 vv.y = v.y/p;
65 vv.z = v.z/p;
66 return vv;
67}
float Mag(vector3 v)
Definition vector3.h:30

◆ XYZ2Polar()

polar XYZ2Polar ( vector3 v)

Definition at line 142 of file vector3.h.

143{
144 polar s;
145 float rxy;
146
147 s.r = sqrt(v.x*v.x+v.y*v.y+v.z*v.z);
148 if(s.r==0.0){
149 s.theta = 0.0;
150 }
151 else{
152 s.theta = acos(v.z/s.r);
153 }
154
155 rxy = sqrt(v.x*v.x+v.y*v.y);
156 if(rxy==0.0){
157 s.phi = 0.0;
158 }
159 else{
160 if(v.y>=0.0) s.phi = acos(v.x/rxy);
161 else{
162 s.phi = 2.0*pi-acos(v.x/rxy);
163 }
164 }
165
166 return s;
167}
XmlRpcServer s
float r
Definition vector3.h:137
const float pi
Definition vector3.h:133

Variable Documentation

◆ pi

const float pi = 3.1415926536

Definition at line 133 of file vector3.h.

Referenced by EmcRecCrystal::BarrelCheckout(), EvtConExc::baryon_sampling(), BesMdcWire::BesMdcWire(), G4HepMCInterface::Boost(), BesTofDigitizerEcV4::Calculate_Readoutstrip_number(), BesTofDigitizerEcV4_dbs::Calculate_Readoutstrip_number(), BesTofDigitizerEcV4::Calculate_Readoutstrip_number_continuum(), BesTofDigitizerEcV4_dbs::Calculate_Readoutstrip_number_continuum(), BesTofDigitizerEcV4_dbs::Calculate_resulting_phi(), BesTofDigitizerEcV4::Calculate_strip_transition_time(), BesTofDigitizerEcV4_dbs::Calculate_strip_transition_time_1(), BesTofDigitizerEcV4_dbs::Calculate_strip_transition_time_2(), BesTofDigitizerEcV4::Calculate_strip_transition_time_cont(), PreXtCalib::calib(), MdcUtilitySvc::cellTrackPassed(), BesMdcConstruction::Construct(), BesSCM::Construct(), BesTofConstruction::ConstructEcTof_mrpc(), BesEvent::ConstructMcTrack(), BesEvent::ConstructMdcTrackFromRec(), BesEvent::ConstructMucTrackFromRec(), TMDCTsf::createTsf(), EvtConExc::decay(), EvtConExc::difgamXs(), BesMdcGeoParameter::Dump(), EmcRecCrystal::EndCapCheckout(), EvtEulerAngles::EulerAngles(), CgemSegmentFitAlg::exe_v1(), CgemSegmentRecAlg::exe_v1(), CalibEventSelect::execute(), DQADtag::execute(), DQARhopi::execute(), DQASelBhabha::execute(), DQASelDimu::execute(), DQASelHadron::execute(), EmcRec::execute(), EvtSelExample::execute(), Gam4pikp::execute(), PipiJpsi::execute(), Ppjrhopi::execute(), Rhopi::execute(), TofRec::execute(), MagneticFieldSvc::fieldVector(), TofCheckDigi::FillCol(), EmcSelBhaEvent::findPhiDiff(), TRungeFitter::fit(), BesTofDigitizerEcV4_dbs::GetTransitionTime_extrap_track(), BesMdcGeoParameter::InitFromFile(), BesMdcGeoParameter::InitFromSvc(), TTrackManager::makeTds(), EvtConExc::meson_sampling(), K0kpi::MTotal(), TMDCWire::neighbor(), ParticleIDBase::pdfCalculate(), BesMdcWire::Phi(), BesMdcSD::ProcessHits(), EvtConExc::Rad1(), EvtConExc::Rad2(), EvtConExc::Ros_xs(), BesEvent::SetCgemClusters(), TRecEmcShower::setPhi(), EvtConExc::SoftPhoton_xs(), PreXtMdcCalib::updateConst(), EvtXsection::Xsection_c(), XYZ2Polar(), and MdcSegInfoSterO::zPosition().

◆ rad