The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
Gaudi::Histo1DDef Class Referencefinal

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 (double low, double high, int bins=100, std::string title="")
 full constructor from edges, bins and the title
 
 Histo1DDef (std::string title="", double low=0.0, double high=1.0, int bins=100)
 full constructor from edges, bins and the title
 
double lowEdge () const
 get the low edge
 
double highEdge () const
 get the high edge
 
int bins () const
 get the number of bins
 
const std::string & title () const
 get the title
 
void setLowEdge (double value)
 set low edge
 
void setHighEdge (double value)
 set high edge
 
void setBins (int value)
 set number of bis
 
void setTitle (std::string value)
 set the title
 
std::ostream & fillStream (std::ostream &o) const
 printout of the histogram definition
 
bool ok () const
 check if all fields are "reasonable"
 

Public Attributes

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

Friends

bool operator< (const Histo1DDef &left, const Histo1DDef &right)
 ordering operator (to please BoundedVerifier)
 
std::ostream & operator<< (std::ostream &o, const Gaudi::Histo1DDef &histo)
 the streamer operator for class Gaudi::Histo1DDef
 

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 30 of file HistoDef.h.

Constructor & Destructor Documentation

◆ Histo1DDef() [1/2]

Gaudi::Histo1DDef::Histo1DDef ( double low,
double high,
int bins = 100,
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 28 of file HistoDef.cpp.

29 : m_title( std::move( title ) ), m_low( low ), m_high( high ), m_bins( bins ) {}
double m_high
High Edge.
Definition HistoDef.h:72
int m_bins
Number of bins.
Definition HistoDef.h:73
int bins() const
get the number of bins
Definition HistoDef.h:51
const std::string & title() const
get the title
Definition HistoDef.h:53
double m_low
Low Edge.
Definition HistoDef.h:71
std::string m_title
Histogram title.
Definition HistoDef.h:70

◆ Histo1DDef() [2/2]

Gaudi::Histo1DDef::Histo1DDef ( std::string title = "",
double low = 0.0,
double high = 1.0,
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 36 of file HistoDef.cpp.

37 : m_title( std::move( title ) ), m_low( low ), m_high( high ), m_bins( bins ) {}

Member Function Documentation

◆ bins()

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

get the number of bins

Definition at line 51 of file HistoDef.h.

51{ return m_bins; }

◆ fillStream()

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

printout of the histogram definition

Definition at line 39 of file HistoDef.cpp.

39 {
40 return o << "(" << Gaudi::Utils::toString( title() ) << "," << lowEdge() << "," << highEdge() << "," << bins() << ")";
41}
double highEdge() const
get the high edge
Definition HistoDef.h:49
double lowEdge() const
get the low edge
Definition HistoDef.h:47
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
Definition ToStream.h:326

◆ highEdge()

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

get the high edge

Definition at line 49 of file HistoDef.h.

49{ return m_high; }

◆ lowEdge()

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

get the low edge

Definition at line 47 of file HistoDef.h.

47{ return m_low; }

◆ ok()

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

check if all fields are "reasonable"

Definition at line 69 of file HistoDef.h.

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

◆ setBins()

void Gaudi::Histo1DDef::setBins ( int value)
inline

set number of bis

Definition at line 59 of file HistoDef.h.

59{ m_bins = value; }

◆ setHighEdge()

void Gaudi::Histo1DDef::setHighEdge ( double value)
inline

set high edge

Definition at line 57 of file HistoDef.h.

57{ m_high = value; }

◆ setLowEdge()

void Gaudi::Histo1DDef::setLowEdge ( double value)
inline

set low edge

Definition at line 55 of file HistoDef.h.

55{ m_low = value; }

◆ setTitle()

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

set the title

Definition at line 61 of file HistoDef.h.

61{ m_title = std::move( value ); }

◆ title()

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

get the title

Definition at line 53 of file HistoDef.h.

53{ return m_title; }

Friends And Related Symbol Documentation

◆ operator<

bool operator< ( const Histo1DDef & left,
const Histo1DDef & right )
friend

ordering operator (to please BoundedVerifier)

Definition at line 44 of file HistoDef.cpp.

44 {
45 return std::tie( left.m_title, left.m_low, left.m_high, left.m_bins ) <
46 std::tie( right.m_title, right.m_low, right.m_high, right.m_bins );
47 }

◆ operator<<

std::ostream & operator<< ( std::ostream & o,
const Gaudi::Histo1DDef & histo )
friend

the streamer operator for class Gaudi::Histo1DDef

Definition at line 49 of file HistoDef.cpp.

49{ return histo.fillStream( o ); }
std::ostream & fillStream(std::ostream &o) const
printout of the histogram definition
Definition HistoDef.cpp:39

Member Data Documentation

◆ m_bins

int Gaudi::Histo1DDef::m_bins

Number of bins.

Definition at line 73 of file HistoDef.h.

◆ m_high

double Gaudi::Histo1DDef::m_high

High Edge.

Definition at line 72 of file HistoDef.h.

◆ m_low

double Gaudi::Histo1DDef::m_low

Low Edge.

Definition at line 71 of file HistoDef.h.

◆ m_title

std::string Gaudi::Histo1DDef::m_title

Histogram title.

Definition at line 70 of file HistoDef.h.


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