Logo ROOT   6.18/05
Reference Guide
HistoModels.hxx
Go to the documentation of this file.
1// Author: Enrico Guiraud, Danilo Piparo CERN 09/2017
2
3/*************************************************************************
4 * Copyright (C) 1995-2017, Rene Brun and Fons Rademakers. *
5 * All rights reserved. *
6 * *
7 * For the licensing terms see $ROOTSYS/LICENSE. *
8 * For the list of contributors see $ROOTSYS/README/CREDITS. *
9 *************************************************************************/
10
11#ifndef ROOT_RDFHISTOMODELS
12#define ROOT_RDFHISTOMODELS
13
14#include <TString.h>
15#include <memory>
16
17class TH1D;
18class TH2D;
19class TH3D;
20class TProfile;
21class TProfile2D;
22
23namespace ROOT {
24
25namespace RDF {
26
27struct TH1DModel {
30 int fNbinsX = 128;
31 double fXLow = 0.;
32 double fXUp = 64.;
33 std::vector<double> fBinXEdges;
34
35 TH1DModel() = default;
36 TH1DModel(const TH1DModel &) = default;
37 ~TH1DModel();
38 TH1DModel(const ::TH1D &h);
39 TH1DModel(const char *name, const char *title, int nbinsx, double xlow, double xup);
40 TH1DModel(const char *name, const char *title, int nbinsx, const float *xbins);
41 TH1DModel(const char *name, const char *title, int nbinsx, const double *xbins);
42 std::shared_ptr<::TH1D> GetHistogram() const;
43};
44
45struct TH2DModel {
48 int fNbinsX = 128;
49 double fXLow = 0.;
50 double fXUp = 64.;
51 int fNbinsY = 128;
52 double fYLow = 0.;
53 double fYUp = 64.;
54 std::vector<double> fBinXEdges;
55 std::vector<double> fBinYEdges;
56
57 TH2DModel() = default;
58 TH2DModel(const TH2DModel &) = default;
59 ~TH2DModel();
60 TH2DModel(const ::TH2D &h);
61 TH2DModel(const char *name, const char *title, int nbinsx, double xlow, double xup, int nbinsy, double ylow,
62 double yup);
63 TH2DModel(const char *name, const char *title, int nbinsx, const double *xbins, int nbinsy, double ylow, double yup);
64 TH2DModel(const char *name, const char *title, int nbinsx, double xlow, double xup, int nbinsy, const double *ybins);
65 TH2DModel(const char *name, const char *title, int nbinsx, const double *xbins, int nbinsy, const double *ybins);
66 TH2DModel(const char *name, const char *title, int nbinsx, const float *xbins, int nbinsy, const float *ybins);
67 std::shared_ptr<::TH2D> GetHistogram() const;
68};
69
70struct TH3DModel {
73 int fNbinsX = 128;
74 double fXLow = 0.;
75 double fXUp = 64.;
76 int fNbinsY = 128;
77 double fYLow = 0.;
78 double fYUp = 64.;
79 int fNbinsZ = 128;
80 double fZLow = 0.;
81 double fZUp = 64.;
82 std::vector<double> fBinXEdges;
83 std::vector<double> fBinYEdges;
84 std::vector<double> fBinZEdges;
85
86 TH3DModel() = default;
87 TH3DModel(const TH3DModel &) = default;
88 ~TH3DModel();
89 TH3DModel(const ::TH3D &h);
90 TH3DModel(const char *name, const char *title, int nbinsx, double xlow, double xup, int nbinsy, double ylow,
91 double yup, int nbinsz, double zlow, double zup);
92 TH3DModel(const char *name, const char *title, int nbinsx, const float *xbins, int nbinsy, const float *ybins,
93 int nbinsz, const float *zbins);
94 TH3DModel(const char *name, const char *title, int nbinsx, const double *xbins, int nbinsy, const double *ybins,
95 int nbinsz, const double *zbins);
96 std::shared_ptr<::TH3D> GetHistogram() const;
97};
98
102 int fNbinsX = 128;
103 double fXLow = 0.;
104 double fXUp = 64.;
105 double fYLow = 0.;
106 double fYUp = 0.;
108 std::vector<double> fBinXEdges;
109
110 TProfile1DModel() = default;
113 TProfile1DModel(const ::TProfile &h);
114 TProfile1DModel(const char *name, const char *title, int nbinsx, double xlow, double xup, const char *option = "");
115 TProfile1DModel(const char *name, const char *title, int nbinsx, double xlow, double xup, double ylow, double yup,
116 const char *option = "");
117 TProfile1DModel(const char *name, const char *title, int nbinsx, const float *xbins, const char *option = "");
118 TProfile1DModel(const char *name, const char *title, int nbinsx, const double *xbins, const char *option = "");
119 TProfile1DModel(const char *name, const char *title, int nbinsx, const double *xbins, double ylow, double yup,
120 const char *option = "");
121 std::shared_ptr<::TProfile> GetProfile() const;
122};
123
127 int fNbinsX = 128;
128 double fXLow = 0.;
129 double fXUp = 64.;
130 int fNbinsY = 128;
131 double fYLow = 0.;
132 double fYUp = 64.;
133 double fZLow = 0.;
134 double fZUp = 0.;
136 std::vector<double> fBinXEdges;
137 std::vector<double> fBinYEdges;
138
139 TProfile2DModel() = default;
142 TProfile2DModel(const ::TProfile2D &h);
143 TProfile2DModel(const char *name, const char *title, int nbinsx, double xlow, double xup, int nbinsy, double ylow,
144 double yup, const char *option = "");
145 TProfile2DModel(const char *name, const char *title, int nbinsx, double xlow, double xup, int nbinsy, double ylow,
146 double yup, double zlow, double zup, const char *option = "");
147 TProfile2DModel(const char *name, const char *title, int nbinsx, const double *xbins, int nbinsy, double ylow,
148 double yup, const char *option = "");
149 TProfile2DModel(const char *name, const char *title, int nbinsx, double xlow, double xup, int nbinsy,
150 const double *ybins, const char *option = "");
151 TProfile2DModel(const char *name, const char *title, int nbinsx, const double *xbins, int nbinsy,
152 const double *ybins, const char *option = "");
153 std::shared_ptr<::TProfile2D> GetProfile() const;
154};
155
156} // ns RDF
157
158} // ns ROOT
159
160#endif // ROOT_RDFHISTOMODELS
#define h(i)
Definition: RSha256.hxx:106
char name[80]
Definition: TGX11.cxx:109
1-D histogram with a double per channel (see TH1 documentation)}
Definition: TH1.h:614
2-D histogram with a double per channel (see TH1 documentation)}
Definition: TH2.h:289
3-D histogram with a double per channel (see TH1 documentation)}
Definition: TH3.h:302
Profile2D histograms are used to display the mean value of Z and its RMS for each cell in X,...
Definition: TProfile2D.h:27
Profile Histogram.
Definition: TProfile.h:32
Basic string class.
Definition: TString.h:131
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
A struct which stores the parameters of a TH1D.
Definition: HistoModels.hxx:27
std::shared_ptr<::TH1D > GetHistogram() const
std::vector< double > fBinXEdges
Definition: HistoModels.hxx:33
TH1DModel(const TH1DModel &)=default
A struct which stores the parameters of a TH2D.
Definition: HistoModels.hxx:45
std::vector< double > fBinYEdges
Definition: HistoModels.hxx:55
TH2DModel(const TH2DModel &)=default
std::vector< double > fBinXEdges
Definition: HistoModels.hxx:54
std::shared_ptr<::TH2D > GetHistogram() const
A struct which stores the parameters of a TH3D.
Definition: HistoModels.hxx:70
std::vector< double > fBinZEdges
Definition: HistoModels.hxx:84
TH3DModel(const TH3DModel &)=default
std::vector< double > fBinYEdges
Definition: HistoModels.hxx:83
std::vector< double > fBinXEdges
Definition: HistoModels.hxx:82
std::shared_ptr<::TH3D > GetHistogram() const
A struct which stores the parameters of a TProfile.
Definition: HistoModels.hxx:99
std::shared_ptr<::TProfile > GetProfile() const
std::vector< double > fBinXEdges
TProfile1DModel(const TProfile1DModel &)=default
A struct which stores the parameters of a TProfile2D.
TProfile2DModel(const TProfile2DModel &)=default
std::vector< double > fBinXEdges
std::shared_ptr<::TProfile2D > GetProfile() const
std::vector< double > fBinYEdges