Logo ROOT  
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 
17 class TH1D;
18 class TH2D;
19 class TH3D;
20 class TProfile;
21 class TProfile2D;
22 
23 namespace ROOT {
24 
25 namespace RDF {
26 
27 struct 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 
45 struct 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 
70 struct 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;
111  TProfile1DModel(const 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;
140  TProfile2DModel(const 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
ROOT::RDF::TH1DModel::TH1DModel
TH1DModel()=default
ROOT::RDF::TH1DModel::fTitle
TString fTitle
Definition: HistoModels.hxx:29
ROOT::RDF::TProfile2DModel::~TProfile2DModel
~TProfile2DModel()
Definition: RDFHistoModels.cxx:341
ROOT::RDF::TH3DModel::fYUp
double fYUp
Definition: HistoModels.hxx:78
ROOT::RDF::TH3DModel::fBinXEdges
std::vector< double > fBinXEdges
Definition: HistoModels.hxx:82
ROOT::RDF::TH1DModel::fBinXEdges
std::vector< double > fBinXEdges
Definition: HistoModels.hxx:33
ROOT::RDF::TH3DModel::GetHistogram
std::shared_ptr<::TH3D > GetHistogram() const
Definition: RDFHistoModels.cxx:200
TH3D
3-D histogram with a double per channel (see TH1 documentation)}
Definition: TH3.h:304
ROOT::RDF::TProfile2DModel::fXLow
double fXLow
Definition: HistoModels.hxx:128
ROOT::RDF::TProfile2DModel::fZUp
double fZUp
Definition: HistoModels.hxx:134
ROOT::RDF::TH3DModel::TH3DModel
TH3DModel()=default
ROOT::RDF::TProfile2DModel::GetProfile
std::shared_ptr<::TProfile2D > GetProfile() const
Definition: RDFHistoModels.cxx:314
ROOT::RDF::TH1DModel::fNbinsX
int fNbinsX
Definition: HistoModels.hxx:30
ROOT::RDF::TProfile2DModel::fYUp
double fYUp
Definition: HistoModels.hxx:132
ROOT::RDF::TProfile2DModel::fOption
TString fOption
Definition: HistoModels.hxx:135
ROOT::RDF::TProfile2DModel::fBinXEdges
std::vector< double > fBinXEdges
Definition: HistoModels.hxx:136
TProfile2D
Definition: TProfile2D.h:27
ROOT::RDF::TProfile2DModel::fYLow
double fYLow
Definition: HistoModels.hxx:131
ROOT::RDF::TH2DModel
A struct which stores the parameters of a TH2D.
Definition: HistoModels.hxx:45
TH1D
1-D histogram with a double per channel (see TH1 documentation)}
Definition: TH1.h:615
ROOT::RDF::TH3DModel::fNbinsY
int fNbinsY
Definition: HistoModels.hxx:76
ROOT::RDF::TProfile2DModel::fXUp
double fXUp
Definition: HistoModels.hxx:129
ROOT::RDF::TH2DModel::GetHistogram
std::shared_ptr<::TH2D > GetHistogram() const
Definition: RDFHistoModels.cxx:150
ROOT::RDF::TH1DModel::fXUp
double fXUp
Definition: HistoModels.hxx:32
ROOT::RDF::TH1DModel::fName
TString fName
Definition: HistoModels.hxx:28
ROOT::RDF::TProfile2DModel::fNbinsY
int fNbinsY
Definition: HistoModels.hxx:130
ROOT::RDF::TProfile1DModel::TProfile1DModel
TProfile1DModel()=default
ROOT::RDF::TH3DModel::fBinZEdges
std::vector< double > fBinZEdges
Definition: HistoModels.hxx:84
ROOT::RDF::TProfile1DModel
A struct which stores the parameters of a TProfile.
Definition: HistoModels.hxx:99
TString
Definition: TString.h:136
ROOT::RDF::TProfile2DModel::fBinYEdges
std::vector< double > fBinYEdges
Definition: HistoModels.hxx:137
TString.h
ROOT::RDF::TH1DModel::~TH1DModel
~TH1DModel()
Definition: RDFHistoModels.cxx:109
ROOT::RDF::TProfile1DModel::fXLow
double fXLow
Definition: HistoModels.hxx:103
ROOT::RDF::TProfile1DModel::fXUp
double fXUp
Definition: HistoModels.hxx:104
ROOT::RDF::TH3DModel::fXUp
double fXUp
Definition: HistoModels.hxx:75
ROOT::RDF::TH3DModel::fBinYEdges
std::vector< double > fBinYEdges
Definition: HistoModels.hxx:83
ROOT::RDF::TH2DModel::TH2DModel
TH2DModel()=default
ROOT::RDF::TH3DModel::fZLow
double fZLow
Definition: HistoModels.hxx:80
ROOT::RDF::TH2DModel::fName
TString fName
Definition: HistoModels.hxx:46
ROOT::RDF::TH3DModel
A struct which stores the parameters of a TH3D.
Definition: HistoModels.hxx:70
ROOT::RDF::TH3DModel::fNbinsZ
int fNbinsZ
Definition: HistoModels.hxx:79
ROOT::RDF::TH2DModel::fNbinsY
int fNbinsY
Definition: HistoModels.hxx:51
ROOT::RDF::TH1DModel::fXLow
double fXLow
Definition: HistoModels.hxx:31
ROOT::RDF::TProfile2DModel::fZLow
double fZLow
Definition: HistoModels.hxx:133
ROOT::RDF::TH2DModel::fXUp
double fXUp
Definition: HistoModels.hxx:50
h
#define h(i)
Definition: RSha256.hxx:124
ROOT::RDF::TH2DModel::~TH2DModel
~TH2DModel()
Definition: RDFHistoModels.cxx:167
ROOT::RDF::TProfile2DModel::TProfile2DModel
TProfile2DModel()=default
ROOT::RDF::TProfile1DModel::GetProfile
std::shared_ptr<::TProfile > GetProfile() const
Definition: RDFHistoModels.cxx:254
TH2D
2-D histogram with a double per channel (see TH1 documentation)}
Definition: TH2.h:292
ROOT::RDF::TH2DModel::fYUp
double fYUp
Definition: HistoModels.hxx:53
ROOT::RDF::TH2DModel::fTitle
TString fTitle
Definition: HistoModels.hxx:47
ROOT::RDF::TH3DModel::fName
TString fName
Definition: HistoModels.hxx:71
ROOT::RDF::TProfile1DModel::fNbinsX
int fNbinsX
Definition: HistoModels.hxx:102
ROOT::RDF::TProfile1DModel::~TProfile1DModel
~TProfile1DModel()
Definition: RDFHistoModels.cxx:266
ROOT::RDF::TProfile1DModel::fOption
TString fOption
Definition: HistoModels.hxx:107
ROOT::RDF::TProfile2DModel::fNbinsX
int fNbinsX
Definition: HistoModels.hxx:127
ROOT::RDF::TH2DModel::fYLow
double fYLow
Definition: HistoModels.hxx:52
ROOT::RDF::TProfile1DModel::fTitle
TString fTitle
Definition: HistoModels.hxx:101
TProfile
Definition: TProfile.h:32
ROOT::RDF::TH3DModel::fNbinsX
int fNbinsX
Definition: HistoModels.hxx:73
ROOT::RDF::TH2DModel::fBinYEdges
std::vector< double > fBinYEdges
Definition: HistoModels.hxx:55
ROOT::RDF::TH2DModel::fNbinsX
int fNbinsX
Definition: HistoModels.hxx:48
ROOT::RDF::TProfile2DModel::fName
TString fName
Definition: HistoModels.hxx:125
ROOT::RDF::TH3DModel::fXLow
double fXLow
Definition: HistoModels.hxx:74
name
char name[80]
Definition: TGX11.cxx:110
ROOT::RDF::TProfile1DModel::fYUp
double fYUp
Definition: HistoModels.hxx:106
ROOT::RDF::TH3DModel::fYLow
double fYLow
Definition: HistoModels.hxx:77
ROOT::RDF::TH2DModel::fBinXEdges
std::vector< double > fBinXEdges
Definition: HistoModels.hxx:54
ROOT::RDF::TH2DModel::fXLow
double fXLow
Definition: HistoModels.hxx:49
ROOT::RDF::TH3DModel::~TH3DModel
~TH3DModel()
Definition: RDFHistoModels.cxx:212
ROOT::RDF::TH3DModel::fZUp
double fZUp
Definition: HistoModels.hxx:81
ROOT::RDF::TH1DModel::GetHistogram
std::shared_ptr<::TH1D > GetHistogram() const
Definition: RDFHistoModels.cxx:98
ROOT::RDF::TProfile1DModel::fBinXEdges
std::vector< double > fBinXEdges
Definition: HistoModels.hxx:108
ROOT
VSD Structures.
Definition: StringConv.hxx:21
ROOT::RDF::TH3DModel::fTitle
TString fTitle
Definition: HistoModels.hxx:72
ROOT::RDF::TProfile2DModel
A struct which stores the parameters of a TProfile2D.
Definition: HistoModels.hxx:124
ROOT::RDF::TProfile1DModel::fYLow
double fYLow
Definition: HistoModels.hxx:105
ROOT::RDF::TProfile2DModel::fTitle
TString fTitle
Definition: HistoModels.hxx:126
ROOT::RDF::TH1DModel
A struct which stores the parameters of a TH1D.
Definition: HistoModels.hxx:27
ROOT::RDF::TProfile1DModel::fName
TString fName
Definition: HistoModels.hxx:100