Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
TrackPropagation
RungeKutta
src
RK4OneStep.cc
Go to the documentation of this file.
1
#include "
RK4OneStep.h
"
2
#include "
RKCartesianDerivative.h
"
3
4
#include <iostream>
5
6
CartesianState
7
RK4OneStep::operator()
(
const
CartesianState
&
start
,
const
RKCartesianDerivative
& deriv,
8
double
step
)
const
9
{
10
double
s0 = 0;
// derivatives do't depend on absolute value of the integration variable
11
CartesianState
k1 = step * deriv( s0, start);
12
CartesianState
k2 = step * deriv( s0+step/2, start+k1/2);
13
CartesianState
k3 = step * deriv( s0+step/2, start+k2/2);
14
CartesianState
k4 = step * deriv( s0+step, start+k3);
15
/*
16
std::cout << "k1 = " << k1.position() << k1.momentum() << std::endl;
17
std::cout << "k2 = " << k2.position() << k2.momentum() << std::endl;
18
std::cout << "k3 = " << k3.position() << k3.momentum() << std::endl;
19
std::cout << "k4 = " << k4.position() << k4.momentum() << std::endl;
20
*/
21
CartesianState
result
= start + k1/6 + k2/3 + k3/3 + k4/6;
22
return
result
;
23
}
dqm_diff.start
tuple start
Check for commandline option errors.
Definition:
dqm_diff.py:58
RK4OneStep.h
RKCartesianDerivative.h
query.result
tuple result
Definition:
query.py:137
RK4OneStep::operator()
CartesianState operator()(const CartesianState &start, const RKCartesianDerivative &deriv, double step) const
Definition:
RK4OneStep.cc:7
relval_parameters_module.step
string step
Definition:
relval_parameters_module.py:36
CartesianState
Definition:
CartesianState.h:8
RKCartesianDerivative
Definition:
RKCartesianDerivative.h:6
Generated for CMSSW Reference Manual by
1.8.5