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 <constantinos.andreopoulos \at cern.ch>
9  University of Liverpool & STFC Rutherford Appleton Laboratory
10 
11 \created November 26, 2004
12 
13 \cpright Copyright (c) 2003-2020, The GENIE Collaboration
14  For the full text of the license visit http://copyright.genie-mc.org
15 */
16 //____________________________________________________________________________
17 
18 #ifndef _CACHE_BRANCH_FUNC_X_H_
19 #define _CACHE_BRANCH_FUNC_X_H_
20 
21 #include <iostream>
22 #include <string>
23 #include <map>
24 
27 
28 using std::string;
29 using std::ostream;
30 using std::map;
31 
32 namespace genie {
33 
34 class CacheBranchFx;
35 ostream & operator << (ostream & stream, const CacheBranchFx & cbntp);
36 
38 {
39 public:
40  using TObject::Print; // suppress clang 'hides overloaded virtual function [-Woverloaded-virtual]' warnings
41 
42  CacheBranchFx();
43  CacheBranchFx(string name);
45 
46  const map<double,double> & Map (void) const { return fFx; }
47  Spline * Spl (void) const { return fSpline; }
48 
49  void CreateSpline(void);
50  void AddValues(double x, double y);
51 
52  void Reset (void);
53  void Print (ostream & stream) const;
54 
55  double operator () (double x) const;
56  friend ostream & operator << (ostream & stream, const CacheBranchFx & cbntp);
57 
58 private:
59  void Init (void);
60  void CleanUp (void);
61 
62  string fName; ///< cache branch name
63  map<double,double> fFx; ///< x->y map
64  Spline * fSpline; ///< spline y = f(x)
65 
67 };
68 
69 } // genie namespace
70 #endif // _CACHE_BRANCH_FUNC_X_H_
static QCString name
Definition: declinfo.cpp:673
THE MAIN GENIE PROJECT NAMESPACE
Definition: AlgCmp.h:25
void Print(ostream &stream) const
map< double, double > fFx
x->y map
Definition: CacheBranchFx.h:63
std::string string
Definition: nybbler.cc:12
A numeric analysis tool class for interpolating 1-D functions.
Definition: Spline.h:46
string fName
cache branch name
Definition: CacheBranchFx.h:62
friend ostream & operator<<(ostream &stream, const CacheBranchFx &cbntp)
void AddValues(double x, double y)
Spline * Spl(void) const
Definition: CacheBranchFx.h:47
Spline * fSpline
spline y = f(x)
Definition: CacheBranchFx.h:64
const map< double, double > & Map(void) const
Definition: CacheBranchFx.h:46
ostream & operator<<(ostream &stream, const AlgConfigPool &config_pool)
double operator()(double x) const
list x
Definition: train.py:276
A simple cache branch storing the cached data in a TNtuple.
Definition: CacheBranchFx.h:37
The TObject at the root of concrete cache branches.
Definition: CacheBranchI.h:25