[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
|
---|
| 29 | void SetBin(int_4 numBin, r_8 w=1., r_8 e=1., uint_4 nb=1);
|
---|
| 30 | //! remplissage nombre d'entrees pour le bin numBin
|
---|
| 31 | void SetNentB(int_4 numBin, uint_4 nb=1);
|
---|
[2603] | 32 |
|
---|
| 33 | //! Retourne le nombre d'entree dans le bin
|
---|
| 34 | inline uint_4 NEntBin(int_4 i) const
|
---|
| 35 | {if(mNData) return mNData[i]; else return 0;}
|
---|
| 36 |
|
---|
| 37 | // get/put dans/depuis un vector
|
---|
| 38 | void GetNBin(TVector<int_4>& v) const;
|
---|
| 39 | void PutNBin(TVector<int_4>& v);
|
---|
| 40 |
|
---|
[2604] | 41 | // Compute the correlation histogram
|
---|
| 42 | void ToCorrel(void);
|
---|
| 43 |
|
---|
[2603] | 44 | protected:
|
---|
| 45 | uint_4* mNData; //!< nombre d'entrees dans chaque bin
|
---|
| 46 | };
|
---|
| 47 |
|
---|
| 48 | /*! \ingroup HiStats \fn operator<<(POuttPersist&,HistoErr)
|
---|
| 49 | \brief Persistance management */
|
---|
| 50 | inline POutPersist& operator << (POutPersist& os, HistoErr & obj)
|
---|
| 51 | { ObjFileIO<HistoErr> fio(&obj); fio.Write(os); return(os); }
|
---|
| 52 | /*! \ingroup HiStats \fn operator<<(POuttPersist&,HistoErr)
|
---|
| 53 | \brief Persistance management */
|
---|
| 54 | inline PInPersist& operator >> (PInPersist& is, HistoErr & obj)
|
---|
| 55 | { ObjFileIO<HistoErr> fio(&obj); is.SkipToNextObject(); fio.Read(is); return(is); }
|
---|
| 56 |
|
---|
| 57 | } // Fin du namespace
|
---|
| 58 |
|
---|
| 59 | #endif // HISTERR_SEEN
|
---|