[2603] | 1 | #ifndef HISTERR_SEEN
|
---|
| 2 | #define HISTERR_SEEN
|
---|
| 3 |
|
---|
| 4 | #include "objfio.h"
|
---|
| 5 | #include <iostream>
|
---|
| 6 | #include <stdio.h>
|
---|
| 7 | #include "histos.h"
|
---|
| 8 |
|
---|
| 9 | namespace SOPHYA {
|
---|
| 10 |
|
---|
| 11 | //! 1 dimension histograms with errors given by user
|
---|
| 12 | class HistoErr : public Histo {
|
---|
| 13 | friend class ObjFileIO<HistoErr>;
|
---|
| 14 | public:
|
---|
| 15 |
|
---|
| 16 | // CREATOR / DESTRUCTOR
|
---|
| 17 | HistoErr(void);
|
---|
| 18 | HistoErr(r_8 xMin, r_8 xMax, int_4 nBin=100);
|
---|
| 19 | HistoErr(const HistoErr& H);
|
---|
| 20 | virtual ~HistoErr(void);
|
---|
| 21 |
|
---|
| 22 | // UPDATING or SETTING
|
---|
| 23 | void Zero(void);
|
---|
| 24 | //! Addition du contenu de l'histo pour abscisse x poids w et l'erreur e
|
---|
| 25 | void Add(r_8 x, r_8 w=1., r_8 e=1.);
|
---|
| 26 | //! Addition du contenu de l'histo pour le bin numBin poids w et l'erreur e
|
---|
| 27 | void AddBin(int_4 numBin, r_8 w=1., r_8 e=1.);
|
---|
[2604] | 28 | //! remplissage contenu de l'histo pour le bin numBin poids w et l'erreur e
|
---|
[2626] | 29 | void SetBin(int_4 numBin, r_8 w=1., r_8 e=1., r_8 nb=1.);
|
---|
[2604] | 30 | //! remplissage nombre d'entrees pour le bin numBin
|
---|
[2626] | 31 | void SetNentB(int_4 numBin, r_8 nb=1.);
|
---|
[2603] | 32 |
|
---|
| 33 | //! Retourne le nombre d'entree dans le bin
|
---|
[2626] | 34 | inline r_8 NEntBin(int_4 i) const
|
---|
| 35 | {if(mNData) return mNData[i]; else return 0.;}
|
---|
[2603] | 36 |
|
---|
[2608] | 37 | //! get/put from/to a vector
|
---|
[2626] | 38 | void GetNBin(TVector<r_8>& v) const;
|
---|
| 39 | void PutNBin(TVector<r_8>& v);
|
---|
[2603] | 40 |
|
---|
[2608] | 41 | //! Re-center bin abscissa
|
---|
[2627] | 42 | void ReCenterBin(void);
|
---|
[2608] | 43 | //! Compute the correlation histogram
|
---|
[2604] | 44 | void ToCorrel(void);
|
---|
| 45 |
|
---|
[2619] | 46 | // Operators
|
---|
| 47 | HistoErr& operator = (const HistoErr& h);
|
---|
| 48 |
|
---|
[2603] | 49 | protected:
|
---|
[2608] | 50 | void allocate_mNData(int nbin);
|
---|
[2619] | 51 | void Delete(void);
|
---|
| 52 |
|
---|
[2626] | 53 | r_8* mNData; //!< nombre d'entrees dans chaque bin
|
---|
[2603] | 54 | };
|
---|
| 55 |
|
---|
| 56 | /*! \ingroup HiStats \fn operator<<(POuttPersist&,HistoErr)
|
---|
| 57 | \brief Persistance management */
|
---|
| 58 | inline POutPersist& operator << (POutPersist& os, HistoErr & obj)
|
---|
| 59 | { ObjFileIO<HistoErr> fio(&obj); fio.Write(os); return(os); }
|
---|
| 60 | /*! \ingroup HiStats \fn operator<<(POuttPersist&,HistoErr)
|
---|
| 61 | \brief Persistance management */
|
---|
| 62 | inline PInPersist& operator >> (PInPersist& is, HistoErr & obj)
|
---|
| 63 | { ObjFileIO<HistoErr> fio(&obj); is.SkipToNextObject(); fio.Read(is); return(is); }
|
---|
| 64 |
|
---|
| 65 | } // Fin du namespace
|
---|
| 66 |
|
---|
| 67 | #endif // HISTERR_SEEN
|
---|