source: Sophya/trunk/SophyaPI/PIext/phistwrapper.h@ 3132

Last change on this file since 3132 was 3132, checked in by ansari, 19 years ago

introduction methode P1DHistoWrapper::DecodeOptionString et son implementation par defaut, Reza 12/01/2007

File size: 1.5 KB
Line 
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
14// methodes par defaut dans pihisto.cc
15class P1DHistoWrapper
16{
17public:
18 P1DHistoWrapper();
19 virtual ~P1DHistoWrapper();
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
31 virtual r_8 Value(int_4 i) = 0;
32 virtual r_8 Error(int_4 i) = 0;
33
34 inline r_8 operator()(int_4 i) { return ( Value(i)*mScale+mOff ); }
35 // Methode de mise a jour du contenu
36 // avec implementation par defaut - ne faisant rien
37 virtual void Update() { return; }
38
39 // ajoute des lignes de texte avec les infos statistiques (dans text)
40 // renvoie le nombre de lignes ajoutees - avec implementation par defaut
41 virtual int GetStatInfoAsText(vector<string> & text );
42
43// Methode de decodage des options - avec implementation par defaut
44// l'implementation par defaut ds le fichier pihisto.cc
45 virtual int DecodeOptionString(vector<string> & opt, bool rmdecopt=true);
46
47protected:
48 r_8 mScale, mOff; // scaling coefficient, offset coefficient
49
50};
51
52
53#endif
Note: See TracBrowser for help on using the repository browser.