Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
KFPHistogram1D Class Reference

One-dimensional histogram. More...

#include <KFParticle/blob/master/KFParticlePerformance/KFPHistogram/KFPHistogram1D.h>

+ Collaboration diagram for KFPHistogram1D:

Public Member Functions

 KFPHistogram1D ()
 
 KFPHistogram1D (std::string name, int nBins, float minX, float maxX)
 Constructor with user-defined parameters.
 
 ~KFPHistogram1D ()
 
int * GetHistogram () const
 Returns a pointer to the histogram data.
 
std::string Name () const
 Returns name of the histogram.
 
float MinBin () const
 returns minimum of the X axis.
 
float MaxBin () const
 Returns maximum of the X axis.
 
int NBins () const
 Returns number of bins.
 
int DataSize () const
 Returns number of bins plus underflow and overflow bins.
 
int Size () const
 Returns number of bins plus underflow and overflow bins.
 
void SetBinContent (int iBin, int value)
 Sets the value of the bin "iBin".
 
void SetHistogramMemory (int *pointer)
 Sets the pointer to the memory with the histogram.
 
void Fill (float value)
 
void operator+= (const KFPHistogram1D &h)
 
 KFPHistogram1D (const KFPHistogram1D &h)
 
const KFPHistogram1Doperator= (const KFPHistogram1D &h)
 

Private Attributes

int * fHistogram
 Pointer to the array with the values of the histogram.
 
int fSize
 Number of bins +2, additional two bins are reserved for the underflow and overflow.
 
std::string fName
 Name of the histogram.
 
float fMinBin
 Minimum value at the X axis.
 
float fMaxBin
 Maximum value at the X axis.
 

Detailed Description

One-dimensional histogram.

Author
M.Zyzak, I.Kisel
Date
05.02.2019
Version
1.0

The class is used to collect one-dimensional histograms in the environment, where ROOT is not available, for example at Intel Xeon Phi cards. It contains the histogram itself, number of bins, its name, minimum and maximum value of the axis. The histogram memory is allocated externally (by KFPHistogram) for better performance.

Definition at line 44 of file KFPHistogram1D.h.

View newest version in sPHENIX GitHub at line 44 of file KFPHistogram1D.h

Constructor & Destructor Documentation

KFPHistogram1D::KFPHistogram1D ( )
inline

Definition at line 48 of file KFPHistogram1D.h.

View newest version in sPHENIX GitHub at line 48 of file KFPHistogram1D.h

KFPHistogram1D::KFPHistogram1D ( std::string  name,
int  nBins,
float  minX,
float  maxX 
)
inline

Constructor with user-defined parameters.

Definition at line 49 of file KFPHistogram1D.h.

View newest version in sPHENIX GitHub at line 49 of file KFPHistogram1D.h

KFPHistogram1D::~KFPHistogram1D ( )
inline

Definition at line 51 of file KFPHistogram1D.h.

View newest version in sPHENIX GitHub at line 51 of file KFPHistogram1D.h

KFPHistogram1D::KFPHistogram1D ( const KFPHistogram1D h)
inline

The copy-constructor. Memory for the fHistogram is not allocated, only the pointer is copied.

Definition at line 94 of file KFPHistogram1D.h.

View newest version in sPHENIX GitHub at line 94 of file KFPHistogram1D.h

Member Function Documentation

int KFPHistogram1D::DataSize ( ) const
inline

Returns number of bins plus underflow and overflow bins.

Definition at line 58 of file KFPHistogram1D.h.

View newest version in sPHENIX GitHub at line 58 of file KFPHistogram1D.h

References fSize.

Referenced by KFPHistogramSet::SetHistogramMemory().

+ Here is the caller graph for this function:

void KFPHistogram1D::Fill ( float  value)
inline

Adds "value" to the histogram: calculates the corresponding bin and adds one there.

Definition at line 65 of file KFPHistogram1D.h.

View newest version in sPHENIX GitHub at line 65 of file KFPHistogram1D.h

References fHistogram, fMaxBin, fMinBin, and fSize.

Referenced by KFPHistogramSet::Fill().

+ Here is the caller graph for this function:

int* KFPHistogram1D::GetHistogram ( ) const
inline

Returns a pointer to the histogram data.

Definition at line 53 of file KFPHistogram1D.h.

View newest version in sPHENIX GitHub at line 53 of file KFPHistogram1D.h

References fHistogram.

float KFPHistogram1D::MaxBin ( ) const
inline

Returns maximum of the X axis.

Definition at line 56 of file KFPHistogram1D.h.

View newest version in sPHENIX GitHub at line 56 of file KFPHistogram1D.h

References fMaxBin.

float KFPHistogram1D::MinBin ( ) const
inline

returns minimum of the X axis.

Definition at line 55 of file KFPHistogram1D.h.

View newest version in sPHENIX GitHub at line 55 of file KFPHistogram1D.h

References fMinBin.

std::string KFPHistogram1D::Name ( ) const
inline

Returns name of the histogram.

Definition at line 54 of file KFPHistogram1D.h.

View newest version in sPHENIX GitHub at line 54 of file KFPHistogram1D.h

References fName.

int KFPHistogram1D::NBins ( ) const
inline

Returns number of bins.

Definition at line 57 of file KFPHistogram1D.h.

View newest version in sPHENIX GitHub at line 57 of file KFPHistogram1D.h

References fSize.

void KFPHistogram1D::operator+= ( const KFPHistogram1D h)
inline

Adds histogram "h" to the current histogram bin-by-bin.

Definition at line 80 of file KFPHistogram1D.h.

View newest version in sPHENIX GitHub at line 80 of file KFPHistogram1D.h

References fHistogram, fName, fSize, and i.

const KFPHistogram1D& KFPHistogram1D::operator= ( const KFPHistogram1D h)
inline

Copies object "h" to the current object. Memory for the fHistogram is not allocated, only the pointer is copied. Returns the current object.

Definition at line 99 of file KFPHistogram1D.h.

View newest version in sPHENIX GitHub at line 99 of file KFPHistogram1D.h

References fHistogram, fMaxBin, fMinBin, fName, and fSize.

void KFPHistogram1D::SetBinContent ( int  iBin,
int  value 
)
inline

Sets the value of the bin "iBin".

Definition at line 61 of file KFPHistogram1D.h.

View newest version in sPHENIX GitHub at line 61 of file KFPHistogram1D.h

References fHistogram, and value.

Referenced by KFPHistogramSet::SetHisto1DBinContent().

+ Here is the caller graph for this function:

void KFPHistogram1D::SetHistogramMemory ( int *  pointer)
inline

Sets the pointer to the memory with the histogram.

Definition at line 62 of file KFPHistogram1D.h.

View newest version in sPHENIX GitHub at line 62 of file KFPHistogram1D.h

References fHistogram.

Referenced by KFPHistogramSet::SetHistogramMemory().

+ Here is the caller graph for this function:

int KFPHistogram1D::Size ( ) const
inline

Returns number of bins plus underflow and overflow bins.

Definition at line 59 of file KFPHistogram1D.h.

View newest version in sPHENIX GitHub at line 59 of file KFPHistogram1D.h

References fSize.

Member Data Documentation

int* KFPHistogram1D::fHistogram
private

Pointer to the array with the values of the histogram.

Definition at line 111 of file KFPHistogram1D.h.

View newest version in sPHENIX GitHub at line 111 of file KFPHistogram1D.h

Referenced by Fill(), GetHistogram(), operator+=(), operator=(), SetBinContent(), and SetHistogramMemory().

float KFPHistogram1D::fMaxBin
private

Maximum value at the X axis.

Definition at line 116 of file KFPHistogram1D.h.

View newest version in sPHENIX GitHub at line 116 of file KFPHistogram1D.h

Referenced by Fill(), MaxBin(), and operator=().

float KFPHistogram1D::fMinBin
private

Minimum value at the X axis.

Definition at line 115 of file KFPHistogram1D.h.

View newest version in sPHENIX GitHub at line 115 of file KFPHistogram1D.h

Referenced by Fill(), MinBin(), and operator=().

std::string KFPHistogram1D::fName
private

Name of the histogram.

Definition at line 114 of file KFPHistogram1D.h.

View newest version in sPHENIX GitHub at line 114 of file KFPHistogram1D.h

Referenced by Name(), operator+=(), and operator=().

int KFPHistogram1D::fSize
private

Number of bins +2, additional two bins are reserved for the underflow and overflow.

Definition at line 112 of file KFPHistogram1D.h.

View newest version in sPHENIX GitHub at line 112 of file KFPHistogram1D.h

Referenced by DataSize(), Fill(), NBins(), operator+=(), operator=(), and Size().


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