thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
LWH::HistogramFactory Class Reference

User level interface for factory classes of Histograms (binned, unbinned, and profile). More...

#include <HistogramFactory.h>

Inheritance diagram for LWH::HistogramFactory:

Public Member Functions

 HistogramFactory (Tree &t)
 Standard constructor.
 
virtual ~HistogramFactory ()
 Destructor.
 
bool destroy (IBaseHistogram *hist)
 Destroy an IBaseHistogram object.
 
ICloud1D * createCloud1D (const std::string &, const std::string &, int=-1, const std::string &="")
 LWH cannot create a ICloud1D, an unbinned 1-dimensional histogram.
 
ICloud1D * createCloud1D (const std::string &)
 LWH cannot create a ICloud1D, an unbinned 1-dimensional histogram.
 
ICloud1D * createCopy (const std::string &, const ICloud1D &)
 LWH cannot create a copy of an ICloud1D.
 
ICloud2D * createCloud2D (const std::string &, const std::string &, int=-1, const std::string &="")
 LWH cannot create a ICloud2D, an unbinned 2-dimensional histogram.
 
ICloud2D * createCloud2D (const std::string &)
 LWH cannot create a ICloud2D, an unbinned 2-dimensional histogram.
 
ICloud2D * createCopy (const std::string &, const ICloud2D &)
 LWH cannot create a copy of an ICloud2D.
 
ICloud3D * createCloud3D (const std::string &, const std::string &, int=-1, const std::string &="")
 LWH cannot create a ICloud3D, an unbinned 3-dimensional histogram.
 
ICloud3D * createCloud3D (const std::string &)
 LWH cannot create a ICloud3D, an unbinned 3-dimensional histogram.
 
ICloud3D * createCopy (const std::string &, const ICloud3D &)
 LWH cannot create a copy of an ICloud3D.
 
IHistogram1D * createHistogram1D (const std::string &path, const std::string &title, int nBins, double lowerEdge, double upperEdge, const std::string &="")
 Create a IHistogram1D.
 
IHistogram1D * createHistogram1D (const std::string &pathAndTitle, int nBins, double lowerEdge, double upperEdge)
 Create a IHistogram1D.
 
IHistogram1D * createHistogram1D (const std::string &path, const std::string &title, const std::vector< double > &binEdges, const std::string &="")
 Create a IHistogram1D.
 
IHistogram1D * createCopy (const std::string &path, const IHistogram1D &hist)
 Create a copy of an IHistogram1D.
 
IHistogram2D * createHistogram2D (const std::string &path, const std::string &title, int nx, double xlo, double xup, int ny, double ylo, double yup, const std::string &="")
 Create a IHistogram2D.
 
IHistogram2D * createHistogram2D (const std::string &pathAndTitle, int nx, double xlo, double xup, int ny, double ylo, double yup)
 Create a IHistogram2D.
 
IHistogram2D * createHistogram2D (const std::string &path, const std::string &title, const std::vector< double > &xedges, const std::vector< double > &yedges, const std::string &="")
 Create a IHistogram2D.
 
IHistogram2D * createCopy (const std::string &path, const IHistogram2D &hist)
 Create a copy of an IHistogram2D.
 
IHistogram3D * createHistogram3D (const std::string &, const std::string &, int, double, double, int, double, double, int, double, double, const std::string &="")
 LWH cannot create a IHistogram3D.
 
IHistogram3D * createHistogram3D (const std::string &, int, double, double, int, double, double, int, double, double)
 LWH cannot create a IHistogram3D.
 
IHistogram3D * createHistogram3D (const std::string &, const std::string &, const std::vector< double > &, const std::vector< double > &, const std::vector< double > &, const std::string &="")
 LWH cannot create a IHistogram3D.
 
IHistogram3D * createCopy (const std::string &, const IHistogram3D &)
 LWH cannot create a copy of an IHistogram3D.
 
IProfile1D * createProfile1D (const std::string &, const std::string &, int, double, double, const std::string &="")
 LWH cannot create a IProfile1D.
 
IProfile1D * createProfile1D (const std::string &, const std::string &, int, double, double, double, double, const std::string &="")
 LWH cannot create a IProfile1D.
 
IProfile1D * createProfile1D (const std::string &, const std::string &, const std::vector< double > &, const std::string &="")
 LWH cannot create a IProfile1D.
 
IProfile1D * createProfile1D (const std::string &, const std::string &, const std::vector< double > &, double, double, const std::string &="")
 LWH cannot create a IProfile1D.
 
IProfile1D * createProfile1D (const std::string &, int, double, double)
 LWH cannot create a IProfile1D.
 
IProfile1D * createProfile1D (const std::string &, int, double, double, double, double)
 LWH cannot create a IProfile1D.
 
IProfile1D * createCopy (const std::string &, const IProfile1D &)
 LWH cannot create a copy of an IProfile1D.
 
IProfile2D * createProfile2D (const std::string &, const std::string &, int, double, double, int, double, double, const std::string &="")
 LWH cannot create a IProfile2D.
 
IProfile2D * createProfile2D (const std::string &, const std::string &, int, double, double, int, double, double, double, double, const std::string &="")
 LWH cannot create a IProfile2D.
 
IProfile2D * createProfile2D (const std::string &, const std::string &, const std::vector< double > &, const std::vector< double > &, const std::string &="")
 LWH cannot create a IProfile2D.
 
IProfile2D * createProfile2D (const std::string &, const std::string &, const std::vector< double > &, const std::vector< double > &, double, double, const std::string &="")
 LWH cannot create a IProfile2D.
 
IProfile2D * createProfile2D (const std::string &, int, double, double, int, double, double)
 LWH cannot create a IProfile2D.
 
IProfile2D * createProfile2D (const std::string &, int, double, double, int, double, double, double, double)
 LWH cannot create a IProfile2D.
 
IProfile2D * createCopy (const std::string &, const IProfile2D &)
 LWH cannot create a copy of an IProfile2D.
 
Histogram1Dadd (const std::string &path, const Histogram1D &hist1, const Histogram1D &hist2)
 Create a Histogram1D by adding two Histogram1D.
 
IHistogram1D * add (const std::string &path, const IHistogram1D &hist1, const IHistogram1D &hist2)
 Create an IHistogram1D by adding two IHistogram1D.
 
Histogram1Dsubtract (const std::string &path, const Histogram1D &h1, const Histogram1D &h2)
 Create a Histogram1D by subtracting two Histogram1D.
 
IHistogram1D * subtract (const std::string &path, const IHistogram1D &hist1, const IHistogram1D &hist2)
 Create an IHistogram1D by subtracting two IHistogram1D.
 
Histogram1Dmultiply (const std::string &path, const Histogram1D &h1, const Histogram1D &h2)
 Create a Histogram1D by multiplying two Histogram1D.
 
IHistogram1D * multiply (const std::string &path, const IHistogram1D &hist1, const IHistogram1D &hist2)
 Create an IHistogram1D by multiplying two IHistogram1D.
 
Histogram1Ddivide (const std::string &path, const Histogram1D &h1, const Histogram1D &h2)
 Create n Histogram1D by dividing two Histogram1D.
 
IHistogram1D * divide (const std::string &path, const IHistogram1D &hist1, const IHistogram1D &hist2)
 Create an IHistogram1D by dividing two IHistogram1D.
 
bool _neq (double a, double b, double eps=1e-5) const
 
bool checkBins (const Histogram1D &h1, const Histogram1D &h2) const
 Check if two histograms have the same bins.
 
bool checkBins (const Histogram2D &h1, const Histogram2D &h2) const
 Check if two histograms have the same bins.
 
IHistogram2D * add (const std::string &path, const IHistogram2D &hist1, const IHistogram2D &hist2)
 LWH cannot create an IHistogram2D by adding two IHistogram2D.
 
Histogram2Dadd (const std::string &path, const Histogram2D &h1, const Histogram2D &h2)
 LWH cannot create an IHistogram2D by adding two IHistogram2D.
 
Histogram2Dsubtract (const std::string &path, const Histogram2D &h1, const Histogram2D &h2)
 LWH cannot create an IHistogram2D by subtracting two IHistogram2D.
 
IHistogram2D * subtract (const std::string &path, const IHistogram2D &h1, const IHistogram2D &h2)
 LWH cannot create an IHistogram2D by subtracting two IHistogram2D.
 
IHistogram2D * multiply (const std::string &path, const IHistogram2D &h1, const IHistogram2D &h2)
 LWH cannot create an IHistogram2D by multiplying two IHistogram2D.
 
Histogram2Dmultiply (const std::string &path, const Histogram2D &h1, const Histogram2D &h2)
 LWH cannot create an IHistogram2D by multiplying two IHistogram2D.
 
Histogram2Ddivide (const std::string &path, const Histogram2D &h1, const Histogram2D &h2)
 LWH cannot create an IHistogram2D by dividing two IHistogram2D.
 
IHistogram2D * divide (const std::string &path, const IHistogram2D &h1, const IHistogram2D &h2)
 LWH cannot create an IHistogram2D by dividing two IHistogram2D.
 
IHistogram3D * add (const std::string &, const IHistogram3D &, const IHistogram3D &)
 LWH cannot create an IHistogram3D by adding two IHistogram3D.
 
IHistogram3D * subtract (const std::string &, const IHistogram3D &, const IHistogram3D &)
 LWH cannot create an IHistogram3D by subtracting two IHistogram3D.
 
IHistogram3D * multiply (const std::string &, const IHistogram3D &, const IHistogram3D &)
 LWH cannot create an IHistogram3D by multiplying two IHistogram3D.
 
IHistogram3D * divide (const std::string &, const IHistogram3D &, const IHistogram3D &)
 LWH cannot create an IHistogram3D by dividing two IHistogram3D.
 
IHistogram1D * projectionX (const std::string &path, const IHistogram2D &h)
 LWH cannot create an IHistogram1D by projecting an IHistogram2D along its x axis.
 
Histogram1DprojectionX (const std::string &path, const Histogram2D &h)
 LWH cannot create an IHistogram1D by projecting an IHistogram2D along its x axis.
 
IHistogram1D * projectionY (const std::string &path, const IHistogram2D &h)
 LWH cannot create an IHistogram1D by projecting an IHistogram2D along its y axis.
 
Histogram1DprojectionY (const std::string &path, const Histogram2D &h)
 LWH cannot create an IHistogram1D by projecting an IHistogram2D along its y axis.
 
IHistogram1D * sliceX (const std::string &path, const IHistogram2D &h, int i)
 LWH cannot create an IHistogram1D by slicing an IHistogram2D parallel to the y axis at a given bin.
 
Histogram1DsliceX (const std::string &path, const Histogram2D &h, int i)
 LWH cannot create an IHistogram1D by slicing an IHistogram2D parallel to the y axis at a given bin.
 
IHistogram1D * sliceY (const std::string &path, const IHistogram2D &h, int i)
 LWH cannot create an IHistogram1D by slicing an IHistogram2D parallel to the x axis at a given bin.
 
Histogram1DsliceY (const std::string &path, const Histogram2D &h, int i)
 LWH cannot create an IHistogram1D by slicing an IHistogram2D parallel to the x axis at a given bin.
 
IHistogram1D * sliceX (const std::string &path, const IHistogram2D &h, int il, int iu)
 LWH cannot create an IHistogram1D by slicing an IHistogram2D parallel to the y axis between two bins (inclusive).
 
Histogram1DsliceX (const std::string &path, const Histogram2D &h2, int il, int iu)
 LWH cannot create an IHistogram1D by slicing an IHistogram2D parallel to the y axis between two bins (inclusive).
 
IHistogram1D * sliceY (const std::string &path, const IHistogram2D &h, int il, int iu)
 LWH cannot create an IHistogram1D by slicing an IHistogram2D parallel to the x axis between two bins (inclusive).
 
Histogram1DsliceY (const std::string &path, const Histogram2D &h2, int il, int iu)
 
IHistogram2D * projectionXY (const std::string &, const IHistogram3D &)
 LWH cannot create an IHistogram2D by projecting an IHistogram3D on the x-y plane.
 
IHistogram2D * projectionXZ (const std::string &, const IHistogram3D &)
 LWH cannot create an IHistogram2D by projecting an IHistogram3D on the x-z plane.
 
IHistogram2D * projectionYZ (const std::string &, const IHistogram3D &)
 LWH cannot create an IHistogram2D by projecting an IHistogram3D on the y-z plane.
 
IHistogram2D * sliceXY (const std::string &, const IHistogram3D &, int, int)
 LWH cannot create an IHistogram2D by slicing an IHistogram3D perpendicular to the Z axis, between "index1" and "index2" (inclusive).
 
IHistogram2D * sliceXZ (const std::string &, const IHistogram3D &, int, int)
 LWH cannot create an IHistogram2D by slicing an IHistogram3D perpendicular to the Y axis, between "index1" and "index2" (inclusive).
 
IHistogram2D * sliceYZ (const std::string &, const IHistogram3D &, int, int)
 LWH cannot create an IHistogram2D by slicing an IHistogram3D perpendicular to the X axis, between "index1" and "index2" (inclusive).
 

Static Private Member Functions

template<typename T >
static T * error (std::string feature)
 Throw a suitable error.
 

Private Attributes

Treetree
 The tree where the actual histograms are stored.
 

Detailed Description

User level interface for factory classes of Histograms (binned, unbinned, and profile).

The created objects are assumed to be managed by the tree which is associated to the factory. So far only one-dimensional histograms are implemented in LWH.

Definition at line 32 of file HistogramFactory.h.

Constructor & Destructor Documentation

◆ HistogramFactory()

LWH::HistogramFactory::HistogramFactory ( Tree t)
inline

Standard constructor.

Definition at line 39 of file HistogramFactory.h.

◆ ~HistogramFactory()

virtual LWH::HistogramFactory::~HistogramFactory ( )
inlinevirtual

Destructor.

Definition at line 45 of file HistogramFactory.h.

Member Function Documentation

◆ _neq()

bool LWH::HistogramFactory::_neq ( double  a,
double  b,
double  eps = 1e-5 
) const
inline

Definition at line 615 of file HistogramFactory.h.

◆ add() [1/5]

IHistogram3D * LWH::HistogramFactory::add ( const std::string &  ,
const IHistogram3D &  ,
const IHistogram3D &   
)
inline

LWH cannot create an IHistogram3D by adding two IHistogram3D.

Definition at line 795 of file HistogramFactory.h.

◆ add() [2/5]

Histogram1D * LWH::HistogramFactory::add ( const std::string &  path,
const Histogram1D hist1,
const Histogram1D hist2 
)
inline

Create a Histogram1D by adding two Histogram1D.

Parameters
pathThe path of the created IHistogram. The path must be a full path. ("/folder1/folder2/dataName" is a valid path). The characther / cannot be used in names; it is only used to delimit directories within paths.
hist1The first member of the addition.
hist2The second member of the addition.
Returns
The sum of the two IHistogram1D.
Exceptions
std::runtime_errorif histogram could not be created.

Definition at line 456 of file HistogramFactory.h.

References LWH::Histogram1D::add(), checkBins(), LWH::Tree::insert(), LWH::Histogram1D::setTitle(), and tree.

Referenced by add().

◆ add() [3/5]

Histogram2D * LWH::HistogramFactory::add ( const std::string &  path,
const Histogram2D h1,
const Histogram2D h2 
)
inline

LWH cannot create an IHistogram2D by adding two IHistogram2D.

Definition at line 673 of file HistogramFactory.h.

References LWH::Histogram2D::add(), checkBins(), LWH::Tree::insert(), LWH::Histogram2D::setTitle(), and tree.

◆ add() [4/5]

IHistogram1D * LWH::HistogramFactory::add ( const std::string &  path,
const IHistogram1D &  hist1,
const IHistogram1D &  hist2 
)
inline

Create an IHistogram1D by adding two IHistogram1D.

Parameters
pathThe path of the created IHistogram. The path must be a full path. ("/folder1/folder2/dataName" is a valid path). The characther / cannot be used in names; it is only used to delimit directories within paths.
hist1The first member of the addition.
hist2The second member of the addition.
Returns
The sum of the two IHistogram1D.
Exceptions
std::runtime_errorif histogram could not be created.

Definition at line 477 of file HistogramFactory.h.

References add().

◆ add() [5/5]

IHistogram2D * LWH::HistogramFactory::add ( const std::string &  path,
const IHistogram2D &  hist1,
const IHistogram2D &  hist2 
)
inline

LWH cannot create an IHistogram2D by adding two IHistogram2D.

Definition at line 664 of file HistogramFactory.h.

References add().

◆ checkBins() [1/2]

bool LWH::HistogramFactory::checkBins ( const Histogram1D h1,
const Histogram1D h2 
) const
inline

Check if two histograms have the same bins.

Definition at line 625 of file HistogramFactory.h.

References LWH::Histogram1D::ax, and LWH::Histogram1D::fax.

Referenced by add(), divide(), multiply(), and subtract().

◆ checkBins() [2/2]

bool LWH::HistogramFactory::checkBins ( const Histogram2D h1,
const Histogram2D h2 
) const
inline

Check if two histograms have the same bins.

Definition at line 640 of file HistogramFactory.h.

References LWH::Histogram2D::xax, LWH::Histogram2D::xfax, LWH::Histogram2D::yax, and LWH::Histogram2D::yfax.

◆ createCloud1D() [1/2]

ICloud1D * LWH::HistogramFactory::createCloud1D ( const std::string &  )
inline

LWH cannot create a ICloud1D, an unbinned 1-dimensional histogram.

Definition at line 69 of file HistogramFactory.h.

◆ createCloud1D() [2/2]

ICloud1D * LWH::HistogramFactory::createCloud1D ( const std::string &  ,
const std::string &  ,
int  = -1,
const std::string &  = "" 
)
inline

LWH cannot create a ICloud1D, an unbinned 1-dimensional histogram.

Definition at line 61 of file HistogramFactory.h.

◆ createCloud2D() [1/2]

ICloud2D * LWH::HistogramFactory::createCloud2D ( const std::string &  )
inline

LWH cannot create a ICloud2D, an unbinned 2-dimensional histogram.

Definition at line 92 of file HistogramFactory.h.

◆ createCloud2D() [2/2]

ICloud2D * LWH::HistogramFactory::createCloud2D ( const std::string &  ,
const std::string &  ,
int  = -1,
const std::string &  = "" 
)
inline

LWH cannot create a ICloud2D, an unbinned 2-dimensional histogram.

Definition at line 83 of file HistogramFactory.h.

◆ createCloud3D() [1/2]

ICloud3D * LWH::HistogramFactory::createCloud3D ( const std::string &  )
inline

LWH cannot create a ICloud3D, an unbinned 3-dimensional histogram.

Definition at line 114 of file HistogramFactory.h.

◆ createCloud3D() [2/2]

ICloud3D * LWH::HistogramFactory::createCloud3D ( const std::string &  ,
const std::string &  ,
int  = -1,
const std::string &  = "" 
)
inline

LWH cannot create a ICloud3D, an unbinned 3-dimensional histogram.

Definition at line 106 of file HistogramFactory.h.

◆ createCopy() [1/8]

ICloud1D * LWH::HistogramFactory::createCopy ( const std::string &  ,
const ICloud1D &   
)
inline

LWH cannot create a copy of an ICloud1D.

Definition at line 76 of file HistogramFactory.h.

◆ createCopy() [2/8]

ICloud2D * LWH::HistogramFactory::createCopy ( const std::string &  ,
const ICloud2D &   
)
inline

LWH cannot create a copy of an ICloud2D.

Definition at line 99 of file HistogramFactory.h.

◆ createCopy() [3/8]

ICloud3D * LWH::HistogramFactory::createCopy ( const std::string &  ,
const ICloud3D &   
)
inline

LWH cannot create a copy of an ICloud3D.

Definition at line 121 of file HistogramFactory.h.

◆ createCopy() [4/8]

IHistogram3D * LWH::HistogramFactory::createCopy ( const std::string &  ,
const IHistogram3D &   
)
inline

LWH cannot create a copy of an IHistogram3D.

Definition at line 322 of file HistogramFactory.h.

◆ createCopy() [5/8]

IProfile1D * LWH::HistogramFactory::createCopy ( const std::string &  ,
const IProfile1D &   
)
inline

LWH cannot create a copy of an IProfile1D.

Definition at line 379 of file HistogramFactory.h.

◆ createCopy() [6/8]

IProfile2D * LWH::HistogramFactory::createCopy ( const std::string &  ,
const IProfile2D &   
)
inline

LWH cannot create a copy of an IProfile2D.

Definition at line 441 of file HistogramFactory.h.

◆ createCopy() [7/8]

IHistogram1D * LWH::HistogramFactory::createCopy ( const std::string &  path,
const IHistogram1D &  hist 
)
inline

Create a copy of an IHistogram1D.

Parameters
pathThe path of the created IHistogram. The path must be a full path. ("/folder1/folder2/dataName" is a valid path). The characther / cannot be used in names; it is only used to delimit directories within paths.
histThe IHistogram1D to be copied.
Returns
The copy of the IHistogram1D.
Exceptions
std::runtime_errorif histogram could not be created.

Definition at line 214 of file HistogramFactory.h.

References LWH::Tree::insert(), LWH::Histogram1D::setTitle(), and tree.

◆ createCopy() [8/8]

IHistogram2D * LWH::HistogramFactory::createCopy ( const std::string &  path,
const IHistogram2D &  hist 
)
inline

Create a copy of an IHistogram2D.

Definition at line 278 of file HistogramFactory.h.

References LWH::Tree::insert(), LWH::Histogram2D::setTitle(), and tree.

◆ createHistogram1D() [1/3]

IHistogram1D * LWH::HistogramFactory::createHistogram1D ( const std::string &  path,
const std::string &  title,
const std::vector< double > &  binEdges,
const std::string &  = "" 
)
inline

Create a IHistogram1D.

Parameters
pathThe path of the created IHistogram. The path can either be a relative or full path. ("/folder1/folder2/dataName" and "../folder/dataName" are valid paths). All the directories in the path must exist. The characther / cannot be used in names; it is only used to delimit directories within paths.
titleThe title of the IHistogram1D.
binEdgesThe array of the bin edges for the x axis.

Definition at line 189 of file HistogramFactory.h.

References LWH::Tree::insert(), LWH::Histogram1D::setTitle(), and tree.

◆ createHistogram1D() [2/3]

IHistogram1D * LWH::HistogramFactory::createHistogram1D ( const std::string &  path,
const std::string &  title,
int  nBins,
double  lowerEdge,
double  upperEdge,
const std::string &  = "" 
)
inline

Create a IHistogram1D.

Parameters
pathThe path of the created IHistogram. The path must be a full path. ("/folder1/folder2/dataName" is a valid path). The characther / cannot be used in names; it is only used to delimit directories within paths.
titleThe title of the IHistogram1D.
nBinsThe number of bins of the x axis.
lowerEdgeThe lower edge of the x axis.
upperEdgeThe upper edge of the x axis.
Returns
The newly created IHistogram1D ot the null pointer if something went wrong, such as a non existing directrory in the path or that an object with the given path already existed.
Exceptions
std::runtime_errorif histogram could not be created.

Definition at line 142 of file HistogramFactory.h.

References LWH::Tree::insert(), LWH::Histogram1D::setTitle(), and tree.

Referenced by createHistogram1D().

◆ createHistogram1D() [3/3]

IHistogram1D * LWH::HistogramFactory::createHistogram1D ( const std::string &  pathAndTitle,
int  nBins,
double  lowerEdge,
double  upperEdge 
)
inline

Create a IHistogram1D.

Parameters
pathAndTitleThe path of the created IHistogram. The path must be a full path. ("/folder1/folder2/dataName" is a valid path). The characther / cannot be used in names; it is only used to delimit directories within paths.
nBinsThe number of bins of the x axis.
lowerEdgeThe lower edge of the x axis.
upperEdgeThe upper edge of the x axis.
Returns
The newly created IHistogram1D.
Exceptions
std::runtime_errorif histogram could not be created.

Definition at line 169 of file HistogramFactory.h.

References createHistogram1D().

◆ createHistogram2D() [1/3]

IHistogram2D * LWH::HistogramFactory::createHistogram2D ( const std::string &  path,
const std::string &  title,
const std::vector< double > &  xedges,
const std::vector< double > &  yedges,
const std::string &  = "" 
)
inline

Create a IHistogram2D.

Definition at line 259 of file HistogramFactory.h.

References LWH::Tree::insert(), LWH::Histogram2D::setTitle(), and tree.

◆ createHistogram2D() [2/3]

IHistogram2D * LWH::HistogramFactory::createHistogram2D ( const std::string &  path,
const std::string &  title,
int  nx,
double  xlo,
double  xup,
int  ny,
double  ylo,
double  yup,
const std::string &  = "" 
)
inline

Create a IHistogram2D.

Definition at line 230 of file HistogramFactory.h.

References LWH::Tree::insert(), LWH::Histogram2D::setTitle(), and tree.

Referenced by createHistogram2D().

◆ createHistogram2D() [3/3]

IHistogram2D * LWH::HistogramFactory::createHistogram2D ( const std::string &  pathAndTitle,
int  nx,
double  xlo,
double  xup,
int  ny,
double  ylo,
double  yup 
)
inline

Create a IHistogram2D.

Definition at line 248 of file HistogramFactory.h.

References createHistogram2D().

◆ createHistogram3D() [1/3]

IHistogram3D * LWH::HistogramFactory::createHistogram3D ( const std::string &  ,
const std::string &  ,
const std::vector< double > &  ,
const std::vector< double > &  ,
const std::vector< double > &  ,
const std::string &  = "" 
)
inline

LWH cannot create a IHistogram3D.

Definition at line 311 of file HistogramFactory.h.

◆ createHistogram3D() [2/3]

IHistogram3D * LWH::HistogramFactory::createHistogram3D ( const std::string &  ,
const std::string &  ,
int  ,
double  ,
double  ,
int  ,
double  ,
double  ,
int  ,
double  ,
double  ,
const std::string &  = "" 
)
inline

LWH cannot create a IHistogram3D.

Definition at line 293 of file HistogramFactory.h.

◆ createHistogram3D() [3/3]

IHistogram3D * LWH::HistogramFactory::createHistogram3D ( const std::string &  ,
int  ,
double  ,
double  ,
int  ,
double  ,
double  ,
int  ,
double  ,
double   
)
inline

LWH cannot create a IHistogram3D.

Definition at line 303 of file HistogramFactory.h.

◆ createProfile1D() [1/6]

IProfile1D * LWH::HistogramFactory::createProfile1D ( const std::string &  ,
const std::string &  ,
const std::vector< double > &  ,
const std::string &  = "" 
)
inline

LWH cannot create a IProfile1D.

Definition at line 346 of file HistogramFactory.h.

◆ createProfile1D() [2/6]

IProfile1D * LWH::HistogramFactory::createProfile1D ( const std::string &  ,
const std::string &  ,
const std::vector< double > &  ,
double  ,
double  ,
const std::string &  = "" 
)
inline

LWH cannot create a IProfile1D.

Definition at line 355 of file HistogramFactory.h.

◆ createProfile1D() [3/6]

IProfile1D * LWH::HistogramFactory::createProfile1D ( const std::string &  ,
const std::string &  ,
int  ,
double  ,
double  ,
const std::string &  = "" 
)
inline

LWH cannot create a IProfile1D.

Definition at line 329 of file HistogramFactory.h.

◆ createProfile1D() [4/6]

IProfile1D * LWH::HistogramFactory::createProfile1D ( const std::string &  ,
const std::string &  ,
int  ,
double  ,
double  ,
double  ,
double  ,
const std::string &  = "" 
)
inline

LWH cannot create a IProfile1D.

Definition at line 337 of file HistogramFactory.h.

◆ createProfile1D() [5/6]

IProfile1D * LWH::HistogramFactory::createProfile1D ( const std::string &  ,
int  ,
double  ,
double   
)
inline

LWH cannot create a IProfile1D.

Definition at line 364 of file HistogramFactory.h.

◆ createProfile1D() [6/6]

IProfile1D * LWH::HistogramFactory::createProfile1D ( const std::string &  ,
int  ,
double  ,
double  ,
double  ,
double   
)
inline

LWH cannot create a IProfile1D.

Definition at line 371 of file HistogramFactory.h.

◆ createProfile2D() [1/6]

IProfile2D * LWH::HistogramFactory::createProfile2D ( const std::string &  ,
const std::string &  ,
const std::vector< double > &  ,
const std::vector< double > &  ,
const std::string &  = "" 
)
inline

LWH cannot create a IProfile2D.

Definition at line 405 of file HistogramFactory.h.

◆ createProfile2D() [2/6]

IProfile2D * LWH::HistogramFactory::createProfile2D ( const std::string &  ,
const std::string &  ,
const std::vector< double > &  ,
const std::vector< double > &  ,
double  ,
double  ,
const std::string &  = "" 
)
inline

LWH cannot create a IProfile2D.

Definition at line 415 of file HistogramFactory.h.

◆ createProfile2D() [3/6]

IProfile2D * LWH::HistogramFactory::createProfile2D ( const std::string &  ,
const std::string &  ,
int  ,
double  ,
double  ,
int  ,
double  ,
double  ,
const std::string &  = "" 
)
inline

LWH cannot create a IProfile2D.

Definition at line 386 of file HistogramFactory.h.

◆ createProfile2D() [4/6]

IProfile2D * LWH::HistogramFactory::createProfile2D ( const std::string &  ,
const std::string &  ,
int  ,
double  ,
double  ,
int  ,
double  ,
double  ,
double  ,
double  ,
const std::string &  = "" 
)
inline

LWH cannot create a IProfile2D.

Definition at line 395 of file HistogramFactory.h.

◆ createProfile2D() [5/6]

IProfile2D * LWH::HistogramFactory::createProfile2D ( const std::string &  ,
int  ,
double  ,
double  ,
int  ,
double  ,
double   
)
inline

LWH cannot create a IProfile2D.

Definition at line 425 of file HistogramFactory.h.

◆ createProfile2D() [6/6]

IProfile2D * LWH::HistogramFactory::createProfile2D ( const std::string &  ,
int  ,
double  ,
double  ,
int  ,
double  ,
double  ,
double  ,
double   
)
inline

LWH cannot create a IProfile2D.

Definition at line 433 of file HistogramFactory.h.

◆ destroy()

bool LWH::HistogramFactory::destroy ( IBaseHistogram *  hist)
inline

Destroy an IBaseHistogram object.

Parameters
histThe IBaseHistogram to be destroyed.
Returns
false If the histogram cannot be destroyed.

Definition at line 52 of file HistogramFactory.h.

References LWH::Tree::findPath(), LWH::Tree::rm(), and tree.

◆ divide() [1/5]

IHistogram3D * LWH::HistogramFactory::divide ( const std::string &  ,
const IHistogram3D &  ,
const IHistogram3D &   
)
inline

LWH cannot create an IHistogram3D by dividing two IHistogram3D.

Definition at line 819 of file HistogramFactory.h.

◆ divide() [2/5]

Histogram1D * LWH::HistogramFactory::divide ( const std::string &  path,
const Histogram1D h1,
const Histogram1D h2 
)
inline

Create n Histogram1D by dividing two Histogram1D.

Parameters
pathThe path of the created IHistogram. The path must be a full path. ("/folder1/folder2/dataName" is a valid path). The characther / cannot be used in names; it is only used to delimit directories within paths.
h1The first member of the division.
h2The second member of the division.
Returns
The ration of the two IHistogram1D.
Exceptions
std::runtime_errorif histogram could not be created.

Definition at line 578 of file HistogramFactory.h.

References LWH::Histogram1D::ax, checkBins(), LWH::Tree::insert(), LWH::Histogram1D::setTitle(), LWH::Histogram1D::sum, LWH::Histogram1D::sumw, LWH::Histogram1D::sumw2, and tree.

Referenced by divide().

◆ divide() [3/5]

Histogram2D * LWH::HistogramFactory::divide ( const std::string &  path,
const Histogram2D h1,
const Histogram2D h2 
)
inline

◆ divide() [4/5]

IHistogram1D * LWH::HistogramFactory::divide ( const std::string &  path,
const IHistogram1D &  hist1,
const IHistogram1D &  hist2 
)
inline

Create an IHistogram1D by dividing two IHistogram1D.

Parameters
pathThe path of the created IHistogram. The path must be a full path. ("/folder1/folder2/dataName" is a valid path). The characther / cannot be used in names; it is only used to delimit directories within paths.
hist1The first member of the division.
hist2The second member of the division.
Returns
The ration of the two IHistogram1D.
Exceptions
std::runtime_errorif histogram could not be created.

Definition at line 609 of file HistogramFactory.h.

References divide().

◆ divide() [5/5]

IHistogram2D * LWH::HistogramFactory::divide ( const std::string &  path,
const IHistogram2D &  h1,
const IHistogram2D &  h2 
)
inline

LWH cannot create an IHistogram2D by dividing two IHistogram2D.

Definition at line 786 of file HistogramFactory.h.

References divide().

◆ error()

template<typename T >
static T * LWH::HistogramFactory::error ( std::string  feature)
inlinestaticprivate

Throw a suitable error.

Definition at line 1025 of file HistogramFactory.h.

◆ multiply() [1/5]

IHistogram3D * LWH::HistogramFactory::multiply ( const std::string &  ,
const IHistogram3D &  ,
const IHistogram3D &   
)
inline

LWH cannot create an IHistogram3D by multiplying two IHistogram3D.

Definition at line 811 of file HistogramFactory.h.

◆ multiply() [2/5]

Histogram1D * LWH::HistogramFactory::multiply ( const std::string &  path,
const Histogram1D h1,
const Histogram1D h2 
)
inline

Create a Histogram1D by multiplying two Histogram1D.

Parameters
pathThe path of the created IHistogram. The path must be a full path. ("/folder1/folder2/dataName" is a valid path). The characther / cannot be used in names; it is only used to delimit directories within paths.
h1The first member of the multiplication.
h2The second member of the multiplication.
Returns
The product of the two IHistogram1D.
Exceptions
std::runtime_errorif histogram could not be created.

Definition at line 536 of file HistogramFactory.h.

References LWH::Histogram1D::ax, checkBins(), LWH::Tree::insert(), LWH::Histogram1D::setTitle(), LWH::Histogram1D::sumw, LWH::Histogram1D::sumw2, and tree.

Referenced by multiply().

◆ multiply() [3/5]

Histogram2D * LWH::HistogramFactory::multiply ( const std::string &  path,
const Histogram2D h1,
const Histogram2D h2 
)
inline

◆ multiply() [4/5]

IHistogram1D * LWH::HistogramFactory::multiply ( const std::string &  path,
const IHistogram1D &  hist1,
const IHistogram1D &  hist2 
)
inline

Create an IHistogram1D by multiplying two IHistogram1D.

Parameters
pathThe path of the created IHistogram. The path must be a full path. ("/folder1/folder2/dataName" is a valid path). The characther / cannot be used in names; it is only used to delimit directories within paths.
hist1The first member of the multiplication.
hist2The second member of the multiplication.
Returns
The product of the two IHistogram1D.
Exceptions
std::runtime_errorif histogram could not be created.

Definition at line 561 of file HistogramFactory.h.

References multiply().

◆ multiply() [5/5]

IHistogram2D * LWH::HistogramFactory::multiply ( const std::string &  path,
const IHistogram2D &  h1,
const IHistogram2D &  h2 
)
inline

LWH cannot create an IHistogram2D by multiplying two IHistogram2D.

Definition at line 727 of file HistogramFactory.h.

References multiply().

◆ projectionX() [1/2]

Histogram1D * LWH::HistogramFactory::projectionX ( const std::string &  path,
const Histogram2D h 
)
inline

LWH cannot create an IHistogram1D by projecting an IHistogram2D along its x axis.

Definition at line 836 of file HistogramFactory.h.

References sliceX(), and LWH::Histogram2D::yax.

◆ projectionX() [2/2]

IHistogram1D * LWH::HistogramFactory::projectionX ( const std::string &  path,
const IHistogram2D &  h 
)
inline

LWH cannot create an IHistogram1D by projecting an IHistogram2D along its x axis.

Definition at line 828 of file HistogramFactory.h.

References projectionX().

Referenced by projectionX().

◆ projectionXY()

IHistogram2D * LWH::HistogramFactory::projectionXY ( const std::string &  ,
const IHistogram3D &   
)
inline

LWH cannot create an IHistogram2D by projecting an IHistogram3D on the x-y plane.

Definition at line 973 of file HistogramFactory.h.

◆ projectionXZ()

IHistogram2D * LWH::HistogramFactory::projectionXZ ( const std::string &  ,
const IHistogram3D &   
)
inline

LWH cannot create an IHistogram2D by projecting an IHistogram3D on the x-z plane.

Definition at line 981 of file HistogramFactory.h.

◆ projectionY() [1/2]

Histogram1D * LWH::HistogramFactory::projectionY ( const std::string &  path,
const Histogram2D h 
)
inline

LWH cannot create an IHistogram1D by projecting an IHistogram2D along its y axis.

Definition at line 852 of file HistogramFactory.h.

References sliceY(), and LWH::Histogram2D::xax.

◆ projectionY() [2/2]

IHistogram1D * LWH::HistogramFactory::projectionY ( const std::string &  path,
const IHistogram2D &  h 
)
inline

LWH cannot create an IHistogram1D by projecting an IHistogram2D along its y axis.

Definition at line 844 of file HistogramFactory.h.

References projectionY().

Referenced by projectionY().

◆ projectionYZ()

IHistogram2D * LWH::HistogramFactory::projectionYZ ( const std::string &  ,
const IHistogram3D &   
)
inline

LWH cannot create an IHistogram2D by projecting an IHistogram3D on the y-z plane.

Definition at line 989 of file HistogramFactory.h.

◆ sliceX() [1/4]

Histogram1D * LWH::HistogramFactory::sliceX ( const std::string &  path,
const Histogram2D h,
int  i 
)
inline

LWH cannot create an IHistogram1D by slicing an IHistogram2D parallel to the y axis at a given bin.

Definition at line 870 of file HistogramFactory.h.

References sliceX().

◆ sliceX() [2/4]

Histogram1D * LWH::HistogramFactory::sliceX ( const std::string &  path,
const Histogram2D h2,
int  il,
int  iu 
)
inline

◆ sliceX() [3/4]

IHistogram1D * LWH::HistogramFactory::sliceX ( const std::string &  path,
const IHistogram2D &  h,
int  i 
)
inline

LWH cannot create an IHistogram1D by slicing an IHistogram2D parallel to the y axis at a given bin.

Definition at line 861 of file HistogramFactory.h.

References sliceX().

Referenced by projectionX(), and sliceX().

◆ sliceX() [4/4]

IHistogram1D * LWH::HistogramFactory::sliceX ( const std::string &  path,
const IHistogram2D &  h,
int  il,
int  iu 
)
inline

LWH cannot create an IHistogram1D by slicing an IHistogram2D parallel to the y axis between two bins (inclusive).

Definition at line 896 of file HistogramFactory.h.

References sliceX().

◆ sliceXY()

IHistogram2D * LWH::HistogramFactory::sliceXY ( const std::string &  ,
const IHistogram3D &  ,
int  ,
int   
)
inline

LWH cannot create an IHistogram2D by slicing an IHistogram3D perpendicular to the Z axis, between "index1" and "index2" (inclusive).

Definition at line 998 of file HistogramFactory.h.

◆ sliceXZ()

IHistogram2D * LWH::HistogramFactory::sliceXZ ( const std::string &  ,
const IHistogram3D &  ,
int  ,
int   
)
inline

LWH cannot create an IHistogram2D by slicing an IHistogram3D perpendicular to the Y axis, between "index1" and "index2" (inclusive).

Definition at line 1007 of file HistogramFactory.h.

◆ sliceY() [1/4]

Histogram1D * LWH::HistogramFactory::sliceY ( const std::string &  path,
const Histogram2D h,
int  i 
)
inline

LWH cannot create an IHistogram1D by slicing an IHistogram2D parallel to the x axis at a given bin.

Definition at line 887 of file HistogramFactory.h.

References sliceY().

◆ sliceY() [2/4]

Histogram1D * LWH::HistogramFactory::sliceY ( const std::string &  path,
const Histogram2D h2,
int  il,
int  iu 
)
inline

Definition at line 942 of file HistogramFactory.h.

◆ sliceY() [3/4]

IHistogram1D * LWH::HistogramFactory::sliceY ( const std::string &  path,
const IHistogram2D &  h,
int  i 
)
inline

LWH cannot create an IHistogram1D by slicing an IHistogram2D parallel to the x axis at a given bin.

Definition at line 879 of file HistogramFactory.h.

References sliceY().

Referenced by projectionY(), and sliceY().

◆ sliceY() [4/4]

IHistogram1D * LWH::HistogramFactory::sliceY ( const std::string &  path,
const IHistogram2D &  h,
int  il,
int  iu 
)
inline

LWH cannot create an IHistogram1D by slicing an IHistogram2D parallel to the x axis between two bins (inclusive).

Definition at line 937 of file HistogramFactory.h.

References sliceY().

◆ sliceYZ()

IHistogram2D * LWH::HistogramFactory::sliceYZ ( const std::string &  ,
const IHistogram3D &  ,
int  ,
int   
)
inline

LWH cannot create an IHistogram2D by slicing an IHistogram3D perpendicular to the X axis, between "index1" and "index2" (inclusive).

Definition at line 1016 of file HistogramFactory.h.

◆ subtract() [1/5]

IHistogram3D * LWH::HistogramFactory::subtract ( const std::string &  ,
const IHistogram3D &  ,
const IHistogram3D &   
)
inline

LWH cannot create an IHistogram3D by subtracting two IHistogram3D.

Definition at line 803 of file HistogramFactory.h.

◆ subtract() [2/5]

Histogram1D * LWH::HistogramFactory::subtract ( const std::string &  path,
const Histogram1D h1,
const Histogram1D h2 
)
inline

Create a Histogram1D by subtracting two Histogram1D.

Parameters
pathThe path of the created IHistogram. The path must be a full path. ("/folder1/folder2/dataName" is a valid path). The characther / cannot be used in names; it is only used to delimit directories within paths.
h1The first member of the subtraction.
h2The second member of the subtraction.
Returns
The difference of the two IHistogram1D.
Exceptions
std::runtime_errorif histogram could not be created.

Definition at line 494 of file HistogramFactory.h.

References LWH::Histogram1D::ax, checkBins(), LWH::Tree::insert(), LWH::Histogram1D::setTitle(), LWH::Histogram1D::sum, LWH::Histogram1D::sumw, LWH::Histogram1D::sumw2, and tree.

Referenced by subtract().

◆ subtract() [3/5]

Histogram2D * LWH::HistogramFactory::subtract ( const std::string &  path,
const Histogram2D h1,
const Histogram2D h2 
)
inline

◆ subtract() [4/5]

IHistogram1D * LWH::HistogramFactory::subtract ( const std::string &  path,
const IHistogram1D &  hist1,
const IHistogram1D &  hist2 
)
inline

Create an IHistogram1D by subtracting two IHistogram1D.

Parameters
pathThe path of the created IHistogram. The path must be a full path. ("/folder1/folder2/dataName" is a valid path). The characther / cannot be used in names; it is only used to delimit directories within paths.
hist1The first member of the subtraction.
hist2The second member of the subtraction.
Returns
The difference of the two IHistogram1D.
Exceptions
std::runtime_errorif histogram could not be created.

Definition at line 519 of file HistogramFactory.h.

References subtract().

◆ subtract() [5/5]

IHistogram2D * LWH::HistogramFactory::subtract ( const std::string &  path,
const IHistogram2D &  h1,
const IHistogram2D &  h2 
)
inline

LWH cannot create an IHistogram2D by subtracting two IHistogram2D.

Definition at line 718 of file HistogramFactory.h.

References subtract().

Member Data Documentation

◆ tree

Tree* LWH::HistogramFactory::tree
private

The tree where the actual histograms are stored.

Definition at line 1030 of file HistogramFactory.h.

Referenced by add(), createCopy(), createHistogram1D(), createHistogram2D(), destroy(), divide(), multiply(), sliceX(), and subtract().


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