EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Nystrom.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Nystrom.h
1 /* Copyright 2008-2009, Technische Universitaet Muenchen,
2  Authors: Christian Hoeppner & Sebastian Neubert
3 
4  This file is part of GENFIT.
5 
6  GENFIT is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published
8  by the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  GENFIT is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with GENFIT. If not, see <http://www.gnu.org/licenses/>.
18 */
19 //-----------------------------------------------------------
20 // File and Version Information:
21 // $Id$
22 //
23 // Description:
24 // 4th order Runge Kutta algorithm after Nystrom
25 // integrates a second order ordinary differentiel equation of type
26 // u''=g(u,u'); u=(u1,u2,...un); u\element{R}
27 //
28 // Environment:
29 // Software developed for the PANDA Detector at FAIR.
30 //
31 // Author List:
32 // Sebastian Neubert TUM (original author)
33 //
34 //
35 //-----------------------------------------------------------
36 
37 #ifndef NYSTROM_HH
38 #define NYSTROM_HH
39 
40 // Base Class Headers ----------------
41 
42 
43 // Collaborating Class Headers -------
44 #include <ostream> // remove if you do not need streaming op
45 #include "TVectorT.h"
46 
47 // Collaborating Class Declarations --
48 class AbsNystromEQM;
49 
50 
51 class Nystrom {
52 public:
53 
54  // Constructors/Destructors ---------
55  Nystrom(AbsNystromEQM* eqm);
57 
58  // Modifiers -----------------------
59  void setFunction(AbsNystromEQM* eqm){_eqm=eqm;}
60  void setAccuracy(double a){_acc=a;}
61  void setAdaptive(bool flag=true){_adaptive=flag;}
62 
63  // Operations ----------------------
64  void step(const TVectorT<double>& u,
65  const TVectorT<double>& uprime,
66  const TVectorT<double>& par,
67  TVectorT<double>& newu, TVectorT<double>& newuprime,
68  double h);
69 
70  double adaptiveStep(const TVectorT<double>& u,
71  const TVectorT<double>& uprime,
72  const TVectorT<double>& par,
73  TVectorT<double>& newu,
74  TVectorT<double>& newuprime,
75  double& stepdone,
76  double h,double sign, double reststep); // return new h
77 
78 
79  // returns length of propagation (in 3D!)
80  double propagate(double start, double end,
81  const TVectorT<double>& u,
82  const TVectorT<double>& uprime,
83  const TVectorT<double>& par,
84  TVectorT<double>& newu, TVectorT<double>& newuprime);
85 private:
86 
87  // Private Data Members ------------
88 
89  // Equation of Motion:
91  double _acc; // desired accuracy
92  bool _adaptive; // use adaptive stepping? default=true;
93 
94  // function pointer to system function u''=g(u,u')
95  // TVectorT<double>(*_g)(const TVectorT<double>&u,const TVectorT<double>& uprim, const TVectorT<double>& par);
96 
97  // Private Methods -----------------
98 
99 };
100 
101 #endif
102 
103 //--------------------------------------------------------------
104 // $Log$
105 //--------------------------------------------------------------