Jpp
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
JTOOLS::JHistogram< JAbscissa_t, JContents_t > Class Template Referenceabstract

Template definition of histogram object interface. More...

#include <JHistogram.hh>

Inheritance diagram for JTOOLS::JHistogram< JAbscissa_t, JContents_t >:
JTOOLS::JHistogram1D< JBin2D< JAbscissa_t, JContents_t >, JContainer_t, JDistance_t >

Public Types

typedef JAbscissa_t abscissa_type
 
typedef JContents_t contents_type
 

Public Member Functions

virtual ~JHistogram ()
 Virtual destructor. More...
 
virtual void evaluate (const abscissa_type *pX, typename JLANG::JClass< contents_type >::argument_type w)=0
 Histogram filling. More...
 
JHistogramadd (const JHistogram &histogram)
 Add histogram. More...
 
JHistogramsub (const JHistogram &histogram)
 Subtract histogram. More...
 
JHistogrammul (const double value)
 Scale histogram. More...
 
JHistogramdiv (double value)
 Scale histogram. More...
 
const contents_typegetUnderflow () const
 Get contents below lower limit. More...
 
const contents_typegetOverflow () const
 Get contents above upper limit. More...
 
const contents_typegetIntegral () const
 Get contents above upper limit. More...
 

Protected Member Functions

 JHistogram ()
 Default constructor. More...
 

Protected Attributes

contents_type underflow
 
contents_type overflow
 
contents_type integral
 

Friends

JReaderoperator>> (JReader &in, JHistogram &object)
 Read histogram from input. More...
 
JWriteroperator<< (JWriter &out, const JHistogram &object)
 Write histogram to output. More...
 

Detailed Description

template<class JAbscissa_t, class JContents_t>
class JTOOLS::JHistogram< JAbscissa_t, JContents_t >

Template definition of histogram object interface.

This class also comprises auxiliary data.

Definition at line 27 of file JHistogram.hh.

Member Typedef Documentation

◆ abscissa_type

template<class JAbscissa_t, class JContents_t>
typedef JAbscissa_t JTOOLS::JHistogram< JAbscissa_t, JContents_t >::abscissa_type

Definition at line 42 of file JHistogram.hh.

◆ contents_type

template<class JAbscissa_t, class JContents_t>
typedef JContents_t JTOOLS::JHistogram< JAbscissa_t, JContents_t >::contents_type

Definition at line 43 of file JHistogram.hh.

Constructor & Destructor Documentation

◆ JHistogram()

template<class JAbscissa_t, class JContents_t>
JTOOLS::JHistogram< JAbscissa_t, JContents_t >::JHistogram ( )
inlineprotected

Default constructor.

Definition at line 33 of file JHistogram.hh.

33  :
37  {}

◆ ~JHistogram()

template<class JAbscissa_t, class JContents_t>
virtual JTOOLS::JHistogram< JAbscissa_t, JContents_t >::~JHistogram ( )
inlinevirtual

Virtual destructor.

Definition at line 49 of file JHistogram.hh.

50  {}

Member Function Documentation

◆ evaluate()

template<class JAbscissa_t, class JContents_t>
virtual void JTOOLS::JHistogram< JAbscissa_t, JContents_t >::evaluate ( const abscissa_type pX,
typename JLANG::JClass< contents_type >::argument_type  w 
)
pure virtual

Histogram filling.

Parameters
pXpointer to abscissa values
wweight

Implemented in JTOOLS::JHistogram1D< JBin2D< JAbscissa_t, JContents_t >, JContainer_t, JDistance_t >.

◆ add()

template<class JAbscissa_t, class JContents_t>
JHistogram& JTOOLS::JHistogram< JAbscissa_t, JContents_t >::add ( const JHistogram< JAbscissa_t, JContents_t > &  histogram)
inline

Add histogram.

Parameters
histogramhistogram
Returns
this histogram

Definition at line 69 of file JHistogram.hh.

70  {
71  this->underflow += histogram.underflow;
72  this->overflow += histogram.overflow;
73  this->integral += histogram.integral;
74 
75  return *this;
76  }

◆ sub()

template<class JAbscissa_t, class JContents_t>
JHistogram& JTOOLS::JHistogram< JAbscissa_t, JContents_t >::sub ( const JHistogram< JAbscissa_t, JContents_t > &  histogram)
inline

Subtract histogram.

Parameters
histogramhistogram
Returns
this histogram

Definition at line 85 of file JHistogram.hh.

86  {
87  this->underflow -= histogram.underflow;
88  this->overflow -= histogram.overflow;
89  this->integral -= histogram.integral;
90 
91  return *this;
92  }

◆ mul()

template<class JAbscissa_t, class JContents_t>
JHistogram& JTOOLS::JHistogram< JAbscissa_t, JContents_t >::mul ( const double  value)
inline

Scale histogram.

Parameters
valuemultiplication factor
Returns
this histogram

Definition at line 101 of file JHistogram.hh.

102  {
103  this->underflow *= value;
104  this->overflow *= value;
105  this->integral *= value;
106 
107  return *this;
108  }

◆ div()

template<class JAbscissa_t, class JContents_t>
JHistogram& JTOOLS::JHistogram< JAbscissa_t, JContents_t >::div ( double  value)
inline

Scale histogram.

Parameters
valuedivision factor
Returns
this histogram

Definition at line 117 of file JHistogram.hh.

118  {
119  this->underflow /= value;
120  this->overflow /= value;
121  this->integral /= value;
122 
123  return *this;
124  }

◆ getUnderflow()

template<class JAbscissa_t, class JContents_t>
const contents_type& JTOOLS::JHistogram< JAbscissa_t, JContents_t >::getUnderflow ( ) const
inline

Get contents below lower limit.

Returns
contents

Definition at line 132 of file JHistogram.hh.

133  {
134  return underflow;
135  }

◆ getOverflow()

template<class JAbscissa_t, class JContents_t>
const contents_type& JTOOLS::JHistogram< JAbscissa_t, JContents_t >::getOverflow ( ) const
inline

Get contents above upper limit.

Returns
contents

Definition at line 143 of file JHistogram.hh.

144  {
145  return overflow;
146  }

◆ getIntegral()

template<class JAbscissa_t, class JContents_t>
const contents_type& JTOOLS::JHistogram< JAbscissa_t, JContents_t >::getIntegral ( ) const
inline

Get contents above upper limit.

Returns
contents

Definition at line 154 of file JHistogram.hh.

155  {
156  return integral;
157  }

Friends And Related Function Documentation

◆ operator>>

template<class JAbscissa_t, class JContents_t>
JReader& operator>> ( JReader in,
JHistogram< JAbscissa_t, JContents_t > &  object 
)
friend

Read histogram from input.

Parameters
inreader
objecthistogram
Returns
reader

Definition at line 167 of file JHistogram.hh.

168  {
169  in >> object.underflow;
170  in >> object.overflow;
171  in >> object.integral;
172 
173  return in;
174  }

◆ operator<<

template<class JAbscissa_t, class JContents_t>
JWriter& operator<< ( JWriter out,
const JHistogram< JAbscissa_t, JContents_t > &  object 
)
friend

Write histogram to output.

Parameters
outwriter
objecthistogram
Returns
writer

Definition at line 184 of file JHistogram.hh.

185  {
186  out << object.underflow;
187  out << object.overflow;
188  out << object.integral;
189 
190  return out;
191  }

Member Data Documentation

◆ underflow

template<class JAbscissa_t, class JContents_t>
contents_type JTOOLS::JHistogram< JAbscissa_t, JContents_t >::underflow
protected

Definition at line 195 of file JHistogram.hh.

◆ overflow

template<class JAbscissa_t, class JContents_t>
contents_type JTOOLS::JHistogram< JAbscissa_t, JContents_t >::overflow
protected

Definition at line 196 of file JHistogram.hh.

◆ integral

template<class JAbscissa_t, class JContents_t>
contents_type JTOOLS::JHistogram< JAbscissa_t, JContents_t >::integral
protected

Definition at line 197 of file JHistogram.hh.


The documentation for this class was generated from the following file:
JTOOLS::JHistogram::overflow
contents_type overflow
Definition: JHistogram.hh:196
JTOOLS::JHistogram::integral
contents_type integral
Definition: JHistogram.hh:197
JMATH::zero
static const JZero zero
Function object to assign zero value.
Definition: JZero.hh:94
JTOOLS::JHistogram::underflow
contents_type underflow
Definition: JHistogram.hh:195