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 ) {
A namespace to set the standard for indexing into 2 dimension data point tuple.
virtual double getAverage(hippodraw::Axes::Type axis) const
Get the Average of all projected values on the specified axis.
virtual const Range & getRange(Axes::Type) const
Returns the Range along the specified axis.
virtual const std::string & getXLabel() const
Finds the X axis label of the plot.
bool m_fixed
Sets true if the bins are disconnected from the data source and are, thus, fixed. ...
virtual void willDelete(const Observable *object)
Implements Observer pattern.
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...
unsigned int m_min_bindings
The minimum number of columns that must be bound.
Part of an implementation of the Observable-Observer pattern based on the example in the GOF Patterns...
virtual void checkScaling()
Checks the axis scaling.
bool isScaling() const
Returns true if the axis is being scaled.
hippodraw::AxisModelBase class interface
virtual void willDelete(const Observable *object)
If object is the target of normalization, removes the target and sets normalization off...
std::vector< std::string > m_binding_options
The list of binding options for the Projector.
DataSource * m_proj_values
The NTuple representing the result of the projection.
BinsBase * m_binner
The binner object.
virtual void willDelete(const Observable *)
Responds to willDelete message from the observed data source.
virtual void setBinnerRange(hippodraw::Axes::Type axis, const Range &range, bool const_width)
Sets the Range of the binner.
double high() const
Returns the maximum of the range object.
virtual ProjectorBase * clone()
The clone function returns an object of its own kind which is a copy of this object at this moment...
virtual int getOverflow() const
Returns overflow.
unsigned int columns() const
Returns the number of columns or data arrays available from this DataSource.
virtual const DataSource * getNTuple() const
Returns the DataSource used by the projector.
A derived class of BinningProjector that projects a column of data into a one dimensional histogram...
virtual Range dataRangeOn(hippodraw::Axes::Type axis) const
Returns the range of the data on a specified axis.
virtual const std::string & getYLabel(bool density=false) const
Returns the label of the axis.
const DataSource * m_ntuple
The pointer to the data source being projected.
double getPos(int column) const
Returns the minimum positive value on the specified column.
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.
AxisModelBase * m_y_axis
The AxisModel along the Y axis.
virtual void changedNTuple()
This function is called when the NTuple has been changed to a new one.
hippodraw::NTuple class interface.
Base class for DataSource.
virtual void update(const Observable *)
Responds to update message from the data source.
intp size(numeric::array arr)
double low() const
Returns the minimum of the range object.
DyHist1DProjector()
The default constructor.
double getPosOnValue() const
Returns the smallest positive value on the Y axis.
Expresses a range of values.
The base class for the Projector hierarchy.
An NTupleProjector is a projector that projects data from an DataSource object.
virtual int indexOf(const std::string &label) const
Returns the index of the label.
virtual void reset()=0
Resets the accumulation to zero.
CutList_t m_cut_list
A list of cuts that filter the projection.
virtual bool isAxisBinned(const std::string &axis) const
Returns true if specified axis is binned.
bool includes(double value) const
Returns true if the argument value is inside the range.
hippodraw::DataPointTuple namespace interface
std::string m_y_label_density
The label of the y axis when axis is not scaled.
A derived class of BinningProjector that implements the member function common to classes implementin...
virtual void setRange(hippodraw::Axes::Type, bool)
virtual int getUnderflow() const =0
Returns the underflow.
virtual void update(const Observable *object)
Updates the receiving projector.
virtual void execute()
Projects the data source into bins.
Range dataRange(int column) const
Returns the range of data on the specified column.
virtual void update(const Observable *object)
Implements Observer pattern.
void setDirty()
Sets a flag to indicate that re-binning needs to be done.
virtual double getPosOn(hippodraw::Axes::Type axis) const
Returns the minimum positive value of the data on a specified axis.
DyHist1Projector class interface.
virtual int getOverflow() const =0
Returns the overflow.
std::string m_y_label_entries
The label of the y axis when axis is scaled.
column
The column indices for 2 dimension data point tuple.
hippodraw::BinsBase class interface
const Range & getRange(bool scaled) const
Returns the range represented by this AxisModel.
virtual void setDirty(bool value=true)
Sets the dirty flag to value.
virtual int getUnderflow() const
Returns underflow.
std::vector< unsigned int > m_columns
A vector containing indexes to the columns of the DataSource.
Range dataRangeOnValue() const
Returns the data range on the Y axis.