BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtComplex.hh File Reference
#include <iostream>
#include <math.h>
#include "EvtGenBase/EvtConst.hh"

Go to the source code of this file.

Classes

class  EvtComplex
 

Typedefs

typedef EvtComplexEvtComplexPtr
 
typedef EvtComplexPtrEvtComplexPtrPtr
 
typedef EvtComplexPtrPtrEvtComplexPtrPtrPtr
 

Functions

EvtComplex operator* (double d, const EvtComplex &c)
 
EvtComplex operator* (const EvtComplex &c, double d)
 
EvtComplex operator/ (const EvtComplex &c, double d)
 
EvtComplex operator/ (double d, const EvtComplex &c)
 
EvtComplex operator/ (const EvtComplex &c1, const EvtComplex &c2)
 
EvtComplex operator* (const EvtComplex &c1, const EvtComplex &c2)
 
EvtComplex operator- (const EvtComplex &c1, const EvtComplex &c2)
 
EvtComplex operator+ (const EvtComplex &c1, const EvtComplex &c2)
 
EvtComplex operator- (const EvtComplex &c)
 
EvtComplex conj (const EvtComplex &c)
 
double abs (const EvtComplex &c)
 
double abs2 (const EvtComplex &c)
 
double arg (const EvtComplex &c)
 
double real (const EvtComplex &c)
 
double imag (const EvtComplex &c)
 
EvtComplex exp (const EvtComplex &c)
 

Typedef Documentation

◆ EvtComplexPtr

◆ EvtComplexPtrPtr

◆ EvtComplexPtrPtrPtr

Function Documentation

◆ abs()

double abs ( const EvtComplex c)

Definition at line 212 of file BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtComplex.hh.

212 {
213
214 double c2=c._rpart*c._rpart+c._ipart*c._ipart;
215 if (c2<=0.0) return 0.0;
216 return sqrt(c2);
217
218}

◆ abs2()

double abs2 ( const EvtComplex c)

Definition at line 221 of file BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtComplex.hh.

221 {
222
223 return c._rpart*c._rpart+c._ipart*c._ipart;
224}

◆ arg()

double arg ( const EvtComplex c)

Definition at line 227 of file BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtComplex.hh.

227 { //added by FS
228 if ((c._rpart==0)&&(c._ipart==0)) {return 0.0;}
229 if (c._rpart==0){
230 if (c._ipart>0){
231 return EvtConst::pi/2;
232 } else {
233 return -EvtConst::pi/2;
234 }
235 } else {
236 return atan2(c._ipart,c._rpart);
237 }
238}

◆ conj()

EvtComplex conj ( const EvtComplex c)

Definition at line 206 of file BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtComplex.hh.

206 {
207
208 return EvtComplex(c._rpart,-c._ipart);
209
210}

◆ exp()

EvtComplex exp ( const EvtComplex c)

Definition at line 252 of file BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtComplex.hh.

252 {
253
254 return exp(c._rpart)*EvtComplex(cos(c._ipart),sin(c._ipart));
255
256}
double sin(const BesAngle a)
Definition: BesAngle.h:210
double cos(const BesAngle a)
Definition: BesAngle.h:213
EvtComplex exp(const EvtComplex &c)

Referenced by exp().

◆ imag()

double imag ( const EvtComplex c)

Definition at line 246 of file BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtComplex.hh.

246 {
247
248 return c._ipart;
249
250}

◆ operator*() [1/3]

EvtComplex operator* ( const EvtComplex c,
double  d 
)

Definition at line 117 of file BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtComplex.hh.

117 {
118
119 return EvtComplex(c._rpart*d,c._ipart*d);
120
121}

◆ operator*() [2/3]

EvtComplex operator* ( const EvtComplex c1,
const EvtComplex c2 
)

Definition at line 168 of file BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtComplex.hh.

168 {
169
170 return EvtComplex(c1._rpart*c2._rpart-c1._ipart*c2._ipart,
171 c1._rpart*c2._ipart+c1._ipart*c2._rpart);
172
173}

◆ operator*() [3/3]

EvtComplex operator* ( double  d,
const EvtComplex c 
)

Definition at line 111 of file BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtComplex.hh.

111 {
112
113 return EvtComplex(c._rpart*d,c._ipart*d);
114
115}

◆ operator+()

EvtComplex operator+ ( const EvtComplex c1,
const EvtComplex c2 
)

Definition at line 181 of file BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtComplex.hh.

181 {
182
183 return EvtComplex(c1._rpart+c2._rpart,c1._ipart+c2._ipart);
184
185}

◆ operator-() [1/2]

EvtComplex operator- ( const EvtComplex c)

Definition at line 200 of file BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtComplex.hh.

200 {
201
202 return EvtComplex(-c._rpart,-c._ipart);
203
204}

◆ operator-() [2/2]

EvtComplex operator- ( const EvtComplex c1,
const EvtComplex c2 
)

Definition at line 175 of file BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtComplex.hh.

175 {
176
177 return EvtComplex(c1._rpart-c2._rpart,c1._ipart-c2._ipart);
178
179}

◆ operator/() [1/3]

EvtComplex operator/ ( const EvtComplex c,
double  d 
)

Definition at line 125 of file BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtComplex.hh.

125 {
126
127 return EvtComplex(c._rpart/d,c._ipart/d);
128
129}

◆ operator/() [2/3]

EvtComplex operator/ ( const EvtComplex c1,
const EvtComplex c2 
)

Definition at line 159 of file BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtComplex.hh.

159 {
160
161 double inv=1.0/(c2._rpart*c2._rpart+c2._ipart*c2._ipart);
162
163 return EvtComplex(inv*(c1._rpart*c2._rpart+c1._ipart*c2._ipart),
164 inv*(c1._ipart*c2._rpart-c1._rpart*c2._ipart));
165
166}

◆ operator/() [3/3]

EvtComplex operator/ ( double  d,
const EvtComplex c 
)

Definition at line 149 of file BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtComplex.hh.

149 {
150
151double Num=d/(c._rpart*c._rpart+c._ipart*c._ipart);
152
153return EvtComplex( Num*c._rpart, -Num*c._ipart );
154
155}

◆ real()

double real ( const EvtComplex c)

Definition at line 240 of file BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtComplex.hh.

240 {
241
242 return c._rpart;
243
244}