This class is the public interface the what the user sees as the DataRep object from Python. More...
#include <PyDataRep.h>
Public Member Functions | |
void | addCut () |
Adds a new region cut. | |
void | applyCut (QtCut *cut) |
Apply a cut. | |
void | applyCuts (const std::vector< QtCut * > &cuts) |
Apply a sequence of cuts to the DataRep. | |
const std::vector< std::string > & | colorNames () |
Returns the names of the available colors. | |
const NTuple * | createNTuple () const |
Create an NTuple for the displayed data. | |
NTuple * | createNTupleUnderRegion () const |
Returns a new NTuple from the bound DataSource by selecting rows that satisfy the region cut. | |
double | getBinWidth (const std::string &axis) |
Get the bin width for the specified axis. | |
const std::vector< double > & | getColumnWithCuts (const std::string &column) |
Return the named column with the present set of cuts applied. | |
hippodraw::DataRep * | getDataRep () |
The get method. | |
double | getMean (const std::string &axis) |
Returns the mean value along axis axis. | |
NTuple * | getNTupleWithCuts () const |
Return the current NTuple but with the present set of cuts applied. | |
double | getRMS (const std::string &axis) |
Returns the RMS of the mean value along axis axis. | |
const std::string & | name () const |
Return the display name used to create this data rep. | |
void | normalizeTo (const PyDataRep *target) |
Normalizes the receiving object to the target one. | |
double | numberOfEntries () const |
Return the number of entries in the rep. | |
PyDataRep (hippodraw::DataRep *) | |
A constructor. | |
PyDataRep (const std::string &type, const DataSource *ntuple, const std::vector< std::string > &bindings) | |
Constructor to create data reps from python. | |
PyDataRep (const std::string &type, const PyDataSource *ntuple, const std::vector< std::string > &bindings) | |
Constructor to create data reps from python using a PyDataSource object. | |
PyDataRep () | |
The default constructor. | |
PyDataRep (PyDataRep *pyRep) | |
Copy constructor. | |
void | set (Color::Value value) |
Sets the Color of the point representation to one of Color::Value. | |
void | set (hippodraw::Symbol::Type type) |
sets the plotting symbol and size for a point. | |
void | set (hippodraw::Line::Style style) |
sets the plotting line style. | |
void | setAxisBinding (const std::string &axis, const std::string &label) |
Set the axis bindings for a single axis. | |
void | setAxisBindings (const std::vector< std::string > &bindings) |
Set the axis bindings for all axes at once. | |
void | setBinWidth (const std::string &axis, double width) |
Sets the bin width, if binned, on axis to width. | |
void | setColor (const std::string &color) |
Set the color used for plotting, selecting from a predefined palette of "black", "red", "green", "blue", "yellow", "cyan", "magenta". | |
void | setCutRange (double low, double high) |
Sets the range of the region cut. | |
void | setErrorDisplay (const std::string &axis, bool flag) |
Turn on the error bars. | |
void | setLineStyle (const std::string &lineStyle) |
Set the plotting line style. | |
void | setPointRep (RepBase *pointRep) |
Set the point representation. | |
void | setSize (double value) |
Sets the size of the point representation. | |
void | setSymbol (const std::string &symbolName, float size=2.) |
Set the plotting symbol and size. | |
void | setWeight (const std::string &label) |
Set the weight for DyHistogram (or Color Plot or Contour plots). |
Static Public Member Functions | |
static const std::vector < std::string > & | names () |
Returns the names of the types of DataRep objects available. |
Private Member Functions | |
void | init () |
Used in the constructors. |
Static Private Member Functions | |
static void | makeColorMap () |
Create the color map. | |
static void | makeLineStyleMap () |
Create the line style map. | |
static void | makeSymbolMap () |
Create the plotting symbols map. |
Private Attributes | |
std::vector< double > | m_columnData |
Vector of values returned by const reference for getColumnWithCuts method. | |
hippodraw::DataRep * | m_datarep |
The actual DataRep object. |
Static Private Attributes | |
static bool | s_have_static_members |
A flag to indicate that we have the static data members. | |
static std::map< std::string, hippodraw::Line::Style > | s_lineStyles |
A map of line styles, keyed by name. | |
static std::map< std::string, hippodraw::Symbol::Type > | s_symbols |
A map of symbol types, keyed by name. |
This class is the public interface the what the user sees as the DataRep object from Python.
Definition at line 37 of file PyDataRep.h.
PyDataRep | ( | hippodraw::DataRep * | rep | ) |
A constructor.
Definition at line 263 of file PyDataRep.cxx.
PyDataRep | ( | const std::string & | type, |
const DataSource * | ntuple, | ||
const std::vector< std::string > & | bindings | ||
) |
Constructor to create data reps from python.
Definition at line 269 of file PyDataRep.cxx.
References DataRepController::createDataRep().
PyDataRep | ( | const std::string & | type, |
const PyDataSource * | ntuple, | ||
const std::vector< std::string > & | bindings | ||
) |
Constructor to create data reps from python using a PyDataSource object.
Definition at line 278 of file PyDataRep.cxx.
References DataRepController::createDataRep(), and PyDataSource::dataSource().
PyDataRep | ( | ) |
The default constructor.
Definition at line 288 of file PyDataRep.cxx.
Copy constructor.
Definition at line 294 of file PyDataRep.cxx.
References DataRep::clone(), and PyDataRep::getDataRep().
void addCut | ( | ) |
void applyCut | ( | QtCut * | cut | ) |
Apply a cut.
Definition at line 409 of file PyDataRep.cxx.
void applyCuts | ( | const std::vector< QtCut * > & | cuts | ) |
Apply a sequence of cuts to the DataRep.
Definition at line 418 of file PyDataRep.cxx.
References num_util::size().
const vector< string > & colorNames | ( | ) |
Returns the names of the available colors.
Definition at line 433 of file PyDataRep.cxx.
const NTuple * createNTuple | ( | ) | const |
Create an NTuple for the displayed data.
Definition at line 489 of file PyDataRep.cxx.
NTuple * createNTupleUnderRegion | ( | ) | const |
Returns a new NTuple from the bound DataSource by selecting rows that satisfy the region cut.
Definition at line 523 of file PyDataRep.cxx.
double getBinWidth | ( | const std::string & | axis | ) |
Get the bin width for the specified axis.
Definition at line 371 of file PyDataRep.cxx.
References hippodraw::Axes::convert(), and ProjectorBase::getBinWidth().
const std::vector< double > & getColumnWithCuts | ( | const std::string & | column | ) |
Return the named column with the present set of cuts applied.
Definition at line 510 of file PyDataRep.cxx.
DataRep * getDataRep | ( | ) |
The get method.
Definition at line 308 of file PyDataRep.cxx.
Referenced by QtDisplay::addDataRep(), and PyDataRep::PyDataRep().
double getMean | ( | const std::string & | axis | ) |
Returns the mean value along axis axis.
Definition at line 383 of file PyDataRep.cxx.
NTuple * getNTupleWithCuts | ( | ) | const |
Return the current NTuple but with the present set of cuts applied.
Definition at line 500 of file PyDataRep.cxx.
double getRMS | ( | const std::string & | axis | ) |
Returns the RMS of the mean value along axis axis.
Definition at line 394 of file PyDataRep.cxx.
|
private |
Used in the constructors.
Definition at line 663 of file PyDataRep.cxx.
|
staticprivate |
Create the color map.
|
staticprivate |
Create the line style map.
Definition at line 613 of file PyDataRep.cxx.
References hippodraw::Line::Dash, hippodraw::Line::DashDot, hippodraw::Line::DashDotDot, hippodraw::Line::Dot, hippodraw::FontWeight::Invisible, and hippodraw::Line::Solid.
|
staticprivate |
Create the plotting symbols map.
Definition at line 555 of file PyDataRep.cxx.
References hippodraw::Symbol::CIRCLE, hippodraw::Symbol::FILLED_CIRCLE, hippodraw::Symbol::FILLED_TRIANGLE, hippodraw::Symbol::PLUS, hippodraw::Symbol::SOLIDSQUARE, hippodraw::Symbol::SQUARE, hippodraw::Symbol::TIMES, and hippodraw::Symbol::TRIANGLE.
const std::string & name | ( | ) | const |
Return the display name used to create this data rep.
Definition at line 366 of file PyDataRep.cxx.
|
static |
Returns the names of the types of DataRep objects available.
Definition at line 301 of file PyDataRep.cxx.
void normalizeTo | ( | const PyDataRep * | target | ) |
Normalizes the receiving object to the target one.
Definition at line 674 of file PyDataRep.cxx.
double numberOfEntries | ( | ) | const |
Return the number of entries in the rep.
Definition at line 403 of file PyDataRep.cxx.
void set | ( | Color::Value | value | ) |
Sets the Color of the point representation to one of Color::Value.
Definition at line 440 of file PyDataRep.cxx.
void set | ( | hippodraw::Symbol::Type | type | ) |
sets the plotting symbol and size for a point.
Definition at line 568 of file PyDataRep.cxx.
void set | ( | hippodraw::Line::Style | style | ) |
sets the plotting line style.
Definition at line 624 of file PyDataRep.cxx.
void setAxisBinding | ( | const std::string & | axis, |
const std::string & | label | ||
) |
Set the axis bindings for a single axis.
Definition at line 325 of file PyDataRep.cxx.
void setAxisBindings | ( | const std::vector< std::string > & | bindings | ) |
Set the axis bindings for all axes at once.
Definition at line 339 of file PyDataRep.cxx.
void setBinWidth | ( | const std::string & | axis, |
double | width | ||
) |
Sets the bin width, if binned, on axis to width.
Definition at line 686 of file PyDataRep.cxx.
References hippodraw::Axes::convert(), and num_util::type().
void setColor | ( | const std::string & | color | ) |
Set the color used for plotting, selecting from a predefined palette of "black", "red", "green", "blue", "yellow", "cyan", "magenta".
Definition at line 457 of file PyDataRep.cxx.
void setCutRange | ( | double | low, |
double | high | ||
) |
Sets the range of the region cut.
Definition at line 545 of file PyDataRep.cxx.
void setErrorDisplay | ( | const std::string & | axis, |
bool | flag | ||
) |
Turn on the error bars.
Definition at line 477 of file PyDataRep.cxx.
References hippodraw::Axes::convert().
void setLineStyle | ( | const std::string & | lineStyle | ) |
Set the plotting line style.
Definition at line 642 of file PyDataRep.cxx.
void setPointRep | ( | RepBase * | pointRep | ) |
Set the point representation.
Definition at line 318 of file PyDataRep.cxx.
void setSize | ( | double | value | ) |
Sets the size of the point representation.
Definition at line 585 of file PyDataRep.cxx.
void setSymbol | ( | const std::string & | symbolName, |
float | size = 2. |
||
) |
Set the plotting symbol and size.
Definition at line 592 of file PyDataRep.cxx.
void setWeight | ( | const std::string & | label | ) |
Set the weight for DyHistogram (or Color Plot or Contour plots).
Definition at line 352 of file PyDataRep.cxx.
|
private |
Vector of values returned by const reference for getColumnWithCuts method.
Definition at line 48 of file PyDataRep.h.
|
private |
The actual DataRep object.
Definition at line 43 of file PyDataRep.h.
|
staticprivate |
A flag to indicate that we have the static data members.
Definition at line 57 of file PyDataRep.h.
|
staticprivate |
A map of line styles, keyed by name.
Definition at line 54 of file PyDataRep.h.
|
staticprivate |
A map of symbol types, keyed by name.
Definition at line 51 of file PyDataRep.h.