1 / 18

Histogram Interface

Histogram Interface. Pavel Binko LHCb / CERN. New LHC++. The new LHC++ being prepared nearly from scratch Defined categories or packages (like in PAW) Histograms, VectorOfPoints, Fitting, Plotting, Ntuples, Functions Controller - user entry point Analyzer - interface to the experiments

karynl
Download Presentation

Histogram Interface

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Histogram Interface Pavel Binko LHCb / CERN

  2. New LHC++ • The new LHC++ being prepared nearly from scratch • Defined categories or packages (like in PAW) • Histograms, VectorOfPoints, Fitting, Plotting, Ntuples, Functions • Controller - user entry point • Analyzer - interface to the experiments • Event display • There will be three sub-packages per category • Class definitions (e.g. all different histogram types, as 1D, 2D, etc.) • Factory - to allow creation of objects (of all classes defined above) • Manager - manipulates the objects above, steers a persistency • All categories will have an abstract interface(s)

  3. Scope • Interface to HTL 1D and 2D histograms • The talk represents common work of Andreas Pfeiffer and me • Currently being discussed with Gloria Corti (LHCb) • Correctness, completeness and consistency • Understandability • Will be ready for review in LHCb after the LCB workshop in Marseille

  4. Basic principles • Only interfaces, basic types, and types from foundation libraries are allowed • STL is currently the only one foundation library • Uses only long and double as basic types (no int and float) • HTL internal classes or others do not appear in the interface • Accessors • XXX() (no getXXX() functions), and setXXX(value) to set new value • In member function names • in-range bins are not specified implicitly • ...All... mean all (in-range and extra) bins • …Extra… mean extra bins

  5. Class hierarchy • IHistogramBase • Contains functions identical for both 1D and 2D histograms • May not be used (not complete) • IHistogram1D and IHistogram2D - “the” interfaces • Inherit from IHistogramBase • Contain 1D and 2D specific functions • IHistogramCommon • Included in IHistogram1D and IHistogram2D • Contains functions they differ only in parameters (1D instead of 2D)

  6. Naming, reset and dimensions /// Reset histogram's contents virtual void reset() = 0; /// Dimension of the histo. i.e. of the problem space (returns 1 or 2) virtual long dim() const = 0; /// Name of this histogram (short name, maybe a single word) virtual std::string name() const = 0; virtual void setName( const std::string aName ) = 0; /// Number of this histogram (optional) virtual long number() const = 0; /// Number of this histogram, handled es a std::string (optional) virtual std::string numberAsString() const = 0; /// Set the histogram number as integer number or as a std::string virtual void setNumber( long aNumber ) = 0; virtual void setNumber( std::string aNumberAsString ) = 0;

  7. Bin counts /// Number of in-range bins in the whole histogram (in all axes) /// The same as nBinsX() for 1D histogram /// Equals nBinsX()*nBinsY() for 2D histogram virtual long nBins() const = 0; /// Number of all bins (including extra bins) in the whole histogram /// Returns nBins()+2 for 1D histogram, and nBins()+8 for 2D histogram virtual long nAllBins() const = 0; /// Number of extra bins in the whole histogram /// Returns 2 for 1D histogram, and 8 for 2D histogram virtual long nExtraBins() const = 0; /// Number of in-range bins in the X axis /// The same as nBins() for 1D histogram virtual long nBinsX() const = 0; /// Number of in-range bins in the Y axis is defined in IHistogram2D

  8. Bin sizes and edges /// Size of the in-range bin identified by indexX virtual double binSizeX( long indexX ) const = 0; /// Size of the in-range bin identified by coordX virtual double binSizeX( double coordX ) const = 0; /// Lower edge of the in-range bin identified by indexX /// If the indexX will be <0, it returns the lower histogram limit virtual double binLowerEdgeX( long indexX ) const = 0; /// Lower edge of the in-range bin identified by coordX /// If the coordX will be <lower histogram limit, it returns the lower limit virtual double binLowerEdgeX( double coordX ) const = 0; /// Upper edge of the in-range bin identified by indexX /// If the indexX will be >nBinsX()-1, it returns the the upper histogram limit virtual double binUpperEdgeX( long indexX ) const = 0; /// Upper edge of the in-range bin identified by coordX /// If the coordX will be >upper histogram limit, it returns the upper limit virtual double binUpperEdgeX( double coordX ) const = 0;

  9. Bin centre /// binCentre() is reserved kyeword, as it might return a 2D point in the future /// Centre of the bin located by indexX virtual double binCentreX( long indexX ) const = 0; /// Centre of the bin located by coordX virtual double binCentreX( double coordX ) const = 0;

  10. Total entry counts /// -------------------------------------------------------------------------- /// Total entry counts /// Number of in-range entries in the whole histogram virtual long nEntries() const = 0; /// Number of all entries in all bins in the whole histogram virtual long nAllEntries() const = 0; /// Number of extra entries in the whole histogram virtual long nExtraEntries() const = 0;

  11. Entry counts in specific in-range bins /// -------------------------------------------------------------------------- /// Entry counts in specific in-range bins /// Entries in the in-range bin identified by indexX virtual long nEntries( long indexX ) const = 0; /// Entries in the in-range bin identified by coordX virtual long nEntries( double coordX ) const = 0; /// Entries in all in-range bins along the axis Y, projected on axis X /// The bin on axis X is identified by indexX virtual long nEntriesX( long indexX ) const = 0; /// The bin on axis X is identified by coordX virtual long nEntriesX( double coordX ) const = 0;

  12. Entries in specific extra bins /// -------------------------------------------------------------------------- /// Entries in specific extra bins /// Number of entries in the W (west) extra bin virtual long nEntriesW() const = 0; /// Number of entries in the NW (north-west) extra bin is defined in IHistogram2D /// Number of entries in the N (north) extra bin is defined in IHistogram2D /// Number of entries in the NE (north-east) extra bin is defined in IHistogram2D /// Number of entries in the E (east) extra bin virtual long nEntriesE() const = 0; /// Number of entries in the SE (south-east) extra bin is defined in IHistogram2D /// Number of entries in the S (south) extra bin is defined in IHistogram2D /// Number of entries in the SW (south-west) extra bin is defined in IHistogram2D

  13. Statistics (1) /// mean() is reserved kyeword, as it might return a 2D point in the future /// meanX() returns the mean of the whole histogram /// SUM[ bin centre * bin value ] / SUM[ bin value ] /// In case of 2D histogram meanX() returns the mean projected on the axis X virtual double meanX() const = 0; /// meanY() is defined in IHistogram2D /// rms() is reserved kyeword, as it might return a 2D entity in the future /// rmsX() returns the rms of the whole histogram /// SUM[ (bin centre - mean)^2 * bin value ] / SUM[ bin value ] /// In case of 2D histogram rmsX() returns the rms projected on the axis X virtual double rmsX() const = 0; /// rmsY() is defined in IHistogram2D

  14. Statistics (2) /// Sum of weighted entries in in-range bins virtual double sumWeightedEntries() const = 0; /// Sum of weighted entries in all bins virtual double sumAllWeightedEntries() const = 0; /// Sum of weighted entries in extra bins virtual double sumExtraWeightedEntries() const = 0; /// Min value of in-range bins in the whole histogram virtual double minValue() const = 0; /// IndexX of the in-range bin containing the minValue() virtual long minBinX() const = 0; /// Max value of in-range bins in the whole histogram virtual double maxValue() const = 0; /// IndexX of the in-range bin containing the maxValue() virtual long maxBinX() const = 0;

  15. Fill and errors (in IHistogram1D or 2D) /// -------------------------------------------------------------------------- /// Fill 1D histogram virtual void fill( double x, double weight = 1 ) = 0; /// -------------------------------------------------------------------------- /// Fill 2D histogram virtual void fill( double x, double y, double weight = 1 ) = 0; /// -------------------------------------------------------------------------- /// Bin error in 1D histogram virtual double error( long indexX ) const = 0; virtual double error( double coordX ) const = 0; /// -------------------------------------------------------------------------- /// Bin error in 2D histogram virtual double error( long indexX, long indexY ) const = 0; virtual double error( double coordX, double coordY ) const = 0;

  16. Projections (in IHistogram2D) /// -------------------------------------------------------------------------- /// Projections /// Projection on axis X virtual IHistogram1D* projectionX() const = 0; /// Projection on axis Y virtual IHistogram1D* projectionY() const = 0;

  17. Slices (in IHistogram2D) /// Slice parallel with the axis X, identified by bin indexY virtual IHistogram1D* sliceX( long indexY ) const = 0; /// Slice parallel with the axis X, identified by bin coordY virtual IHistogram1D* sliceX( double coordY ) const = 0; /// Slice parallel with the axis Y, identified by bin indexX virtual IHistogram1D* sliceY( long indexX ) const = 0; /// Slice parallel with the axis Y, identified by bin coordX virtual IHistogram1D* sliceY( double coordX ) const = 0; /// Slice parallel with the axis X, between indexY1 and indexY2 virtual IHistogram1D* sliceX( long indexY1, long indexY2 ) const = 0; /// Slice parallel with the axis X, between coordY1 and coordY2 virtual IHistogram1D* sliceX( double coordY1, double coordY2 ) const = 0; /// Slice parallel with the axis Y, between indexX1 and indexX2 virtual IHistogram1D* sliceY( long indexX1, long indexX2 ) const = 0; /// Slice parallel with the axis Y, identified by bin coordX virtual IHistogram1D* sliceY( double coordX1, double coordX2 ) const = 0;

  18. Operators • Operators • +, += • -, -= • *, *= • /, /= • normalize() • weightedNormalize() • diff() // statistical compatibility test • Output operators and functions should be in the category plotting • Re-binning • What from above belongs into class VectorOfPoints ?

More Related