geirs2Panic  Richard J. Mathar
Fits header keyword batch editor
 All Classes Files Functions Variables Macros Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | List of all members
Histos Class Reference

#include <Histos.h>

Collaboration diagram for Histos:
Collaboration graph

Public Member Functions

 Histos ()
 Constructor. More...
 
 Histos (vector< valarray< float > > &arr, vector< string > &iname)
 Constructor. More...
 
 Histos (vector< valarray< float > > &arr, const int Nbin, vector< string > &iname, string &contName)
 Constructor. More...
 
 Histos (vector< valarray< float > > &arr, const int Nbin, vector< string > &iname, string &contName, double range[2])
 Constructor. More...
 
void dumpFil (const char *fname)
 Create ASCII file in xy gnuplot format. More...
 
void gnuplot (const char *gplDfile, const char *gplfile, const bool doLogHist, string epsout)
 Generate a gnuplot shell command list. More...
 

Static Public Member Functions

static void valRange (vector< valarray< float > > &arr, double mimax[2])
 Determine smallest and largest value in all elements of the arrays. More...
 
static int countRange (vector< valarray< float > > &arr)
 

Public Attributes

double strt
 The smallest range of the first bin. More...
 
double stride
 The width of each bin. More...
 
string contName
 Some type of contents description. More...
 
vector< Histohs
 

Private Member Functions

void init (vector< valarray< float > > &arr, const int Nbin, const double *range, vector< string > &iname)
 Principal part of the constructor. More...
 

Detailed Description

Since
2013-01-29
Author
Richard J. Mathar

Constructor & Destructor Documentation

Histos::Histos ( )

Constructor.

Empty histogram. The main purpose of this construction is to allow allocations of vectors of histograms.

Since
2013-01-28
Author
Richard J. Mathar
Histos::Histos ( vector< valarray< float > > &  arr,
vector< string > &  iname 
)

Constructor.

Parameters
arrThe array of values to be binned.
inameThe associated list of names, one per arr component.
Since
2013-01-28
Author
Richard J. Mathar
Histos::Histos ( vector< valarray< float > > &  arr,
const int  Nbin,
vector< string > &  iname,
string &  conts 
)

Constructor.

Parameters
arrThe array of values to be binned.
NbinA number of bins to be used. If less than 1, the program depicts a default on its own.
inameName of the files associated with the arr.
contsA global simple name for the entire collection. Mainly for use with display headers and the like.
Since
2013-01-28
Author
Richard J. Mathar
Histos::Histos ( vector< valarray< float > > &  arr,
const int  Nbin,
vector< string > &  iname,
string &  conts,
double  range[2] 
)

Constructor.

Parameters
arrThe array of values to be binned.
NbinA number of bins to be used. If less than 1, the program depicts a default on its own.
inameName of the files associated with the arr.
contsA global simple name for the entire collection. Mainly for use with display headers and the like.
[in]range
Since
2013-01-28
Author
Richard J. Mathar

Member Function Documentation

void Histos::dumpFil ( const char *  fname)

Create ASCII file in xy gnuplot format.

Parameters
[in]fnameThe file to be generated.
Since
2013-01-29
2013-12-04 cumulative sum column added.
Author
Richard J. Mathar
void Histos::gnuplot ( const char *  fdname,
const char *  fpltname,
const bool  doLogHist,
string  epsout 
)

Generate a gnuplot shell command list.

Parameters
[in]fdnameThe file that contains the data to be plotted.
[in]fpltnameThe file with the gnuplot commands.
[in]doLogHistPrint a logarithmic, not a linear vertical scale
[in]epsoutPrint diagram into the EPS file, not on screen.
Since
2013-01-29
Author
Richard J. Mathar
void Histos::valRange ( vector< valarray< float > > &  arr,
double  mimax[2] 
)
static

Determine smallest and largest value in all elements of the arrays.

NaN-values are not taken into account (ignored).

Parameters
[in]arrThe arrays to be scanned.
[out]mimaxThe minimum in [0], the maximum in [1] If the array arr has zero size, the mimax[] are unchanged on return.
int Histos::countRange ( vector< valarray< float > > &  arr)
static
Parameters
[in]arrThe arrays to be scanned.
Returns
void Histos::init ( vector< valarray< float > > &  arr,
const int  Nbin,
const double *  range,
vector< string > &  iname 
)
private

Principal part of the constructor.

Parameters
arrThe array of values to be binned.
NbinThe number of bins into which the values are split.
rangeThe minimum and maximum value in the first and last bin.
Todo:
Check that Nbin is larger than zero etc.
Since
2013-01-28
Author
Richard J. Mathar

Member Data Documentation

double Histos::strt

The smallest range of the first bin.

double Histos::stride

The width of each bin.

string Histos::contName

Some type of contents description.

vector<Histo> Histos::hs