CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Static Private Attributes
funct::GaussIntegrator Class Reference

#include <NumericalIntegration.h>

Public Member Functions

double error () const
 
 GaussIntegrator ()
 
 GaussIntegrator (double epsilon)
 
template<typename F >
double operator() (const F &f, double a, double b) const
 

Private Attributes

double aa
 
double aconst
 
double bb
 
double c1
 
double c2
 
double epsilon_
 
double error_
 
double f1
 
double f2
 
double h
 
unsigned int i
 
double s16
 
double s8
 
double u
 
double xx
 

Static Private Attributes

static const double kCST = 5. / 1000
 
static const double kHF = 0.5
 
static const double w [12]
 
static const double x [12]
 

Detailed Description

Definition at line 65 of file NumericalIntegration.h.

Constructor & Destructor Documentation

◆ GaussIntegrator() [1/2]

funct::GaussIntegrator::GaussIntegrator ( )
inline

Definition at line 67 of file NumericalIntegration.h.

67 {}

◆ GaussIntegrator() [2/2]

funct::GaussIntegrator::GaussIntegrator ( double  epsilon)
inline

Definition at line 68 of file NumericalIntegration.h.

68 : epsilon_(epsilon) {}

Member Function Documentation

◆ error()

double funct::GaussIntegrator::error ( ) const
inline

Definition at line 115 of file NumericalIntegration.h.

115 { return error_; }

References error_.

Referenced by Page1Parser.Page1Parser::check_for_whole_start_tag().

◆ operator()()

template<typename F >
double funct::GaussIntegrator::operator() ( const F f,
double  a,
double  b 
) const
inline

Definition at line 70 of file NumericalIntegration.h.

70  {
71  h = 0;
72  if (b == a)
73  return h;
74  aconst = kCST / std::abs(b - a);
75  bb = a;
76  CASE1:
77  aa = bb;
78  bb = b;
79  CASE2:
80  c1 = kHF * (bb + aa);
81  c2 = kHF * (bb - aa);
82  s8 = 0;
83  for (i = 0; i < 4; ++i) {
84  u = c2 * x[i];
85  xx = c1 + u;
86  f1 = f(xx);
87  xx = c1 - u;
88  f2 = f(xx);
89  s8 += w[i] * (f1 + f2);
90  }
91  s16 = 0;
92  for (i = 4; i < 12; ++i) {
93  u = c2 * x[i];
94  xx = c1 + u;
95  f1 = f(xx);
96  xx = c1 - u;
97  f2 = f(xx);
98  s16 += w[i] * (f1 + f2);
99  }
100  s16 = c2 * s16;
101  if (std::abs(s16 - c2 * s8) <= epsilon_ * (1. + std::abs(s16))) {
102  h += s16;
103  if (bb != b)
104  goto CASE1;
105  } else {
106  bb = c1;
107  if (1. + aconst * std::abs(c2) != 1)
108  goto CASE2;
109  h = s8;
110  }
111 
112  error_ = std::abs(s16 - c2 * s8);
113  return h;
114  }

References a, aa, funct::abs(), aconst, b, bb, c1, c2, epsilon_, error_, f, f1, f2, h, i, kCST, kHF, s16, s8, u, w, x, and xx.

Member Data Documentation

◆ aa

double funct::GaussIntegrator::aa
mutableprivate

Definition at line 123 of file NumericalIntegration.h.

Referenced by geometryXMLparser.Alignable::covariance(), and operator()().

◆ aconst

double funct::GaussIntegrator::aconst
mutableprivate

Definition at line 123 of file NumericalIntegration.h.

Referenced by operator()().

◆ bb

double funct::GaussIntegrator::bb
mutableprivate

Definition at line 123 of file NumericalIntegration.h.

Referenced by geometryXMLparser.Alignable::covariance(), and operator()().

◆ c1

double funct::GaussIntegrator::c1
mutableprivate

Definition at line 123 of file NumericalIntegration.h.

Referenced by operator()().

◆ c2

double funct::GaussIntegrator::c2
mutableprivate

Definition at line 123 of file NumericalIntegration.h.

Referenced by operator()().

◆ epsilon_

double funct::GaussIntegrator::epsilon_
private

Definition at line 119 of file NumericalIntegration.h.

Referenced by operator()().

◆ error_

double funct::GaussIntegrator::error_
mutableprivate

Definition at line 118 of file NumericalIntegration.h.

Referenced by error(), and operator()().

◆ f1

double funct::GaussIntegrator::f1
mutableprivate

Definition at line 123 of file NumericalIntegration.h.

Referenced by operator()().

◆ f2

double funct::GaussIntegrator::f2
mutableprivate

Definition at line 123 of file NumericalIntegration.h.

Referenced by operator()().

◆ h

double funct::GaussIntegrator::h
mutableprivate

Definition at line 123 of file NumericalIntegration.h.

Referenced by operator()().

◆ i

unsigned int funct::GaussIntegrator::i
mutableprivate

Definition at line 124 of file NumericalIntegration.h.

Referenced by operator()().

◆ kCST

const double funct::GaussIntegrator::kCST = 5. / 1000
staticprivate

Definition at line 122 of file NumericalIntegration.h.

Referenced by operator()().

◆ kHF

const double funct::GaussIntegrator::kHF = 0.5
staticprivate

Definition at line 121 of file NumericalIntegration.h.

Referenced by operator()().

◆ s16

double funct::GaussIntegrator::s16
mutableprivate

Definition at line 123 of file NumericalIntegration.h.

Referenced by operator()().

◆ s8

double funct::GaussIntegrator::s8
mutableprivate

Definition at line 123 of file NumericalIntegration.h.

Referenced by operator()().

◆ u

double funct::GaussIntegrator::u
mutableprivate

Definition at line 123 of file NumericalIntegration.h.

Referenced by operator()().

◆ w

const double funct::GaussIntegrator::w
staticprivate
Initial value:
= {0.10122853629037626,
0.22238103445337447,
0.31370664587788729,
0.36268378337836198,
0.02715245941175409,
0.06225352393864789,
0.09515851168249278,
0.12462897125553387,
0.14959598881657673,
0.16915651939500254,
0.18260341504492359,
0.18945061045506850}

Definition at line 120 of file NumericalIntegration.h.

Referenced by operator()().

◆ x

const double funct::GaussIntegrator::x
staticprivate
Initial value:
= {0.96028985649753623,
0.79666647741362674,
0.52553240991632899,
0.18343464249564980,
0.98940093499164993,
0.94457502307323258,
0.86563120238783174,
0.75540440835500303,
0.61787624440264375,
0.45801677765722739,
0.28160355077925891,
0.09501250983763744}

Definition at line 120 of file NumericalIntegration.h.

Referenced by svgfig.Curve.Sample::__repr__(), svgfig.Ellipse::__repr__(), operator()(), geometryXMLparser.Alignable::pos(), ntupleDataFormat._HitObject::r(), and ntupleDataFormat._HitObject::r3D().

◆ xx

double funct::GaussIntegrator::xx
mutableprivate

Definition at line 123 of file NumericalIntegration.h.

Referenced by geometryXMLparser.Alignable::covariance(), and operator()().

funct::GaussIntegrator::f1
double f1
Definition: NumericalIntegration.h:123
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
funct::GaussIntegrator::h
double h
Definition: NumericalIntegration.h:123
funct::GaussIntegrator::kCST
static const double kCST
Definition: NumericalIntegration.h:122
geometryDiff.epsilon
int epsilon
Definition: geometryDiff.py:26
funct::GaussIntegrator::bb
double bb
Definition: NumericalIntegration.h:123
funct::GaussIntegrator::f2
double f2
Definition: NumericalIntegration.h:123
funct::GaussIntegrator::kHF
static const double kHF
Definition: NumericalIntegration.h:121
funct::GaussIntegrator::u
double u
Definition: NumericalIntegration.h:123
h
b
double b
Definition: hdecay.h:118
a
double a
Definition: hdecay.h:119
funct::GaussIntegrator::xx
double xx
Definition: NumericalIntegration.h:123
funct::GaussIntegrator::i
unsigned int i
Definition: NumericalIntegration.h:124
funct::GaussIntegrator::w
static const double w[12]
Definition: NumericalIntegration.h:120
funct::GaussIntegrator::s16
double s16
Definition: NumericalIntegration.h:123
funct::GaussIntegrator::s8
double s8
Definition: NumericalIntegration.h:123
funct::GaussIntegrator::c2
double c2
Definition: NumericalIntegration.h:123
funct::GaussIntegrator::x
static const double x[12]
Definition: NumericalIntegration.h:120
funct::GaussIntegrator::c1
double c1
Definition: NumericalIntegration.h:123
funct::GaussIntegrator::epsilon_
double epsilon_
Definition: NumericalIntegration.h:119
funct::GaussIntegrator::aa
double aa
Definition: NumericalIntegration.h:123
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
funct::GaussIntegrator::aconst
double aconst
Definition: NumericalIntegration.h:123
funct::GaussIntegrator::error_
double error_
Definition: NumericalIntegration.h:118