Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RProfile.hxx
Go to the documentation of this file.
1/// \file
2/// \warning This is part of the %ROOT 7 prototype! It will change without notice. It might trigger earthquakes.
3/// Feedback is welcome!
4
5#ifndef ROOT_RProfile
6#define ROOT_RProfile
7
8#include "RAxisVariant.hxx"
9#include "RBinIndex.hxx"
11#include "RHistEngine.hxx"
12#include "RHistStats.hxx"
13#include "RHistUtils.hxx"
14#include "RRegularAxis.hxx"
15#include "RWeight.hxx"
16
17#include <array>
18#include <cstddef>
19#include <cstdint>
20#include <initializer_list>
21#include <stdexcept>
22#include <tuple>
23#include <type_traits>
24#include <utility>
25#include <vector>
26
27class TBuffer;
28
29namespace ROOT {
30namespace Experimental {
31
32/**
33A profile histogram, computing statistical quantities of an additional variable per bin.
34
35Calling \ref Fill(const A &... args) "Fill" requires an additional value:
36\code
37ROOT::Experimental::RProfile profile(10, {5, 15});
38profile.Fill(8.2, 23.0);
39profile.Fill(8.7, 25.0);
40// Bin 3 has a mean of 24.0 and a standard deviation of 1.0
41\endcode
42
43The class is not templated, the bin content is always of type RProfileBin.
44
45An object can have arbitrary dimensionality determined at run-time. The axis configuration is passed as a vector of
46RAxisVariant:
47\code
48std::vector<ROOT::Experimental::RAxisVariant> axes;
49axes.push_back(ROOT::Experimental::RRegularAxis(10, {5, 15}));
50axes.push_back(ROOT::Experimental::RVariableBinAxis({1, 10, 100, 1000}));
51ROOT::Experimental::RProfile profile(axes);
52// profile.GetNDimensions() will return 2
53\endcode
54
55\warning This is part of the %ROOT 7 prototype! It will change without notice. It might trigger earthquakes.
56Feedback is welcome!
57*/
60 double fValue;
61
62 explicit RValueWrapper(double value) : fValue(value) {}
63 };
64
66 double fValue;
67 double fWeight;
68
69 explicit RValueWeightWrapper(double value, double weight) : fValue(value), fWeight(weight) {}
70 };
71
72public:
73 /// The bin content type of a profile histogram.
75 double fSumValues = 0;
76 double fSumValues2 = 0;
77 double fSum = 0;
78 double fSum2 = 0;
79
81 {
82 fSumValues += rhs.fValue;
83 fSumValues2 += rhs.fValue * rhs.fValue;
84 fSum++;
85 fSum2++;
86 return *this;
87 }
88
90 {
91 fSumValues += rhs.fWeight * rhs.fValue;
92 fSumValues2 += rhs.fWeight * rhs.fValue * rhs.fValue;
93 fSum += rhs.fWeight;
94 fSum2 += rhs.fWeight * rhs.fWeight;
95 return *this;
96 }
97
99 {
100 fSumValues += rhs.fSumValues;
101 fSumValues2 += rhs.fSumValues2;
102 fSum += rhs.fSum;
103 fSum2 += rhs.fSum2;
104 return *this;
105 }
106
107 RProfileBin &operator*=(double factor)
108 {
109 fSumValues *= factor;
110 fSumValues2 *= factor;
111 fSum *= factor;
112 fSum2 *= factor * factor;
113 return *this;
114 }
115
116 /// Add another bin content using atomic instructions.
117 ///
118 /// \param[in] rhs another bin content that must not be modified during the operation
120 {
121 Internal::AtomicAdd(&fSumValues, rhs.fSumValues);
122 Internal::AtomicAdd(&fSumValues2, rhs.fSumValues2);
125 }
126 };
127
128private:
129 /// The histogram engine including the bin contents.
131 /// The global histogram statistics.
133
134 /// Private constructor based off an engine.
136
137public:
138 /// Construct a profile histogram.
139 ///
140 /// \param[in] axes the axis objects, must have size > 0
141 explicit RProfile(std::vector<RAxisVariant> axes) : fEngine(std::move(axes)), fStats(fEngine.GetNDimensions() + 1)
142 {
143 // The axes parameter was moved, use from the engine.
144 const auto &engineAxes = fEngine.GetAxes();
145 for (std::size_t i = 0; i < engineAxes.size(); i++) {
146 if (engineAxes[i].GetCategoricalAxis() != nullptr) {
148 }
149 }
150 }
151
152 /// Construct a profile histogram.
153 ///
154 /// Note that there is no perfect forwarding of the axis objects. If that is needed, use the
155 /// \ref RProfile(std::vector<RAxisVariant> axes) "overload accepting a std::vector".
156 ///
157 /// \param[in] axes the axis objects, must have size > 0
158 explicit RProfile(std::initializer_list<RAxisVariant> axes) : RProfile(std::vector(axes)) {}
159
160 /// Construct a profile histogram.
161 ///
162 /// Note that there is no perfect forwarding of the axis objects. If that is needed, use the
163 /// \ref RProfile(std::vector<RAxisVariant> axes) "overload accepting a std::vector".
164 ///
165 /// \param[in] axis1 the first axis object
166 /// \param[in] axes the remaining axis objects
167 template <typename... Axes>
168 explicit RProfile(const RAxisVariant &axis1, const Axes &...axes)
169 : RProfile(std::vector<RAxisVariant>{axis1, axes...})
170 {
171 }
172
173 /// Construct a one-dimensional profile histogram with a regular axis.
174 ///
175 /// \param[in] nNormalBins the number of normal bins, must be > 0
176 /// \param[in] interval the axis interval (lower end inclusive, upper end exclusive)
177 /// \par See also
178 /// the \ref RRegularAxis::RRegularAxis(std::uint64_t nNormalBins, std::pair<double, double> interval, bool
179 /// enableFlowBins) "constructor of RRegularAxis"
180 RProfile(std::uint64_t nNormalBins, std::pair<double, double> interval)
182 {
183 }
184
185 /// The copy constructor is deleted.
186 ///
187 /// Copying all bin contents can be an expensive operation, depending on the number of bins. If required, users can
188 /// explicitly call Clone().
189 RProfile(const RProfile &) = delete;
190 /// Efficiently move construct a profile histogram.
191 ///
192 /// After this operation, the moved-from object is invalid.
193 RProfile(RProfile &&) = default;
194
195 /// The copy assignment operator is deleted.
196 ///
197 /// Copying all bin contents can be an expensive operation, depending on the number of bins. If required, users can
198 /// explicitly call Clone().
199 RProfile &operator=(const RProfile &) = delete;
200 /// Efficiently move a profile histogram.
201 ///
202 /// After this operation, the moved-from object is invalid.
204
205 ~RProfile() = default;
206
207 /// \name Accessors
208 /// \{
209
210 const RHistEngine<RProfileBin> &GetEngine() const { return fEngine; }
211 const RHistStats &GetStats() const { return fStats; }
212
213 const std::vector<RAxisVariant> &GetAxes() const { return fEngine.GetAxes(); }
214 std::size_t GetNDimensions() const { return fEngine.GetNDimensions(); }
215 std::uint64_t GetTotalNBins() const { return fEngine.GetTotalNBins(); }
216
217 std::uint64_t GetNEntries() const { return fStats.GetNEntries(); }
218
219 /// \}
220 /// \name Computations
221 /// \{
222
223 /// \copydoc RHistStats::ComputeNEffectiveEntries()
225 /// \copydoc RHistStats::ComputeMean()
226 double ComputeMean(std::size_t dim = 0) const { return fStats.ComputeMean(dim); }
227 /// \copydoc RHistStats::ComputeStdDev()
228 double ComputeStdDev(std::size_t dim = 0) const { return fStats.ComputeStdDev(dim); }
229
230 /// \}
231 /// \name Accessors
232 /// \{
233
234 /// Get the content of a single bin.
235 ///
236 /// \code
237 /// ROOT::Experimental::RProfile profile({/* two dimensions */});
238 /// std::array<ROOT::Experimental::RBinIndex, 2> indices = {3, 5};
239 /// const auto &content = profile.GetBinContent(indices);
240 /// \endcode
241 ///
242 /// \note Compared to TH1 conventions, the first normal bin has index 0 and underflow and overflow bins are special
243 /// values. See also the class documentation of RBinIndex.
244 ///
245 /// Throws an exception if the number of indices does not match the axis configuration or the bin is not found.
246 ///
247 /// \param[in] indices the array of indices for each axis
248 /// \return the bin content
249 /// \par See also
250 /// the \ref GetBinContent(const A &... args) const "variadic function template overload" accepting arguments
251 /// directly
252 template <std::size_t N>
253 const RProfileBin &GetBinContent(const std::array<RBinIndex, N> &indices) const
254 {
255 return fEngine.GetBinContent(indices);
256 }
257
258 /// Get the content of a single bin.
259 ///
260 /// \code
261 /// ROOT::Experimental::RProfile profile({/* two dimensions */});
262 /// std::vector<ROOT::Experimental::RBinIndex> indices = {3, 5};
263 /// const auto &content = profile.GetBinContent(indices);
264 /// \endcode
265 ///
266 /// \note Compared to TH1 conventions, the first normal bin has index 0 and underflow and overflow bins are special
267 /// values. See also the class documentation of RBinIndex.
268 ///
269 /// Throws an exception if the number of indices does not match the axis configuration or the bin is not found.
270 ///
271 /// \param[in] indices the array of indices for each axis
272 /// \return the bin content
273 /// \par See also
274 /// the \ref GetBinContent(const A &... args) const "variadic function template overload" accepting arguments
275 /// directly
276 const RProfileBin &GetBinContent(const std::vector<RBinIndex> &indices) const
277 {
278 return fEngine.GetBinContent(indices);
279 }
280
281 /// Get the content of a single bin.
282 ///
283 /// \code
284 /// ROOT::Experimental::RProfile profile({/* two dimensions */});
285 /// const auto &content = profile.GetBinContent(3, 5);
286 /// \endcode
287 ///
288 /// \note Compared to TH1 conventions, the first normal bin has index 0 and underflow and overflow bins are special
289 /// values. See also the class documentation of RBinIndex.
290 ///
291 /// Throws an exception if the number of arguments does not match the axis configuration or the bin is not found.
292 ///
293 /// \param[in] args the arguments for each axis
294 /// \return the bin content
295 /// \par See also
296 /// the function overloads accepting \ref GetBinContent(const std::array<RBinIndex, N> &indices) const "`std::array`"
297 /// or \ref GetBinContent(const std::vector<RBinIndex> &indices) const "`std::vector`"
298 template <typename... A>
299 const RProfileBin &GetBinContent(const A &...args) const
300 {
301 return fEngine.GetBinContent(args...);
302 }
303
304 /// Get the multidimensional range of all bins.
305 ///
306 /// \return the multidimensional range
307 RBinIndexMultiDimRange GetFullMultiDimRange() const { return fEngine.GetFullMultiDimRange(); }
308
309 /// Set the content of a single bin.
310 ///
311 /// \code
312 /// ROOT::Experimental::RProfile profile({/* two dimensions */});
313 /// std::array<ROOT::Experimental::RBinIndex, 2> indices = {3, 5};
314 /// ROOT::Experimental::RProfile::RProfileBin value = /* ... */;
315 /// profile.SetBinContent(indices, value);
316 /// \endcode
317 ///
318 /// \note Compared to TH1 conventions, the first normal bin has index 0 and underflow and overflow bins are special
319 /// values. See also the class documentation of RBinIndex.
320 ///
321 /// Throws an exception if the number of indices does not match the axis configuration or the bin is not found.
322 ///
323 /// \warning Setting the bin content will taint the global histogram statistics. Attempting to access its values, for
324 /// example calling GetNEntries(), will throw exceptions.
325 ///
326 /// \param[in] indices the array of indices for each axis
327 /// \param[in] value the new value of the bin content
328 /// \par See also
329 /// the \ref SetBinContent(const A &... args) "variadic function template overload" accepting arguments directly
330 template <std::size_t N, typename V>
331 void SetBinContent(const std::array<RBinIndex, N> &indices, const V &value)
332 {
333 fEngine.SetBinContent(indices, value);
334 fStats.Taint();
335 }
336
337 /// Set the content of a single bin.
338 ///
339 /// \code
340 /// ROOT::Experimental::RProfile profile({/* two dimensions */});
341 /// ROOT::Experimental::RProfile::RProfileBin value = /* ... */;
342 /// profile.SetBinContent(3, 5, value);
343 /// \endcode
344 ///
345 /// \note Compared to TH1 conventions, the first normal bin has index 0 and underflow and overflow bins are special
346 /// values. See also the class documentation of RBinIndex.
347 ///
348 /// Throws an exception if the number of arguments does not match the axis configuration or the bin is not found.
349 ///
350 /// \warning Setting the bin content will taint the global histogram statistics. Attempting to access its values, for
351 /// example calling GetNEntries(), will throw exceptions.
352 ///
353 /// \param[in] args the arguments for each axis and the new value of the bin content
354 /// \par See also
355 /// the \ref SetBinContent(const std::array<RBinIndex, N> &indices, const V &value) "function overload" accepting
356 /// `std::array`
357 template <typename... A>
358 void SetBinContent(const A &...args)
359 {
360 fEngine.SetBinContent(args...);
361 fStats.Taint();
362 }
363
364 /// \}
365 /// \name Filling
366 /// \{
367
368 /// Fill an entry into the profile histogram.
369 ///
370 /// \code
371 /// ROOT::Experimental::RProfile profile({/* two dimensions */});
372 /// auto args = std::make_tuple(8.5, 10.5);
373 /// profile.Fill(args, 23.0);
374 /// \endcode
375 ///
376 /// If one of the arguments is outside the corresponding axis and flow bins are disabled, the entry will be silently
377 /// discarded.
378 ///
379 /// Throws an exception if the number of arguments does not match the axis configuration, or if an argument cannot be
380 /// converted for the axis type at run-time.
381 ///
382 /// \param[in] args the arguments for each axis
383 /// \param[in] v the additional argument
384 /// \par See also
385 /// the \ref Fill(const A &... args) "variadic function template overload" accepting arguments directly and the
386 /// \ref Fill(const std::tuple<A...> &args, const V &value, RWeight weight) "overload for weighted filling"
387 template <typename... A, typename V>
388 void Fill(const std::tuple<A...> &args, const V &value)
389 {
391 fEngine.Fill(args, wrapper);
392 // Avoid a second conversion of value, which we already did in wrapper.
394 }
395
396 /// Fill an entry into the profile histogram with a weight.
397 ///
398 /// \code
399 /// ROOT::Experimental::RProfile profile({/* two dimensions */});
400 /// auto args = std::make_tuple(8.5, 10.5);
401 /// profile.Fill(args, 23.0, ROOT::Experimental::RWeight(0.8));
402 /// \endcode
403 ///
404 /// If one of the arguments is outside the corresponding axis and flow bins are disabled, the entry will be silently
405 /// discarded.
406 ///
407 /// Throws an exception if the number of arguments does not match the axis configuration, or if an argument cannot be
408 /// converted for the axis type at run-time.
409 ///
410 /// \param[in] args the arguments for each axis
411 /// \param[in] v the additional argument
412 /// \param[in] weight the weight for this entry
413 /// \par See also
414 /// the \ref Fill(const A &... args) "variadic function template overload" accepting arguments directly and the
415 /// \ref Fill(const std::tuple<A...> &args, const V &value) "overload for unweighted filling"
416 template <typename... A, typename V>
417 void Fill(const std::tuple<A...> &args, const V &value, RWeight weight)
418 {
420 fEngine.Fill(args, wrapper);
421 // Avoid a second conversion of value, which we already did in wrapper.
422 fStats.Fill(Internal::AppendReference(args, wrapper.fValue), weight);
423 }
424
425 /// Fill an entry into the profile histogram.
426 ///
427 /// \code
428 /// ROOT::Experimental::RProfile profile({/* two dimensions */});
429 /// profile.Fill(8.5, 10.5, 23.0);
430 /// \endcode
431 ///
432 /// For weighted filling, pass an RWeight as the last argument:
433 /// \code
434 /// profile.Fill(8.5, 10.5, 23.0, ROOT::Experimental::RWeight(0.8));
435 /// \endcode
436 ///
437 /// If one of the arguments is outside the corresponding axis and flow bins are disabled, the entry will be silently
438 /// discarded.
439 ///
440 /// Throws an exception if the number of arguments does not match the axis configuration, or if an argument cannot be
441 /// converted for the axis type at run-time.
442 ///
443 /// \param[in] args the arguments for each axis
444 /// \par See also
445 /// the function overloads accepting `std::tuple`
446 /// \ref Fill(const std::tuple<A...> &args, const V &value) "for unweighted filling" and
447 /// \ref Fill(const std::tuple<A...> &args, const V &value, RWeight weight) "for weighted filling"
448 template <typename... A>
449 void Fill(const A &...args)
450 {
451 static_assert(sizeof...(A) >= 2, "need at least two arguments to Fill");
452 if constexpr (sizeof...(A) >= 2) {
453 auto t = std::forward_as_tuple(args...);
454 if constexpr (std::is_same_v<typename Internal::LastType<A...>::type, RWeight>) {
455 static constexpr std::size_t N = sizeof...(A) - 2;
456 if (N != GetNDimensions()) {
457 throw std::invalid_argument("invalid number of arguments to Fill");
458 }
459 RWeight weight = std::get<N + 1>(t);
460 RValueWeightWrapper wrapper(std::get<N>(t), weight.fValue);
461 fEngine.FillImpl<N>(t, wrapper);
462 } else {
463 static constexpr std::size_t N = sizeof...(A) - 1;
464 if (N != GetNDimensions()) {
465 throw std::invalid_argument("invalid number of arguments to Fill");
466 }
467 RValueWrapper wrapper(std::get<N>(t));
468 fEngine.FillImpl<N>(t, wrapper);
469 }
470 fStats.Fill(args...);
471 }
472 }
473
474 /// \}
475 /// \name Operations
476 /// \{
477
478 /// Add all bin contents and statistics of another profile histogram.
479 ///
480 /// Throws an exception if the axes configurations are not identical.
481 ///
482 /// \param[in] other another profile histogram
483 void Add(const RProfile &other)
484 {
485 fEngine.Add(other.fEngine);
486 fStats.Add(other.fStats);
487 }
488
489 /// Add all bin contents and statistics of another profile histogram using atomic instructions.
490 ///
491 /// Throws an exception if the axes configurations are not identical.
492 ///
493 /// \param[in] other another profile histogram that must not be modified during the operation
495 {
496 fEngine.AddAtomic(other.fEngine);
497 fStats.AddAtomic(other.fStats);
498 }
499
500 /// Clear all bin contents and statistics.
501 void Clear()
502 {
503 fEngine.Clear();
504 fStats.Clear();
505 }
506
507 /// Clone this profile histogram.
508 ///
509 /// Copying all bin contents can be an expensive operation, depending on the number of bins.
510 ///
511 /// \return the cloned object
513 {
514 RProfile profile(fEngine.Clone());
515 profile.fStats = fStats;
516 return profile;
517 }
518
519 /// Scale all bin contents and statistics.
520 ///
521 /// \param[in] factor the scale factor
522 void Scale(double factor)
523 {
524 fEngine.Scale(factor);
525 fStats.Scale(factor);
526 }
527
528 /// \}
529
530 /// %ROOT Streamer function to throw when trying to store an object of this class.
531 void Streamer(TBuffer &) { throw std::runtime_error("unable to store RProfile"); }
532};
533
534} // namespace Experimental
535} // namespace ROOT
536
537#endif
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
#define N
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
A variant of all supported axis types.
A multidimensional range of bin indices.
Histogram statistics of unbinned values.
void Add(const RHistStats &other)
Add all entries from another statistics object.
void Clear()
Clear this statistics object.
void Taint()
Taint this statistics object.
void AddAtomic(const RHistStats &other)
Add all entries from another statistics object using atomic instructions.
void Scale(double factor)
Scale the histogram statistics.
void Fill(const std::tuple< A... > &args)
Fill an entry into this statistics object.
double ComputeNEffectiveEntries() const
Compute the number of effective entries.
void DisableDimension(std::size_t dim)
Disable one dimension of this statistics object.
std::uint64_t GetNEntries() const
double ComputeMean(std::size_t dim=0) const
Compute the arithmetic mean of unbinned values.
double ComputeStdDev(std::size_t dim=0) const
Compute the standard deviation of unbinned values.
A profile histogram, computing statistical quantities of an additional variable per bin.
Definition RProfile.hxx:58
void Fill(const std::tuple< A... > &args, const V &value, RWeight weight)
Fill an entry into the profile histogram with a weight.
Definition RProfile.hxx:417
RProfile Clone() const
Clone this profile histogram.
Definition RProfile.hxx:512
RProfile(const RAxisVariant &axis1, const Axes &...axes)
Construct a profile histogram.
Definition RProfile.hxx:168
const RProfileBin & GetBinContent(const std::vector< RBinIndex > &indices) const
Get the content of a single bin.
Definition RProfile.hxx:276
RProfile(std::vector< RAxisVariant > axes)
Construct a profile histogram.
Definition RProfile.hxx:141
RProfile & operator=(RProfile &&)=default
Efficiently move a profile histogram.
double ComputeStdDev(std::size_t dim=0) const
Compute the standard deviation of unbinned values.
Definition RProfile.hxx:228
void SetBinContent(const A &...args)
Set the content of a single bin.
Definition RProfile.hxx:358
double ComputeNEffectiveEntries() const
Compute the number of effective entries.
Definition RProfile.hxx:224
RProfile & operator=(const RProfile &)=delete
The copy assignment operator is deleted.
void Scale(double factor)
Scale all bin contents and statistics.
Definition RProfile.hxx:522
RHistStats fStats
The global histogram statistics.
Definition RProfile.hxx:132
void Fill(const std::tuple< A... > &args, const V &value)
Fill an entry into the profile histogram.
Definition RProfile.hxx:388
std::size_t GetNDimensions() const
Definition RProfile.hxx:214
void AddAtomic(const RProfile &other)
Add all bin contents and statistics of another profile histogram using atomic instructions.
Definition RProfile.hxx:494
void Streamer(TBuffer &)
ROOT Streamer function to throw when trying to store an object of this class.
Definition RProfile.hxx:531
RProfile(std::uint64_t nNormalBins, std::pair< double, double > interval)
Construct a one-dimensional profile histogram with a regular axis.
Definition RProfile.hxx:180
void Fill(const A &...args)
Fill an entry into the profile histogram.
Definition RProfile.hxx:449
const RHistStats & GetStats() const
Definition RProfile.hxx:211
std::uint64_t GetTotalNBins() const
Definition RProfile.hxx:215
void Add(const RProfile &other)
Add all bin contents and statistics of another profile histogram.
Definition RProfile.hxx:483
const std::vector< RAxisVariant > & GetAxes() const
Definition RProfile.hxx:213
const RProfileBin & GetBinContent(const std::array< RBinIndex, N > &indices) const
Get the content of a single bin.
Definition RProfile.hxx:253
const RHistEngine< RProfileBin > & GetEngine() const
Definition RProfile.hxx:210
RProfile(RHistEngine< RProfileBin > engine)
Private constructor based off an engine.
Definition RProfile.hxx:135
RProfile(const RProfile &)=delete
The copy constructor is deleted.
double ComputeMean(std::size_t dim=0) const
Compute the arithmetic mean of unbinned values.
Definition RProfile.hxx:226
std::uint64_t GetNEntries() const
Definition RProfile.hxx:217
RProfile(RProfile &&)=default
Efficiently move construct a profile histogram.
RBinIndexMultiDimRange GetFullMultiDimRange() const
Get the multidimensional range of all bins.
Definition RProfile.hxx:307
void Clear()
Clear all bin contents and statistics.
Definition RProfile.hxx:501
void SetBinContent(const std::array< RBinIndex, N > &indices, const V &value)
Set the content of a single bin.
Definition RProfile.hxx:331
RProfile(std::initializer_list< RAxisVariant > axes)
Construct a profile histogram.
Definition RProfile.hxx:158
RHistEngine< RProfileBin > fEngine
The histogram engine including the bin contents.
Definition RProfile.hxx:130
const RProfileBin & GetBinContent(const A &...args) const
Get the content of a single bin.
Definition RProfile.hxx:299
A regular axis with equidistant bins in the interval .
Buffer base class used for serializing objects.
Definition TBuffer.h:43
std::tuple< const Ts &..., const A & > AppendReference(const std::tuple< Ts... > &t, const A &a)
std::enable_if_t< std::is_integral_v< T > > AtomicAdd(T *ptr, T val)
The bin content type of a profile histogram.
Definition RProfile.hxx:74
RProfileBin & operator+=(const RProfileBin &rhs)
Definition RProfile.hxx:98
void AtomicAdd(const RProfileBin &rhs)
Add another bin content using atomic instructions.
Definition RProfile.hxx:119
RProfileBin & operator+=(const RValueWeightWrapper &rhs)
Definition RProfile.hxx:89
RProfileBin & operator+=(const RValueWrapper &rhs)
Definition RProfile.hxx:80
RProfileBin & operator*=(double factor)
Definition RProfile.hxx:107
RValueWeightWrapper(double value, double weight)
Definition RProfile.hxx:69
A weight for filling histograms.
Definition RWeight.hxx:17