#ifndef HEPHISTOHISTPROF_H #define HEPHISTOHISTPROF_H // ---------------------------------------------------------------------- // // HepHistoHistProf.h - class declaration for Histo profile histogram // // HepHistoHistProf is the implementation of the Histo profile // histogram. It is derived from HepHistProf (the generic interface) and // HepHistoHist. It is mainly a C++ wrapper around the Nirvana Histo // histogramming libraries (written mainly in C). // // No HepHistoHistProf objects are ever directly // instantiated by the programmer. When creating new HepHist* objects, // the manager is in charge of creating the appropriate HepHisto object. // // To use generate Histo histograms, HepHistoFileManager must be used: // // int lunit = 10; // HepFileManager* m = new HepHistoFileManager("filename.rz", lunit); // : // : // HepHistProf* h(m->histProf("Title", 100, 0.0, 23.0, 0.0, 23.0)); // float x, y, weight; // : // [gather data] // : // h->accumulate(x, y, weight); // // // Note that the constructor can take an ID number which is used by // the Histo implementation of HepHistProf. If omitted, the ID number is // generated automatically (which is recommended). The ID number is // available through the id() method. // // // Created by Bob Jacobsen to go with HepHistogram // 30-May-1997 Walter Brown Added cloning functions // 29-May-1997 Jason Luther Added comments // 04-Jun-1997 Jason Luther Rewrote comments // 09-Jun-1997 Jason Luther Added cloning constructor // 04-Aug-1998 Philippe Canal Added weight, entries, sum, etc.. // // ---------------------------------------------------------------------- #ifdef HEP_SHORT_NAMES // done early to override HepPlot #define HistProf HepHistoHistProf #endif #ifndef HEPHISTOFILEMANAGER_H #include "HepTuple/HepHistoFileManager.h" #endif #ifndef HEPHISTOFILEMANAGERHISTPROF_H #include "HepTuple/HepHistProf.h" #endif ZM_BEGIN_NAMESPACE( zmht ) /* namespace zmht { */ class HepHistoHistProf : public HepHistProf { friend class HepHistoFileManager; protected: // create a profile plot with the given title and binning HepHistoHistProf( HepHistoFileManager * manager , const std::string& title , const int nBins , const float lowX, const float highX , const float lowY, const float highY , const std::string& chopt , const int id_req = 0 , const int histo_id = 0 ); HepHistoHistProf( HepHistoFileManager * manager , const std::string& title , const int nBins , const float lowX, const float highX , const float lowY, const float highY , const int id_req = 0 , const int histo_id = 0 ); // Used for dummy construction ... // the object is then not valid ... HepHistoHistProf( ); // default constructor public: virtual ~HepHistoHistProf(); // clone an existing profile histogram HepHistoHistProf( HepHistProf * original , const std::string& title , const int id_req = 0 ); virtual void accumulate( const float x , const float y , const float weight = 1.0 ); #ifdef LATER virtual float bin( // retrieve contents of specified bin const int binNum ) const; virtual float binError( // retrieve error for specified bin const int binNum ) const; // get sum of weights for all bins virtual void getSumW( // get sum of weights of all bins float * data ) const; // get sum of weighted Y for all bins virtual void getSumWY( // get sum of weighted Y of all bins float * data ) const; // get sum of weighted Y^2 for all bins virtual void getSumWY2( // get sum of weighted Y^2 of all bins float * data ) const; #endif // LATER virtual void reset(); virtual int entries() const; // number of entries virtual int entries( const int binNumX) const; // number of entries in X-bin virtual float weight() const; // sum of all weight virtual float weight2() const; // sum of all weight^2 virtual float weight( const int binNumX) const; // sum of all weight in X-bin #ifdef LATER virtual float sumX() const; // retrieve weighted sum of X virtual float sumX2() const; // retrieve weighted sum of X^2 #endif // LATER virtual float sumY() const; // retrieve weighted sum of Y virtual float sumY2() const; // retrieve weighted sum of Y^2 virtual float sumY( const int binNumX) const; // retrieve sum of Y in X-bin virtual float sumY2( const int binNumX) const; // retrieve sum of Y^2 in X-bin // Arithmetic operation += on histograms HepHistProf & operator += ( const HepHistProf & ); // Arithmetic operation -= on histograms HepHistProf & operator -= ( const HepHistProf & ); // Arithmetic operation *= on histograms HepHistProf & operator *= ( const HepHistProf & ); // Arithmetic operation /= on histograms HepHistProf & operator /= ( const HepHistProf & ); private: // forbidden operations, hence private: //HepHistoHistProf( ); // default constructor HepHistoHistProf( const HepHistoHistProf & ); // copy constructor HepHistoHistProf & operator=( const HepHistoHistProf & ); // assignment // remember the Histoscope id for quick reference int histo_id_; }; // HepHistoHistProf ZM_END_NAMESPACE( zmht ) /* } // namespace zmht */ #endif // HEPHISTOHISTPROF_H