[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,
|
---|
[344] | 81 | string const & funcname, string & nomnt,
|
---|
| 82 | int nl1=-1, int nl2=-1);
|
---|
[333] | 83 | virtual void PrepareNTExpressionCFile(string & nomobj, string const & fname,
|
---|
| 84 | string const & funcname);
|
---|
| 85 |
|
---|
| 86 | // Methodes de fit - CMV , deux methodes H1 H2 ou 1 seule ??) ...
|
---|
| 87 | virtual void Fit12D(string & nom, string& func,
|
---|
| 88 | string par,string step,string min,string max,string opt);
|
---|
| 89 |
|
---|
| 90 | // Calcul d'expressions d'interface NTuple pour les objets
|
---|
| 91 | void ComputeExpressions(NObjMgrAdapter* obja, string& expx, string& expy,
|
---|
| 92 | string& expz, string& expt, string& expcut,
|
---|
| 93 | NTuple* nt=NULL, Histo* h1=NULL,
|
---|
| 94 | Histo2D* h2=NULL, HProf* hp=NULL);
|
---|
| 95 | PlotExprFunc LinkExprFunc(string& vardec, string& expx, string& expy,
|
---|
| 96 | string& expz, string& expt, string& cut);
|
---|
[326] | 97 | DlFunction LinkFunctionFromFile(string const & fname, string const & funcname);
|
---|
[165] | 98 | void CloseDLL();
|
---|
| 99 |
|
---|
[326] | 100 | // Utilitaires divers
|
---|
[165] | 101 | string FileName2Name(string const & fn);
|
---|
| 102 | int DecodeDispOption(string& dopt, bool& fgsrgr);
|
---|
[333] | 103 | char* PClassIdToClassName(int cid);
|
---|
[165] | 104 |
|
---|
[295] | 105 | protected:
|
---|
[165] | 106 | void InitGrAttNames();
|
---|
| 107 |
|
---|
[295] | 108 | // Pour enregister les objets et leurs adaptateurs pour NamedObjMgr
|
---|
| 109 | struct dataobj_adapter {
|
---|
| 110 | AnyDataObj* obj; NObjMgrAdapter* obja;
|
---|
| 111 | };
|
---|
| 112 | typedef list<dataobj_adapter> ObjAdaptList;
|
---|
| 113 | ObjAdaptList objadaplist;
|
---|
| 114 |
|
---|
[165] | 115 | // Variables membre , en public pour le moment
|
---|
| 116 | struct gratt_item {
|
---|
| 117 | int a1, a2;
|
---|
| 118 | };
|
---|
| 119 | typedef map<string, gratt_item, less<string> > GrAttNames;
|
---|
[295] | 120 |
|
---|
[165] | 121 | // Pour les changements d'attributs graphiques / de visualisation
|
---|
| 122 | GrAttNames GrAcolors;
|
---|
| 123 | GrAttNames GrAlines;
|
---|
| 124 | GrAttNames GrAmarkers;
|
---|
| 125 | GrAttNames GrAfonts;
|
---|
| 126 | GrAttNames GrAcmap;
|
---|
| 127 | GrAttNames GrAzoom;
|
---|
[203] | 128 | GrAttNames GrAaxes;
|
---|
[165] | 129 |
|
---|
[171] | 130 | PDynLinkMgr * dynlink; // shared-lib lib.so
|
---|
| 131 | string TmpDir; // Pour fichiers temporaires
|
---|
[165] | 132 |
|
---|
| 133 | PIStdImgApp* mImgapp;
|
---|
[333] | 134 | NamedObjMgr* mOmg;
|
---|
[165] | 135 |
|
---|
| 136 | };
|
---|
| 137 |
|
---|
| 138 |
|
---|
| 139 | #endif
|
---|