source: Sophya/trunk/Cosmo/RadioBeam/qhist.h@ 3936

Last change on this file since 3936 was 3783, checked in by ansari, 15 years ago

Ajout des programmes calcpk.cc calcpk2.cc syncube.cc tjyk.cc (voir fichier README) Reza 15/06/2010

File size: 1.3 KB
Line 
1// Simple specific histo-like classes
2// R. Ansari - Avril-Mai 2010
3
4#ifndef QHIST_SEEN
5#define QHIST_SEEN
6
7#include "histats.h" // SOPHYA .h
8
9#include "machdefs.h" // SOPHYA .h
10#include "sopnamsp.h" // SOPHYA .h
11#include <iostream>
12
13#include "histats.h" // SOPHYA .h
14
15// -----------------------------------
16// -- Classe ressemblant a un histo 1D
17class QHis1D {
18 QHis1D();
19 QHis1D(QHis1D const& a);
20 QHis1D(r_8 xMin,r_8 xMax,int_4 nxBin);
21 void Define(r_8 xMin,r_8 xMax,int_4 nxBin);
22 sa_size_t Add(r_8 x, r_8 w=1.);
23 inline double WBinX() { return dxb_; }
24 inline double NBinX() { return nx_; }
25
26 Histo Convert();
27
28 r_8 xmin_,xmax_;
29 r_8 dxb_;
30 sa_size_t nx_;
31 TArray<r_8> aw_;
32 sa_size_t nhis_, nunder_, nover_;
33 r_8 swunder_, swover_ ;
34};
35
36// -----------------------------------
37// -- Classe ressemblant a un histo 2D
38class QHis2D {
39public:
40 QHis2D();
41 QHis2D(r_8 xMin,r_8 xMax,int_4 nxBin,r_8 yMin,r_8 yMax,int_4 nyBin);
42 void Define(r_8 xMin,r_8 xMax,int_4 nxBin,r_8 yMin,r_8 yMax,int_4 nyBin);
43 double Add(r_8 x, r_8 y, r_8 w, bool fgfh);
44 void SetZeroBin(r_8 x=0, r_8 y=0);
45 inline double WBinX() { return dxb; }
46 inline double WBinY() { return dyb; }
47 Histo2D Convert();
48
49 r_8 xmin,xmax,ymin,ymax;
50 r_8 dxb,dyb;
51 sa_size_t nx,ny;
52 sa_size_t ixb0, jyb0;
53 TArray<r_8> aw;
54 double sumw0;
55};
56
57
58#endif
Note: See TracBrowser for help on using the repository browser.