GENIEGenerator
Loading...
Searching...
No Matches
CacheBranchFx.h
Go to the documentation of this file.
1//____________________________________________________________________________
2/*!
3
4\class genie::CacheBranchFx
5
6\brief A simple cache branch storing the cached data in a TNtuple
7
8\author Costas Andreopoulos <c.andreopoulos \at cern.ch>
9 University of Liverpool
10
11 Update May 15, 2022 IK:
12 Now type of spline can be: TSpline3, TSpline5 and
13 ROOT::Math::GSLInterpolator (LINEAR, POLYNOMIAL, CSPLINE, CSPLINE_PERIODIC,
14 AKIMA, AKIMA_PERIODIC)
15
16\ref [1] GENIE docdb 297
17
18\author Costas Andreopoulos <c.andreopoulos \at cern.ch>
19 University of Liverpool \n
20 Igor Kakorin <kakorin@jinr.ru>
21 Joint Institute for Nuclear Research
22
23\created November 26, 2004
24
25\cpright Copyright (c) 2003-2025, The GENIE Collaboration
26 For the full text of the license visit http://copyright.genie-mc.org
27*/
28//____________________________________________________________________________
29
30#ifndef _CACHE_BRANCH_FUNC_X_H_
31#define _CACHE_BRANCH_FUNC_X_H_
32
33#include <iostream>
34#include <string>
35#include <map>
36
39
40using std::string;
41using std::ostream;
42using std::map;
43
44namespace genie {
45
46class CacheBranchFx;
47ostream & operator << (ostream & stream, const CacheBranchFx & cbntp);
48
50{
51public:
52 using TObject::Print; // suppress clang 'hides overloaded virtual function [-Woverloaded-virtual]' warnings
53
55 CacheBranchFx(string name);
57
58 const map<double,double> & Map (void) const { return fFx; }
59 Spline * Spl (void) const { return fSpline; }
60
61 void CreateSpline(string type = "TSpline3");
62 void AddValues(double x, double y);
63
64 void Reset (void);
65 void Print (ostream & stream) const;
66
67 double operator () (double x) const;
68 friend ostream & operator << (ostream & stream, const CacheBranchFx & cbntp);
69
70private:
71 void Init (void);
72 void CleanUp (void);
73
74 string fName; ///< cache branch name
75 map<double,double> fFx; ///< x->y map
76 Spline * fSpline; ///< spline y = f(x)
77
78ClassDef(CacheBranchFx,1)
79};
80
81} // genie namespace
82#endif // _CACHE_BRANCH_FUNC_X_H_
A simple cache branch storing the cached data in a TNtuple.
void Print(ostream &stream) const
void CreateSpline(string type="TSpline3")
friend ostream & operator<<(ostream &stream, const CacheBranchFx &cbntp)
string fName
cache branch name
Spline * Spl(void) const
void AddValues(double x, double y)
Spline * fSpline
spline y = f(x)
double operator()(double x) const
map< double, double > fFx
x->y map
const map< double, double > & Map(void) const
A numeric analysis tool class for interpolating 1-D functions.
Definition Spline.h:58
THE MAIN GENIE PROJECT NAMESPACE
Definition AlgCmp.h:25
ostream & operator<<(ostream &stream, const AlgConfigPool &config_pool)