Garfield++ v1r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
linexi2 Class Reference

#include <linexi2.h>

+ Inheritance diagram for linexi2:

Public Member Functions

 linexi2 (const linexi2_coor &lc, const double *fay)
 
 linexi2 (const long fqlr, const double *fax, const double *fay)
 
linexi2operator= (linexi2 &lx)
 
 linexi2 (linexi2 &lx)
 
double line (double x)
 
- Public Member Functions inherited from linexi2_coor
 linexi2_coor (const long fqlr, const double *fax)
 
 linexi2_coor (const linexi2_coor &lc)
 
linexi2_cooroperator= (const linexi2_coor &lc)
 

Public Attributes

const double * ay
 
double y_mean
 
double xy_mean
 
double a
 
double b
 
- Public Attributes inherited from linexi2_coor
long qlr
 
const double * ax
 
double x_mean
 
double Dx
 

Detailed Description

Definition at line 39 of file linexi2.h.

Constructor & Destructor Documentation

◆ linexi2() [1/3]

linexi2::linexi2 ( const linexi2_coor lc,
const double *  fay 
)

Definition at line 36 of file linexi2.cpp.

37 : linexi2_coor(lc), ay(fay) {
38 long n;
39 y_mean = 0;
40 xy_mean = 0;
41 for (n = 0; n < qlr; n++) {
42 y_mean += ay[n];
43 xy_mean += ax[n] * ay[n];
44 }
45 y_mean /= qlr;
46 xy_mean /= qlr;
47 if (Dx > 0)
48 a = (xy_mean - x_mean * y_mean) / Dx;
49 else
50 a = DBL_MAX;
51 b = y_mean - a * x_mean;
52}
double x_mean
Definition: linexi2.h:22
const double * ax
Definition: linexi2.h:21
double Dx
Definition: linexi2.h:23
long qlr
Definition: linexi2.h:20
double y_mean
Definition: linexi2.h:42
const double * ay
Definition: linexi2.h:41
double a
Definition: linexi2.h:44
double xy_mean
Definition: linexi2.h:43
double b
Definition: linexi2.h:45

◆ linexi2() [2/3]

linexi2::linexi2 ( const long  fqlr,
const double *  fax,
const double *  fay 
)

Definition at line 53 of file linexi2.cpp.

54 : linexi2_coor(fqlr, fax), ay(fay) {
55 long n;
56 y_mean = 0;
57 xy_mean = 0;
58 for (n = 0; n < qlr; n++) {
59 y_mean += ay[n];
60 xy_mean += ax[n] * ay[n];
61 }
62 y_mean /= qlr;
63 xy_mean /= qlr;
64 if (Dx > 0)
65 a = (xy_mean - x_mean * y_mean) / Dx;
66 else
67 a = DBL_MAX;
68 b = y_mean - a * x_mean;
69}

◆ linexi2() [3/3]

linexi2::linexi2 ( linexi2 lx)
inline

Definition at line 57 of file linexi2.h.

57 : linexi2_coor(lx) {
58 ay = lx.ay;
59 y_mean = lx.y_mean;
60 xy_mean = lx.xy_mean;
61 a = lx.a;
62 b = lx.b;
63 }

Member Function Documentation

◆ line()

double linexi2::line ( double  x)
inline

Definition at line 64 of file linexi2.h.

64 {
65 return a * x + b;
66 } //??

Referenced by Heed::straight::straight().

◆ operator=()

linexi2 & linexi2::operator= ( linexi2 lx)
inline

Definition at line 48 of file linexi2.h.

48 {
49 *((linexi2_coor*)this) = (linexi2_coor&)lx;
50 ay = lx.ay;
51 y_mean = lx.y_mean;
52 xy_mean = lx.xy_mean;
53 a = lx.a;
54 b = lx.b;
55 return *this;
56 }

Member Data Documentation

◆ a

double linexi2::a

Definition at line 44 of file linexi2.h.

Referenced by line(), linexi2(), operator<<(), and operator=().

◆ ay

const double* linexi2::ay

Definition at line 41 of file linexi2.h.

Referenced by linexi2(), operator<<(), and operator=().

◆ b

double linexi2::b

Definition at line 45 of file linexi2.h.

Referenced by line(), linexi2(), operator<<(), and operator=().

◆ xy_mean

double linexi2::xy_mean

Definition at line 43 of file linexi2.h.

Referenced by linexi2(), operator<<(), and operator=().

◆ y_mean

double linexi2::y_mean

Definition at line 42 of file linexi2.h.

Referenced by linexi2(), operator<<(), and operator=().


The documentation for this class was generated from the following files: