Project
Loading...
Searching...
No Matches
CachingTF1.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
14
15#ifndef ALICEO2_CACHINGTF1_H
16#define ALICEO2_CACHINGTF1_H
17
18#include <TF1.h>
19
20namespace o2
21{
22namespace math_utils
23{
24class CachingTF1 : public TF1
25{
32 public:
33 using TF1::TF1;
34 ~CachingTF1() override = default;
35
36 // get reading access to fIntegral member
37 std::vector<double> const& getIntegralVector() const { return fIntegral; }
38
39 private:
40 // in the original TF1 implementation, these members
41 // are marked transient; by simply introducing something that
42 // points to them they will now be written correctly to disc
43 std::vector<double>* mIntegralCache = &fIntegral;
44 std::vector<double>* mAlphaCache = &fAlpha;
45 std::vector<double>* mBetaCache = &fBeta;
46 std::vector<double>* mGammaCache = &fGamma;
47 ClassDefOverride(CachingTF1, 1);
48};
49} // namespace math_utils
50} // namespace o2
51
52#endif
~CachingTF1() override=default
std::vector< double > const & getIntegralVector() const
Definition CachingTF1.h:37
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...