[3125] | 1 | // This may look like C code, but it is really -*- C++ -*-
|
---|
| 2 | // Classe d'emballage (wrapper) d'histos pour trace PI
|
---|
| 3 | // C. Magneville / R. Ansari 2007
|
---|
| 4 | // (C) CEA-DAPNIA LAL-IN2P3/CNRS
|
---|
| 5 |
|
---|
| 6 | #ifndef PHISTOWRAPPER_H
|
---|
| 7 | #define PHISTOWRAPPER_H
|
---|
| 8 |
|
---|
| 9 | #include <string>
|
---|
| 10 | #include <vector>
|
---|
| 11 |
|
---|
| 12 |
|
---|
| 13 | //! Wrapper class interface for 1d-histogram like objects , used by PIHisto
|
---|
[3132] | 14 | // methodes par defaut dans pihisto.cc
|
---|
[3125] | 15 | class P1DHistoWrapper
|
---|
| 16 | {
|
---|
| 17 | public:
|
---|
[3132] | 18 | P1DHistoWrapper();
|
---|
| 19 | virtual ~P1DHistoWrapper();
|
---|
[3125] | 20 |
|
---|
| 21 | virtual int_4 NBins() = 0;
|
---|
| 22 | virtual r_8 XMin() = 0;
|
---|
| 23 | virtual r_8 XMax() = 0;
|
---|
| 24 | virtual r_8 BinWidth() = 0;
|
---|
| 25 |
|
---|
| 26 | virtual r_8 BinLowEdge(int_4 i) = 0;
|
---|
| 27 | virtual r_8 BinCenter(int_4 i) = 0;
|
---|
| 28 | virtual r_8 BinHighEdge(int_4 i) = 0;
|
---|
| 29 |
|
---|
| 30 | // Renvoie contenu du bin i
|
---|
[3132] | 31 | virtual r_8 Value(int_4 i) = 0;
|
---|
[3125] | 32 | virtual r_8 Error(int_4 i) = 0;
|
---|
[3135] | 33 | virtual r_8 NbEntries(int_4 i) = 0;
|
---|
[3125] | 34 |
|
---|
[3132] | 35 | inline r_8 operator()(int_4 i) { return ( Value(i)*mScale+mOff ); }
|
---|
[3125] | 36 | // Methode de mise a jour du contenu
|
---|
| 37 | // avec implementation par defaut - ne faisant rien
|
---|
| 38 | virtual void Update() { return; }
|
---|
| 39 |
|
---|
| 40 | // ajoute des lignes de texte avec les infos statistiques (dans text)
|
---|
| 41 | // renvoie le nombre de lignes ajoutees - avec implementation par defaut
|
---|
[3132] | 42 | virtual int GetStatInfoAsText(vector<string> & text );
|
---|
[3125] | 43 |
|
---|
[3132] | 44 | // Methode de decodage des options - avec implementation par defaut
|
---|
| 45 | // l'implementation par defaut ds le fichier pihisto.cc
|
---|
| 46 | virtual int DecodeOptionString(vector<string> & opt, bool rmdecopt=true);
|
---|
| 47 |
|
---|
| 48 | protected:
|
---|
| 49 | r_8 mScale, mOff; // scaling coefficient, offset coefficient
|
---|
| 50 |
|
---|
[3125] | 51 | };
|
---|
| 52 |
|
---|
| 53 |
|
---|
| 54 | #endif
|
---|