Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:28:08

0001 // -*- C++ -*-
0002 // AID-GENERATED
0003 // =========================================================================
0004 // This class was generated by AID - Abstract Interface Definition          
0005 // DO NOT MODIFY, but use the org.freehep.aid.Aid utility to regenerate it. 
0006 // =========================================================================
0007 #ifndef AIDA_IHISTOGRAM1D_H
0008 #define AIDA_IHISTOGRAM1D_H 1
0009 
0010 //  This file is part of the AIDA library
0011 //  Copyright (C) 2002 by the AIDA team.  All rights reserved.
0012 //  This library is free software and under the terms of the
0013 //  GNU Library General Public License described in the LGPL.txt 
0014 
0015 #include "AIDA/IHistogram.h"
0016 
0017 namespace AIDA {
0018 
0019 class IAxis;
0020 
0021 /**
0022  * User level interface to 1D Histogram.
0023  *
0024  * @author The AIDA team (http://aida.freehep.org/)
0025  *
0026  */
0027  
0028 class IHistogram1D : virtual public IHistogram {
0029 
0030 public: 
0031     /// Destructor.
0032     virtual ~IHistogram1D() { /* nop */; }
0033 
0034     /**
0035      * Fill the IHistogram1D with a value and the
0036      * corresponding weight.
0037      * @param x      The value to be filled in.
0038      * @param weight The corresponding weight (by default 1).
0039      * @return false If the weight is <0 or >1 (?).
0040      *
0041      */
0042     virtual bool fill(double x, double weight = 1.) = 0;
0043 
0044     /**
0045      * The weighted mean of a bin. 
0046      * @param index The bin number (0...N-1) or OVERFLOW or UNDERFLOW.
0047      * @return      The mean of the corresponding bin.
0048      *
0049      */
0050     virtual double binMean(int index) const = 0;
0051 
0052     /**
0053      * Number of entries in the corresponding bin (ie the number of times fill was called for this bin).
0054      * @param index The bin number (0...N-1) or OVERFLOW or UNDERFLOW.
0055      * @return      The number of entries in the corresponding bin. 
0056      *
0057      */
0058     virtual int binEntries(int index) const = 0;
0059 
0060     /**
0061      * Total height of the corresponding bin (ie the sum of the weights in this bin).
0062      * @param index The bin number (0...N-1) or OVERFLOW or UNDERFLOW.
0063      * @return      The height of the corresponding bin.
0064      *
0065      */
0066     virtual double binHeight(int index) const = 0;
0067 
0068     /**
0069      * The error of a given bin.
0070      * @param index The bin number (0...N-1) or OVERFLOW or UNDERFLOW.
0071      * @return      The error on the corresponding bin.
0072      *
0073      */
0074     virtual double binError(int index) const = 0;
0075 
0076     /**
0077      * The mean of the whole IHistogram1D.
0078      * @return The mean of the IHistogram1D.
0079      *
0080      */
0081     virtual double mean() const = 0;
0082 
0083     /**
0084      * The RMS of the whole IHistogram1D.
0085      * @return The RMS if the IHistogram1D.
0086      *
0087      */
0088     virtual double rms() const = 0;
0089 
0090     /**
0091      * Get the x axis of the IHistogram1D.
0092      * @return The x coordinate IAxis.
0093      *
0094      */
0095     virtual const IAxis & axis() const = 0;
0096 
0097     /**
0098      * Get the bin number corresponding to a given coordinate along the x axis.
0099      * This is a convenience method, equivalent to <tt>axis().coordToIndex(coord)</tt>.
0100      * @see IAxis#coordToIndex(double)
0101      * @param coord The coordinalte along the x axis.
0102      * @return      The corresponding bin number.
0103      *
0104      */
0105     virtual int coordToIndex(double coord) const = 0;
0106 
0107     /**
0108      * Add to this IHistogram1D the contents of another IHistogram1D.
0109      * @param hist The IHistogram1D to be added to this IHistogram1D.
0110      * @return false If the IHistogram1Ds binnings are incompatible.
0111      *
0112      */
0113     virtual bool add(const IHistogram1D & hist) = 0;
0114 }; // class
0115 } // namespace AIDA
0116 #endif /* ifndef AIDA_IHISTOGRAM1D_H */