14 #include "msdevstudio/MSconfig.h" 30 #ifdef ITERATOR_MEMBER_DEFECT 87 unsigned int weight = UINT_MAX;
88 bool have_weight =
m_columns[1] < UINT_MAX;
100 for (
unsigned int i = 0; i <
size; i++ )
103 double x =
m_ntuple -> valueAt ( i, column );
106 w =
m_ntuple -> valueAt ( i, weight );
141 if ( density ==
false ) {
183 if ( tuple -> empty () || axis ==
Axes::Y ) {
188 if ( axis ==
Axes::X )
return 0.0;
193 double scale_factor =
m_y_axis -> getScaleFactor ();
194 double min = r.
low() * scale_factor;
195 double max = r.
high() * scale_factor;
197 const vector < double > & values
200 for (
unsigned int i = 0; i < values.size(); i++ ) {
201 double val = values[i] * scale_factor;
203 if(val >= min && val <= max){
213 unsigned int col = tuple ->
indexOf ( label );
214 unsigned int size = tuple -> rows ();
217 for (
unsigned int i = 0; i <
size; i++ ) {
220 double value = tuple -> valueAt ( i, col );
230 return (sum / number);
250 if ( const_width ==
false ) {
262 = dynamic_cast <
const DataSource * > ( object );
264 if ( datasource != 0 ) {
277 = dynamic_cast <
const DataSource * > ( object );
279 if ( datasource != 0 ) {
virtual void accumulate(double x, double w_or_y=1.0, double z=1.0, double w=1.0)=0
Accumulates the data point with weight w.
Part of an implementation of the Observable-Observer pattern based on the example in the GOF Patterns...
virtual const std::string & getXLabel() const
Finds the X axis label of the plot.
double getPos(int column) const
Returns the minimum positive value on the specified column.
virtual int getUnderflow() const
Returns underflow.
virtual int getUnderflow() const =0
Returns the underflow.
virtual void willDelete(const Observable *object)
If object is the target of normalization, removes the target and sets normalization off...
virtual const DataSource * getNTuple() const
Returns the DataSource used by the projector.
double high() const
Returns the maximum of the range object.
CutList_t m_cut_list
A list of cuts that filter the projection.
virtual void changedNTuple()
This function is called when the NTuple has been changed to a new one.
A derived class of BinningProjector that implements the member function common to classes implementin...
bool acceptRow(unsigned int i, const CutList_t &cut_list) const
For row i of the column in the DataSource, returns true if all the cuts accept the row...
virtual const Range & getRange(Axes::Type) const
Returns the Range along the specified axis.
std::vector< unsigned int > m_columns
A vector containing indexes to the columns of the DataSource.
Range dataRange(int column) const
Returns the range of data on the specified column.
An NTupleProjector is a projector that projects data from an DataSource object.
A derived class of BinningProjector that projects a column of data into a one dimensional histogram...
bool includes(double value) const
Returns true if the argument value is inside the range.
virtual void setRange(hippodraw::Axes::Type, bool)
hippodraw::NTuple class interface.
virtual void setDirty(bool value=true)
Sets the dirty flag to value.
virtual double getPosOn(hippodraw::Axes::Type axis) const
Returns the minimum positive value of the data on a specified axis.
virtual void update(const Observable *object)
Implements Observer pattern.
hippodraw::BinsBase class interface
Range dataRangeOnValue() const
Returns the data range on the Y axis.
virtual Range dataRangeOn(hippodraw::Axes::Type axis) const
Returns the range of the data on a specified axis.
virtual void execute()
Projects the data source into bins.
BinsBase * m_binner
The binner object.
virtual int indexOf(const std::string &label) const
Returns the index of the label.
virtual double getAverage(hippodraw::Axes::Type axis) const
Get the Average of all projected values on the specified axis.
virtual void willDelete(const Observable *object)
Implements Observer pattern.
virtual int getOverflow() const =0
Returns the overflow.
const DataSource * m_ntuple
The pointer to the data source being projected.
std::vector< std::string > m_binding_options
The list of binding options for the Projector.
std::string m_y_label_density
The label of the y axis when axis is not scaled.
virtual void willDelete(const Observable *)
Responds to willDelete message from the observed data source.
hippodraw::AxisModelBase class interface
column
The column indices for 2 dimension data point tuple.
void setDirty()
Sets a flag to indicate that re-binning needs to be done.
The base class for the Projector hierarchy.
virtual const std::string & getYLabel(bool density=false) const
Returns the label of the axis.
virtual void update(const Observable *object)
Updates the receiving projector.
DyHist1Projector class interface.
virtual bool isAxisBinned(const std::string &axis) const
Returns true if specified axis is binned.
DyHist1DProjector()
The default constructor.
virtual int getOverflow() const
Returns overflow.
DataSource * m_proj_values
The NTuple representing the result of the projection.
hippodraw::DataPointTuple namespace interface
const Range & getRange(bool scaled) const
Returns the range represented by this AxisModel.
bool isScaling() const
Returns true if the axis is being scaled.
unsigned int columns() const
Returns the number of columns or data arrays available from this DataSource.
double low() const
Returns the minimum of the range object.
virtual void setBinnerRange(hippodraw::Axes::Type axis, const Range &range, bool const_width)
Sets the Range of the binner.
intp size(numeric::array arr)
Expresses a range of values.
A namespace to set the standard for indexing into 2 dimension data point tuple.
double getPosOnValue() const
Returns the smallest positive value on the Y axis.
AxisModelBase * m_y_axis
The AxisModel along the Y axis.
virtual ProjectorBase * clone()
The clone function returns an object of its own kind which is a copy of this object at this moment...
bool m_fixed
Sets true if the bins are disconnected from the data source and are, thus, fixed. ...
unsigned int m_min_bindings
The minimum number of columns that must be bound.
virtual void checkScaling()
Checks the axis scaling.
virtual void reset()=0
Resets the accumulation to zero.
virtual void update(const Observable *)
Responds to update message from the data source.
std::string m_y_label_entries
The label of the y axis when axis is scaled.
Base class for DataSource.