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*/
58class RProfile final {
59 friend class RProfileFillContext;
60
62 double fValue;
63
64 explicit RValueWrapper(double value) : fValue(value) {}
65 };
66
68 double fValue;
69 double fWeight;
70
71 explicit RValueWeightWrapper(double value, double weight) : fValue(value), fWeight(weight) {}
72 };
73
74public:
75 /// The bin content type of a profile histogram.
76 struct RProfileBin final {
77 double fSumValues = 0;
78 double fSumValues2 = 0;
79 double fSum = 0;
80 double fSum2 = 0;
81
83 {
84 fSumValues += rhs.fValue;
85 fSumValues2 += rhs.fValue * rhs.fValue;
86 fSum++;
87 fSum2++;
88 return *this;
89 }
90
92 {
93 fSumValues += rhs.fWeight * rhs.fValue;
94 fSumValues2 += rhs.fWeight * rhs.fValue * rhs.fValue;
95 fSum += rhs.fWeight;
96 fSum2 += rhs.fWeight * rhs.fWeight;
97 return *this;
98 }
99
101 {
102 fSumValues += rhs.fSumValues;
104 fSum += rhs.fSum;
105 fSum2 += rhs.fSum2;
106 return *this;
107 }
108
109 RProfileBin &operator*=(double factor)
110 {
111 fSumValues *= factor;
112 fSumValues2 *= factor;
113 fSum *= factor;
114 fSum2 *= factor * factor;
115 return *this;
116 }
117
118 private:
126
127 public:
129 {
130 double v = rhs.fValue;
131 AtomicAddRelease(v, v * v, 1.0, 1.0);
132 }
133
135 {
136 double v = rhs.fValue;
137 double w = rhs.fWeight;
138 AtomicAddRelease(w * v, w * v * v, w, w * w);
139 }
140
141 /// Add another bin content using atomic instructions.
142 ///
143 /// \param[in] rhs another bin content that must not be modified during the operation
151 };
152
153private:
154 /// The histogram engine including the bin contents.
156 /// The global histogram statistics.
158
159 /// Private constructor based off an engine.
161
162public:
163 /// Construct a profile histogram.
164 ///
165 /// \param[in] axes the axis objects, must have size > 0
166 explicit RProfile(std::vector<RAxisVariant> axes) : fEngine(std::move(axes)), fStats(fEngine.GetNDimensions() + 1)
167 {
168 // The axes parameter was moved, use from the engine.
169 const auto &engineAxes = fEngine.GetAxes();
170 for (std::size_t i = 0; i < engineAxes.size(); i++) {
171 if (engineAxes[i].GetCategoricalAxis() != nullptr) {
173 }
174 }
175 }
176
177 /// Construct a profile histogram.
178 ///
179 /// Note that there is no perfect forwarding of the axis objects. If that is needed, use the
180 /// \ref RProfile(std::vector<RAxisVariant> axes) "overload accepting a std::vector".
181 ///
182 /// \param[in] axes the axis objects, must have size > 0
183 explicit RProfile(std::initializer_list<RAxisVariant> axes) : RProfile(std::vector(axes)) {}
184
185 /// Construct a profile histogram.
186 ///
187 /// Note that there is no perfect forwarding of the axis objects. If that is needed, use the
188 /// \ref RProfile(std::vector<RAxisVariant> axes) "overload accepting a std::vector".
189 ///
190 /// \param[in] axis1 the first axis object
191 /// \param[in] axes the remaining axis objects
192 template <typename... Axes>
193 explicit RProfile(const RAxisVariant &axis1, const Axes &...axes)
194 : RProfile(std::vector<RAxisVariant>{axis1, axes...})
195 {
196 }
197
198 /// Construct a one-dimensional profile histogram with a regular axis.
199 ///
200 /// \param[in] nNormalBins the number of normal bins, must be > 0
201 /// \param[in] interval the axis interval (lower end inclusive, upper end exclusive)
202 /// \par See also
203 /// the \ref RRegularAxis::RRegularAxis(std::uint64_t nNormalBins, std::pair<double, double> interval, bool
204 /// enableFlowBins) "constructor of RRegularAxis"
205 RProfile(std::uint64_t nNormalBins, std::pair<double, double> interval)
206 : RProfile(std::vector<RAxisVariant>{RRegularAxis(nNormalBins, interval)})
207 {
208 }
209
210 /// The copy constructor is deleted.
211 ///
212 /// Copying all bin contents can be an expensive operation, depending on the number of bins. If required, users can
213 /// explicitly call Clone().
214 RProfile(const RProfile &) = delete;
215 /// Efficiently move construct a profile histogram.
216 ///
217 /// After this operation, the moved-from object is invalid.
218 RProfile(RProfile &&) = default;
219
220 /// The copy assignment operator is deleted.
221 ///
222 /// Copying all bin contents can be an expensive operation, depending on the number of bins. If required, users can
223 /// explicitly call Clone().
224 RProfile &operator=(const RProfile &) = delete;
225 /// Efficiently move a profile histogram.
226 ///
227 /// After this operation, the moved-from object is invalid.
229
230 ~RProfile() = default;
231
232 /// \name Accessors
233 /// \{
234
235 const RHistEngine<RProfileBin> &GetEngine() const { return fEngine; }
236 const RHistStats &GetStats() const { return fStats; }
237
238 const std::vector<RAxisVariant> &GetAxes() const { return fEngine.GetAxes(); }
239 std::size_t GetNDimensions() const { return fEngine.GetNDimensions(); }
240 std::uint64_t GetTotalNBins() const { return fEngine.GetTotalNBins(); }
241
242 std::uint64_t GetNEntries() const { return fStats.GetNEntries(); }
243
244 /// \}
245 /// \name Computations
246 /// \{
247
248 /// \copydoc RHistStats::ComputeNEffectiveEntries()
250 /// \copydoc RHistStats::ComputeMean()
251 double ComputeMean(std::size_t dim = 0) const { return fStats.ComputeMean(dim); }
252 /// \copydoc RHistStats::ComputeStdDev()
253 double ComputeStdDev(std::size_t dim = 0) const { return fStats.ComputeStdDev(dim); }
254
255 /// \}
256 /// \name Accessors
257 /// \{
258
259 /// Get the content of a single bin.
260 ///
261 /// \code
262 /// ROOT::Experimental::RProfile profile({/* two dimensions */});
263 /// std::array<ROOT::Experimental::RBinIndex, 2> indices = {3, 5};
264 /// const auto &content = profile.GetBinContent(indices);
265 /// \endcode
266 ///
267 /// \note Compared to TH1 conventions, the first normal bin has index 0 and underflow and overflow bins are special
268 /// values. See also the class documentation of RBinIndex.
269 ///
270 /// Throws an exception if the number of indices does not match the axis configuration or the bin is not found.
271 ///
272 /// \param[in] indices the array of indices for each axis
273 /// \return the bin content
274 /// \par See also
275 /// the \ref GetBinContent(const A &... args) const "variadic function template overload" accepting arguments
276 /// directly
277 template <std::size_t N>
278 const RProfileBin &GetBinContent(const std::array<RBinIndex, N> &indices) const
279 {
280 return fEngine.GetBinContent(indices);
281 }
282
283 /// Get the content of a single bin.
284 ///
285 /// \code
286 /// ROOT::Experimental::RProfile profile({/* two dimensions */});
287 /// std::vector<ROOT::Experimental::RBinIndex> indices = {3, 5};
288 /// const auto &content = profile.GetBinContent(indices);
289 /// \endcode
290 ///
291 /// \note Compared to TH1 conventions, the first normal bin has index 0 and underflow and overflow bins are special
292 /// values. See also the class documentation of RBinIndex.
293 ///
294 /// Throws an exception if the number of indices does not match the axis configuration or the bin is not found.
295 ///
296 /// \param[in] indices the array of indices for each axis
297 /// \return the bin content
298 /// \par See also
299 /// the \ref GetBinContent(const A &... args) const "variadic function template overload" accepting arguments
300 /// directly
301 const RProfileBin &GetBinContent(const std::vector<RBinIndex> &indices) const
302 {
303 return fEngine.GetBinContent(indices);
304 }
305
306 /// Get the content of a single bin.
307 ///
308 /// \code
309 /// ROOT::Experimental::RProfile profile({/* two dimensions */});
310 /// const auto &content = profile.GetBinContent(3, 5);
311 /// \endcode
312 ///
313 /// \note Compared to TH1 conventions, the first normal bin has index 0 and underflow and overflow bins are special
314 /// values. See also the class documentation of RBinIndex.
315 ///
316 /// Throws an exception if the number of arguments does not match the axis configuration or the bin is not found.
317 ///
318 /// \param[in] args the arguments for each axis
319 /// \return the bin content
320 /// \par See also
321 /// the function overloads accepting \ref GetBinContent(const std::array<RBinIndex, N> &indices) const "`std::array`"
322 /// or \ref GetBinContent(const std::vector<RBinIndex> &indices) const "`std::vector`"
323 template <typename... A>
324 const RProfileBin &GetBinContent(const A &...args) const
325 {
326 return fEngine.GetBinContent(args...);
327 }
328
329 /// Get the multidimensional range of all bins.
330 ///
331 /// \return the multidimensional range
332 RBinIndexMultiDimRange GetFullMultiDimRange() const { return fEngine.GetFullMultiDimRange(); }
333
334 /// Set the content of a single bin.
335 ///
336 /// \code
337 /// ROOT::Experimental::RProfile profile({/* two dimensions */});
338 /// std::array<ROOT::Experimental::RBinIndex, 2> indices = {3, 5};
339 /// ROOT::Experimental::RProfile::RProfileBin value = /* ... */;
340 /// profile.SetBinContent(indices, value);
341 /// \endcode
342 ///
343 /// \note Compared to TH1 conventions, the first normal bin has index 0 and underflow and overflow bins are special
344 /// values. See also the class documentation of RBinIndex.
345 ///
346 /// Throws an exception if the number of indices does not match the axis configuration or the bin is not found.
347 ///
348 /// \warning Setting the bin content will taint the global histogram statistics. Attempting to access its values, for
349 /// example calling GetNEntries(), will throw exceptions.
350 ///
351 /// \param[in] indices the array of indices for each axis
352 /// \param[in] value the new value of the bin content
353 /// \par See also
354 /// the \ref SetBinContent(const A &... args) "variadic function template overload" accepting arguments directly
355 template <std::size_t N, typename V>
356 void SetBinContent(const std::array<RBinIndex, N> &indices, const V &value)
357 {
358 fEngine.SetBinContent(indices, value);
359 fStats.Taint();
360 }
361
362 /// Set the content of a single bin.
363 ///
364 /// \code
365 /// ROOT::Experimental::RProfile profile({/* two dimensions */});
366 /// ROOT::Experimental::RProfile::RProfileBin value = /* ... */;
367 /// profile.SetBinContent(3, 5, value);
368 /// \endcode
369 ///
370 /// \note Compared to TH1 conventions, the first normal bin has index 0 and underflow and overflow bins are special
371 /// values. See also the class documentation of RBinIndex.
372 ///
373 /// Throws an exception if the number of arguments does not match the axis configuration or the bin is not found.
374 ///
375 /// \warning Setting the bin content will taint the global histogram statistics. Attempting to access its values, for
376 /// example calling GetNEntries(), will throw exceptions.
377 ///
378 /// \param[in] args the arguments for each axis and the new value of the bin content
379 /// \par See also
380 /// the \ref SetBinContent(const std::array<RBinIndex, N> &indices, const V &value) "function overload" accepting
381 /// `std::array`
382 template <typename... A>
383 void SetBinContent(const A &...args)
384 {
385 fEngine.SetBinContent(args...);
386 fStats.Taint();
387 }
388
389 /// \}
390 /// \name Filling
391 /// \{
392
393 /// Fill an entry into the profile histogram.
394 ///
395 /// \code
396 /// ROOT::Experimental::RProfile profile({/* two dimensions */});
397 /// auto args = std::make_tuple(8.5, 10.5);
398 /// profile.Fill(args, 23.0);
399 /// \endcode
400 ///
401 /// If one of the arguments is outside the corresponding axis and flow bins are disabled, the entry will be silently
402 /// discarded.
403 ///
404 /// Throws an exception if the number of arguments does not match the axis configuration, or if an argument cannot be
405 /// converted for the axis type at run-time.
406 ///
407 /// \param[in] args the arguments for each axis
408 /// \param[in] v the additional argument
409 /// \par See also
410 /// the \ref Fill(const A &... args) "variadic function template overload" accepting arguments directly and the
411 /// \ref Fill(const std::tuple<A...> &args, const V &value, RWeight weight) "overload for weighted filling"
412 template <typename... A, typename V>
413 void Fill(const std::tuple<A...> &args, const V &value)
414 {
415 RValueWrapper wrapper(value);
416 fEngine.Fill(args, wrapper);
417 // Avoid a second conversion of value, which we already did in wrapper.
419 }
420
421 /// Fill an entry into the profile histogram with a weight.
422 ///
423 /// \code
424 /// ROOT::Experimental::RProfile profile({/* two dimensions */});
425 /// auto args = std::make_tuple(8.5, 10.5);
426 /// profile.Fill(args, 23.0, ROOT::Experimental::RWeight(0.8));
427 /// \endcode
428 ///
429 /// If one of the arguments is outside the corresponding axis and flow bins are disabled, the entry will be silently
430 /// discarded.
431 ///
432 /// Throws an exception if the number of arguments does not match the axis configuration, or if an argument cannot be
433 /// converted for the axis type at run-time.
434 ///
435 /// \param[in] args the arguments for each axis
436 /// \param[in] v the additional argument
437 /// \param[in] weight the weight for this entry
438 /// \par See also
439 /// the \ref Fill(const A &... args) "variadic function template overload" accepting arguments directly and the
440 /// \ref Fill(const std::tuple<A...> &args, const V &value) "overload for unweighted filling"
441 template <typename... A, typename V>
442 void Fill(const std::tuple<A...> &args, const V &value, RWeight weight)
443 {
444 RValueWeightWrapper wrapper(value, weight.fValue);
445 fEngine.Fill(args, wrapper);
446 // Avoid a second conversion of value, which we already did in wrapper.
447 fStats.Fill(Internal::AppendReference(args, wrapper.fValue), weight);
448 }
449
450 /// Fill an entry into the profile histogram.
451 ///
452 /// \code
453 /// ROOT::Experimental::RProfile profile({/* two dimensions */});
454 /// profile.Fill(8.5, 10.5, 23.0);
455 /// \endcode
456 ///
457 /// For weighted filling, pass an RWeight as the last argument:
458 /// \code
459 /// profile.Fill(8.5, 10.5, 23.0, ROOT::Experimental::RWeight(0.8));
460 /// \endcode
461 ///
462 /// If one of the arguments is outside the corresponding axis and flow bins are disabled, the entry will be silently
463 /// discarded.
464 ///
465 /// Throws an exception if the number of arguments does not match the axis configuration, or if an argument cannot be
466 /// converted for the axis type at run-time.
467 ///
468 /// \param[in] args the arguments for each axis
469 /// \par See also
470 /// the function overloads accepting `std::tuple`
471 /// \ref Fill(const std::tuple<A...> &args, const V &value) "for unweighted filling" and
472 /// \ref Fill(const std::tuple<A...> &args, const V &value, RWeight weight) "for weighted filling"
473 template <typename... A>
474 void Fill(const A &...args)
475 {
476 static_assert(sizeof...(A) >= 2, "need at least two arguments to Fill");
477 if constexpr (sizeof...(A) >= 2) {
478 auto t = std::forward_as_tuple(args...);
479 if constexpr (std::is_same_v<typename Internal::LastType<A...>::type, RWeight>) {
480 static constexpr std::size_t N = sizeof...(A) - 2;
481 if (N != GetNDimensions()) {
482 throw std::invalid_argument("invalid number of arguments to Fill");
483 }
484 RWeight weight = std::get<N + 1>(t);
485 RValueWeightWrapper wrapper(std::get<N>(t), weight.fValue);
486 fEngine.FillImpl<N>(t, wrapper);
487 } else {
488 static constexpr std::size_t N = sizeof...(A) - 1;
489 if (N != GetNDimensions()) {
490 throw std::invalid_argument("invalid number of arguments to Fill");
491 }
492 RValueWrapper wrapper(std::get<N>(t));
493 fEngine.FillImpl<N>(t, wrapper);
494 }
495 fStats.Fill(args...);
496 }
497 }
498
499 /// \}
500 /// \name Operations
501 /// \{
502
503 /// Add all bin contents and statistics of another profile histogram.
504 ///
505 /// Throws an exception if the axes configurations are not identical.
506 ///
507 /// \param[in] other another profile histogram
508 void Add(const RProfile &other)
509 {
510 fEngine.Add(other.fEngine);
511 fStats.Add(other.fStats);
512 }
513
514 /// Add all bin contents and statistics of another profile histogram using atomic instructions.
515 ///
516 /// Throws an exception if the axes configurations are not identical.
517 ///
518 /// \param[in] other another profile histogram that must not be modified during the operation
519 void AddAtomic(const RProfile &other)
520 {
521 fEngine.AddAtomic(other.fEngine);
522 fStats.AddAtomic(other.fStats);
523 }
524
525 /// Clear all bin contents and statistics.
526 void Clear()
527 {
528 fEngine.Clear();
529 fStats.Clear();
530 }
531
532 /// Clone this profile histogram.
533 ///
534 /// Copying all bin contents can be an expensive operation, depending on the number of bins.
535 ///
536 /// \return the cloned object
538 {
539 RProfile profile(fEngine.Clone());
540 profile.fStats = fStats;
541 return profile;
542 }
543
544 /// Scale all bin contents and statistics.
545 ///
546 /// \param[in] factor the scale factor
547 void Scale(double factor)
548 {
549 fEngine.Scale(factor);
550 fStats.Scale(factor);
551 }
552
553 /// \}
554
555 /// %ROOT Streamer function to throw when trying to store an object of this class.
556 void Streamer(TBuffer &) { throw std::runtime_error("unable to store RProfile"); }
557};
558
559} // namespace Experimental
560} // namespace ROOT
561
562#endif
#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.
A histogram data structure to bin data along multiple dimensions.
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 context to concurrently fill an RProfile.
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:442
RProfile Clone() const
Clone this profile histogram.
Definition RProfile.hxx:537
RProfile(const RAxisVariant &axis1, const Axes &...axes)
Construct a profile histogram.
Definition RProfile.hxx:193
const RProfileBin & GetBinContent(const std::vector< RBinIndex > &indices) const
Get the content of a single bin.
Definition RProfile.hxx:301
RProfile(std::vector< RAxisVariant > axes)
Construct a profile histogram.
Definition RProfile.hxx:166
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:253
void SetBinContent(const A &...args)
Set the content of a single bin.
Definition RProfile.hxx:383
double ComputeNEffectiveEntries() const
Compute the number of effective entries.
Definition RProfile.hxx:249
RProfile & operator=(const RProfile &)=delete
The copy assignment operator is deleted.
void Scale(double factor)
Scale all bin contents and statistics.
Definition RProfile.hxx:547
RHistStats fStats
The global histogram statistics.
Definition RProfile.hxx:157
void Fill(const std::tuple< A... > &args, const V &value)
Fill an entry into the profile histogram.
Definition RProfile.hxx:413
std::size_t GetNDimensions() const
Definition RProfile.hxx:239
void AddAtomic(const RProfile &other)
Add all bin contents and statistics of another profile histogram using atomic instructions.
Definition RProfile.hxx:519
void Streamer(TBuffer &)
ROOT Streamer function to throw when trying to store an object of this class.
Definition RProfile.hxx:556
RProfile(std::uint64_t nNormalBins, std::pair< double, double > interval)
Construct a one-dimensional profile histogram with a regular axis.
Definition RProfile.hxx:205
void Fill(const A &...args)
Fill an entry into the profile histogram.
Definition RProfile.hxx:474
const RHistStats & GetStats() const
Definition RProfile.hxx:236
std::uint64_t GetTotalNBins() const
Definition RProfile.hxx:240
void Add(const RProfile &other)
Add all bin contents and statistics of another profile histogram.
Definition RProfile.hxx:508
const std::vector< RAxisVariant > & GetAxes() const
Definition RProfile.hxx:238
const RProfileBin & GetBinContent(const std::array< RBinIndex, N > &indices) const
Get the content of a single bin.
Definition RProfile.hxx:278
const RHistEngine< RProfileBin > & GetEngine() const
Definition RProfile.hxx:235
RProfile(RHistEngine< RProfileBin > engine)
Private constructor based off an engine.
Definition RProfile.hxx:160
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:251
std::uint64_t GetNEntries() const
Definition RProfile.hxx:242
RProfile(RProfile &&)=default
Efficiently move construct a profile histogram.
RBinIndexMultiDimRange GetFullMultiDimRange() const
Get the multidimensional range of all bins.
Definition RProfile.hxx:332
void Clear()
Clear all bin contents and statistics.
Definition RProfile.hxx:526
void SetBinContent(const std::array< RBinIndex, N > &indices, const V &value)
Set the content of a single bin.
Definition RProfile.hxx:356
RProfile(std::initializer_list< RAxisVariant > axes)
Construct a profile histogram.
Definition RProfile.hxx:183
RHistEngine< RProfileBin > fEngine
The histogram engine including the bin contents.
Definition RProfile.hxx:155
const RProfileBin & GetBinContent(const A &...args) const
Get the content of a single bin.
Definition RProfile.hxx:324
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)
std::enable_if_t< std::is_integral_v< T > > AtomicAddRelease(T *ptr, T val)
The bin content type of a profile histogram.
Definition RProfile.hxx:76
void AtomicAddRelease(double v, double v2, double w, double w2)
Definition RProfile.hxx:119
RProfileBin & operator+=(const RProfileBin &rhs)
Definition RProfile.hxx:100
void AtomicAdd(const RProfileBin &rhs)
Add another bin content using atomic instructions.
Definition RProfile.hxx:144
void AtomicAddRelease(const RValueWrapper &rhs)
Definition RProfile.hxx:128
RProfileBin & operator+=(const RValueWeightWrapper &rhs)
Definition RProfile.hxx:91
RProfileBin & operator+=(const RValueWrapper &rhs)
Definition RProfile.hxx:82
RProfileBin & operator*=(double factor)
Definition RProfile.hxx:109
void AtomicAddRelease(const RValueWeightWrapper &rhs)
Definition RProfile.hxx:134
RValueWeightWrapper(double value, double weight)
Definition RProfile.hxx:71
A weight for filling histograms.
Definition RWeight.hxx:17