[165] | 1 | // This may look like C code, but it is really -*- C++ -*-
|
---|
| 2 | // Classe de services destinee a NamedObjMgr pour piapp
|
---|
| 3 | // Reza Aout 98
|
---|
| 4 | // CEA-DAPNIA LAL-IN2P3/CNRS
|
---|
| 5 |
|
---|
| 6 | #ifndef SERVNOBJM_H_SEEN
|
---|
| 7 | #define SERVNOBJM_H_SEEN
|
---|
| 8 |
|
---|
[293] | 9 | #include "machdefs.h"
|
---|
[165] | 10 | #include <string>
|
---|
[295] | 11 | #include <list>
|
---|
| 12 | #include <map>
|
---|
| 13 | #if defined(__KCC__)
|
---|
| 14 | using std::string ;
|
---|
| 15 | #include <list.h>
|
---|
| 16 | #include <map.h>
|
---|
| 17 | #endif
|
---|
[165] | 18 |
|
---|
[171] | 19 | #include "pdlmgr.h"
|
---|
[165] | 20 | #include "dlftypes.h"
|
---|
[330] | 21 | #include "anydataobj.h"
|
---|
[165] | 22 |
|
---|
| 23 | class NTuple;
|
---|
| 24 | class Histo;
|
---|
| 25 | class Histo2D;
|
---|
| 26 | class HProf;
|
---|
[333] | 27 | class NamedObjMgr;
|
---|
[165] | 28 | class PIStdImgApp;
|
---|
[330] | 29 | class NObjMgrAdapter;
|
---|
[165] | 30 |
|
---|
| 31 | class Services2NObjMgr {
|
---|
| 32 | public:
|
---|
[333] | 33 | Services2NObjMgr(NamedObjMgr* omg, string& tmpdir);
|
---|
[327] | 34 | virtual ~Services2NObjMgr();
|
---|
[165] | 35 |
|
---|
[295] | 36 | // Pour enregistrer les objets de donnees et leurs adaptateurs
|
---|
| 37 | void RegisterClass(AnyDataObj* o, NObjMgrAdapter* oa);
|
---|
| 38 | // Pour recuperer l'adaptateur pour un objet o
|
---|
| 39 | NObjMgrAdapter* GetAdapter(AnyDataObj* o);
|
---|
| 40 |
|
---|
[165] | 41 | inline void SetImgApp(PIStdImgApp* app) {mImgapp = app; }
|
---|
| 42 |
|
---|
[333] | 43 | // Trace de fonctions 1-D , 2-D
|
---|
| 44 | virtual void PlotFunc(string const & expfunc, string & nom, double xmin, double xmax,
|
---|
| 45 | int np=100, string dopt="");
|
---|
| 46 | virtual void PlotFunc2D(string const & expfunc, string & nom, double xmin, double xmax,
|
---|
| 47 | double ymin, double ymax, int npx=50, int npy=50, string dopt="");
|
---|
| 48 | virtual void PlotFuncFrCFile(string const & fname, string const & func, string & nom,
|
---|
| 49 | double xmin, double xmax, int np=100, string dopt="");
|
---|
| 50 | virtual void PlotFunc2DFrCFile(string const & fname, string const & func, string & nom,
|
---|
| 51 | double xmin, double xmax, double ymin, double ymax,
|
---|
| 52 | int npx=50, int npy=50, string dopt="");
|
---|
| 53 | virtual void PlotFunc(DlFunctionOfX f, string & nom, double xmin, double xmax,
|
---|
| 54 | int np=100, string dopt="");
|
---|
| 55 | virtual void PlotFunc2D(DlFunctionOfXY f, string & nom, double xmin, double xmax,
|
---|
| 56 | double ymin, double ymax, int npx=50, int npy=50, string dopt="");
|
---|
| 57 |
|
---|
| 58 | // Trace d'expression de NTuple, et d'autres objets
|
---|
| 59 | virtual void DisplayPoints2D(string & nom, string& expx, string& expy,
|
---|
| 60 | string& experrx, string& experry,
|
---|
| 61 | string& expcut, string dopt="");
|
---|
| 62 | virtual void DisplayPoints3D(string & nom, string& expx, string& expy, string& expz,
|
---|
| 63 | string& expcut, string dopt="");
|
---|
| 64 | virtual void DisplayPoints2DW(string & nom, string& expx, string& expy,
|
---|
| 65 | string& expwt, string& expcut, string dopt="");
|
---|
| 66 | // Projection d'expressions dans histogramme (et trace)
|
---|
| 67 | virtual void ProjectH1(string & nom, string& expx, string& expwt, string& expcut,
|
---|
| 68 | string& nomh1, string dopt="");
|
---|
| 69 | virtual void ProjectH2(string & nom, string& expx, string& expy, string& expwt,
|
---|
| 70 | string& expcut, string& nomh2, string dopt="");
|
---|
| 71 | virtual void ProjectHProf(string & nom, string& expx, string& expy, string& expwt,
|
---|
| 72 | string& expcut, string& nomprof, string dopt="");
|
---|
| 73 | // Projection d'expression dans vecteurs et dans n-tuple
|
---|
| 74 | virtual void FillVect(string & nom, string& expx, string& expcut,
|
---|
| 75 | string& nomvec, string dopt="");
|
---|
| 76 | virtual void FillNT(string & nom, string& expx, string& expy, string& expz,
|
---|
| 77 | string& expt, string& expcut, string& nomnt);
|
---|
| 78 | virtual void FillGFD(string & nom, string& expx, string& expy, string& expz,
|
---|
| 79 | string& experr, string& expcut, string& nomgfd);
|
---|
| 80 | virtual void FillNTFrCFile(string & nom, string const & fname,
|
---|
| 81 | string const & funcname, string & nomnt);
|
---|
| 82 | virtual void PrepareNTExpressionCFile(string & nomobj, string const & fname,
|
---|
| 83 | string const & funcname);
|
---|
| 84 |
|
---|
| 85 | // Methodes de fit - CMV , deux methodes H1 H2 ou 1 seule ??) ...
|
---|
| 86 | virtual void Fit12D(string & nom, string& func,
|
---|
| 87 | string par,string step,string min,string max,string opt);
|
---|
| 88 |
|
---|
| 89 | // Calcul d'expressions d'interface NTuple pour les objets
|
---|
| 90 | void ComputeExpressions(NObjMgrAdapter* obja, string& expx, string& expy,
|
---|
| 91 | string& expz, string& expt, string& expcut,
|
---|
| 92 | NTuple* nt=NULL, Histo* h1=NULL,
|
---|
| 93 | Histo2D* h2=NULL, HProf* hp=NULL);
|
---|
| 94 | PlotExprFunc LinkExprFunc(string& vardec, string& expx, string& expy,
|
---|
| 95 | string& expz, string& expt, string& cut);
|
---|
[326] | 96 | DlFunction LinkFunctionFromFile(string const & fname, string const & funcname);
|
---|
[165] | 97 | void CloseDLL();
|
---|
| 98 |
|
---|
[326] | 99 | // Utilitaires divers
|
---|
[165] | 100 | string FileName2Name(string const & fn);
|
---|
| 101 | int DecodeDispOption(string& dopt, bool& fgsrgr);
|
---|
[333] | 102 | char* PClassIdToClassName(int cid);
|
---|
[165] | 103 |
|
---|
[295] | 104 | protected:
|
---|
[165] | 105 | void InitGrAttNames();
|
---|
| 106 |
|
---|
[295] | 107 | // Pour enregister les objets et leurs adaptateurs pour NamedObjMgr
|
---|
| 108 | struct dataobj_adapter {
|
---|
| 109 | AnyDataObj* obj; NObjMgrAdapter* obja;
|
---|
| 110 | };
|
---|
| 111 | typedef list<dataobj_adapter> ObjAdaptList;
|
---|
| 112 | ObjAdaptList objadaplist;
|
---|
| 113 |
|
---|
[165] | 114 | // Variables membre , en public pour le moment
|
---|
| 115 | struct gratt_item {
|
---|
| 116 | int a1, a2;
|
---|
| 117 | };
|
---|
| 118 | typedef map<string, gratt_item, less<string> > GrAttNames;
|
---|
[295] | 119 |
|
---|
[165] | 120 | // Pour les changements d'attributs graphiques / de visualisation
|
---|
| 121 | GrAttNames GrAcolors;
|
---|
| 122 | GrAttNames GrAlines;
|
---|
| 123 | GrAttNames GrAmarkers;
|
---|
| 124 | GrAttNames GrAfonts;
|
---|
| 125 | GrAttNames GrAcmap;
|
---|
| 126 | GrAttNames GrAzoom;
|
---|
[203] | 127 | GrAttNames GrAaxes;
|
---|
[165] | 128 |
|
---|
[171] | 129 | PDynLinkMgr * dynlink; // shared-lib lib.so
|
---|
| 130 | string TmpDir; // Pour fichiers temporaires
|
---|
[165] | 131 |
|
---|
| 132 | PIStdImgApp* mImgapp;
|
---|
[333] | 133 | NamedObjMgr* mOmg;
|
---|
[165] | 134 |
|
---|
| 135 | };
|
---|
| 136 |
|
---|
| 137 |
|
---|
| 138 | #endif
|
---|