ndmspc  v1.2.0-0.1.rc3
Ndmspc::NBinningPoint Class Reference

Represents a single point in multi-dimensional binning. More...

#include <NBinningPoint.h>

Inheritance diagram for Ndmspc::NBinningPoint:

Public Member Functions

 NBinningPoint (NBinning *b=nullptr)
 Constructor. More...
 
virtual ~NBinningPoint ()
 Destructor.
 
virtual void Print (Option_t *option="") const
 Print binning point information. More...
 
virtual void Reset ()
 Reset the binning point to initial state. More...
 
Int_t GetNDimensionsContent () const
 Get number of dimensions in content histogram. More...
 
Int_t * GetCoords () const
 Get pointer to content coordinates array. More...
 
Int_t GetNDimensions () const
 Get number of dimensions. More...
 
Int_t * GetStorageCoords () const
 Get pointer to storage coordinates array. More...
 
bool RecalculateStorageCoords (Long64_t entry=-1, bool useBinningDefCheck=false)
 Recalculate storage coordinates for the point. More...
 
bool SetPointContentFromLinearIndex (Long64_t linBin, bool checkBinningDef=false)
 Set point content from linear index. More...
 
NStorageTreeGetStorageTree () const
 Returns a pointer to the associated storage tree. More...
 
Long64_t Fill (bool ignoreFilledCheck=false)
 Fill the binning point content. More...
 
json & GetCfg ()
 Get reference to configuration JSON object. More...
 
void SetCfg (json cfg)
 Set configuration JSON object. More...
 
std::map< int, std::vector< int > > GetBaseAxisRanges () const
 Get base axis ranges for the point. More...
 
std::string GetString (const std::string &prefix="", bool all=false) const
 Returns a string representation of the binning point. More...
 
std::vector< std::string > GetLabels () const
 Get labels for each axis. More...
 
Double_t * GetMins () const
 Get the array of minimum values for all axes. More...
 
Double_t * GetMaxs () const
 Get the array of maximum values for all axes. More...
 
Double_t GetBinMin (std::string axis) const
 Get the minimum value for a specific axis. More...
 
Double_t GetBinMax (std::string axis) const
 Get the maximum value for a specific axis. More...
 
Double_t GetBinCenter (std::string axis) const
 Returns the center value of the bin along the specified axis. More...
 
std::string GetBinLabel (std::string axis) const
 Get the label for a specific axis. More...
 
Int_t GetBin (std::string axis) const
 Returns the bin index for the specified axis. More...
 
NBinningGetBinning () const
 Get pointer to NBinning object. More...
 
void SetBinning (NBinning *b)
 Set NBinning object pointer. More...
 
NStorageTreeGetTreeStorage () const
 Get pointer to storage tree object. More...
 
void SetTreeStorage (NStorageTree *s)
 Set storage tree object pointer. More...
 
NGnTreeGetInput () const
 Get pointer to input NGnTree object. More...
 
void SetInput (NGnTree *input)
 Set input NGnTree object pointer. More...
 
void SetEntryNumber (Long64_t entry)
 Set entry number for the point. More...
 
Long64_t GetEntryNumber () const
 Get entry number for the point. More...
 
void SetParameters (NParameters *params)
 Set the parameters for this binning point. More...
 
NParametersGetParameters () const
 Get the parameters associated with this binning point. More...
 
TObject * GetTempObject (const std::string &name) const
 Retrieve a temporary object by name. More...
 
void SetTempObject (const std::string &name, TObject *obj)
 Set a temporary object with the given name. More...
 
json & GetTempCfg ()
 Get reference to temporary configuration JSON object. More...
 

Private Attributes

json fCfg {}
 Configuration object.
 
NGnTreefInput {nullptr}
 Input NGnTree object.
 
NBinningfBinning {nullptr}
 Binning object.
 
NStorageTreefTreeStorage {nullptr}
 Storage tree object.
 
Int_t fContentNDimensions {1}
 Number of dimensions in content histogram.
 
Int_t * fContentCoords {nullptr}
 Coordinates of the point.
 
Int_t fNDimensions {1}
 Number of dimensions.
 
Int_t * fStorageCoords {nullptr}
 Storage coordinates of the point.
 
Double_t * fMins {nullptr}
 Minimum values for each axis.
 
Double_t * fMaxs {nullptr}
 Maximum values for each axis.
 
Int_t * fBaseBinMin {nullptr}
 Base bin minimum (for variable binning)
 
Int_t * fBaseBinMax {nullptr}
 Base bin maximum (for variable binning)
 
std::vector< std::string > fLabels {}
 Labels for each axis.
 
Long64_t fEntryNumber {-1}
 Entry in the storage tree.
 
NParametersfParameters {nullptr}
 Parameter axis (if any)
 
std::map< std::string, TObject * > fTempObjects
 ! Outputs map
 
json fTempCfg {}
 Temporary configuration object.
 

Detailed Description

Represents a single point in multi-dimensional binning.

Stores coordinates, axis ranges, labels, and configuration for a binning point. Provides methods for coordinate management, storage mapping, content filling, and integration with NBinning.

Author
Martin Vala mvala.nosp@m.@cer.nosp@m.n.ch

Definition at line 21 of file NBinningPoint.h.

Constructor & Destructor Documentation

◆ NBinningPoint()

Ndmspc::NBinningPoint::NBinningPoint ( NBinning b = nullptr)

Member Function Documentation

◆ Fill()

Long64_t Ndmspc::NBinningPoint::Fill ( bool  ignoreFilledCheck = false)

Fill the binning point content.

Parameters
ignoreFilledCheckIgnore filled check.
Returns
Number of filled bins.

Fill the content histogram at the current point

Definition at line 226 of file NBinningPoint.cxx.

References fBinning, fContentCoords, fStorageCoords, Ndmspc::NBinning::GetContent(), Ndmspc::NBinningDef::GetContent(), Ndmspc::NBinning::GetDefinition(), and Ndmspc::NBinningDef::GetIds().

Referenced by Ndmspc::NStorageTree::Fill().

◆ GetBaseAxisRanges()

std::map< int, std::vector< int > > Ndmspc::NBinningPoint::GetBaseAxisRanges ( ) const

Get base axis ranges for the point.

Returns
Map of axis index to vector of ranges.

Get base axis ranges as map of axis id to vector of {min, max}

Definition at line 184 of file NBinningPoint.cxx.

References fBaseBinMax, fBaseBinMin, and fNDimensions.

◆ GetBin()

int Ndmspc::NBinningPoint::GetBin ( std::string  axis) const

Returns the bin index for the specified axis.

Parameters
axisThe name of the axis for which to retrieve the bin index.
Returns
int The bin index corresponding to the given axis.

Get bin for specific axis

Definition at line 358 of file NBinningPoint.cxx.

References fBinning, fNDimensions, fStorageCoords, and Ndmspc::NBinning::GetAxes().

Referenced by Ndmspc::NGnTree::BuildObjectPath().

◆ GetBinCenter()

Double_t Ndmspc::NBinningPoint::GetBinCenter ( std::string  axis) const

Returns the center value of the bin along the specified axis.

Parameters
axisThe name of the axis for which to get the bin center.
Returns
Double_t The center value of the bin on the given axis.

Get center value for specific axis

Definition at line 314 of file NBinningPoint.cxx.

References fBinning, fMaxs, fMins, fNDimensions, and Ndmspc::NBinning::GetAxes().

Referenced by Ndmspc::NGnTree::BuildObjectPath().

◆ GetBinLabel()

std::string Ndmspc::NBinningPoint::GetBinLabel ( std::string  axis) const

Get the label for a specific axis.

Parameters
axisThe name of the axis.
Returns
The label for the given axis.

Get label for specific axis

Definition at line 336 of file NBinningPoint.cxx.

References fBinning, fLabels, fNDimensions, and Ndmspc::NBinning::GetAxes().

Referenced by Ndmspc::NGnTree::BuildObjectPath(), and Ndmspc::NGnTree::Import().

◆ GetBinMax()

Double_t Ndmspc::NBinningPoint::GetBinMax ( std::string  axis) const

Get the maximum value for a specific axis.

Parameters
axisThe name of the axis.
Returns
The maximum value for the given axis.

Get maximum value for specific axis

Definition at line 292 of file NBinningPoint.cxx.

References fBinning, fMaxs, fNDimensions, and Ndmspc::NBinning::GetAxes().

Referenced by Ndmspc::NGnTree::BuildObjectPath().

◆ GetBinMin()

Double_t Ndmspc::NBinningPoint::GetBinMin ( std::string  axis) const

Get the minimum value for a specific axis.

Parameters
axisThe name of the axis.
Returns
The minimum value for the given axis.

Get minimum value for specific axis

Definition at line 270 of file NBinningPoint.cxx.

References fBinning, fMins, fNDimensions, and Ndmspc::NBinning::GetAxes().

Referenced by Ndmspc::NGnTree::BuildObjectPath().

◆ GetBinning()

NBinning* Ndmspc::NBinningPoint::GetBinning ( ) const
inline

Get pointer to NBinning object.

Returns
Pointer to NBinning.

Definition at line 185 of file NBinningPoint.h.

References fBinning.

◆ GetCfg()

json& Ndmspc::NBinningPoint::GetCfg ( )
inline

Get reference to configuration JSON object.

Returns
Reference to JSON configuration.

Definition at line 103 of file NBinningPoint.h.

References fCfg.

Referenced by Ndmspc::NGnTree::Import(), Ndmspc::NGnTree::NGnTree(), Ndmspc::NGnThreadData::Process(), and Ndmspc::NGnTree::Projection().

◆ GetCoords()

Int_t* Ndmspc::NBinningPoint::GetCoords ( ) const
inline

Get pointer to content coordinates array.

Returns
Pointer to coordinates array.

Definition at line 55 of file NBinningPoint.h.

References fContentCoords.

Referenced by Ndmspc::NBinning::GetPoint(), Ndmspc::NGnTree::Import(), Ndmspc::NGnThreadData::Merge(), Ndmspc::NGnThreadData::Process(), and Ndmspc::NGnTree::Process().

◆ GetEntryNumber()

Long64_t Ndmspc::NBinningPoint::GetEntryNumber ( ) const
inline

Get entry number for the point.

Returns
Entry number.

Definition at line 227 of file NBinningPoint.h.

References fEntryNumber.

Referenced by Ndmspc::NStorageTree::Fill(), Ndmspc::NStorageTree::Merge(), Ndmspc::NGnTree::NGnTree(), and Ndmspc::NGnTree::Projection().

◆ GetInput()

NGnTree* Ndmspc::NBinningPoint::GetInput ( ) const
inline

Get pointer to input NGnTree object.

Returns
Pointer to NGnTree.

Definition at line 209 of file NBinningPoint.h.

References fInput.

Referenced by Ndmspc::NGnTree::NGnTree(), and Ndmspc::NGnTree::Projection().

◆ GetLabels()

std::vector<std::string> Ndmspc::NBinningPoint::GetLabels ( ) const
inline

Get labels for each axis.

Returns
Vector of axis labels.

Definition at line 130 of file NBinningPoint.h.

References fLabels.

◆ GetMaxs()

Double_t* Ndmspc::NBinningPoint::GetMaxs ( ) const
inline

Get the array of maximum values for all axes.

Returns
Pointer to the array of maximum values.

Definition at line 142 of file NBinningPoint.h.

References fMaxs.

◆ GetMins()

Double_t* Ndmspc::NBinningPoint::GetMins ( ) const
inline

Get the array of minimum values for all axes.

Returns
Pointer to the array of minimum values.

Definition at line 136 of file NBinningPoint.h.

References fMins.

◆ GetNDimensions()

Int_t Ndmspc::NBinningPoint::GetNDimensions ( ) const
inline

Get number of dimensions.

Returns
Number of dimensions.

Definition at line 61 of file NBinningPoint.h.

References fNDimensions.

◆ GetNDimensionsContent()

Int_t Ndmspc::NBinningPoint::GetNDimensionsContent ( ) const
inline

Get number of dimensions in content histogram.

Returns
Number of dimensions.

Definition at line 49 of file NBinningPoint.h.

References fContentNDimensions.

Referenced by Ndmspc::NGnTree::Import(), Ndmspc::NGnThreadData::Process(), and Ndmspc::NGnTree::Process().

◆ GetParameters()

NParameters* Ndmspc::NBinningPoint::GetParameters ( ) const
inline

Get the parameters associated with this binning point.

Returns the pointer to the NParameters object currently associated with this binning point.

Returns
Pointer to the NParameters object.

Definition at line 245 of file NBinningPoint.h.

References fParameters.

Referenced by Ndmspc::NGnTree::NGnTree().

◆ GetStorageCoords()

Int_t* Ndmspc::NBinningPoint::GetStorageCoords ( ) const
inline

Get pointer to storage coordinates array.

Returns
Pointer to storage coordinates array.

Definition at line 67 of file NBinningPoint.h.

References fStorageCoords.

Referenced by Ndmspc::NStorageTree::Fill(), Ndmspc::NGnThreadData::Merge(), Ndmspc::NGnTree::NGnTree(), Ndmspc::NGnTree::Play(), Ndmspc::NGnThreadData::Process(), Ndmspc::NGnTree::Process(), and Ndmspc::NBinningDef::RefreshContentFromIds().

◆ GetStorageTree()

NStorageTree* Ndmspc::NBinningPoint::GetStorageTree ( ) const
inline

Returns a pointer to the associated storage tree.

Returns
NStorageTree* Pointer to the storage tree object.

Definition at line 90 of file NBinningPoint.h.

References fTreeStorage.

Referenced by Ndmspc::NGnTree::Import().

◆ GetString()

std::string Ndmspc::NBinningPoint::GetString ( const std::string &  prefix = "",
bool  all = false 
) const

Returns a string representation of the binning point.

Parameters
prefixOptional prefix to prepend to the string.
allIf true, includes all details in the string; otherwise, provides a summary.
Returns
std::string String representation of the binning point.

Returns point as string

Definition at line 196 of file NBinningPoint.cxx.

References fBinning, fNDimensions, Ndmspc::NBinning::GetAxes(), and Ndmspc::NBinning::GetAxisType().

Referenced by Ndmspc::NGnTree::NGnTree(), and Print().

◆ GetTempCfg()

json& Ndmspc::NBinningPoint::GetTempCfg ( )
inline

Get reference to temporary configuration JSON object.

Returns
Reference to temporary JSON configuration.

Definition at line 267 of file NBinningPoint.h.

References fTempCfg.

◆ GetTempObject()

TObject * Ndmspc::NBinningPoint::GetTempObject ( const std::string &  name) const

Retrieve a temporary object by name.

Parameters
nameThe name of the temporary object.
Returns
TObject* Pointer to the temporary object, or nullptr if not found.

Definition at line 380 of file NBinningPoint.cxx.

References fTempObjects.

Referenced by Ndmspc::NGnTree::Import(), and Ndmspc::NGnTree::NGnTree().

◆ GetTreeStorage()

NStorageTree* Ndmspc::NBinningPoint::GetTreeStorage ( ) const
inline

Get pointer to storage tree object.

Returns
Pointer to NStorageTree.

Definition at line 197 of file NBinningPoint.h.

References fTreeStorage.

Referenced by Ndmspc::NGnTree::Import().

◆ Print()

void Ndmspc::NBinningPoint::Print ( Option_t *  option = "") const
virtual

Print binning point information.

Parameters
optionPrint options.

Print the binning point

Definition at line 81 of file NBinningPoint.cxx.

References Ndmspc::NUtils::ArrayToVector(), fCfg, fContentCoords, fContentNDimensions, fEntryNumber, fLabels, fMaxs, fMins, fNDimensions, fStorageCoords, Ndmspc::NUtils::GetCoordsString(), and GetString().

Referenced by Ndmspc::NGnTree::Play(), and Ndmspc::NGnTree::Projection().

◆ RecalculateStorageCoords()

bool Ndmspc::NBinningPoint::RecalculateStorageCoords ( Long64_t  entry = -1,
bool  useBinningDefCheck = false 
)

◆ Reset()

void Ndmspc::NBinningPoint::Reset ( )
virtual

◆ SetBinning()

void Ndmspc::NBinningPoint::SetBinning ( NBinning b)

Set NBinning object pointer.

Parameters
bPointer to NBinning.

◆ SetCfg()

void Ndmspc::NBinningPoint::SetCfg ( json  cfg)
inline

Set configuration JSON object.

Parameters
cfgJSON configuration.

Definition at line 109 of file NBinningPoint.h.

References fCfg.

Referenced by Ndmspc::NGnThreadData::Process(), and Ndmspc::NBinning::SetCfg().

◆ SetEntryNumber()

void Ndmspc::NBinningPoint::SetEntryNumber ( Long64_t  entry)
inline

Set entry number for the point.

Parameters
entryEntry number.

Definition at line 221 of file NBinningPoint.h.

References fEntryNumber.

Referenced by Ndmspc::NStorageTree::Fill().

◆ SetInput()

void Ndmspc::NBinningPoint::SetInput ( NGnTree input)
inline

Set input NGnTree object pointer.

Parameters
inputPointer to NGnTree.

Definition at line 215 of file NBinningPoint.h.

References fInput.

Referenced by Ndmspc::NGnThreadData::Process().

◆ SetParameters()

void Ndmspc::NBinningPoint::SetParameters ( NParameters params)
inline

Set the parameters for this binning point.

Assigns the provided NParameters object to this binning point.

Parameters
paramsPointer to the NParameters object to associate.

Definition at line 236 of file NBinningPoint.h.

References fParameters.

Referenced by Ndmspc::NGnThreadData::Init().

◆ SetPointContentFromLinearIndex()

bool Ndmspc::NBinningPoint::SetPointContentFromLinearIndex ( Long64_t  linBin,
bool  checkBinningDef = false 
)

Set point content from linear index.

Parameters
linBinLinear bin index.
checkBinningDefCheck binning definition.
Returns
True if set successfully.

Set point content coordinates from linear index

Definition at line 251 of file NBinningPoint.cxx.

References fBinning, fContentCoords, Ndmspc::NBinning::GetContent(), and RecalculateStorageCoords().

Referenced by Ndmspc::NStorageTree::GetEntry(), and Ndmspc::NBinningDef::RefreshContentFromIds().

◆ SetTempObject()

void Ndmspc::NBinningPoint::SetTempObject ( const std::string &  name,
TObject *  obj 
)
inline

Set a temporary object with the given name.

Parameters
nameThe name to associate with the object.
objPointer to the object to store.

Definition at line 261 of file NBinningPoint.h.

References fTempObjects.

Referenced by Ndmspc::NGnTree::Import(), and Ndmspc::NGnTree::NGnTree().

◆ SetTreeStorage()

void Ndmspc::NBinningPoint::SetTreeStorage ( NStorageTree s)
inline

Set storage tree object pointer.

Parameters
sPointer to NStorageTree.

Definition at line 203 of file NBinningPoint.h.

References fTreeStorage.

Referenced by Ndmspc::NGnThreadData::Init(), Ndmspc::NGnTree::NGnTree(), and Ndmspc::NGnThreadData::Process().


The documentation for this class was generated from the following files: