#include <HManager.h>
Public Member Functions | |
virtual | ~HManager () |
virtual H1 * | hist1i (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 H1 * | hist1f (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 H1 * | hist1d (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 H1 * | hist1i (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 H1 * | hist1f (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 H1 * | hist1d (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 H1 * | hist1i (const std::string &name, const std::string &title, const PSHist::Axis &axis)=0 |
Create new 1-dimensional histogram and return pointer to it. | |
virtual H1 * | hist1f (const std::string &name, const std::string &title, const PSHist::Axis &axis)=0 |
Create new 1-dimensional histogram and return pointer to it. | |
virtual H1 * | hist1d (const std::string &name, const std::string &title, const PSHist::Axis &axis)=0 |
Create new 1-dimensional histogram and return pointer to it. | |
virtual H2 * | hist2i (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 H2 * | hist2f (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 H2 * | hist2d (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 Profile * | prof1 (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 Profile * | prof1 (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 Profile * | prof1 (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 Profile * | prof1 (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 Profile * | prof1 (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 Profile * | prof1 (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. |
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
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.
Definition at line 114 of file HManager.h.
virtual PSHist::HManager::~HManager | ( | ) | [inline, virtual] |
Definition at line 118 of file HManager.h.
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.
[in] | name | Histogram name, unique string. |
[in] | title | Title of the histogram, arbitrary string. |
[in] | axis | Axis definition. |
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.
[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. |
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.
[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. |
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.
[in] | name | Histogram name, unique string. |
[in] | title | Title of the histogram, arbitrary string. |
[in] | axis | Axis definition. |
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.
[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. |
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.
[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. |
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.
[in] | name | Histogram name, unique string. |
[in] | title | Title of the histogram, arbitrary string. |
[in] | axis | Axis definition. |
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.
[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. |
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.
[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. |
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.
[in] | name | Histogram name, unique string. |
[in] | title | Title of the histogram, arbitrary string. |
[in] | xaxis | X axis definition. |
[in] | yaxis | Y axis definition. |
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.
[in] | name | Histogram name, unique string. |
[in] | title | Title of the histogram, arbitrary string. |
[in] | xaxis | X axis definition. |
[in] | yaxis | Y axis definition. |
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.
[in] | name | Histogram name, unique string. |
[in] | title | Title of the histogram, arbitrary string. |
[in] | xaxis | X axis definition. |
[in] | yaxis | Y axis definition. |
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.
[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. |
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.
[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. |
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.
[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. |
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.
[in] | name | Histogram name, unique string. |
[in] | title | Title of the histogram, arbitrary string. |
[in] | axis | X axis definition. |
[in] | option | Option string. |
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.
[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. |
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.
[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. |
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.
ExceptionStore | thrown if write operation fails. |