Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

PyDataRep Class Reference

#include <PyDataRep.h>

Collaboration diagram for PyDataRep:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class is the public interface the what the user sees as the DataRep object from Python.

Author:
Sanket B Malde <sanket@slac.stanford.edu>

J. Chiang <jchiang@slac.stanford.edu>

Definition at line 37 of file PyDataRep.h.

Public Member Functions

void applyCut (QtCut *cut)
 Apply a cut.
const NTuplecreateNTuple () const
 Create an NTuple for the displayed data.
double getBinWidth (const std::string &axis)
 Get the bin width for the specified axis.
DataRepgetDataRep ()
 The get method.
double getMean (const std::string &axis)
 Returns the mean value along axis axis.
NTuplegetNTupleWithCuts () 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::stringname () 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 (PyDataRep *pyRep)
 Copy constructor.
 PyDataRep ()
 The default constructor.
 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 (const std::string &type, const DataSource *ntuple, const std::vector< std::string > &bindings)
 Constructor to create data reps from python.
 PyDataRep (DataRep *)
 A constructor.
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 pre-defined palette of "black", "red", "green", "blue", "yellow", "cyan", "magenta".
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 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).

Private Member Functions

void init ()
 Used in the constructors, this method calls makeColorMap() and makeSymbolMap().

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

DataRepm_datarep
 The actual DataRep object.

Static Private Attributes

static std::map< std::string,
std::vector< int > > 
s_colorMap
 A small palette of colors with which to plot.
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.


Constructor & Destructor Documentation

PyDataRep::PyDataRep DataRep  ) 
 

A constructor.

Definition at line 136 of file PyDataRep.cxx.

References init(), and m_datarep.

PyDataRep::PyDataRep const std::string type,
const DataSource ntuple,
const std::vector< std::string > &  bindings
 

Constructor to create data reps from python.

Definition at line 142 of file PyDataRep.cxx.

References DataRepController::createDataRep(), init(), DataRepController::instance(), and m_datarep.

PyDataRep::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 151 of file PyDataRep.cxx.

References DataRepController::createDataRep(), PyDataSource::dataSource(), init(), DataRepController::instance(), and m_datarep.

PyDataRep::PyDataRep  ) 
 

The default constructor.

Definition at line 161 of file PyDataRep.cxx.

References init(), and m_datarep.

PyDataRep::PyDataRep PyDataRep pyRep  ) 
 

Copy constructor.

Definition at line 167 of file PyDataRep.cxx.

References DataRep::clone(), getDataRep(), and m_datarep.


Member Function Documentation

void PyDataRep::applyCut QtCut cut  ) 
 

Apply a cut.

Definition at line 267 of file PyDataRep.cxx.

References CutController::instance(), and m_datarep.

Referenced by hippodraw::Python::export_DataRep().

const NTuple * PyDataRep::createNTuple  )  const
 

Create an NTuple for the displayed data.

Definition at line 304 of file PyDataRep.cxx.

References m_datarep.

Referenced by hippodraw::Python::export_DataRep().

double PyDataRep::getBinWidth const std::string axis  ) 
 

Get the bin width for the specified axis.

Definition at line 230 of file PyDataRep.cxx.

References hippodraw::Axes::convert(), ProjectorBase::getBinWidth(), DataRep::getProjector(), and m_datarep.

Referenced by hippodraw::Python::export_DataRep().

DataRep * PyDataRep::getDataRep  ) 
 

The get method.

Definition at line 172 of file PyDataRep.cxx.

References m_datarep.

Referenced by QtDisplay::addDataRep(), and PyDataRep().

double PyDataRep::getMean const std::string axis  ) 
 

Returns the mean value along axis axis.

Definition at line 241 of file PyDataRep.cxx.

References m_datarep, and mean.

Referenced by hippodraw::Python::export_DataRep().

NTuple * PyDataRep::getNTupleWithCuts  )  const
 

Return the current NTuple but with the present set of cuts applied.

Definition at line 313 of file PyDataRep.cxx.

References DataRep::getNTupleAfterCuts(), and m_datarep.

Referenced by hippodraw::Python::export_DataRep().

double PyDataRep::getRMS const std::string axis  ) 
 

Returns the RMS of the mean value along axis axis.

Definition at line 252 of file PyDataRep.cxx.

References m_datarep.

Referenced by hippodraw::Python::export_DataRep().

void PyDataRep::init  )  [private]
 

Used in the constructors, this method calls makeColorMap() and makeSymbolMap().

Definition at line 410 of file PyDataRep.cxx.

References makeColorMap(), makeLineStyleMap(), makeSymbolMap(), and s_have_static_members.

Referenced by PyDataRep().

void PyDataRep::makeColorMap  )  [static, private]
 

Create the color map.

Todo:
Determine if this map should be here or in the Color class.

Definition at line 324 of file PyDataRep.cxx.

References s_colorMap.

Referenced by init().

void PyDataRep::makeLineStyleMap  )  [static, private]
 

Create the line style map.

Definition at line 381 of file PyDataRep.cxx.

References hippodraw::Line::Dash, hippodraw::Line::DashDot, hippodraw::Line::DashDotDot, hippodraw::Line::Dot, hippodraw::Line::Invisible, s_lineStyles, and hippodraw::Line::Solid.

Referenced by init().

void PyDataRep::makeSymbolMap  )  [static, private]
 

Create the plotting symbols map.

Definition at line 348 of file PyDataRep.cxx.

References hippodraw::Symbol::CIRCLE, hippodraw::Symbol::FILLED_CIRCLE, hippodraw::Symbol::FILLED_TRIANGLE, hippodraw::Symbol::PLUS, s_symbols, hippodraw::Symbol::SOLIDSQUARE, hippodraw::Symbol::SQUARE, hippodraw::Symbol::TIMES, and hippodraw::Symbol::TRIANGLE.

Referenced by init().

const std::string & PyDataRep::name  )  const
 

Return the display name used to create this data rep.

Definition at line 225 of file PyDataRep.cxx.

References m_datarep, and DataRep::name().

Referenced by hippodraw::Python::export_DataRep().

void PyDataRep::normalizeTo const PyDataRep target  ) 
 

Normalizes the receiving object to the target one.

Definition at line 422 of file PyDataRep.cxx.

References m_datarep.

Referenced by hippodraw::Python::export_DataRep().

double PyDataRep::numberOfEntries  )  const
 

Return the number of entries in the rep.

Definition at line 261 of file PyDataRep.cxx.

References DataRep::getProjector(), and m_datarep.

Referenced by hippodraw::Python::export_DataRep().

void PyDataRep::setAxisBinding const std::string axis,
const std::string label
 

Set the axis bindings for a single axis.

Definition at line 184 of file PyDataRep.cxx.

References m_datarep, and DataRep::setAxisBinding().

Referenced by hippodraw::Python::export_DataRep().

void PyDataRep::setAxisBindings const std::vector< std::string > &  bindings  ) 
 

Set the axis bindings for all axes at once.

Definition at line 198 of file PyDataRep.cxx.

References m_datarep, and DataRep::setAxisBindings().

Referenced by hippodraw::Python::export_DataRep().

void PyDataRep::setBinWidth const std::string axis,
double  width
 

Sets the bin width, if binned, on axis to width.

Bug:
Doesn't always work if display hasn't drawn yet.

Definition at line 432 of file PyDataRep.cxx.

References hippodraw::Axes::convert(), DisplayController::instance(), m_datarep, and num_util::type().

Referenced by hippodraw::Python::export_DataRep().

void PyDataRep::setColor const std::string color  ) 
 

Set the color used for plotting, selecting from a pre-defined palette of "black", "red", "green", "blue", "yellow", "cyan", "magenta".

Definition at line 275 of file PyDataRep.cxx.

References m_datarep, and s_colorMap.

Referenced by hippodraw::Python::export_DataRep().

void PyDataRep::setErrorDisplay const std::string axis,
bool  flag
 

Turn on the error bars.

Definition at line 292 of file PyDataRep.cxx.

References hippodraw::Axes::convert(), m_datarep, and DataRep::setErrorDisplay().

Referenced by hippodraw::Python::export_DataRep().

void PyDataRep::setLineStyle const std::string lineStyle  ) 
 

Set the plotting line style.

Definition at line 390 of file PyDataRep.cxx.

References m_datarep, s_lineStyles, and DataRep::setRepStyle().

Referenced by hippodraw::Python::export_DataRep().

void PyDataRep::setPointRep RepBase pointRep  ) 
 

Set the point representation.

Definition at line 177 of file PyDataRep.cxx.

References m_datarep, and DataRep::setRepresentation().

Referenced by hippodraw::Python::export_DataRep().

void PyDataRep::setSymbol const std::string symbolName,
float  size = 2.
 

Set the plotting symbol and size.

Todo:
Should be able to expose the enumearation to Python.

Definition at line 360 of file PyDataRep.cxx.

References m_datarep, and s_symbols.

Referenced by hippodraw::Python::export_DataRep().

void PyDataRep::setWeight const std::string label  ) 
 

Set the weight for DyHistogram (or Color Plot or Contour plots).

Definition at line 211 of file PyDataRep.cxx.

References m_datarep, DataRep::name(), and DataRep::setAxisBinding().

Referenced by hippodraw::Python::export_DataRep().


Member Data Documentation

DataRep* PyDataRep::m_datarep [private]
 

The actual DataRep object.

Definition at line 43 of file PyDataRep.h.

Referenced by applyCut(), createNTuple(), getBinWidth(), getDataRep(), getMean(), getNTupleWithCuts(), getRMS(), name(), normalizeTo(), numberOfEntries(), PyDataRep(), setAxisBinding(), setAxisBindings(), setBinWidth(), setColor(), setErrorDisplay(), setLineStyle(), setPointRep(), setSymbol(), and setWeight().

std::map< std::string, std::vector< int > > PyDataRep::s_colorMap [static, private]
 

A small palette of colors with which to plot.

Definition at line 131 of file PyDataRep.cxx.

Referenced by makeColorMap(), and setColor().

bool PyDataRep::s_have_static_members [static, private]
 

A flag to indicate that we have the static data members.

Referenced by init().

std::map< std::string, hippodraw::Line::Style > PyDataRep::s_lineStyles [static, private]
 

A map of line styles, keyed by name.

Definition at line 133 of file PyDataRep.cxx.

Referenced by makeLineStyleMap(), and setLineStyle().

std::map< std::string, hippodraw::Symbol::Type > PyDataRep::s_symbols [static, private]
 

A map of symbol types, keyed by name.

Definition at line 132 of file PyDataRep.cxx.

Referenced by makeSymbolMap(), and setSymbol().


The documentation for this class was generated from the following files:
Generated for HippoDraw-1.14.8.5 by doxygen 1.4.3