Gaudi Framework, version v20r2

Generated: 18 Jul 2008

Gaudi::Histo1DDef Class Reference

#include <GaudiKernel/HistoDef.h>

Collaboration diagram for Gaudi::Histo1DDef:

Collaboration graph
[legend]
List of all members.

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 ibelyaev@physics.syr.edu
Date:
2007-09-17

Definition at line 28 of file HistoDef.h.

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
 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
virtual ~Histo1DDef ()
 destructor virtual destructor
double lowEdge () const
 get the low edge
double highEdge () const
 get the high edge
int bins () const
 get the number of bins
const std::stringtitle () const
 get the title
void setLowEdge (const double value)
 set low edge
void setHighEdge (const double value)
 set high edge
void setBins (const int value)
 set number of bis
void setTitle (const std::string &value)
 set the title
std::ostreamfillStream (std::ostream &o) const
 printout of the histogram definition
bool operator< (const Histo1DDef &right) const
 ordering operator (to please BoundedVerifier)
bool operator== (const Histo1DDef &right) const
 equality operator
bool operator!= (const Histo1DDef &right) const
 non-equality
bool ok () const
 check if all fields are "reasonable"

Private Attributes

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


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:
low the low edge of the histogram
high the high edge of the histogram
bins number of bins
title the historgam title

Definition at line 29 of file HistoDef.cpp.

00033   : m_title ( title ) 
00034   , m_low   ( low   ) 
00035   , m_high  ( high  ) 
00036   , m_bins  ( bins  )
00037 {}

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:
title the historgam title
low the low edge of the histogram
high the high edge of the histogram
bins number of bins

Definition at line 47 of file HistoDef.cpp.

00051   : m_title ( title ) 
00052   , m_low   ( low   ) 
00053   , m_high  ( high  ) 
00054   , m_bins  ( bins  )
00055 {}

Gaudi::Histo1DDef::~Histo1DDef (  )  [virtual]

destructor virtual destructor

Definition at line 59 of file HistoDef.cpp.

References ~Histo1DDef().

Referenced by ~Histo1DDef().

00059 {}


Member Function Documentation

double Gaudi::Histo1DDef::lowEdge (  )  const [inline]

get the low edge

Definition at line 62 of file HistoDef.h.

References lowEdge(), and m_low.

Referenced by fillStream(), lowEdge(), ok(), operator<(), and operator==().

00062 { return m_low   ; }

double Gaudi::Histo1DDef::highEdge (  )  const [inline]

get the high edge

Definition at line 64 of file HistoDef.h.

References highEdge(), and m_high.

Referenced by fillStream(), highEdge(), ok(), operator<(), and operator==().

00064 { return m_high  ; }

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

get the number of bins

Definition at line 66 of file HistoDef.h.

References bins(), and m_bins.

Referenced by bins(), ok(), operator<(), and operator==().

00066 { return m_bins  ; }

const std::string& Gaudi::Histo1DDef::title (  )  const [inline]

get the title

Definition at line 68 of file HistoDef.h.

References m_title, and title().

Referenced by operator<(), operator==(), and title().

00068 { return m_title ; }

void Gaudi::Histo1DDef::setLowEdge ( const double  value  )  [inline]

set low edge

Definition at line 73 of file HistoDef.h.

References m_low, and setLowEdge().

Referenced by setLowEdge().

00073 { m_low   = value ; }

void Gaudi::Histo1DDef::setHighEdge ( const double  value  )  [inline]

set high edge

Definition at line 75 of file HistoDef.h.

References m_high, and setHighEdge().

Referenced by setHighEdge().

00075 { m_high  = value ; }

void Gaudi::Histo1DDef::setBins ( const int  value  )  [inline]

set number of bis

Definition at line 77 of file HistoDef.h.

References m_bins, and setBins().

Referenced by setBins().

00077 { m_bins  = value ; }

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

set the title

Definition at line 79 of file HistoDef.h.

References m_title, and setTitle().

Referenced by setTitle().

00079 { m_title = value ; }

std::ostream & Gaudi::Histo1DDef::fillStream ( std::ostream o  )  const

printout of the histogram definition

Definition at line 63 of file HistoDef.cpp.

References fillStream(), highEdge(), lowEdge(), and Gaudi::Utils::toString().

Referenced by fillStream().

00064 {
00065   return o << "(" << Gaudi::Utils::toString ( title () )  
00066            << "," << lowEdge  () 
00067            << "," << highEdge () 
00068            << "," << bins     ()  << ")" ;
00069 }

bool Gaudi::Histo1DDef::operator< ( const Histo1DDef right  )  const

ordering operator (to please BoundedVerifier)

Definition at line 73 of file HistoDef.cpp.

References bins(), highEdge(), lowEdge(), and title().

00074 {
00075   return 
00076     this      ==  &right             ? false : 
00077     title    () <  right.title    () ? true  :
00078     title    () >  right.title    () ? false :
00079     lowEdge  () <  right.lowEdge  () ? true  :
00080     lowEdge  () >  right.lowEdge  () ? false :
00081     highEdge () <  right.highEdge () ? true  :
00082     highEdge () >  right.highEdge () ? false : bins () < right.bins () ;
00083 }

bool Gaudi::Histo1DDef::operator== ( const Histo1DDef right  )  const

equality operator

Definition at line 87 of file HistoDef.cpp.

References bins(), highEdge(), lowEdge(), and title().

00088 {
00089   return ( this == &right ) || 
00090     ( title    () == right.title    () && 
00091       lowEdge  () == right.lowEdge  () && 
00092       highEdge () == right.highEdge () && 
00093       bins     () == right.bins     () );
00094 }

bool Gaudi::Histo1DDef::operator!= ( const Histo1DDef right  )  const

non-equality

Definition at line 98 of file HistoDef.cpp.

00099 { return  !( *this == right ) ; }

bool Gaudi::Histo1DDef::ok (  )  const [inline]

check if all fields are "reasonable"

Definition at line 98 of file HistoDef.h.

References bins(), highEdge(), lowEdge(), and ok().

Referenced by ok().

00098 { return 0 < bins() && lowEdge() < highEdge() ; }


Member Data Documentation

std::string Gaudi::Histo1DDef::m_title [private]

Histogram title.

Definition at line 103 of file HistoDef.h.

Referenced by setTitle(), and title().

double Gaudi::Histo1DDef::m_low [private]

Low Edge.

Definition at line 105 of file HistoDef.h.

Referenced by lowEdge(), and setLowEdge().

double Gaudi::Histo1DDef::m_high [private]

High Edge.

Definition at line 107 of file HistoDef.h.

Referenced by highEdge(), and setHighEdge().

int Gaudi::Histo1DDef::m_bins [private]

Number of bins.

Definition at line 109 of file HistoDef.h.

Referenced by bins(), and setBins().


The documentation for this class was generated from the following files:
Generated at Fri Jul 18 12:07:21 2008 for Gaudi Framework, version v20r2 by Doxygen version 1.5.1 written by Dimitri van Heesch, © 1997-2004