Pixie16 Analysis Software Suite
Analysis code for processing of .ldf files
Plots Class Reference

Holds pointers to all Histograms. More...

#include <Plots.hpp>

Collaboration diagram for Plots:

Public Member Functions

 Plots (int offset, int range, std::string name)
 
int GetOffset ()
 
void PrintNonEmpty (std::ofstream &hislog)
 
bool CheckRange (int id) const
 
bool Exists (int id) const
 
bool Exists (const std::string &mne) const
 
bool DeclareHistogram1D (int dammId, int xSize, const char *title, int halfWordsPerChan, int xHistLength, int xLow, int xHigh, const std::string &mne="")
 Declares a 1D histogram calls the C++ wrapper for DAMM. More...
 
bool DeclareHistogram1D (int dammId, int xSize, const char *title, int halfWordsPerChan=2, const std::string &mne="")
 Declares a 1D histogram calls the C++ wrapper for DAMM. More...
 
bool DeclareHistogram1D (int dammId, int xSize, const char *title, int halfWordsPerChan, int contraction, const std::string &mne="")
 Declares a 1D histogram calls the C++ wrapper for DAMM. More...
 
bool DeclareHistogram2D (int dammId, int xSize, int ySize, const char *title, int halfWordsPerChan, int xHistLength, int xLow, int xHigh, int yHistLength, int yLow, int yHigh, const std::string &mne="")
 Declares a 2D histogram calls the C++ wrapper for DAMM. More...
 
bool DeclareHistogram2D (int dammId, int xSize, int ySize, const char *title, int halfWordPerChan=1, const std::string &mne="")
 Declares a 2D histogram calls the C++ wrapper for DAMM. More...
 
bool DeclareHistogram2D (int dammId, int xSize, int ySize, const char *title, int halfWordsPerChan, int xContraction, int yContraction, const std::string &mne="")
 Declares a 2D histogram calls the C++ wrapper for DAMM. More...
 
bool Plot (int dammId, double val1, double val2=-1, double val3=-1, const char *name="h")
 Plots into histogram defined by dammId. More...
 
bool Plot (const std::string &mne, double val1, double val2=-1, double val3=-1, const char *name="h")
 Plots into histogram defined by mne. More...
 
bool BananaTest (const int &id, const double &x, const double &y)
 

Private Member Functions

int Round (double val) const
 

Private Attributes

int offset_
 
int range_
 
std::string name_
 
std::set< int > idList
 
std::map< std::string, int > mneList
 
std::map< int, std::string > titleList
 

Static Private Attributes

static PlotsRegisterplots_register_
 Instance of the plots register.
 

Detailed Description

Holds pointers to all Histograms.

Constructor & Destructor Documentation

Plots::Plots ( int  offset,
int  range,
std::string  name 
)

Default constructor that takes the offset, range, and name of processor

Parameters
[in]offset: the offset for the processor
[in]range: the range for the processor
[in]name: the name of the processor

Member Function Documentation

bool Plots::BananaTest ( const int &  id,
const double &  x,
const double &  y 
)

Method to test if a parameter is inside of a loaded banana

Will not help you defend against a man wielding a pointed stick.

Parameters
[in]id: the banana id to look at
[in]x: the x value to check
[in]y: the y value to check
Returns
true if the x,y coordinate was inside the banana
bool Plots::CheckRange ( int  id) const
Returns
true if id is within allowed range.
Parameters
[in]id: the id to check
bool Plots::DeclareHistogram1D ( int  dammId,
int  xSize,
const char *  title,
int  halfWordsPerChan,
int  xHistLength,
int  xLow,
int  xHigh,
const std::string &  mne = "" 
)

Declares a 1D histogram calls the C++ wrapper for DAMM.

Parameters
[in]dammId: The histogram number to define
[in]xSize: The range of the x-axis
[in]title: The title for the histogram
[in]halfWordsPerChan: the half words per channel in the his
[in]xHistLength: length of the histogram in the x axis
[in]xLow: the Low range of the histogram
[in]xHigh: the High range of the histogram
[in]mne: the mnemonic for the histogram
Returns
true if things go all right
bool Plots::DeclareHistogram1D ( int  dammId,
int  xSize,
const char *  title,
int  halfWordsPerChan = 2,
const std::string &  mne = "" 
)

Declares a 1D histogram calls the C++ wrapper for DAMM.

Parameters
[in]dammId: The histogram number to define
[in]xSize: The range of the x-axis
[in]title: The title for the histogram
[in]halfWordsPerChan: the half words per channel in the his
[in]mne: the mnemonic for the histogram
Returns
true if things go all right
bool Plots::DeclareHistogram1D ( int  dammId,
int  xSize,
const char *  title,
int  halfWordsPerChan,
int  contraction,
const std::string &  mne = "" 
)

Declares a 1D histogram calls the C++ wrapper for DAMM.

Parameters
[in]dammId: The histogram number to define
[in]xSize: The range of the x-axis
[in]title: The title for the histogram
[in]halfWordsPerChan: the half words per channel in the his
[in]contraction: the histogram contraction number
[in]mne: the mnemonic for the histogram
Returns
true if things go all right
bool Plots::DeclareHistogram2D ( int  dammId,
int  xSize,
int  ySize,
const char *  title,
int  halfWordsPerChan,
int  xHistLength,
int  xLow,
int  xHigh,
int  yHistLength,
int  yLow,
int  yHigh,
const std::string &  mne = "" 
)

Declares a 2D histogram calls the C++ wrapper for DAMM.

Parameters
[in]dammId: The histogram number to define
[in]xSize: The range of the x-axis
[in]ySize: The range of the y-axis
[in]title: The title of the histogram
[in]halfWordsPerChan: the half words per channel in the his
[in]xHistLength: length of the histogram in the x axis
[in]xLow: the Low range of the histogram
[in]xHigh: the High range of the histogram
[in]yHistLength: length of the histogram in the y axis
[in]yLow: the Low for the y-range of the histogram
[in]yHigh: the High for the y-range of the histogram
[in]mne: the mnemonic for the histogram
Returns
true if things go all right
bool Plots::DeclareHistogram2D ( int  dammId,
int  xSize,
int  ySize,
const char *  title,
int  halfWordPerChan = 1,
const std::string &  mne = "" 
)

Declares a 2D histogram calls the C++ wrapper for DAMM.

Parameters
[in]dammId: The histogram number to define
[in]xSize: The range of the x-axis
[in]ySize: The range of the y-axis
[in]title: The title of the histogram
[in]halfWordPerChan: the half words per channel in the his
[in]mne: the mnemonic for the histogram
Returns
true if things go all right
bool Plots::DeclareHistogram2D ( int  dammId,
int  xSize,
int  ySize,
const char *  title,
int  halfWordsPerChan,
int  xContraction,
int  yContraction,
const std::string &  mne = "" 
)

Declares a 2D histogram calls the C++ wrapper for DAMM.

Parameters
[in]dammId: The histogram number to define
[in]xSize: The range of the x-axis
[in]ySize: the range of the y-axis
[in]title: The title for the histogram
[in]halfWordsPerChan: the half words per channel in the his
[in]xContraction: the histogram x contraction number
[in]yContraction: the histogram y contraction number
[in]mne: the mnemonic for the histogram
Returns
true if things go all right
bool Plots::Exists ( int  id) const
Returns
true if histogram number id exists.
Parameters
[in]id: the id to check
bool Plots::Exists ( const std::string &  mne) const
Returns
true if histogram with mnemonic mne exists.
Parameters
[in]mne: the name to check in the list
int Plots::GetOffset ( )
inline
Returns
the offset for a given processor
bool Plots::Plot ( int  dammId,
double  val1,
double  val2 = -1,
double  val3 = -1,
const char *  name = "h" 
)

Plots into histogram defined by dammId.

Parameters
[in]dammId: The histogram number to define
[in]val1: the x value
[in]val2: the y value
[in]val3: the z value
[in]name: the name of the histogram
Returns
true if successful
bool Plots::Plot ( const std::string &  mne,
double  val1,
double  val2 = -1,
double  val3 = -1,
const char *  name = "h" 
)

Plots into histogram defined by mne.

Parameters
[in]mne: the mnemonic to plot into
[in]val1: the x value
[in]val2: the y value
[in]val3: the z value
[in]name: the name of the histogram
Returns
true if successful
void Plots::PrintNonEmpty ( std::ofstream &  hislog)

Prints out the non empty histograms in the analysis

Parameters
[in]hislog: the file stream to print to
int Plots::Round ( double  val) const
private

A function to round the value before passing it to DAMM

Parameters
[in]val: the value to round
Returns
the rounded value

Field Documentation

std::set<int> Plots::idList
private

set of int (relative dammId without offsets

std::map<std::string, int> Plots::mneList
private

Map of mnemonic -> int

std::string Plots::name_
private

Name of the owner of plots, mainly for debugging

int Plots::offset_
private

Holds offset for a given set of plots

int Plots::range_
private

Holds allowed range for a given set of plots

std::map<int, std::string> Plots::titleList
private

Map of dammid -> title, helps debugging duplicated dammids


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