BOSS 7.0.2
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtVector4C.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: EvtVector4C.cc
12//
13// Description: EvtComplex implemention of 4 - vectors
14//
15// Modification history:
16//
17// DJL/RYD September 25, 1996 Module created
18//
19//------------------------------------------------------------------------
20//
22#include <iostream>
23#include <math.h>
24#include <assert.h>
27using std::ostream;
28
29
31
32 v[0]=EvtComplex(0.0); v[1]=EvtComplex(0.0);
33 v[2]=EvtComplex(0.0); v[3]=EvtComplex(0.0);
34
35}
36
38
40 const EvtComplex& e2,const EvtComplex& e3){
41
42 v[0]=e0; v[1]=e1; v[2]=e2; v[3]=e3;
43}
44
45
47 double alpha,double beta,double gamma){
48
49 EvtVector4C tmp(rs);
50 tmp.applyRotateEuler(alpha,beta,gamma);
51 return tmp;
52
53}
54
56 const EvtVector4R p4){
57
58 EvtVector4C tmp(rs);
59 tmp.applyBoostTo(p4);
60 return tmp;
61
62}
63
65 const EvtVector3R boost){
66
67 EvtVector4C tmp(rs);
68 tmp.applyBoostTo(boost);
69 return tmp;
70
71}
72
74
75 double e=p4.get(0);
76
77 EvtVector3R boost(p4.get(1)/e,p4.get(2)/e,p4.get(3)/e);
78
79 applyBoostTo(boost);
80
81 return;
82
83}
84
86
87 double bx,by,bz,gamma,b2;
88
89 bx=boost.get(0);
90 by=boost.get(1);
91 bz=boost.get(2);
92
93 double bxx=bx*bx;
94 double byy=by*by;
95 double bzz=bz*bz;
96
97 b2=bxx+byy+bzz;
98
99
100 if (b2==0.0){
101 return;
102 }
103
104 assert(b2<1.0);
105
106 gamma=1.0/sqrt(1-b2);
107
108
109 double gb2=(gamma-1.0)/b2;
110
111 double gb2xy=gb2*bx*by;
112 double gb2xz=gb2*bx*bz;
113 double gb2yz=gb2*by*bz;
114
115 double gbx=gamma*bx;
116 double gby=gamma*by;
117 double gbz=gamma*bz;
118
119 EvtComplex e2=v[0];
120 EvtComplex px2=v[1];
121 EvtComplex py2=v[2];
122 EvtComplex pz2=v[3];
123
124 v[0]=gamma*e2+gbx*px2+gby*py2+gbz*pz2;
125
126 v[1]=gbx*e2+gb2*bxx*px2+px2+gb2xy*py2+gb2xz*pz2;
127
128 v[2]=gby*e2+gb2*byy*py2+py2+gb2xy*px2+gb2yz*pz2;
129
130 v[3]=gbz*e2+gb2*bzz*pz2+pz2+gb2yz*py2+gb2xz*px2;
131
132 return;
133
134}
135
136void EvtVector4C::applyRotateEuler(double phi,double theta,double ksi){
137
138 double sp=sin(phi);
139 double st=sin(theta);
140 double sk=sin(ksi);
141 double cp=cos(phi);
142 double ct=cos(theta);
143 double ck=cos(ksi);
144
145 EvtComplex x=( ck*ct*cp-sk*sp)*v[1]+( -sk*ct*cp-ck*sp)*v[2]+st*cp*v[3];
146 EvtComplex y=( ck*ct*sp+sk*cp)*v[1]+(-sk*ct*sp+ck*cp)*v[2]+st*sp*v[3];
147 EvtComplex z=-ck*st*v[1]+sk*st*v[2]+ct*v[3];
148
149 v[1]=x;
150 v[2]=y;
151 v[3]=z;
152
153}
154
155
156ostream& operator<<(ostream& s, const EvtVector4C& v){
157
158 s<<"("<<v.v[0]<<","<<v.v[1]<<","<<v.v[2]<<","<<v.v[3]<<")";
159
160 return s;
161
162}
163
Double_t x[10]
Double_t e1
Double_t e2
ostream & operator<<(ostream &s, const EvtVector4C &v)
Definition: EvtVector4C.cc:156
EvtVector4C rotateEuler(const EvtVector4C &rs, double alpha, double beta, double gamma)
Definition: EvtVector4C.cc:46
EvtVector4C boostTo(const EvtVector4C &rs, const EvtVector4R p4)
Definition: EvtVector4C.cc:55
const double alpha
XmlRpcServer s
Definition: HelloServer.cpp:11
double sin(const BesAngle a)
double cos(const BesAngle a)
**********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
double get(int i) const
Definition: EvtVector3R.hh:126
virtual ~EvtVector4C()
Definition: EvtVector4C.cc:37
void applyRotateEuler(double alpha, double beta, double gamma)
Definition: EvtVector4C.cc:136
void applyBoostTo(const EvtVector4R &p4)
Definition: EvtVector4C.cc:73
double get(int i) const
Definition: EvtVector4R.hh:179