source: Sophya/trunk/SophyaLib/HiStats/histerr.h@ 2603

Last change on this file since 2603 was 2603, checked in by cmv, 21 years ago

add HistoErr pour gestion des erreurs cmv 3/9/04

File size: 1.5 KB
Line 
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
9namespace SOPHYA {
10
11//! 1 dimension histograms with errors given by user
12class HistoErr : public Histo {
13 friend class ObjFileIO<HistoErr>;
14public:
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
29 //! Retourne le nombre d'entree dans le bin
30 inline uint_4 NEntBin(int_4 i) const
31 {if(mNData) return mNData[i]; else return 0;}
32
33 // get/put dans/depuis un vector
34 void GetNBin(TVector<int_4>& v) const;
35 void PutNBin(TVector<int_4>& v);
36
37protected:
38 uint_4* mNData; //!< nombre d'entrees dans chaque bin
39};
40
41/*! \ingroup HiStats \fn operator<<(POuttPersist&,HistoErr)
42 \brief Persistance management */
43inline POutPersist& operator << (POutPersist& os, HistoErr & obj)
44{ ObjFileIO<HistoErr> fio(&obj); fio.Write(os); return(os); }
45/*! \ingroup HiStats \fn operator<<(POuttPersist&,HistoErr)
46 \brief Persistance management */
47inline PInPersist& operator >> (PInPersist& is, HistoErr & obj)
48{ ObjFileIO<HistoErr> fio(&obj); is.SkipToNextObject(); fio.Read(is); return(is); }
49
50} // Fin du namespace
51
52#endif // HISTERR_SEEN
Note: See TracBrowser for help on using the repository browser.