|
ndmspc
v1.2.0-0.1.rc3
|
Defines binning mapping and content for NDMSPC histograms. More...
#include <NBinningDef.h>
Public Member Functions | |
| NBinningDef (std::string name="default", std::map< std::string, std::vector< std::vector< int >>> definition={}, NBinning *binning=nullptr) | |
| Constructor. More... | |
| virtual | ~NBinningDef () |
| Destructor. More... | |
| virtual void | Print (Option_t *option="") const |
| Print binning definition information. More... | |
| std::map< std::string, std::vector< std::vector< int > > > | GetDefinition () const |
| Get the binning mapping definition. More... | |
| void | SetDefinition (const std::map< std::string, std::vector< std::vector< int >>> &d) |
| Set the binning mapping definition. More... | |
| void | SetAxisDefinition (std::string axisName, const std::vector< std::vector< int >> &d) |
| Set axis definition for a specific axis. More... | |
| std::vector< int > | GetVariableAxes () const |
| Get list of variable axes indices. More... | |
| void | AddVariableAxis (size_t axis) |
| Add a variable axis index. More... | |
| void | RefreshContentFromIds () |
| Refresh content histogram from bin IDs. More... | |
| void | RefreshIdsFromContent () |
| Refresh bin IDs from content histogram. More... | |
| std::vector< Long64_t > | GetIds () const |
| Get list of bin IDs. More... | |
| std::vector< Long64_t > & | GetIds () |
| Get reference to list of bin IDs. More... | |
| Long64_t | GetId (size_t index) const |
| Get bin ID at specified index. More... | |
| TObjArray * | GetAxes () const |
| Get list of axes from content histogram. More... | |
| THnSparse * | GetContent () const |
| Get the template content histogram. More... | |
| NBinning * | GetBinning () const |
| Get pointer to parent NBinning object. More... | |
Private Attributes | |
| NBinning * | fBinning {nullptr} |
| Pointer to the parent binning. | |
| std::string | fName |
| Name of the binning definition. | |
| std::map< std::string, std::vector< std::vector< int > > > | fDefinition |
| Binning mapping definition. | |
| std::vector< int > | fVariableAxes {} |
| List of variable axes indices in the content histogram. | |
| std::vector< Long64_t > | fIds {} |
| List of IDs for the binning definition. | |
| THnSparse * | fContent {nullptr} |
| Template histogram for the binning definition. | |
Defines binning mapping and content for NDMSPC histograms.
NBinningDef object for binning mapping and content definition.
Stores axis definitions, variable axes, bin IDs, and template histogram content. Provides methods for refreshing IDs/content, axis management, and integration with NBinning.
Definition at line 26 of file NBinningDef.h.
| Ndmspc::NBinningDef::NBinningDef | ( | std::string | name = "default", |
| std::map< std::string, std::vector< std::vector< int >>> | definition = {}, |
||
| NBinning * | binning = nullptr |
||
| ) |
Constructor.
| name | Name of the binning definition. |
| definition | Mapping of axis names to binning vectors. |
| binning | Pointer to parent NBinning object. |
Constructor
Definition at line 14 of file NBinningDef.cxx.
References fBinning, fContent, fDefinition, Ndmspc::NBinning::GetAxes(), GetDefinition(), and SetAxisDefinition().
|
virtual |
|
inline |
Add a variable axis index.
| axis | Axis index to add. |
Definition at line 77 of file NBinningDef.h.
References fVariableAxes.
|
inline |
Get list of axes from content histogram.
Definition at line 112 of file NBinningDef.h.
References fContent.
Referenced by Ndmspc::NBinningPoint::RecalculateStorageCoords().
|
inline |
Get pointer to parent NBinning object.
Definition at line 124 of file NBinningDef.h.
References fBinning.
|
inline |
Get the template content histogram.
Definition at line 118 of file NBinningDef.h.
References fContent.
Referenced by Ndmspc::NGnNavigator::DrawSpectra(), Ndmspc::NGnNavigator::ExecuteEvent(), Ndmspc::NBinningPoint::Fill(), Ndmspc::NStorageTree::Fill(), Ndmspc::NGnNavigator::GetChild(), Ndmspc::NGnThreadData::Init(), Ndmspc::NGnThreadData::Merge(), Ndmspc::NGnTree::Play(), Ndmspc::NGnNavigator::Print(), Ndmspc::NGnThreadData::Process(), Ndmspc::NGnTree::Projection(), and Ndmspc::NGnNavigator::Reshape().
|
inline |
Get the binning mapping definition.
Definition at line 52 of file NBinningDef.h.
References fDefinition.
Referenced by Ndmspc::NBinning::GenerateListOfAxes(), and NBinningDef().
| Long64_t Ndmspc::NBinningDef::GetId | ( | size_t | index | ) | const |
Get bin ID at specified index.
| index | Index of bin. |
Returns ID for given index
Definition at line 179 of file NBinningDef.cxx.
References fIds.
Referenced by Ndmspc::NBinning::GetPoint(), and Ndmspc::NGnThreadData::Process().
|
inline |
Get reference to list of bin IDs.
Definition at line 99 of file NBinningDef.h.
References fIds.
|
inline |
Get list of bin IDs.
Definition at line 93 of file NBinningDef.h.
References fIds.
Referenced by Ndmspc::NBinningPoint::Fill(), Ndmspc::NGnThreadData::Init(), Ndmspc::NGnThreadData::Merge(), Ndmspc::NGnThreadData::Process(), Ndmspc::NGnTree::Process(), Ndmspc::NGnTree::Projection(), and Ndmspc::NBinningPoint::RecalculateStorageCoords().
|
inline |
Get list of variable axes indices.
Definition at line 71 of file NBinningDef.h.
References fVariableAxes.
Referenced by Ndmspc::NGnNavigator::Reshape().
|
virtual |
Print binning definition information.
| option | Print options. |
Print the binning definition
Definition at line 146 of file NBinningDef.cxx.
References fBinning, fContent, fDefinition, fIds, fName, fVariableAxes, Ndmspc::NBinning::GetAxes(), and Ndmspc::NUtils::GetCoordsString().
Referenced by Ndmspc::NGnTree::Play(), and Ndmspc::NGnTree::Process().
| void Ndmspc::NBinningDef::RefreshContentFromIds | ( | ) |
Refresh content histogram from bin IDs.
Refresh content from IDs
Definition at line 228 of file NBinningDef.cxx.
References Ndmspc::NDimensionalExecutor::Execute(), fBinning, fContent, fIds, Ndmspc::NUtils::GetCoordsString(), Ndmspc::NBinning::GetPoint(), Ndmspc::NBinningPoint::GetStorageCoords(), and Ndmspc::NBinningPoint::SetPointContentFromLinearIndex().
| void Ndmspc::NBinningDef::RefreshIdsFromContent | ( | ) |
Refresh bin IDs from content histogram.
Refresh IDs from content
Definition at line 192 of file NBinningDef.cxx.
References Ndmspc::NDimensionalExecutor::Execute(), fContent, fIds, and Ndmspc::NUtils::GetCoordsString().
Referenced by Ndmspc::NGnTree::Projection().
|
inline |
Set axis definition for a specific axis.
| axisName | Name of the axis. |
| d | Binning vectors for the axis. |
Definition at line 65 of file NBinningDef.h.
References fDefinition.
Referenced by NBinningDef().
|
inline |
Set the binning mapping definition.
| d | Mapping of axis names to binning vectors. |
Definition at line 58 of file NBinningDef.h.
References fDefinition.