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

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

correct. erreur persistance HistoErr, methode ReCenterBin cmv (sur les conseils de rz) 7/9/04

File size: 1.9 KB
RevLine 
[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
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.);
[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
[2608]37 //! get/put from/to a vector
[2603]38 void GetNBin(TVector<int_4>& v) const;
39 void PutNBin(TVector<int_4>& v);
40
[2608]41 //! Re-center bin abscissa
42 void ReCenterBin(r_8 xcmin,r_8 xcmax);
43 //! Compute the correlation histogram
[2604]44 void ToCorrel(void);
45
[2603]46protected:
[2608]47 void allocate_mNData(int nbin);
[2603]48 uint_4* mNData; //!< nombre d'entrees dans chaque bin
49};
50
51/*! \ingroup HiStats \fn operator<<(POuttPersist&,HistoErr)
52 \brief Persistance management */
53inline POutPersist& operator << (POutPersist& os, HistoErr & obj)
54{ ObjFileIO<HistoErr> fio(&obj); fio.Write(os); return(os); }
55/*! \ingroup HiStats \fn operator<<(POuttPersist&,HistoErr)
56 \brief Persistance management */
57inline PInPersist& operator >> (PInPersist& is, HistoErr & obj)
58{ ObjFileIO<HistoErr> fio(&obj); is.SkipToNextObject(); fio.Read(is); return(is); }
59
60} // Fin du namespace
61
62#endif // HISTERR_SEEN
Note: See TracBrowser for help on using the repository browser.