Hammer
1.0.0
Helicity Amplitude Module for Matrix Element Reweighting
|
Bin class with Tensor contents. More...
#include <Histogram.hh>
Public Member Functions | |
Bin (const Tensor &t, bool withErrors=false) | |
constructor based on a tensor (for determining shape and labels) More... | |
Bin (const Serial::FBTensor *w, const Serial::FBTensor *w2, size_t num) | |
serialization constructor More... | |
Bin (const Bin &other)=default | |
Bin & | operator= (const Bin &other)=default |
Bin (Bin &&other)=default | |
Bin & | operator= (Bin &&other)=default |
~Bin ()=default | |
void | clear () |
clears the contents of the bin (including the shapes of the tensors) More... | |
void | addWeight (const Tensor &t) |
add the values of a tensor to the current bin. More... | |
const Tensor & | getWeight () const |
the sum of tensor weights contained in the bin More... | |
const Tensor & | getSquaredWeight () const |
the sum of (outer) squared tensor weights contained in the bin, or an empty tensor if the errors are not tracked More... | |
size_t | getNumEvents () const |
the number of entries in the bin (number of times addWeight has been called) More... | |
Bin & | operator+= (const Bin &other) |
Private Attributes | |
Tensor | _weight |
tensor sum of weights More... | |
Tensor | _weight2 |
tensor sum of squared weights (in the outer square sense) More... | |
size_t | _NEvents |
number of entries More... | |
bool | _withErrors |
Bin class with Tensor contents.
Contains an histogram bin, with value, error, etc.
Definition at line 47 of file Histogram.hh.
Hammer::Histogram::Bin::Bin | ( | const Tensor & | t, |
bool | withErrors = false |
||
) |
constructor based on a tensor (for determining shape and labels)
[in] | t | the model tensor |
[in] | withErrors | whether errors should also be initialized (squared tensor weights) |
Definition at line 25 of file Histogram.cc.
Hammer::Histogram::Bin::Bin | ( | const Serial::FBTensor * | w, |
const Serial::FBTensor * | w2, | ||
size_t | num | ||
) |
serialization constructor
[in] | w | the reader for the sum of tensor weights |
[in] | w2 | the reader for the sum of the squared tensor weights (if available) |
[in] | num | the number of entries |
Definition at line 38 of file Histogram.cc.
|
default |
|
default |
|
default |
void Hammer::Histogram::Bin::addWeight | ( | const Tensor & | t | ) |
add the values of a tensor to the current bin.
Throws if the shapes do not match
[in] | t | the tensor |
Definition at line 55 of file Histogram.cc.
void Hammer::Histogram::Bin::clear | ( | ) |
clears the contents of the bin (including the shapes of the tensors)
Definition at line 49 of file Histogram.cc.
size_t Hammer::Histogram::Bin::getNumEvents | ( | ) | const |
the number of entries in the bin (number of times addWeight
has been called)
Definition at line 71 of file Histogram.cc.
const Tensor & Hammer::Histogram::Bin::getSquaredWeight | ( | ) | const |
the sum of (outer) squared tensor weights contained in the bin, or an empty tensor if the errors are not tracked
Definition at line 67 of file Histogram.cc.
const Tensor & Hammer::Histogram::Bin::getWeight | ( | ) | const |
the sum of tensor weights contained in the bin
Definition at line 63 of file Histogram.cc.
Histogram::Bin & Hammer::Histogram::Bin::operator+= | ( | const Bin & | other | ) |
|
private |
number of entries
Definition at line 95 of file Histogram.hh.
|
private |
tensor sum of weights
Definition at line 93 of file Histogram.hh.
|
private |
tensor sum of squared weights (in the outer square sense)
Definition at line 94 of file Histogram.hh.
|
private |
Definition at line 96 of file Histogram.hh.