BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtVector3C.cc
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2//
3// Environment:
4// This software is part of the EvtGen package developed jointly
5// for the BaBar and CLEO collaborations. If you use all or part
6// of it, please give an appropriate acknowledgement.
7//
8// Copyright Information: See EvtGen/COPYRIGHT
9// Copyright (C) 1998 Caltech, UCSB
10//
11// Module: EvtVector3C.cc
12//
13// Description: Complex 3 vectors.
14//
15// Modification history:
16//
17// RYD September 5, 1997 Module created
18//
19//------------------------------------------------------------------------
20//
21#include "EvtVector3C.hh"
22#include "EvtComplex.hh"
23#include "EvtPatches.hh"
24#include <iostream>
25#include <math.h>
26using std::ostream;
27
29
30 v[0] = EvtComplex( 0.0 );
31 v[1] = EvtComplex( 0.0 );
32 v[2] = EvtComplex( 0.0 );
33}
34
36
38
39 v[0] = e1;
40 v[1] = e2;
41 v[2] = e3;
42}
43
45
46 // Calcs the cross product. Added by djl on July 27, 1995.
47
48 EvtVector3C temp;
49
50 temp.v[0] = v[1] * p2.v[2] - v[2] * p2.v[1];
51 temp.v[1] = v[2] * p2.v[0] - v[0] * p2.v[2];
52 temp.v[2] = v[0] * p2.v[1] - v[1] * p2.v[0];
53
54 return temp;
55}
56
57EvtVector3C rotateEuler( const EvtVector3C& v, double alpha, double beta, double gamma ) {
58
59 EvtVector3C tmp( v );
60 tmp.applyRotateEuler( alpha, beta, gamma );
61 return tmp;
62}
63
64void EvtVector3C::applyRotateEuler( double phi, double theta, double ksi ) {
65
66 EvtComplex temp[3];
67 double sp, st, sk, cp, ct, ck;
68
69 sp = sin( phi );
70 st = sin( theta );
71 sk = sin( ksi );
72 cp = cos( phi );
73 ct = cos( theta );
74 ck = cos( ksi );
75
76 temp[0] =
77 ( ck * ct * cp - sk * sp ) * v[0] + ( -sk * ct * cp - ck * sp ) * v[1] + st * cp * v[2];
78 temp[1] =
79 ( ck * ct * sp + sk * cp ) * v[0] + ( -sk * ct * sp + ck * cp ) * v[1] + st * sp * v[2];
80 temp[2] = -ck * st * v[0] + sk * st * v[1] + ct * v[2];
81
82 v[0] = temp[0];
83 v[1] = temp[1];
84 v[2] = temp[2];
85}
86
87ostream& operator<<( ostream& s, const EvtVector3C& v ) {
88
89 s << "(" << v.v[0] << "," << v.v[1] << "," << v.v[2] << ")";
90
91 return s;
92}
double p2[4]
Double_t e1
Double_t e2
double alpha
EvtVector3C rotateEuler(const EvtVector3C &v, double alpha, double beta, double gamma)
ostream & operator<<(ostream &s, const EvtVector3C &v)
XmlRpcServer s
**********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
EvtVector3C cross(const EvtVector3C &v2)
virtual ~EvtVector3C()
void applyRotateEuler(double phi, double theta, double ksi)