PSHist::HManager Class Reference
[PSHist package]

Interface for histogram/tuple manager class. More...

#include <HManager.h>

List of all members.

Public Member Functions

virtual ~HManager ()
virtual H1hist1i (const std::string &name, const std::string &title, int nbins, double xlow, double xhigh)=0
 Create new 1-dimensional histogram and return pointer to it.
virtual H1hist1f (const std::string &name, const std::string &title, int nbins, double xlow, double xhigh)=0
 Create new 1-dimensional histogram and return pointer to it.
virtual H1hist1d (const std::string &name, const std::string &title, int nbins, double xlow, double xhigh)=0
 Create new 1-dimensional histogram and return pointer to it.
virtual H1hist1i (const std::string &name, const std::string &title, int nbins, const double *xbinedges)=0
 Create new 1-dimensional histogram and return pointer to it.
virtual H1hist1f (const std::string &name, const std::string &title, int nbins, const double *xbinedges)=0
 Create new 1-dimensional histogram and return pointer to it.
virtual H1hist1d (const std::string &name, const std::string &title, int nbins, const double *xbinedges)=0
 Create new 1-dimensional histogram and return pointer to it.
virtual H1hist1i (const std::string &name, const std::string &title, const PSHist::Axis &axis)=0
 Create new 1-dimensional histogram and return pointer to it.
virtual H1hist1f (const std::string &name, const std::string &title, const PSHist::Axis &axis)=0
 Create new 1-dimensional histogram and return pointer to it.
virtual H1hist1d (const std::string &name, const std::string &title, const PSHist::Axis &axis)=0
 Create new 1-dimensional histogram and return pointer to it.
virtual H2hist2i (const std::string &name, const std::string &title, const PSHist::Axis &xaxis, const PSHist::Axis &yaxis)=0
 Create new 2-dimensional histogram and return pointer to it.
virtual H2hist2f (const std::string &name, const std::string &title, const PSHist::Axis &xaxis, const PSHist::Axis &yaxis)=0
 Create new 2-dimensional histogram and return pointer to it.
virtual H2hist2d (const std::string &name, const std::string &title, const PSHist::Axis &xaxis, const PSHist::Axis &yaxis)=0
 Create new 2-dimensional histogram and return pointer to it.
virtual Profileprof1 (const std::string &name, const std::string &title, int nbinsx, double xlow, double xhigh, const std::string &option="")=0
 Create new 1-dimensional profile histogram and return pointer to it.
virtual Profileprof1 (const std::string &name, const std::string &title, int nbins, const double *xbinedges, const std::string &option="")=0
 Create new 1-dimensional profile histogram and return pointer to it.
virtual Profileprof1 (const std::string &name, const std::string &title, const PSHist::Axis &axis, const std::string &option="")=0
 Create new 1-dimensional profile histogram and return pointer to it.
virtual Profileprof1 (const std::string &name, const std::string &title, int nbinsx, double xlow, double xhigh, double ylow, double yhigh, const std::string &option="")=0
 Create new 1-dimensional profile histogram and return pointer to it.
virtual Profileprof1 (const std::string &name, const std::string &title, int nbins, const double *xbinedges, double ylow, double yhigh, const std::string &option="")=0
 Create new 1-dimensional profile histogram and return pointer to it.
virtual Profileprof1 (const std::string &name, const std::string &title, const PSHist::Axis &axis, double ylow, double yhigh, const std::string &option="")=0
 Create new 1-dimensional profile histogram and return pointer to it.
virtual void write ()=0
 Store all booked histograms and tuples to a permanent storage.


Detailed Description

Interface for histogram/tuple manager class.

HManager is an empty base class which holds information about ntuples/histograms. The main reason is to be able to create and hold new histograms or/and ntuples without knowing without knowing what the underlying system is. For example, it might be root, hbook, hyppo etc.

Usage:

  #include "RootHist/RootHManager.h"
  #include "PSHist/HManager.h"
  #include "PSHist/Axis.h"
  #include "PSHist/H1.h"
  #include "PSHist/H2.h"
  #include "PSHist/Profile.h"

1. Create a HManager with specific constructor (root for example):

       PSHist::HManager *hMan = new RootHist::RootHManager("my-output-file.root", "RECREATE");

2. Create histograms

       PSHist::H1 *pHis1f = hMan->hist1f("His1 float  title",100,0.,1.);
       PSHist::H2 *pHis2d = hMan->hist2d("His2 double title",100,0.,1.,100,0.,1.);

3. Fill histograms

       pHis1f->fill(x,[weight]);        // once per event
       pHis2d->fill(x,y,[weight]);

4. Write the data into a file:

       hMan->write();                   // at the end of job
       delete hMan;

This software was developed for the LCLS project. If you use all or part of it, please give an appropriate acknowledgment.

See also:
H1

H2

Profile

Version:
Id
HManager.h 2056 2011-06-29 21:44:29Z salnikov@SLAC.STANFORD.EDU
Author:
Mikhail S. Dubrovin

Definition at line 114 of file HManager.h.


Constructor & Destructor Documentation

virtual PSHist::HManager::~HManager (  )  [inline, virtual]

Definition at line 118 of file HManager.h.


Member Function Documentation

virtual H1* PSHist::HManager::hist1d ( const std::string &  name,
const std::string &  title,
const PSHist::Axis axis 
) [pure virtual]

Create new 1-dimensional histogram and return pointer to it.

This method creates new 1-dimensional histogram, number of bins and their edges are determined by separate object (Axis class). Internal storage of the created histogram will consists of 64-bit floating number per histogram bin. The name of the histogram must be unique, otherwise exception is thrown.

Returned pointer should never be deleted by client code.

Parameters:
[in] name Histogram name, unique string.
[in] title Title of the histogram, arbitrary string.
[in] axis Axis definition.
Returns:
Pointer to a newly created histogram, do not delete.
Exceptions:
ExceptionDuplicateName thrown if histogram or tuple with identical name exists already

virtual H1* PSHist::HManager::hist1d ( const std::string &  name,
const std::string &  title,
int  nbins,
const double *  xbinedges 
) [pure virtual]

Create new 1-dimensional histogram and return pointer to it.

This method creates new 1-dimensional histogram with variable-width bins. Internal storage of the created histogram will consists of 64-bit floating number per histogram bin. The name of the histogram must be unique, otherwise exception is thrown.

Returned pointer should never be deleted by client code.

Parameters:
[in] name Histogram name, unique string.
[in] title Title of the histogram, arbitrary string.
[in] nbins Number of bins.
[in] xbinedges Array of the histogram edges, size of the array is nbins+1, it should contain ordered values for low edges of all bins plus high edge of last bin.
Returns:
Pointer to a newly created histogram, do not delete.
Exceptions:
ExceptionDuplicateName thrown if histogram or tuple with identical name exists already

virtual H1* PSHist::HManager::hist1d ( const std::string &  name,
const std::string &  title,
int  nbins,
double  xlow,
double  xhigh 
) [pure virtual]

Create new 1-dimensional histogram and return pointer to it.

This method creates new 1-dimensional histogram with same-width bins. Internal storage of the created histogram will consists of 64-bit floating number per histogram bin. The name of the histogram must be unique, otherwise exception is thrown.

Returned pointer should never be deleted by client code.

Parameters:
[in] name Histogram name, unique string.
[in] title Title of the histogram, arbitrary string.
[in] nbins Number of bins.
[in] xlow Low edge of the first bin.
[in] xhigh High edge of the last bin.
Returns:
Pointer to a newly created histogram, do not delete.
Exceptions:
ExceptionDuplicateName thrown if histogram or tuple with identical name exists already

virtual H1* PSHist::HManager::hist1f ( const std::string &  name,
const std::string &  title,
const PSHist::Axis axis 
) [pure virtual]

Create new 1-dimensional histogram and return pointer to it.

This method creates new 1-dimensional histogram, number of bins and their edges are determined by separate object (Axis class). Internal storage of the created histogram will consists of 32-bit floating number per histogram bin. The name of the histogram must be unique, otherwise exception is thrown.

Returned pointer should never be deleted by client code.

Parameters:
[in] name Histogram name, unique string.
[in] title Title of the histogram, arbitrary string.
[in] axis Axis definition.
Returns:
Pointer to a newly created histogram, do not delete.
Exceptions:
ExceptionDuplicateName thrown if histogram or tuple with identical name exists already

virtual H1* PSHist::HManager::hist1f ( const std::string &  name,
const std::string &  title,
int  nbins,
const double *  xbinedges 
) [pure virtual]

Create new 1-dimensional histogram and return pointer to it.

This method creates new 1-dimensional histogram with variable-width bins. Internal storage of the created histogram will consists of 32-bit floating number per histogram bin. The name of the histogram must be unique, otherwise exception is thrown.

Returned pointer should never be deleted by client code.

Parameters:
[in] name Histogram name, unique string.
[in] title Title of the histogram, arbitrary string.
[in] nbins Number of bins.
[in] xbinedges Array of the histogram edges, size of the array is nbins+1, it should contain ordered values for low edges of all bins plus high edge of last bin.
Returns:
Pointer to a newly created histogram, do not delete.
Exceptions:
ExceptionDuplicateName thrown if histogram or tuple with identical name exists already

virtual H1* PSHist::HManager::hist1f ( const std::string &  name,
const std::string &  title,
int  nbins,
double  xlow,
double  xhigh 
) [pure virtual]

Create new 1-dimensional histogram and return pointer to it.

This method creates new 1-dimensional histogram with same-width bins. Internal storage of the created histogram will consists of 32-bit floating number per histogram bin. The name of the histogram must be unique, otherwise exception is thrown.

Returned pointer should never be deleted by client code.

Parameters:
[in] name Histogram name, unique string.
[in] title Title of the histogram, arbitrary string.
[in] nbins Number of bins.
[in] xlow Low edge of the first bin.
[in] xhigh High edge of the last bin.
Returns:
Pointer to a newly created histogram, do not delete.
Exceptions:
ExceptionDuplicateName thrown if histogram or tuple with identical name exists already

virtual H1* PSHist::HManager::hist1i ( const std::string &  name,
const std::string &  title,
const PSHist::Axis axis 
) [pure virtual]

Create new 1-dimensional histogram and return pointer to it.

This method creates new 1-dimensional histogram, number of bins and their edges are determined by separate object (Axis class). Internal storage of the created histogram will consists of 32-bit integer per histogram bin. The name of the histogram must be unique, otherwise exception is thrown.

Returned pointer should never be deleted by client code.

Parameters:
[in] name Histogram name, unique string.
[in] title Title of the histogram, arbitrary string.
[in] axis Axis definition.
Returns:
Pointer to a newly created histogram, do not delete.
Exceptions:
ExceptionDuplicateName thrown if histogram or tuple with identical name exists already

virtual H1* PSHist::HManager::hist1i ( const std::string &  name,
const std::string &  title,
int  nbins,
const double *  xbinedges 
) [pure virtual]

Create new 1-dimensional histogram and return pointer to it.

This method creates new 1-dimensional histogram with variable-width bins. Internal storage of the created histogram will consists of 32-bit integer per histogram bin. The name of the histogram must be unique, otherwise exception is thrown.

Returned pointer should never be deleted by client code.

Parameters:
[in] name Histogram name, unique string.
[in] title Title of the histogram, arbitrary string.
[in] nbins Number of bins.
[in] xbinedges Array of the histogram edges, size of the array is nbins+1, it should contain ordered values for low edges of all bins plus high edge of last bin.
Returns:
Pointer to a newly created histogram, do not delete.
Exceptions:
ExceptionDuplicateName thrown if histogram or tuple with identical name exists already

virtual H1* PSHist::HManager::hist1i ( const std::string &  name,
const std::string &  title,
int  nbins,
double  xlow,
double  xhigh 
) [pure virtual]

Create new 1-dimensional histogram and return pointer to it.

This method creates new 1-dimensional histogram with same-width bins. Internal storage of the created histogram will consists of 32-bit integer per histogram bin. The name of the histogram must be unique, otherwise exception is thrown.

Returned pointer should never be deleted by client code.

Parameters:
[in] name Histogram name, unique string.
[in] title Title of the histogram, arbitrary string.
[in] nbins Number of bins.
[in] xlow Low edge of the first bin.
[in] xhigh High edge of the last bin.
Returns:
Pointer to a newly created histogram, do not delete.
Exceptions:
ExceptionDuplicateName thrown if histogram or tuple with identical name exists already

virtual H2* PSHist::HManager::hist2d ( const std::string &  name,
const std::string &  title,
const PSHist::Axis xaxis,
const PSHist::Axis yaxis 
) [pure virtual]

Create new 2-dimensional histogram and return pointer to it.

This method creates new 2-dimensional histogram, number of bins and their edges are determined by separate objects (Axis class). Internal storage of the created histogram will consists of 64-bit floating number per histogram bin. The name of the histogram must be unique, otherwise exception is thrown.

Returned pointer should never be deleted by client code.

Parameters:
[in] name Histogram name, unique string.
[in] title Title of the histogram, arbitrary string.
[in] xaxis X axis definition.
[in] yaxis Y axis definition.
Returns:
Pointer to a newly created histogram, do not delete.
Exceptions:
ExceptionDuplicateName thrown if histogram or tuple with identical name exists already

virtual H2* PSHist::HManager::hist2f ( const std::string &  name,
const std::string &  title,
const PSHist::Axis xaxis,
const PSHist::Axis yaxis 
) [pure virtual]

Create new 2-dimensional histogram and return pointer to it.

This method creates new 2-dimensional histogram, number of bins and their edges are determined by separate objects (Axis class). Internal storage of the created histogram will consists of 32-bit floating number per histogram bin. The name of the histogram must be unique, otherwise exception is thrown.

Returned pointer should never be deleted by client code.

Parameters:
[in] name Histogram name, unique string.
[in] title Title of the histogram, arbitrary string.
[in] xaxis X axis definition.
[in] yaxis Y axis definition.
Returns:
Pointer to a newly created histogram, do not delete.
Exceptions:
ExceptionDuplicateName thrown if histogram or tuple with identical name exists already

virtual H2* PSHist::HManager::hist2i ( const std::string &  name,
const std::string &  title,
const PSHist::Axis xaxis,
const PSHist::Axis yaxis 
) [pure virtual]

Create new 2-dimensional histogram and return pointer to it.

This method creates new 2-dimensional histogram, number of bins and their edges are determined by separate objects (Axis class). Internal storage of the created histogram will consists of 32-bit integer per histogram bin. The name of the histogram must be unique, otherwise exception is thrown.

Returned pointer should never be deleted by client code.

Parameters:
[in] name Histogram name, unique string.
[in] title Title of the histogram, arbitrary string.
[in] xaxis X axis definition.
[in] yaxis Y axis definition.
Returns:
Pointer to a newly created histogram, do not delete.
Exceptions:
ExceptionDuplicateName thrown if histogram or tuple with identical name exists already

virtual Profile* PSHist::HManager::prof1 ( const std::string &  name,
const std::string &  title,
const PSHist::Axis axis,
double  ylow,
double  yhigh,
const std::string &  option = "" 
) [pure virtual]

Create new 1-dimensional profile histogram and return pointer to it.

This method creates new 1-dimensional profile histogram, number of bins and their edges are determined by separate object (Axis class). The name of the histogram must be unique, otherwise exception is thrown. Option string determines what value is returned for the bin error, possible values are "" (default) for error-of-mean and "s" for standard deviation. Values of y ouside of range (ylow-yhigh) will be ignored.

Returned pointer should never be deleted by client code.

Parameters:
[in] name Histogram name, unique string.
[in] title Title of the histogram, arbitrary string.
[in] axis X axis definition.
[in] ylow Lowest possible value for Y values.
[in] yhigh Highest possible value for Y values.
[in] option Option string.
Returns:
Pointer to a newly created histogram, do not delete.
Exceptions:
ExceptionDuplicateName thrown if histogram or tuple with identical name exists already

virtual Profile* PSHist::HManager::prof1 ( const std::string &  name,
const std::string &  title,
int  nbins,
const double *  xbinedges,
double  ylow,
double  yhigh,
const std::string &  option = "" 
) [pure virtual]

Create new 1-dimensional profile histogram and return pointer to it.

This method creates new 1-dimensional profile histogram with variable-width bins. The name of the histogram must be unique, otherwise exception is thrown. Option string determines what value is returned for the bin error, possible values are "" (default) for error-of-mean and "s" for standard deviation. Values of y ouside of range (ylow-yhigh) will be ignored.

Returned pointer should never be deleted by client code.

Parameters:
[in] name Histogram name, unique string.
[in] title Title of the histogram, arbitrary string.
[in] nbins Number of bins.
[in] xbinedges Array of the histogram edges, size of the array is nbins+1, it should contain ordered values for low edges of all bins plus high edge of last bin.
[in] ylow Lowest possible value for Y values.
[in] yhigh Highest possible value for Y values.
[in] option Option string.
Returns:
Pointer to a newly created histogram, do not delete.
Exceptions:
ExceptionDuplicateName thrown if histogram or tuple with identical name exists already

virtual Profile* PSHist::HManager::prof1 ( const std::string &  name,
const std::string &  title,
int  nbinsx,
double  xlow,
double  xhigh,
double  ylow,
double  yhigh,
const std::string &  option = "" 
) [pure virtual]

Create new 1-dimensional profile histogram and return pointer to it.

This method creates new 1-dimensional profile histogram with same-width bins. The name of the histogram must be unique, otherwise exception is thrown. Option string determines what value is returned for the bin error, possible values are "" (default) for error-of-mean and "s" for standard deviation. Values of y ouside of range (ylow-yhigh) will be ignored.

Returned pointer should never be deleted by client code.

Parameters:
[in] name Histogram name, unique string.
[in] title Title of the histogram, arbitrary string.
[in] nbinsx Number of bins.
[in] xlow Low edge of the first bin.
[in] xhigh High edge of the last bin.
[in] ylow Lowest possible value for Y values.
[in] yhigh Highest possible value for Y values.
[in] option Option string.
Returns:
Pointer to a newly created histogram, do not delete.
Exceptions:
ExceptionDuplicateName thrown if histogram or tuple with identical name exists already

virtual Profile* PSHist::HManager::prof1 ( const std::string &  name,
const std::string &  title,
const PSHist::Axis axis,
const std::string &  option = "" 
) [pure virtual]

Create new 1-dimensional profile histogram and return pointer to it.

This method creates new 1-dimensional profile histogram, number of bins and their edges are determined by separate object (Axis class). The name of the histogram must be unique, otherwise exception is thrown. Option string determines what value is returned for the bin error, possible values are "" (default) for error-of-mean and "s" for standard deviation.

Returned pointer should never be deleted by client code.

Parameters:
[in] name Histogram name, unique string.
[in] title Title of the histogram, arbitrary string.
[in] axis X axis definition.
[in] option Option string.
Returns:
Pointer to a newly created histogram, do not delete.
Exceptions:
ExceptionDuplicateName thrown if histogram or tuple with identical name exists already

virtual Profile* PSHist::HManager::prof1 ( const std::string &  name,
const std::string &  title,
int  nbins,
const double *  xbinedges,
const std::string &  option = "" 
) [pure virtual]

Create new 1-dimensional profile histogram and return pointer to it.

This method creates new 1-dimensional profile histogram with variable-width bins. The name of the histogram must be unique, otherwise exception is thrown. Option string determines what value is returned for the bin error, possible values are "" (default) for error-of-mean and "s" for standard deviation.

Returned pointer should never be deleted by client code.

Parameters:
[in] name Histogram name, unique string.
[in] title Title of the histogram, arbitrary string.
[in] nbins Number of bins.
[in] xbinedges Array of the histogram edges, size of the array is nbins+1, it should contain ordered values for low edges of all bins plus high edge of last bin.
[in] option Option string.
Returns:
Pointer to a newly created histogram, do not delete.
Exceptions:
ExceptionDuplicateName thrown if histogram or tuple with identical name exists already

virtual Profile* PSHist::HManager::prof1 ( const std::string &  name,
const std::string &  title,
int  nbinsx,
double  xlow,
double  xhigh,
const std::string &  option = "" 
) [pure virtual]

Create new 1-dimensional profile histogram and return pointer to it.

This method creates new 1-dimensional profile histogram with same-width bins. The name of the histogram must be unique, otherwise exception is thrown. Option string determines what value is returned for the bin error, possible values are "" (default) for error-of-mean and "s" for standard deviation.

Returned pointer should never be deleted by client code.

Parameters:
[in] name Histogram name, unique string.
[in] title Title of the histogram, arbitrary string.
[in] nbinsx Number of bins.
[in] xlow Low edge of the first bin.
[in] xhigh High edge of the last bin.
[in] option Option string.
Returns:
Pointer to a newly created histogram, do not delete.
Exceptions:
ExceptionDuplicateName thrown if histogram or tuple with identical name exists already

virtual void PSHist::HManager::write (  )  [pure virtual]

Store all booked histograms and tuples to a permanent storage.

This method should be called once before deleting manager object.

Exceptions:
ExceptionStore thrown if write operation fails.


The documentation for this class was generated from the following file:
Generated on 19 Dec 2016 for PSANAclasses by  doxygen 1.4.7