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.);
|
---|
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., r_8 nb=1.);
|
---|
30 | //! remplissage nombre d'entrees pour le bin numBin
|
---|
31 | void SetNentB(int_4 numBin, r_8 nb=1.);
|
---|
32 |
|
---|
33 | //! Retourne le nombre d'entree dans le bin
|
---|
34 | inline r_8 NEntBin(int_4 i) const
|
---|
35 | {if(mNData) return mNData[i]; else return 0.;}
|
---|
36 |
|
---|
37 | //! get/put from/to a vector
|
---|
38 | void GetNBin(TVector<r_8>& v) const;
|
---|
39 | void PutNBin(TVector<r_8>& v);
|
---|
40 |
|
---|
41 | //! Re-center bin abscissa
|
---|
42 | void ReCenterBin(void);
|
---|
43 | //! Compute the correlation histogram
|
---|
44 | void ToCorrel(void);
|
---|
45 |
|
---|
46 | //! Fill an histogram with an histogram
|
---|
47 | void FillFrHErr(HistoErr& hfrom);
|
---|
48 |
|
---|
49 | // Operators
|
---|
50 | HistoErr& operator = (const HistoErr& h);
|
---|
51 |
|
---|
52 | protected:
|
---|
53 | void allocate_mNData(int nbin);
|
---|
54 | void Delete(void);
|
---|
55 |
|
---|
56 | r_8* mNData; //!< nombre d'entrees dans chaque bin
|
---|
57 | };
|
---|
58 |
|
---|
59 | /*! \ingroup HiStats \fn operator<<(POuttPersist&,HistoErr)
|
---|
60 | \brief Persistance management */
|
---|
61 | inline POutPersist& operator << (POutPersist& os, HistoErr & obj)
|
---|
62 | { ObjFileIO<HistoErr> fio(&obj); fio.Write(os); return(os); }
|
---|
63 | /*! \ingroup HiStats \fn operator<<(POuttPersist&,HistoErr)
|
---|
64 | \brief Persistance management */
|
---|
65 | inline PInPersist& operator >> (PInPersist& is, HistoErr & obj)
|
---|
66 | { ObjFileIO<HistoErr> fio(&obj); is.SkipToNextObject(); fio.Read(is); return(is); }
|
---|
67 |
|
---|
68 | } // Fin du namespace
|
---|
69 |
|
---|
70 | #endif // HISTERR_SEEN
|
---|