PAASS
Software suite to Acquire and Analyze Data from Pixie16
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. More...
 

Detailed Description

Holds pointers to all Histograms.

Definition at line 19 of file Plots.hpp.

Constructor & Destructor Documentation

§ Plots()

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

Definition at line 15 of file Plots.cpp.

Here is the call graph for this function:

Member Function Documentation

§ BananaTest()

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

Definition at line 22 of file Plots.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

§ CheckRange()

bool Plots::CheckRange ( int  id) const
Returns
true if id is within allowed range.
Parameters
[in]id: the id to check

Check if the id falls within the expected range

Definition at line 27 of file Plots.cpp.

Here is the caller graph for this function:

§ DeclareHistogram1D() [1/3]

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

Constructors based on DeclareHistogram functions.

Definition at line 44 of file Plots.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

§ DeclareHistogram1D() [2/3]

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

Definition at line 74 of file Plots.cpp.

§ DeclareHistogram1D() [3/3]

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

Definition at line 81 of file Plots.cpp.

§ DeclareHistogram2D() [1/3]

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

Definition at line 88 of file Plots.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

§ DeclareHistogram2D() [2/3]

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

Definition at line 121 of file Plots.cpp.

§ DeclareHistogram2D() [3/3]

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

Definition at line 130 of file Plots.cpp.

§ Exists() [1/2]

bool Plots::Exists ( int  id) const
Returns
true if histogram number id exists.
Parameters
[in]id: the id to check

Checks if id is taken

Definition at line 32 of file Plots.cpp.

Here is the caller graph for this function:

§ Exists() [2/2]

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

Definition at line 36 of file Plots.cpp.

§ GetOffset()

int Plots::GetOffset ( )
inline
Returns
the offset for a given processor

Definition at line 28 of file Plots.hpp.

Here is the call graph for this function:

§ Plot() [1/2]

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 or weight for a 1D histogram
[in]val3: the z value or weight in a 2D histogram
[in]name: the name of the histogram in ROOT (not implemented now)
Returns
true if successful

Definition at line 139 of file Plots.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

§ Plot() [2/2]

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

Definition at line 162 of file Plots.cpp.

§ PrintNonEmpty()

void Plots::PrintNonEmpty ( std::ofstream &  hislog)

Prints out the non empty histograms in the analysis

Parameters
[in]hislog: the file stream to print to
Here is the caller graph for this function:

§ Round()

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

Definition at line 169 of file Plots.cpp.

Field Documentation

§ idList_

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

set of int (relative dammId without offsets

Definition at line 166 of file Plots.hpp.

§ mneList

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

Map of mnemonic -> int

Definition at line 168 of file Plots.hpp.

§ name_

std::string Plots::name_
private

Name of the owner of plots, mainly for debugging

Definition at line 164 of file Plots.hpp.

§ offset_

int Plots::offset_
private

Holds offset for a given set of plots

Definition at line 160 of file Plots.hpp.

§ plots_register_

PlotsRegister* Plots::plots_register_
staticprivate

Instance of the plots register.

Definition at line 158 of file Plots.hpp.

§ range_

int Plots::range_
private

Holds allowed range for a given set of plots

Definition at line 162 of file Plots.hpp.

§ titleList

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

Map of dammid -> title, helps debugging duplicated dammids

Definition at line 170 of file Plots.hpp.


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