Jpp 20.0.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
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< JBin1D< 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.
 
void reset ()
 Reset.
 
virtual void evaluate (const abscissa_type *pX, typename JLANG::JClass< contents_type >::argument_type w)=0
 Histogram filling.
 
JHistogramadd (const JHistogram &histogram)
 Add histogram.
 
JHistogramsub (const JHistogram &histogram)
 Subtract histogram.
 
JHistogrammul (const double value)
 Scale histogram.
 
JHistogramdiv (double value)
 Scale histogram.
 
const contents_typegetUnderflow () const
 Get contents below lower limit.
 
const contents_typegetOverflow () const
 Get contents above upper limit.
 
const contents_typegetIntegral () const
 Get contents above upper limit.
 

Protected Member Functions

 JHistogram ()
 Default constructor.
 

Protected Attributes

contents_type underflow
 
contents_type overflow
 
contents_type integral
 

Friends

class JROOT::JHistogramHelper
 Friend declaration of auxiliary class for copying ROOT histograms.
 
JReaderoperator>> (JReader &in, JHistogram &object)
 Read histogram from input.
 
JWriteroperator<< (JWriter &out, const JHistogram &object)
 Write histogram to output.
 

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 35 of file JHistogram.hh.

Member Typedef Documentation

◆ abscissa_type

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

Definition at line 50 of file JHistogram.hh.

◆ contents_type

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

Definition at line 51 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 41 of file JHistogram.hh.

41 :
45 {}
contents_type overflow
contents_type integral
contents_type underflow
static const JZero zero
Function object to assign zero value.
Definition JZero.hh:105

◆ ~JHistogram()

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

Virtual destructor.

Definition at line 57 of file JHistogram.hh.

58 {}

Member Function Documentation

◆ reset()

template<class JAbscissa_t , class JContents_t >
void JTOOLS::JHistogram< JAbscissa_t, JContents_t >::reset ( )
inline

Reset.

Definition at line 64 of file JHistogram.hh.

65 {
66 this->underflow = JMATH::zero;
67 this->overflow = JMATH::zero;
68 this->integral = JMATH::zero;
69 }

◆ 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

◆ 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 88 of file JHistogram.hh.

89 {
90 this->underflow += histogram.underflow;
91 this->overflow += histogram.overflow;
92 this->integral += histogram.integral;
93
94 return *this;
95 }

◆ 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 104 of file JHistogram.hh.

105 {
106 this->underflow -= histogram.underflow;
107 this->overflow -= histogram.overflow;
108 this->integral -= histogram.integral;
109
110 return *this;
111 }

◆ 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 120 of file JHistogram.hh.

121 {
122 this->underflow *= value;
123 this->overflow *= value;
124 this->integral *= value;
125
126 return *this;
127 }

◆ 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 136 of file JHistogram.hh.

137 {
138 this->underflow /= value;
139 this->overflow /= value;
140 this->integral /= value;
141
142 return *this;
143 }

◆ 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 151 of file JHistogram.hh.

152 {
153 return underflow;
154 }

◆ 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 162 of file JHistogram.hh.

163 {
164 return overflow;
165 }

◆ 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 173 of file JHistogram.hh.

174 {
175 return integral;
176 }

Friends And Related Symbol Documentation

◆ JROOT::JHistogramHelper

template<class JAbscissa_t , class JContents_t >
friend class JROOT::JHistogramHelper
friend

Friend declaration of auxiliary class for copying ROOT histograms.

Parameters
fromsource
todestination

Definition at line 219 of file JHistogram.hh.

◆ 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 186 of file JHistogram.hh.

187 {
188 in >> object.underflow;
189 in >> object.overflow;
190 in >> object.integral;
191
192 return in;
193 }

◆ 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 203 of file JHistogram.hh.

204 {
205 out << object.underflow;
206 out << object.overflow;
207 out << object.integral;
208
209 return out;
210 }

Member Data Documentation

◆ underflow

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

Definition at line 223 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 224 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 225 of file JHistogram.hh.


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