Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

PyDataRep Class Reference

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

#include <PyDataRep.h>

Collaboration diagram for PyDataRep:
Collaboration graph
[legend]

List of all members.

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 NTuplecreateNTuple () const
 Create an NTuple for the displayed data.
NTuplecreateNTupleUnderRegion () 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::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::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 (const std::string &type, const DataSource *ntuple, const std::vector< std::string > &bindings)
 Constructor to create data reps from python.
 PyDataRep ()
 The default constructor.
 PyDataRep (PyDataRep *pyRep)
 Copy 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 (hippodraw::DataRep *)
 A constructor.
void set (hippodraw::Line::Style style)
 sets the plotting line style.
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 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::DataRepm_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.

Detailed Description

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

Author:
J. Chiang <jchiang@slac.stanford.edu>
Paul F. Kunz <Paul_Kunz@slac.stanford.edu>
Sanket B Malde <sanket@slac.stanford.edu>

Definition at line 37 of file PyDataRep.h.


Constructor & Destructor Documentation

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.

PyDataRep ( PyDataRep pyRep)

Copy constructor.

Definition at line 294 of file PyDataRep.cxx.

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


Member Function Documentation

void addCut ( )

Adds a new region cut.

Bug:
@ Only works on X axis.

Definition at line 536 of file PyDataRep.cxx.

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.

void init ( ) [private]

Used in the constructors.

Definition at line 663 of file PyDataRep.cxx.

static void makeColorMap ( ) [static, private]

Create the color map.

void makeLineStyleMap ( ) [static, private]
void makeSymbolMap ( ) [static, private]
const std::string & name ( ) const

Return the display name used to create this data rep.

Definition at line 366 of file PyDataRep.cxx.

const vector< string > & names ( ) [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 ( hippodraw::Line::Style  style)

sets the plotting line style.

Definition at line 624 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 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.

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

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.

Deprecated:
Use set(hippodraw::Line::Style) instead.

Definition at line 642 of file PyDataRep.cxx.

void setPointRep ( RepBase pointRep)

Set the point representation.

Bug:
@@ A particular DataRep can only accept a subset of all RepBase objects.

Thus, this class should return the names of that subset which is already available to the Inspector and this argument should be replaced by a string.

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.

Deprecated:
Use set(hippodraw::Symbol::Type) instead.

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.


Member Data Documentation

std::vector<double> m_columnData [private]

Vector of values returned by const reference for getColumnWithCuts method.

Definition at line 48 of file PyDataRep.h.

The actual DataRep object.

Definition at line 43 of file PyDataRep.h.

bool s_have_static_members [static, private]

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

Definition at line 57 of file PyDataRep.h.

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

A map of line styles, keyed by name.

Definition at line 54 of file PyDataRep.h.

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

A map of symbol types, keyed by name.

Definition at line 51 of file PyDataRep.h.


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

Generated for HippoDraw Class Library by doxygen