All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Gaudi::Histo1DDef Class Reference

Simple helper class for description of 1D-histogram The class is targeted to act as the primary "histogram property", but clearly have significantly wider application range. More...

#include <GaudiKernel/HistoDef.h>

Collaboration diagram for Gaudi::Histo1DDef:

Public Member Functions

 Histo1DDef (const double low, const double high, const int bins=100, const std::string &title="")
 full constructor from edges, bins and the title More...
 
 Histo1DDef (const std::string &title="", const double low=0.0, const double high=1.0, const int bins=100)
 full constructor from edges, bins and the title More...
 
virtual ~Histo1DDef ()
 destructor More...
 
double lowEdge () const
 get the low edge More...
 
double highEdge () const
 get the high edge More...
 
int bins () const
 get the number of bins More...
 
const std::string & title () const
 get the title More...
 
void setLowEdge (const double value)
 set low edge More...
 
void setHighEdge (const double value)
 set high edge More...
 
void setBins (const int value)
 set number of bis More...
 
void setTitle (const std::string &value)
 set the title More...
 
std::ostream & fillStream (std::ostream &o) const
 printout of the histogram definition More...
 
bool operator< (const Histo1DDef &right) const
 ordering operator (to please BoundedVerifier) More...
 
bool operator== (const Histo1DDef &right) const
 equality operator More...
 
bool operator!= (const Histo1DDef &right) const
 non-equality More...
 
bool ok () const
 check if all fields are "reasonable" More...
 

Private Attributes

std::string m_title
 Histogram title. More...
 
double m_low
 Low Edge. More...
 
double m_high
 High Edge. More...
 
int m_bins
 Number of bins. More...
 

Detailed Description

Simple helper class for description of 1D-histogram The class is targeted to act as the primary "histogram property", but clearly have significantly wider application range.

Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-09-17

Definition at line 32 of file HistoDef.h.

Constructor & Destructor Documentation

Gaudi::Histo1DDef::Histo1DDef ( const double  low,
const double  high,
const int  bins = 100,
const std::string &  title = "" 
)

full constructor from edges, bins and the title

Parameters
lowthe low edge of the histogram
highthe high edge of the histogram
binsnumber of bins
titlethe historgam title

Definition at line 29 of file HistoDef.cpp.

33  : m_title ( title )
34  , m_low ( low )
35  , m_high ( high )
36  , m_bins ( bins )
37 {}
const std::string & title() const
get the title
Definition: HistoDef.h:72
double m_high
High Edge.
Definition: HistoDef.h:111
std::string m_title
Histogram title.
Definition: HistoDef.h:107
int bins() const
get the number of bins
Definition: HistoDef.h:70
int m_bins
Number of bins.
Definition: HistoDef.h:113
double m_low
Low Edge.
Definition: HistoDef.h:109
Gaudi::Histo1DDef::Histo1DDef ( const std::string &  title = "",
const double  low = 0.0,
const double  high = 1.0,
const int  bins = 100 
)

full constructor from edges, bins and the title

Parameters
titlethe historgam title
lowthe low edge of the histogram
highthe high edge of the histogram
binsnumber of bins

Definition at line 47 of file HistoDef.cpp.

51  : m_title ( title )
52  , m_low ( low )
53  , m_high ( high )
54  , m_bins ( bins )
55 {}
const std::string & title() const
get the title
Definition: HistoDef.h:72
double m_high
High Edge.
Definition: HistoDef.h:111
std::string m_title
Histogram title.
Definition: HistoDef.h:107
int bins() const
get the number of bins
Definition: HistoDef.h:70
int m_bins
Number of bins.
Definition: HistoDef.h:113
double m_low
Low Edge.
Definition: HistoDef.h:109
Gaudi::Histo1DDef::~Histo1DDef ( )
virtual

destructor

virtual destructor

Definition at line 59 of file HistoDef.cpp.

59 {}

Member Function Documentation

int Gaudi::Histo1DDef::bins ( ) const
inline

get the number of bins

Definition at line 70 of file HistoDef.h.

70 { return m_bins ; }
int m_bins
Number of bins.
Definition: HistoDef.h:113
std::ostream & Gaudi::Histo1DDef::fillStream ( std::ostream &  o) const

printout of the histogram definition

Definition at line 63 of file HistoDef.cpp.

64 {
65  return o << "(" << Gaudi::Utils::toString ( title () )
66  << "," << lowEdge ()
67  << "," << highEdge ()
68  << "," << bins () << ")" ;
69 }
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
Definition: ToStream.h:367
double highEdge() const
get the high edge
Definition: HistoDef.h:68
double lowEdge() const
get the low edge
Definition: HistoDef.h:66
const std::string & title() const
get the title
Definition: HistoDef.h:72
int bins() const
get the number of bins
Definition: HistoDef.h:70
double Gaudi::Histo1DDef::highEdge ( ) const
inline

get the high edge

Definition at line 68 of file HistoDef.h.

68 { return m_high ; }
double m_high
High Edge.
Definition: HistoDef.h:111
double Gaudi::Histo1DDef::lowEdge ( ) const
inline

get the low edge

Definition at line 66 of file HistoDef.h.

66 { return m_low ; }
double m_low
Low Edge.
Definition: HistoDef.h:109
bool Gaudi::Histo1DDef::ok ( ) const
inline

check if all fields are "reasonable"

Definition at line 102 of file HistoDef.h.

102 { return 0 < bins() && lowEdge() < highEdge() ; }
double highEdge() const
get the high edge
Definition: HistoDef.h:68
double lowEdge() const
get the low edge
Definition: HistoDef.h:66
int bins() const
get the number of bins
Definition: HistoDef.h:70
bool Gaudi::Histo1DDef::operator!= ( const Histo1DDef right) const

non-equality

Definition at line 107 of file HistoDef.cpp.

108 { return !( *this == right ) ; }
bool Gaudi::Histo1DDef::operator< ( const Histo1DDef right) const

ordering operator (to please BoundedVerifier)

Definition at line 73 of file HistoDef.cpp.

74 {
75  return
76  this == &right ? false :
77  title () < right.title () ? true :
78  title () > right.title () ? false :
79  lowEdge () < right.lowEdge () ? true :
80  lowEdge () > right.lowEdge () ? false :
81  highEdge () < right.highEdge () ? true :
82  highEdge () > right.highEdge () ? false : bins () < right.bins () ;
83 }
double highEdge() const
get the high edge
Definition: HistoDef.h:68
double lowEdge() const
get the low edge
Definition: HistoDef.h:66
const std::string & title() const
get the title
Definition: HistoDef.h:72
int bins() const
get the number of bins
Definition: HistoDef.h:70
bool Gaudi::Histo1DDef::operator== ( const Histo1DDef right) const

equality operator

Definition at line 92 of file HistoDef.cpp.

93 {
94  return ( this == &right ) ||
95  ( title () == right.title () &&
96  lowEdge () == right.lowEdge () &&
97  highEdge () == right.highEdge () &&
98  bins () == right.bins () );
99 }
double highEdge() const
get the high edge
Definition: HistoDef.h:68
double lowEdge() const
get the low edge
Definition: HistoDef.h:66
const std::string & title() const
get the title
Definition: HistoDef.h:72
int bins() const
get the number of bins
Definition: HistoDef.h:70
void Gaudi::Histo1DDef::setBins ( const int  value)
inline

set number of bis

Definition at line 81 of file HistoDef.h.

81 { m_bins = value ; }
int m_bins
Number of bins.
Definition: HistoDef.h:113
void Gaudi::Histo1DDef::setHighEdge ( const double  value)
inline

set high edge

Definition at line 79 of file HistoDef.h.

79 { m_high = value ; }
double m_high
High Edge.
Definition: HistoDef.h:111
void Gaudi::Histo1DDef::setLowEdge ( const double  value)
inline

set low edge

Definition at line 77 of file HistoDef.h.

void Gaudi::Histo1DDef::setTitle ( const std::string &  value)
inline

set the title

Definition at line 83 of file HistoDef.h.

83 { m_title = value ; }
std::string m_title
Histogram title.
Definition: HistoDef.h:107
const std::string& Gaudi::Histo1DDef::title ( ) const
inline

get the title

Definition at line 72 of file HistoDef.h.

72 { return m_title ; }
std::string m_title
Histogram title.
Definition: HistoDef.h:107

Member Data Documentation

int Gaudi::Histo1DDef::m_bins
private

Number of bins.

Definition at line 113 of file HistoDef.h.

double Gaudi::Histo1DDef::m_high
private

High Edge.

Definition at line 111 of file HistoDef.h.

double Gaudi::Histo1DDef::m_low
private

Low Edge.

Definition at line 109 of file HistoDef.h.

std::string Gaudi::Histo1DDef::m_title
private

Histogram title.

Definition at line 107 of file HistoDef.h.


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