GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
TCalGraph.h
Go to the documentation of this file.
1#ifndef TCALGRAPH_H
2#define TCALGRAPH_H
3
4/** \addtogroup Calibration
5 * @{
6 */
7
8/////////////////////////////////////////////////////////////////
9///
10/// \class TCalGraph
11///
12/// This is a class that contains the basic info
13/// about a calibration. Calibrations here are TGraphErrors
14/// that are fit, with the resulting fit function being the
15/// calibrating function.
16///
17/////////////////////////////////////////////////////////////////
18
19#include <map>
20#include <utility>
21
22#include "TGraphErrors.h"
23#include "TCalPoint.h"
24#include "TCalList.h"
25#include "TSourceList.h"
26
27class TCalGraph : public TGraphErrors {
28public:
29 TCalGraph();
30 TCalGraph(const char* name, const char* title) : TGraphErrors(name, title) {};
31 TCalGraph(const TCalGraph&);
32 TCalGraph(TCalGraph&&) noexcept = default;
33 TCalGraph& operator=(const TCalGraph&) = default;
34 TCalGraph& operator=(TCalGraph&&) noexcept = default;
35 ~TCalGraph() = default;
36
37#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 24, 0)
38 using TGraph::AddPoint;
39#endif
40 void AddPoint(const TCalPoint& cal_point);
41 Int_t FindClosestPointX(const Double_t& x_val);
42 Double_t FindDistToClosestPointX(const Double_t& x_val);
43
44 Int_t AddLists(const TCalList& cal_list, const TSourceList& src_list);
45 void Draw(Option_t* opt = "") override
46 {
47 BuildGraph();
48 TGraphErrors::Draw(opt);
49 }
50 void ClearAllPoints(Option_t* opt = "");
51
52 void Print(Option_t* opt = "") const override;
53 void Clear(Option_t* opt = "") override;
54
55protected:
56 std::map<UInt_t, std::pair<TCalPoint, TCalPoint>>& CompareMap() { return fCompareMap; }
57
58private:
59 void CorrectMissingPoints(TCalList& cal_list, TCalList& src_list);
60
61 virtual void BuildGraph() = 0;
62
63 std::map<UInt_t, std::pair<TCalPoint, TCalPoint>> fCompareMap;
64
65 /// \cond CLASSIMP
66 ClassDefOverride(TCalGraph, 1) // NOLINT(readability-else-after-return)
67 /// \endcond
68};
69/*! @} */
70#endif
void Draw(Option_t *opt="") override
Definition TCalGraph.h:45
Int_t AddLists(const TCalList &cal_list, const TSourceList &src_list)
Definition TCalGraph.cxx:63
Int_t FindClosestPointX(const Double_t &x_val)
Definition TCalGraph.cxx:43
TCalGraph(const char *name, const char *title)
Definition TCalGraph.h:30
TCalGraph(TCalGraph &&) noexcept=default
Double_t FindDistToClosestPointX(const Double_t &x_val)
Definition TCalGraph.cxx:57
std::map< UInt_t, std::pair< TCalPoint, TCalPoint > > & CompareMap()
Definition TCalGraph.h:56
void Print(Option_t *opt="") const override
Definition TCalGraph.cxx:16
void AddPoint(const TCalPoint &cal_point)
Definition TCalGraph.cxx:36
void ClearAllPoints(Option_t *opt="")
virtual void BuildGraph()=0
void CorrectMissingPoints(TCalList &cal_list, TCalList &src_list)
std::map< UInt_t, std::pair< TCalPoint, TCalPoint > > fCompareMap
Definition TCalGraph.h:63
void Clear(Option_t *opt="") override
Definition TCalGraph.cxx:30