![]() |
Hammer
1.0.0
Helicity Amplitude Module for Matrix Element Reweighting
|
Hammer histogram manager class. More...
#include <Histos.hh>
Public Member Functions | |
Histos (DictionaryManager *dict=nullptr) | |
Histos (const Histos &other)=delete | |
Histos & | operator= (const Histos &other)=delete |
Histos (Histos &&other)=delete | |
Histos & | operator= (Histos &&other)=delete |
~Histos () noexcept | |
void | addHistogramDefinition (const std::string &histogramName, const IndexList &binSizes, bool hasUnderOverFlow=true, const MD::BinRangeList &ranges={}, bool shouldCompress=false, bool withErrors=false) |
void | addHistogramDefinition (const std::string &histogramName, const MD::BinEdgeList &binEdges, bool hasUnderOverFlow=true, bool shouldCompress=false, bool withErrors=false) |
void | createProjectedHistogram (const std::string &oldName, const std::string &newName, const std::set< uint16_t > &collapsedIndexPositions) |
void | setHistogramCompression (const std::string &histogramName, bool value=true) |
void | setHistogramKeepErrors (const std::string &histogramName, bool value=true) |
void | addHistogramFixedData (const std::string &histogramName, MD::SharedTensorData data) |
void | resetHistogramFixedData (const std::string &histogramName) |
void | removeHistogram (const std::string &histogramName) |
void | init () |
void | setEventId (EventUID eventId) |
void | clear () |
IndexList | getBinIndices (const std::string &histogramName, const MD::BinValue &value) const |
EventUIDGroup | getHistogramEventIds (const std::string &name, const std::string &scheme) const |
MD::BinEdgeList | getHistogramEdges (const std::string &histogramName) const |
IndexList | getHistogramShape (const std::string &histogramName) const |
bool | getUnderOverFlows (const std::string &histogramName) const |
size_t | size () const |
bool | canFill (const std::string &name, const std::vector< double > &values) |
Checks values can be binned. More... | |
void | checkExists (const std::string &name) |
Checks histogram exists. More... | |
IOHistogram | getHistogram (const std::string &histogramName, const std::string &schemeName) const |
EventIdGroupDict< IOHistogram > | getHistograms (const std::string &histogramName, const std::string &schemeName) const |
bool | isValidHistogram (const std::string &histogramName, size_t dim) const |
std::vector< std::string > | getHistogramNames () const |
void | fillHisto (const std::string &histogramName, const std::string &schemeName, const IndexList &binPosition, Tensor &value, double extraWeight=1.0) |
bool | writeDefinition (flatbuffers::FlatBufferBuilder *msgwriter, const std::string &histogramName) const |
bool | writeHistogram (flatbuffers::FlatBufferBuilder *msgwriter, const std::string &histogramName, const std::string &schemeName, const EventUID &eventIDs) const |
std::string | readDefinition (const Serial::FBHistoDefinition *msgreader, bool merge) |
HistoInfo | readHistogram (const Serial::FBHistogram *msgreader, bool merge) |
std::vector< EventUID > | getEventIDRepsForHisto (const std::string &name, const std::string &scheme) const |
![]() | |
virtual void | setSettingsHandler (SettingsHandler &sh) |
set link to settings repository handler. More... | |
void | setSettingsHandler (const SettingsConsumer &other) |
SettingsHandler * | getSettingsHandler () const |
provide the pointer to the repository handler More... | |
WTerm | setWeightTerm (WTerm group) |
virtual void | addRefs () const |
SettingsConsumer () | |
base constructor More... | |
SettingsConsumer (const SettingsConsumer &)=default | |
default copy constructor More... | |
SettingsConsumer & | operator= (const SettingsConsumer &)=default |
virtual | ~SettingsConsumer () |
virtual destructor More... | |
Protected Member Functions | |
Log & | getLog () const |
logging facility More... | |
void | defineSettings () |
purely virtual function for a class to define new settings More... | |
![]() | |
Log & | getLog () const |
logging facility More... | |
void | initSettings () |
void | setPath (const std::string &path) |
provide the basic path for the settings defined by this class, as in "<path>:<setting>" More... | |
template<typename T > | |
void | addSetting (const std::string &name, const T &defaultValue) |
template method to add a new setting More... | |
void | removeSetting (const std::string &name) |
template<typename T > | |
T * | getSetting (const std::string &name) const |
template method to return a setting defined by this class More... | |
template<typename T > | |
T * | getSetting (const std::string &otherPath, const std::string &name) const |
template method to return a setting defined by this class More... | |
bool | isOn (const std::string &name) const |
method to check a boolean setting defined by this class More... | |
bool | isOn (const std::string &otherPath, const std::string &name) const |
method to check a boolean setting by its name and path More... | |
template<typename T > | |
void | updateVectorOfSettings (const std::vector< T > &values, const std::vector< std::string > &names, const std::string &path="", WTerm group=WTerm::COMMON) |
template<typename T > | |
void | updateVectorOfSettings (const std::map< std::string, T > &values, const std::string &path="", WTerm group=WTerm::COMMON) |
Private Member Functions | |
const HistogramSet * | getEntry (const std::string &histogramName, const std::string &schemeName) const |
HistogramSet * | getEntry (const std::string &histogramName, const std::string &schemeName) |
std::vector< Tensor > | getExternalData (const std::string &schemeName, std::vector< LabelsList > labels) const |
Private Attributes | |
EventUID | _currentEventId |
HistoNameDict < HistogramDefinition > | _histogramDefs |
HistoNameDict< SchemeDict < HistogramSet > > | _histograms |
DictionaryManager * | _dictionaries |
bool | _initialized |
Additional Inherited Members | |
![]() | |
SettingsHandler * | _settingHandler |
pointer to the settings repository handler. More... | |
std::string | _settingPath |
path of the settings defined by this class More... | |
WTerm | _group |
std::set< std::string > | _ownedSettings |
Hammer::Histos::Histos | ( | DictionaryManager * | dict = nullptr | ) |
|
delete |
|
delete |
void Hammer::Histos::addHistogramDefinition | ( | const std::string & | histogramName, |
const IndexList & | binSizes, | ||
bool | hasUnderOverFlow = true , |
||
const MD::BinRangeList & | ranges = {} , |
||
bool | shouldCompress = false , |
||
bool | withErrors = false |
||
) |
void Hammer::Histos::addHistogramDefinition | ( | const std::string & | histogramName, |
const MD::BinEdgeList & | binEdges, | ||
bool | hasUnderOverFlow = true , |
||
bool | shouldCompress = false , |
||
bool | withErrors = false |
||
) |
void Hammer::Histos::addHistogramFixedData | ( | const std::string & | histogramName, |
MD::SharedTensorData | data | ||
) |
bool Hammer::Histos::canFill | ( | const std::string & | name, |
const std::vector< double > & | values | ||
) |
void Hammer::Histos::checkExists | ( | const std::string & | name | ) |
void Hammer::Histos::createProjectedHistogram | ( | const std::string & | oldName, |
const std::string & | newName, | ||
const std::set< uint16_t > & | collapsedIndexPositions | ||
) |
|
protectedvirtual |
purely virtual function for a class to define new settings
Implements Hammer::SettingsConsumer.
IndexList Hammer::Histos::getBinIndices | ( | const std::string & | histogramName, |
const MD::BinValue & | value | ||
) | const |
|
private |
|
private |
vector< EventUID > Hammer::Histos::getEventIDRepsForHisto | ( | const std::string & | name, |
const std::string & | scheme | ||
) | const |
|
private |
IOHistogram Hammer::Histos::getHistogram | ( | const std::string & | histogramName, |
const std::string & | schemeName | ||
) | const |
MD::BinEdgeList Hammer::Histos::getHistogramEdges | ( | const std::string & | histogramName | ) | const |
EventUIDGroup Hammer::Histos::getHistogramEventIds | ( | const std::string & | name, |
const std::string & | scheme | ||
) | const |
vector< string > Hammer::Histos::getHistogramNames | ( | ) | const |
EventIdGroupDict< IOHistogram > Hammer::Histos::getHistograms | ( | const std::string & | histogramName, |
const std::string & | schemeName | ||
) | const |
IndexList Hammer::Histos::getHistogramShape | ( | const std::string & | histogramName | ) | const |
|
protected |
bool Hammer::Histos::getUnderOverFlows | ( | const std::string & | histogramName | ) | const |
bool Hammer::Histos::isValidHistogram | ( | const std::string & | histogramName, |
size_t | dim | ||
) | const |
string Hammer::Histos::readDefinition | ( | const Serial::FBHistoDefinition * | msgreader, |
bool | merge | ||
) |
HistoInfo Hammer::Histos::readHistogram | ( | const Serial::FBHistogram * | msgreader, |
bool | merge | ||
) |
void Hammer::Histos::removeHistogram | ( | const std::string & | histogramName | ) |
void Hammer::Histos::resetHistogramFixedData | ( | const std::string & | histogramName | ) |
void Hammer::Histos::setEventId | ( | EventUID | eventId | ) |
void Hammer::Histos::setHistogramCompression | ( | const std::string & | histogramName, |
bool | value = true |
||
) |
void Hammer::Histos::setHistogramKeepErrors | ( | const std::string & | histogramName, |
bool | value = true |
||
) |
bool Hammer::Histos::writeDefinition | ( | flatbuffers::FlatBufferBuilder * | msgwriter, |
const std::string & | histogramName | ||
) | const |
bool Hammer::Histos::writeHistogram | ( | flatbuffers::FlatBufferBuilder * | msgwriter, |
const std::string & | histogramName, | ||
const std::string & | schemeName, | ||
const EventUID & | eventIDs | ||
) | const |
|
private |
|
private |
|
private |