Logo ROOT   6.14/05
Reference Guide
RDFHistoModels.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();
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();
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();
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;
112  ~TProfile1DModel();
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;
141  ~TProfile2DModel();
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
std::vector< double > fBinYEdges
std::vector< double > fBinYEdges
A struct which stores the parameters of a TProfile2D.
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
A struct which stores the parameters of a TH3D.
std::vector< double > fBinZEdges
Basic string class.
Definition: TString.h:131
std::vector< double > fBinYEdges
Profile Histogram.
Definition: TProfile.h:32
A struct which stores the parameters of a TH2D.
std::vector< double > fBinXEdges
THist< 3, double, THistStatContent, THistStatUncertainty > TH3D
Definition: THist.hxx:296
std::vector< double > fBinXEdges
3-D histogram with a double per channel (see TH1 documentation)}
Definition: TH3.h:304
std::vector< double > fBinXEdges
1-D histogram with a double per channel (see TH1 documentation)}
Definition: TH1.h:610
#define h(i)
Definition: RSha256.hxx:106
A struct which stores the parameters of a TH1D.
std::vector< double > fBinXEdges
A struct which stores the parameters of a TProfile.
THist< 2, double, THistStatContent, THistStatUncertainty > TH2D
Definition: THist.hxx:290
Profile2D histograms are used to display the mean value of Z and its RMS for each cell in X...
Definition: TProfile2D.h:27
THist< 1, double, THistStatContent, THistStatUncertainty > TH1D
Definition: THist.hxx:284
std::shared_ptr<::TH1D > GetHistogram() const
std::vector< double > fBinXEdges
char name[80]
Definition: TGX11.cxx:109
2-D histogram with a double per channel (see TH1 documentation)}
Definition: TH2.h:291