[165] | 1 | #include <stdio.h>
|
---|
| 2 | #include <stdlib.h>
|
---|
| 3 | #include <ctype.h>
|
---|
| 4 |
|
---|
[295] | 5 | #include <typeinfo>
|
---|
[165] | 6 | #include <iostream.h>
|
---|
| 7 | #include <string>
|
---|
| 8 | #include <list>
|
---|
| 9 | #include <map>
|
---|
| 10 |
|
---|
| 11 | #include "strutil.h"
|
---|
| 12 |
|
---|
| 13 | #include "nobjmgr.h"
|
---|
| 14 | #include "servnobjm.h"
|
---|
[330] | 15 | #include "nomgadapter.h"
|
---|
[165] | 16 | #include "pistdimgapp.h"
|
---|
| 17 |
|
---|
[333] | 18 | #include "fct1dfit.h"
|
---|
| 19 | #include "fct2dfit.h"
|
---|
| 20 |
|
---|
[544] | 21 | #ifdef SANS_EVOLPLANCK
|
---|
[333] | 22 | #include "matrix.h"
|
---|
| 23 | #include "cvector.h"
|
---|
[544] | 24 | #else
|
---|
| 25 | #include "tmatrix.h"
|
---|
| 26 | #include "tvector.h"
|
---|
| 27 | #endif
|
---|
| 28 |
|
---|
[333] | 29 | #include "ntuple.h"
|
---|
| 30 | #include "cimage.h"
|
---|
| 31 |
|
---|
[165] | 32 | #include "histos.h"
|
---|
| 33 | #include "histos2.h"
|
---|
| 34 | #include "ntuple.h"
|
---|
| 35 | #include "hisprof.h"
|
---|
| 36 |
|
---|
[326] | 37 | #include "piscdrawwdg.h"
|
---|
| 38 | #include "pisurfdr.h"
|
---|
[333] | 39 |
|
---|
| 40 | #include "pintuple.h"
|
---|
| 41 | #include "pintup3d.h"
|
---|
| 42 |
|
---|
[326] | 43 | #include "pipodrw.h"
|
---|
[165] | 44 |
|
---|
| 45 |
|
---|
[326] | 46 |
|
---|
[165] | 47 | /* --Methode-- */
|
---|
[333] | 48 | Services2NObjMgr::Services2NObjMgr(NamedObjMgr* omg, string& tmpdir)
|
---|
[165] | 49 | {
|
---|
| 50 | TmpDir = tmpdir;
|
---|
[171] | 51 | PDynLinkMgr::SetTmpDir(tmpdir);
|
---|
[333] | 52 | mImgapp = NULL;
|
---|
| 53 | mOmg = omg;
|
---|
[171] | 54 | dynlink = NULL;
|
---|
[165] | 55 | InitGrAttNames();
|
---|
| 56 | }
|
---|
| 57 |
|
---|
| 58 | /* --Methode-- */
|
---|
| 59 | Services2NObjMgr::~Services2NObjMgr()
|
---|
| 60 | {
|
---|
| 61 | CloseDLL();
|
---|
| 62 | }
|
---|
| 63 |
|
---|
| 64 | /* --Methode-- */
|
---|
[295] | 65 | void Services2NObjMgr::RegisterClass(AnyDataObj* o, NObjMgrAdapter* oa)
|
---|
[165] | 66 | {
|
---|
[295] | 67 | ObjAdaptList::iterator it;
|
---|
| 68 | for(it = objadaplist.begin(); it != objadaplist.end(); it++)
|
---|
[495] | 69 | #ifdef SANS_EVOLPLANCK
|
---|
[295] | 70 | if (typeid(*o) == typeid(*((*it).obj))) THROW(dupIdErr);
|
---|
[495] | 71 | #else
|
---|
| 72 | if (typeid(*o) == typeid(*((*it).obj)))
|
---|
| 73 | throw(DuplicateIdExc("Services2NObjMgr::RegisterClass() - Duplicate class"));
|
---|
| 74 | #endif
|
---|
[295] | 75 | dataobj_adapter oba;
|
---|
| 76 | oba.obj = o;
|
---|
| 77 | oba.obja = oa;
|
---|
| 78 | objadaplist.push_back(oba);
|
---|
| 79 | }
|
---|
[165] | 80 |
|
---|
[295] | 81 | /* --Methode-- */
|
---|
| 82 | NObjMgrAdapter* Services2NObjMgr::GetAdapter(AnyDataObj* o)
|
---|
| 83 | {
|
---|
| 84 | ObjAdaptList::iterator it;
|
---|
| 85 | for(it = objadaplist.begin(); it != objadaplist.end(); it++)
|
---|
| 86 | if (typeid(*o) == typeid(*((*it).obj))) return((*it).obja->Clone(o));
|
---|
| 87 | return(new NObjMgrAdapter(o));
|
---|
| 88 | }
|
---|
[165] | 89 |
|
---|
[295] | 90 | /* --Methode-- */
|
---|
[333] | 91 | void Services2NObjMgr::PlotFunc(string const & expfunc, string & nom, double xmin, double xmax, int np, string dopt)
|
---|
[295] | 92 | {
|
---|
[165] | 93 | FILE *fip;
|
---|
[326] | 94 | string fname = TmpDir + "func1_pia_dl.c";
|
---|
| 95 | string cmd;
|
---|
| 96 | int rc;
|
---|
| 97 |
|
---|
| 98 | if (!mImgapp) return;
|
---|
| 99 |
|
---|
| 100 | cmd = "rm -f " + fname;
|
---|
| 101 | rc = system(cmd.c_str());
|
---|
| 102 | // printf("PlotFunc_Do> %s (Rc=%d)\n", cmd.c_str(), rc);
|
---|
| 103 |
|
---|
| 104 | if ((fip = fopen(fname.c_str(), "w")) == NULL) {
|
---|
| 105 | string sn = fname;
|
---|
[449] | 106 | cout << "Services2NObjMgr/PlotFunc_Error: fopen( " << sn << endl;
|
---|
[326] | 107 | return;
|
---|
| 108 | }
|
---|
| 109 |
|
---|
| 110 | // constitution du fichier a compiler
|
---|
| 111 | fputs("#include <math.h> \n", fip);
|
---|
| 112 | fputs("double func1_pia_dl_func(double x) \n{\n", fip);
|
---|
| 113 | fprintf(fip,"return(%s); \n}\n", expfunc.c_str());
|
---|
| 114 | fclose(fip);
|
---|
| 115 |
|
---|
| 116 | string func = "func1_pia_dl_func";
|
---|
| 117 | DlFunctionOfX f = (DlFunctionOfX) LinkFunctionFromFile(fname, func);
|
---|
| 118 | if (!f) return;
|
---|
[333] | 119 | PlotFunc(f, nom, xmin, xmax, np, dopt);
|
---|
[326] | 120 | CloseDLL();
|
---|
| 121 | return;
|
---|
| 122 | }
|
---|
| 123 |
|
---|
| 124 | /* --Methode-- */
|
---|
[333] | 125 | void Services2NObjMgr::PlotFunc2D(string const & expfunc, string & nom, double xmin, double xmax,
|
---|
| 126 | double ymin, double ymax, int npx, int npy, string dopt)
|
---|
[326] | 127 | {
|
---|
| 128 | FILE *fip;
|
---|
| 129 | string fname = TmpDir + "func2_pia_dl.c";
|
---|
| 130 | string cmd;
|
---|
| 131 | int rc;
|
---|
| 132 |
|
---|
| 133 | if (!mImgapp) return;
|
---|
| 134 |
|
---|
| 135 | cmd = "rm " + fname;
|
---|
| 136 | rc = system(cmd.c_str());
|
---|
| 137 | // printf("PlotFunc2D_Do> %s (Rc=%d)\n", cmd.c_str(), rc);
|
---|
| 138 |
|
---|
| 139 | if ((fip = fopen(fname.c_str(), "w")) == NULL) {
|
---|
| 140 | string sn = fname;
|
---|
[449] | 141 | cout << "Services2NObjMgr/PlotFunc2D_Error: fopen( " << sn << endl;
|
---|
[326] | 142 | return;
|
---|
| 143 | }
|
---|
| 144 |
|
---|
| 145 | // constitution du fichier a compiler
|
---|
| 146 | fputs("#include <math.h> \n", fip);
|
---|
| 147 | fputs("double func2_pia_dl_func(double x, double y) \n{\n", fip);
|
---|
| 148 | fprintf(fip,"return(%s); \n}\n", expfunc.c_str());
|
---|
| 149 | fclose(fip);
|
---|
| 150 |
|
---|
| 151 | string func = "func2_pia_dl_func";
|
---|
| 152 | DlFunctionOfXY f = (DlFunctionOfXY) LinkFunctionFromFile(fname, func);
|
---|
| 153 | if (!f) return;
|
---|
[333] | 154 | PlotFunc2D(f, nom, xmin, xmax, ymin, ymax, npx, npy, dopt);
|
---|
[326] | 155 | CloseDLL();
|
---|
| 156 | return;
|
---|
| 157 | }
|
---|
| 158 |
|
---|
| 159 | /* --Methode-- */
|
---|
[333] | 160 | void Services2NObjMgr::PlotFuncFrCFile(string const & fname, string const & func, string & nom,
|
---|
| 161 | double xmin, double xmax, int np, string dopt)
|
---|
[326] | 162 | {
|
---|
| 163 | DlFunctionOfX f = (DlFunctionOfX) LinkFunctionFromFile(fname, func);
|
---|
| 164 | if (!f) return;
|
---|
[333] | 165 | PlotFunc(f, nom, xmin, xmax, np, dopt);
|
---|
[326] | 166 | CloseDLL();
|
---|
| 167 | return;
|
---|
| 168 | }
|
---|
| 169 |
|
---|
| 170 | /* --Methode-- */
|
---|
[333] | 171 | void Services2NObjMgr::PlotFunc2DFrCFile(string const & fname, string const & func, string & nom,
|
---|
| 172 | double xmin, double xmax, double ymin, double ymax, int npx, int npy, string dopt)
|
---|
[326] | 173 | {
|
---|
| 174 | DlFunctionOfXY f = (DlFunctionOfXY) LinkFunctionFromFile(fname, func);
|
---|
| 175 | if (!f) return;
|
---|
[333] | 176 | PlotFunc2D(f, nom, xmin, xmax, ymin, ymax, npx, npy, dopt);
|
---|
[326] | 177 | CloseDLL();
|
---|
| 178 | return;
|
---|
| 179 | }
|
---|
| 180 |
|
---|
| 181 | /* --Methode-- */
|
---|
[333] | 182 | void Services2NObjMgr::PlotFunc(DlFunctionOfX f, string & nom, double xmin, double xmax, int np, string dopt)
|
---|
[326] | 183 | {
|
---|
| 184 | if (!mImgapp) return;
|
---|
| 185 |
|
---|
| 186 | int k;
|
---|
| 187 | if (np < 1) np = 1;
|
---|
| 188 | if (xmax <= xmin) xmax = xmin+1.;
|
---|
| 189 | Vector* vpy = new Vector(np);
|
---|
| 190 |
|
---|
| 191 | double xx;
|
---|
| 192 | double dx = (xmax-xmin)/np;
|
---|
[500] | 193 |
|
---|
| 194 | try {
|
---|
| 195 | for(k=0; k<np; k++) { xx = xmin+dx*k; (*vpy)(k) = f(xx); }
|
---|
| 196 | }
|
---|
[495] | 197 | #ifdef SANS_EVOLPLANCK
|
---|
[500] | 198 | CATCH(merr) {
|
---|
[326] | 199 | fflush(stdout);
|
---|
| 200 | cout << endl;
|
---|
| 201 | cerr << endl;
|
---|
| 202 | string es = PeidaExc(merr);
|
---|
| 203 | cerr << "Services2NObjMgr::PlotFunc() Exception :" << merr << es;
|
---|
| 204 | delete vpy;
|
---|
| 205 | vpy = NULL;
|
---|
| 206 | } ENDTRY;
|
---|
[495] | 207 | #else
|
---|
| 208 | catch ( PException exc ) {
|
---|
| 209 | fflush(stdout);
|
---|
| 210 | cout << endl;
|
---|
| 211 | cerr << endl;
|
---|
| 212 | cerr << "Services2NObjMgr::PlotFunc() Exception :" << exc.Msg() << endl;
|
---|
| 213 | delete vpy;
|
---|
| 214 | vpy = NULL;
|
---|
| 215 | }
|
---|
| 216 | #endif
|
---|
[326] | 217 |
|
---|
| 218 | if (vpy) {
|
---|
[344] | 219 | string titre;
|
---|
| 220 | if (nom.length() < 1) {
|
---|
| 221 | titre = "Function f(x)";
|
---|
[466] | 222 | nom = "/autoc/f_x";
|
---|
[344] | 223 | }
|
---|
| 224 | else titre = nom;
|
---|
| 225 |
|
---|
| 226 | P1DArrayAdapter* vya = new POVectorAdapter(vpy, false);
|
---|
[326] | 227 | vya->DefineXCoordinate(xmin, (xmax-xmin)/np);
|
---|
| 228 | PIYfXDrawer* dr = new PIYfXDrawer(vya, NULL, true) ;
|
---|
| 229 | bool fgsr = true;
|
---|
| 230 | dopt = "thinline," + dopt;
|
---|
| 231 | int opt = DecodeDispOption(dopt, fgsr);
|
---|
[333] | 232 | int rsid = mImgapp->DispScDrawer(dr, titre, opt);
|
---|
[326] | 233 | if (fgsr) mImgapp->RestoreGraphicAtt();
|
---|
[333] | 234 | if (nom.length() > 0) {
|
---|
| 235 | mOmg->AddObj(vpy, nom);
|
---|
| 236 | mOmg->AddWRsId(nom, rsid);
|
---|
| 237 | }
|
---|
[326] | 238 | }
|
---|
| 239 |
|
---|
| 240 | return;
|
---|
| 241 | }
|
---|
| 242 |
|
---|
| 243 | /* --Methode-- */
|
---|
[333] | 244 | void Services2NObjMgr::PlotFunc2D(DlFunctionOfXY f, string & nom, double xmin, double xmax, double ymin, double ymax,
|
---|
[326] | 245 | int npx, int npy, string dopt)
|
---|
| 246 | {
|
---|
| 247 | if (!mImgapp) return;
|
---|
| 248 |
|
---|
| 249 | if (npx < 3) npx = 3;
|
---|
| 250 | if (npy < 3) npy = 3;
|
---|
| 251 | if (npx > 250) npx = 250;
|
---|
| 252 | if (npy > 250) npy = 250;
|
---|
| 253 | if (xmax <= xmin) xmax = xmin+1.;
|
---|
| 254 | if (ymax <= ymin) ymax = ymin+1.;
|
---|
| 255 |
|
---|
| 256 | Matrix* mtx = new Matrix(npy, npx);
|
---|
| 257 |
|
---|
| 258 | int i,j;
|
---|
| 259 | double xx, yy;
|
---|
| 260 | double dx = (xmax-xmin)/npx;
|
---|
| 261 | double dy = (ymax-ymin)/npy;
|
---|
| 262 | // printf(" -- DBG -- %d %d , %g %g , %g %g \n", npx, npy, xmin, xmax, ymin, ymax);
|
---|
[500] | 263 | try {
|
---|
[326] | 264 | for(j=0; j<npy; j++) {
|
---|
| 265 | yy = ymin+dy*j;
|
---|
| 266 | for(i=0; i<npx; i++) {
|
---|
| 267 | xx = xmin+dx*i;
|
---|
| 268 | (*mtx)(j, i) = f(xx, yy);
|
---|
| 269 | }
|
---|
| 270 | }
|
---|
[500] | 271 | }
|
---|
| 272 | #ifdef SANS_EVOLPLANCK
|
---|
| 273 | CATCH(merr) {
|
---|
[326] | 274 | fflush(stdout);
|
---|
| 275 | cout << endl;
|
---|
| 276 | cerr << endl;
|
---|
| 277 | string es = PeidaExc(merr);
|
---|
| 278 | cerr << "Services2NObjMgr::PlotFunc2D() Exception :" << merr << es;
|
---|
| 279 | delete mtx; mtx = NULL;
|
---|
| 280 | } ENDTRY;
|
---|
[495] | 281 | #else
|
---|
| 282 | catch ( PException exc ) {
|
---|
| 283 | fflush(stdout);
|
---|
| 284 | cout << endl;
|
---|
| 285 | cerr << endl;
|
---|
| 286 | cerr << "Services2NObjMgr::PlotFunc2D() Exception :" << exc.Msg() << endl;
|
---|
| 287 | delete mtx; mtx = NULL;
|
---|
| 288 | }
|
---|
| 289 | #endif
|
---|
[326] | 290 |
|
---|
| 291 | if (mtx) {
|
---|
[344] | 292 | string titre;
|
---|
| 293 | if (nom.length() < 1) {
|
---|
| 294 | titre = "Function f(x,y)";
|
---|
[466] | 295 | nom = "/autoc/f2d_xy";
|
---|
[344] | 296 | }
|
---|
| 297 | else titre = nom;
|
---|
[326] | 298 | bool fgsr = true;
|
---|
| 299 | int opt = DecodeDispOption(dopt, fgsr);
|
---|
[344] | 300 | P2DArrayAdapter* arr = new POMatrixAdapter(mtx, false);
|
---|
[326] | 301 | arr->DefineXYCoordinates(xmin, ymin, dx, dy);
|
---|
| 302 | PISurfaceDrawer* sdr = new PISurfaceDrawer(arr, true, true, true);
|
---|
[333] | 303 | int rsid = mImgapp->Disp3DDrawer(sdr, titre, opt);
|
---|
[326] | 304 | if (fgsr) mImgapp->RestoreGraphicAtt();
|
---|
[333] | 305 | if (nom.length() > 0) {
|
---|
| 306 | mOmg->AddObj(mtx, nom);
|
---|
| 307 | mOmg->AddWRsId(nom, rsid);
|
---|
| 308 | }
|
---|
[326] | 309 | }
|
---|
| 310 |
|
---|
| 311 | return;
|
---|
| 312 | }
|
---|
| 313 |
|
---|
| 314 | /* --Methode-- */
|
---|
[333] | 315 | void Services2NObjMgr::DisplayPoints2D(string& nom, string& expx, string& expy,
|
---|
| 316 | string& experrx, string& experry,
|
---|
[357] | 317 | string& expcut, string dopt, string loop)
|
---|
[333] | 318 | {
|
---|
| 319 | NObjMgrAdapter* obja=NULL;
|
---|
| 320 | obja = mOmg->GetObjAdapter(nom);
|
---|
| 321 | if (obja == NULL) {
|
---|
[449] | 322 | cout << "Services2NObjMgr::DisplayPoints2D() Error , No such object " << nom << endl;
|
---|
[333] | 323 | return;
|
---|
| 324 | }
|
---|
| 325 | if (!mImgapp) return;
|
---|
| 326 |
|
---|
| 327 | // Creation NTuple
|
---|
| 328 | char* ntn[4] = {"expx","expy","expex","expey",};
|
---|
| 329 | NTuple* nt = NULL;
|
---|
| 330 | bool haserr = false;
|
---|
| 331 |
|
---|
| 332 | if ( (experrx.length() > 0 ) && (experry.length() > 0 ) ) { haserr = true; nt = new NTuple(4, ntn); }
|
---|
| 333 | else { haserr = false; experrx = experry = "0."; nt = new NTuple(2, ntn); }
|
---|
| 334 |
|
---|
[357] | 335 | ComputeExpressions(obja, expx, expy, experrx, experry, expcut, loop, nt, NULL, NULL);
|
---|
[333] | 336 |
|
---|
| 337 | if (nt->NEntry() < 1) {
|
---|
| 338 | cout << "Services2NObjMgr::DisplayPoints2D() Warning Zero points satisfy cut !" << endl;
|
---|
| 339 | delete nt;
|
---|
| 340 | return;
|
---|
| 341 | }
|
---|
| 342 |
|
---|
| 343 | // nt->Show();
|
---|
| 344 | // nt->Print(0,10);
|
---|
| 345 | PINTuple* pin = new PINTuple(nt, true);
|
---|
[546] | 346 | pin->SetStats(Services2NObjMgr::GetStatsOption(dopt));
|
---|
[333] | 347 | pin->SelectXY(ntn[0], ntn[1]);
|
---|
| 348 | if ( haserr ) pin->SelectErrBar(ntn[2], ntn[3]);
|
---|
| 349 |
|
---|
| 350 | bool fgsr = true;
|
---|
| 351 | dopt = "defline," + dopt;
|
---|
| 352 | int opt = DecodeDispOption(dopt, fgsr);
|
---|
| 353 | string titre = nom + ":" + expy + "%" + expx;
|
---|
| 354 | mImgapp->DispScDrawer( (PIDrawer*)pin, titre, opt);
|
---|
| 355 | if (fgsr) mImgapp->RestoreGraphicAtt();
|
---|
| 356 | return;
|
---|
| 357 | }
|
---|
| 358 |
|
---|
| 359 | /* --Methode-- */
|
---|
| 360 | void Services2NObjMgr::DisplayPoints3D(string& nom, string& expx, string& expy,
|
---|
[357] | 361 | string& expz, string& expcut, string dopt, string loop)
|
---|
[333] | 362 | {
|
---|
| 363 | NObjMgrAdapter* obja=NULL;
|
---|
| 364 | obja = mOmg->GetObjAdapter(nom);
|
---|
| 365 | if (obja == NULL) {
|
---|
[449] | 366 | cout << "Services2NObjMgr::DisplayPoints3D() Error , No such object " << nom << endl;
|
---|
[333] | 367 | return;
|
---|
| 368 | }
|
---|
| 369 | if (!mImgapp) return;
|
---|
| 370 |
|
---|
| 371 | char* ntn[3] = {"expx","expy","expz"};
|
---|
| 372 | NTuple* nt = new NTuple(3,ntn); // Creation NTuple
|
---|
| 373 |
|
---|
| 374 | string expwt = "1.";
|
---|
[357] | 375 | ComputeExpressions(obja, expx, expy, expz, expwt, expcut, loop, nt, NULL, NULL);
|
---|
[333] | 376 |
|
---|
| 377 | if (nt->NEntry() < 1) {
|
---|
| 378 | cout << "Services2NObjMgr::DisplayPoints3D() Warning Zero points satisfy cut !" << endl;
|
---|
| 379 | delete nt;
|
---|
| 380 | return;
|
---|
| 381 | }
|
---|
| 382 | nt->Show();
|
---|
| 383 | nt->Print(0,10);
|
---|
| 384 | PINTuple3D* pin = new PINTuple3D(nt, true);
|
---|
| 385 | pin->SelectXYZ(ntn[0], ntn[1], ntn[2]);
|
---|
| 386 | bool fgsr = true;
|
---|
| 387 | dopt = "defline," + dopt;
|
---|
| 388 | int opt = DecodeDispOption(dopt, fgsr);
|
---|
| 389 |
|
---|
| 390 | // Pour plot a partir de DispScDrawer
|
---|
| 391 | // string nomdisp = "_NT3D_";
|
---|
| 392 | // mImgapp->DispScDrawer( (PIDrawer*)pin, nomdisp, opt);
|
---|
| 393 | // Pour plot a partir de Disp3DDrawer
|
---|
| 394 | string titre = nom + ":" + expy + "%" + expx;
|
---|
| 395 | mImgapp->Disp3DDrawer(pin, titre, opt);
|
---|
| 396 |
|
---|
| 397 | if (fgsr) mImgapp->RestoreGraphicAtt();
|
---|
| 398 | return;
|
---|
| 399 | }
|
---|
| 400 |
|
---|
| 401 | /* --Methode-- */
|
---|
| 402 | void Services2NObjMgr::DisplayPoints2DW(string& nom, string& expx, string& expy,
|
---|
[357] | 403 | string& expwt, string& expcut, string dopt, string loop)
|
---|
[333] | 404 | {
|
---|
| 405 | NObjMgrAdapter* obja=NULL;
|
---|
| 406 | obja = mOmg->GetObjAdapter(nom);
|
---|
| 407 | if (obja == NULL) {
|
---|
[449] | 408 | cout << "Services2NObjMgr::DisplayPoints2DW() Error , No such object " << nom << endl;
|
---|
[333] | 409 | return;
|
---|
| 410 | }
|
---|
| 411 | if (!mImgapp) return;
|
---|
| 412 |
|
---|
| 413 | char* ntn[3] = {"expx","expy","expw"};
|
---|
| 414 | NTuple* nt = new NTuple(3,ntn); // Creation NTuple
|
---|
| 415 |
|
---|
| 416 | string exp = "1.";
|
---|
[357] | 417 | ComputeExpressions(obja, expx, expy, expwt, exp, expcut, loop, nt, NULL, NULL);
|
---|
[333] | 418 |
|
---|
| 419 | if (nt->NEntry() < 1) {
|
---|
| 420 | cout << "Services2NObjMgr::DisplayPoints2DW() Warning Zero points satisfy cut !" << endl;
|
---|
| 421 | delete nt;
|
---|
| 422 | return;
|
---|
| 423 | }
|
---|
| 424 |
|
---|
| 425 | PINTuple* pin = new PINTuple(nt, true);
|
---|
[546] | 426 | pin->SetStats(Services2NObjMgr::GetStatsOption(dopt));
|
---|
[333] | 427 | pin->SelectXY(ntn[0], ntn[1]);
|
---|
| 428 | pin->SelectWt(ntn[2]);
|
---|
| 429 |
|
---|
| 430 | bool fgsr = true;
|
---|
| 431 | int opt = DecodeDispOption(dopt, fgsr);
|
---|
| 432 | string titre = nom + ":" + expwt + "_" + expy + "%" + expx ;
|
---|
| 433 | mImgapp->DispScDrawer( (PIDrawer*)pin, titre, opt);
|
---|
| 434 | if (fgsr) mImgapp->RestoreGraphicAtt();
|
---|
| 435 | return;
|
---|
| 436 | }
|
---|
| 437 |
|
---|
| 438 | /* --Methode-- */
|
---|
| 439 | void Services2NObjMgr::ProjectH1(string& nom, string& expx, string& expwt,
|
---|
[357] | 440 | string& expcut, string& nomh1, string dopt, string loop)
|
---|
[333] | 441 | {
|
---|
| 442 | NObjMgrAdapter* obja=NULL;
|
---|
| 443 | obja = mOmg->GetObjAdapter(nom);
|
---|
| 444 | if (obja == NULL) {
|
---|
[449] | 445 | cout << "Services2NObjMgr::ProjectH1() Error , No such object " << nom << endl;
|
---|
[333] | 446 | return;
|
---|
| 447 | }
|
---|
| 448 | if (!mImgapp) return;
|
---|
| 449 |
|
---|
| 450 | Histo* h1 = NULL;
|
---|
| 451 | NTuple* nt = NULL;
|
---|
| 452 | AnyDataObj* oh = NULL;
|
---|
| 453 | if (nomh1.length() > 0) oh=mOmg->GetObj(nomh1);
|
---|
| 454 | else nomh1 = "/tmp/projh1d";
|
---|
| 455 | if ( (oh != NULL) && (typeid(*oh) == typeid(Histo)) ) h1 = (Histo*)oh; // Pas de remise a zero ! h1->Zero();
|
---|
| 456 | else {
|
---|
| 457 | char* ntn[2]= {"hxval", "hwt"};
|
---|
| 458 | nt = new NTuple(2,ntn); // Creation NTuple
|
---|
| 459 | }
|
---|
| 460 | string expz = "0.";
|
---|
[357] | 461 | ComputeExpressions(obja, expx, expwt, expz, expwt, expcut, loop, nt, h1, NULL);
|
---|
[333] | 462 |
|
---|
| 463 | if ((!h1) && (!nt)) return;
|
---|
| 464 | if (!h1) {
|
---|
| 465 | if (nt->NEntry() < 1) {
|
---|
| 466 | cout << "Services2NObjMgr::ProjectH1() Warning Zero points satisfy cut !" << endl;
|
---|
| 467 | delete nt;
|
---|
| 468 | return;
|
---|
| 469 | }
|
---|
| 470 | double xmin, xmax;
|
---|
| 471 | nt->GetMinMax(0, xmin, xmax);
|
---|
| 472 | h1 = new Histo(xmin, xmax, 100);
|
---|
| 473 | int k;
|
---|
| 474 | float* xn;
|
---|
| 475 | for(k=0; k<nt->NEntry(); k++) {
|
---|
| 476 | xn = nt->GetVec(k);
|
---|
| 477 | h1->Add(xn[0], xn[1]);
|
---|
| 478 | }
|
---|
| 479 | delete nt;
|
---|
| 480 | mOmg->AddObj(h1, nomh1);
|
---|
| 481 | }
|
---|
| 482 |
|
---|
| 483 | mOmg->DisplayObj(nomh1, dopt);
|
---|
| 484 | return;
|
---|
| 485 | }
|
---|
| 486 |
|
---|
| 487 | /* --Methode-- */
|
---|
| 488 | void Services2NObjMgr::ProjectH2(string& nom, string& expx, string& expy, string& expwt,
|
---|
[357] | 489 | string& expcut, string& nomh2, string dopt, string loop)
|
---|
[333] | 490 | {
|
---|
| 491 | NObjMgrAdapter* obja=NULL;
|
---|
| 492 | obja = mOmg->GetObjAdapter(nom);
|
---|
| 493 | if (obja == NULL) {
|
---|
[449] | 494 | cout << "Services2NObjMgr::ProjectH2() Error , No such object " << nom << endl;
|
---|
[333] | 495 | return;
|
---|
| 496 | }
|
---|
| 497 | if (!mImgapp) return;
|
---|
| 498 |
|
---|
| 499 | Histo2D* h2 = NULL;
|
---|
| 500 | NTuple* nt = NULL;
|
---|
| 501 | AnyDataObj* oh = NULL;
|
---|
| 502 | if (nomh2.length() > 0) oh=mOmg->GetObj(nomh2);
|
---|
| 503 | else nomh2 = "/tmp/projh2d";
|
---|
| 504 | if ( (oh != NULL) && (typeid(*oh) == typeid(Histo2D)) ) h2 = (Histo2D*)oh; // Pas de remise a zero ! h2->Zero();
|
---|
| 505 | else {
|
---|
| 506 | char* ntn[3]= {"hxval", "hyval", "hwt"};
|
---|
| 507 | nt = new NTuple(3,ntn); // Creation NTuple
|
---|
| 508 | }
|
---|
| 509 | string expz = "0.";
|
---|
[357] | 510 | ComputeExpressions(obja, expx, expy, expwt, expwt, expcut, loop, nt, NULL, h2);
|
---|
[333] | 511 |
|
---|
| 512 | if ((!h2) && (!nt)) return;
|
---|
| 513 | if (!h2) {
|
---|
| 514 | if (nt->NEntry() < 1) {
|
---|
| 515 | cout << "Services2NObjMgr::ProjectH2() Warning Zero points satisfy cut !" << endl;
|
---|
| 516 | delete nt;
|
---|
| 517 | return;
|
---|
| 518 | }
|
---|
| 519 | double xmin, xmax, ymin, ymax;
|
---|
| 520 | nt->GetMinMax(0, xmin, xmax);
|
---|
[466] | 521 | nt->GetMinMax(1, ymin, ymax);
|
---|
[333] | 522 | h2 = new Histo2D(xmin, xmax, 50, ymin, ymax, 50);
|
---|
| 523 | int k;
|
---|
| 524 | float* xn;
|
---|
| 525 | for(k=0; k<nt->NEntry(); k++) {
|
---|
| 526 | xn = nt->GetVec(k);
|
---|
| 527 | h2->Add(xn[0], xn[1], xn[2]);
|
---|
| 528 | }
|
---|
| 529 | delete nt;
|
---|
| 530 | mOmg->AddObj(h2, nomh2);
|
---|
| 531 | }
|
---|
| 532 |
|
---|
| 533 | mOmg->DisplayObj(nomh2, dopt);
|
---|
| 534 | return;
|
---|
| 535 |
|
---|
| 536 | }
|
---|
| 537 |
|
---|
| 538 | /* --Methode-- cmv 13/10/98 */
|
---|
| 539 | void Services2NObjMgr::ProjectHProf(string& nom, string& expx, string& expy, string& expwt,
|
---|
[357] | 540 | string& expcut, string& nomprof, string dopt, string loop)
|
---|
| 541 | // Pour remplir un ``GeneralFitData'' a partir de divers objets:
|
---|
[333] | 542 | //| nom = nom de l'objet a projeter dans un HProf.
|
---|
| 543 | //| expx = expression X de definition du bin.
|
---|
| 544 | //| expy = expression Y a additionner dans le bin.
|
---|
| 545 | //| expwt = expression W du poids a additionner.
|
---|
| 546 | //| expcut = expression du test de selection.
|
---|
| 547 | //| nomprof = nom du HProf engendre (optionnel). Si l'objet n'existe pas
|
---|
| 548 | //| les limites Xmin,Xmax sont calculees automatiquement.
|
---|
| 549 | //| sinon ce sont celles de l'objet preexistant.
|
---|
| 550 | //| opt = options generales pour le display.
|
---|
| 551 | {
|
---|
| 552 | NObjMgrAdapter* obja=NULL;
|
---|
| 553 | obja = mOmg->GetObjAdapter(nom);
|
---|
| 554 | if (obja == NULL) {
|
---|
[449] | 555 | cout << "Services2NObjMgr::ProjectHProf() Error , No such object " << nom << endl;
|
---|
[333] | 556 | return;
|
---|
| 557 | }
|
---|
| 558 | if (!mImgapp) return;
|
---|
| 559 |
|
---|
| 560 | HProf* hprof = NULL;
|
---|
| 561 | NTuple* nt = NULL;
|
---|
| 562 | AnyDataObj* oh = NULL;
|
---|
| 563 | if (nomprof.length() > 0) oh=mOmg->GetObj(nomprof);
|
---|
| 564 | else nomprof = "/tmp/projprof";
|
---|
| 565 | if( (oh!=NULL) && (typeid(*oh) == typeid(HProf)) ) hprof = (HProf*)oh;
|
---|
| 566 | else {
|
---|
| 567 | char* ntn[3]= {"hxval", "hyval", "hwt"};
|
---|
| 568 | nt = new NTuple(3,ntn); // Creation NTuple
|
---|
| 569 | }
|
---|
| 570 | string expz = "0.";
|
---|
[357] | 571 | ComputeExpressions(obja, expx, expy, expwt, expwt, expcut, loop, nt, NULL, NULL, hprof);
|
---|
[333] | 572 |
|
---|
| 573 | if((!hprof) && (!nt)) return;
|
---|
| 574 | if(!hprof) {
|
---|
| 575 | if (nt->NEntry() < 1) {
|
---|
| 576 | cout << "Services2NObjMgr::ProjectHProf() Warning Zero points satisfy cut !" << endl;
|
---|
| 577 | delete nt;
|
---|
| 578 | return;
|
---|
| 579 | }
|
---|
| 580 | double xmin, xmax;
|
---|
| 581 | nt->GetMinMax(0, xmin, xmax);
|
---|
| 582 | hprof = new HProf(xmin, xmax, 100);
|
---|
| 583 | int k;
|
---|
| 584 | float* xn;
|
---|
| 585 | for(k=0; k<nt->NEntry(); k++) {
|
---|
| 586 | xn = nt->GetVec(k);
|
---|
| 587 | hprof->Add(xn[0], xn[1], xn[2]);
|
---|
| 588 | }
|
---|
| 589 | delete nt;
|
---|
| 590 | mOmg->AddObj(hprof, nomprof);
|
---|
| 591 | }
|
---|
| 592 | hprof->UpdateHisto();
|
---|
| 593 |
|
---|
| 594 | mOmg->DisplayObj(nomprof, dopt);
|
---|
| 595 | return;
|
---|
| 596 | }
|
---|
| 597 |
|
---|
[357] | 598 |
|
---|
[333] | 599 | /* --Methode-- */
|
---|
[357] | 600 | void Services2NObjMgr::FillVect(string& nom, string& expx, string& expv,
|
---|
| 601 | string& expcut, string& nomvec, string dopt, string loop)
|
---|
[333] | 602 | {
|
---|
| 603 | NObjMgrAdapter* obja=NULL;
|
---|
| 604 | obja = mOmg->GetObjAdapter(nom);
|
---|
| 605 | if (obja == NULL) {
|
---|
[357] | 606 | cout << "Services2NObjMgr::FillVect() Error , No such object: " << nom << endl;
|
---|
[333] | 607 | return;
|
---|
| 608 | }
|
---|
| 609 | if (!mImgapp) return;
|
---|
| 610 |
|
---|
[357] | 611 | Vector* v1 = NULL;
|
---|
| 612 | AnyDataObj* ov = NULL;
|
---|
| 613 | ov=mOmg->GetObj(nomvec);
|
---|
| 614 | if (ov != NULL) v1 = dynamic_cast<Vector *>(ov);
|
---|
| 615 | if (v1 == NULL) {
|
---|
| 616 | cout << "Services2NObjMgr::FillVect() Error , No such object or not a vector: " << nomvec << endl;
|
---|
| 617 | return;
|
---|
| 618 | }
|
---|
| 619 |
|
---|
| 620 | char* ntn[2]= {"vi", "vv"};
|
---|
| 621 | NTuple* nt = new NTuple(2,ntn); // Creation NTuple
|
---|
| 622 |
|
---|
| 623 | string expz = "0.";
|
---|
| 624 | ComputeExpressions(obja, expx, expv, expz, expz, expcut, loop, nt);
|
---|
| 625 |
|
---|
| 626 | if (!nt) return;
|
---|
| 627 | if (nt->NEntry() < 1) {
|
---|
| 628 | cout << "Services2NObjMgr::FillVect() Warning Zero points satisfy cut !" << endl;
|
---|
| 629 | delete nt;
|
---|
| 630 | return;
|
---|
| 631 | }
|
---|
| 632 |
|
---|
| 633 | int i,k;
|
---|
| 634 | double* xn;
|
---|
| 635 | for(k=0; k<nt->NEntry(); k++) {
|
---|
| 636 | xn = nt->GetLineD(k);
|
---|
| 637 | i = xn[0]+0.5;
|
---|
| 638 | if ( (i < 0) || i >= v1->NElts() ) continue;
|
---|
| 639 | (*v1)(i) = xn[1];
|
---|
| 640 | }
|
---|
| 641 | delete nt;
|
---|
| 642 |
|
---|
| 643 |
|
---|
| 644 | mOmg->DisplayObj(nomvec, dopt);
|
---|
| 645 | return;
|
---|
| 646 | }
|
---|
| 647 |
|
---|
| 648 | /* --Methode-- */
|
---|
| 649 | void Services2NObjMgr::FillMatx(string& nom, string& expx, string& expy, string& expv,
|
---|
| 650 | string& expcut, string& nommtx, string dopt, string loop)
|
---|
| 651 | {
|
---|
| 652 | NObjMgrAdapter* obja=NULL;
|
---|
| 653 | obja = mOmg->GetObjAdapter(nom);
|
---|
| 654 | if (obja == NULL) {
|
---|
| 655 | cout << "Services2NObjMgr::FillMatx() Error , No such objet " << nom << endl;
|
---|
| 656 | return;
|
---|
| 657 | }
|
---|
| 658 | if (!mImgapp) return;
|
---|
| 659 |
|
---|
| 660 | Matrix* mtx = NULL;
|
---|
| 661 | AnyDataObj* om = NULL;
|
---|
| 662 | om=mOmg->GetObj(nommtx);
|
---|
| 663 | if (om != NULL) mtx = dynamic_cast<Matrix *>(om);
|
---|
| 664 | if (mtx == NULL) {
|
---|
| 665 | cout << "Services2NObjMgr::FillMatx() Error , No such object or not a matrix " << nommtx << endl;
|
---|
| 666 | return;
|
---|
| 667 | }
|
---|
| 668 |
|
---|
| 669 | char* ntn[3]= {"mi", "mj", "mv"};
|
---|
| 670 | NTuple* nt = new NTuple(3,ntn); // Creation NTuple
|
---|
| 671 |
|
---|
| 672 | string expz = "0.";
|
---|
| 673 | ComputeExpressions(obja, expx, expy, expv, expz, expcut, loop, nt);
|
---|
| 674 |
|
---|
| 675 | if (!nt) return;
|
---|
| 676 | if (nt->NEntry() < 1) {
|
---|
| 677 | cout << "Services2NObjMgr::FillMatx() Warning Zero points satisfy cut !" << endl;
|
---|
| 678 | delete nt;
|
---|
| 679 | return;
|
---|
| 680 | }
|
---|
| 681 |
|
---|
| 682 | int ic, jl, k;
|
---|
| 683 | double* xn;
|
---|
| 684 | for(k=0; k<nt->NEntry(); k++) {
|
---|
| 685 | xn = nt->GetLineD(k);
|
---|
| 686 | ic = xn[0]+0.5;
|
---|
| 687 | jl = xn[1]+0.5;
|
---|
| 688 | if ( (ic < 0) || ic >= mtx->NCol() ) continue;
|
---|
| 689 | if ( (jl < 0) || jl >= mtx->NRows() ) continue;
|
---|
| 690 | (*mtx)(jl, ic) = xn[2];
|
---|
| 691 | }
|
---|
| 692 | delete nt;
|
---|
| 693 |
|
---|
| 694 |
|
---|
| 695 | mOmg->DisplayObj(nommtx, dopt);
|
---|
| 696 | return;
|
---|
| 697 |
|
---|
| 698 | }
|
---|
| 699 |
|
---|
| 700 | /* --Methode-- */
|
---|
| 701 | void Services2NObjMgr::ExpressionToVector(string& nom, string& expx, string& expcut,
|
---|
| 702 | string& nomvec, string dopt, string loop)
|
---|
| 703 | {
|
---|
| 704 | NObjMgrAdapter* obja=NULL;
|
---|
| 705 | obja = mOmg->GetObjAdapter(nom);
|
---|
| 706 | if (obja == NULL) {
|
---|
[449] | 707 | cout << "Services2NObjMgr::ExpressionToVector() Error , No such object " << nom << endl;
|
---|
[357] | 708 | return;
|
---|
| 709 | }
|
---|
| 710 | if (!mImgapp) return;
|
---|
| 711 |
|
---|
[333] | 712 | NTuple* nt = NULL;
|
---|
[357] | 713 | if (nomvec.length() < 1) nomvec = "/tmp/expvec";
|
---|
[333] | 714 |
|
---|
| 715 | char* ntn[2]= {"vecval", "vecwt"};
|
---|
| 716 | nt = new NTuple(1,ntn); // Creation NTuple
|
---|
| 717 |
|
---|
| 718 | string expwt = "1.";
|
---|
| 719 | string expz = "0.";
|
---|
[357] | 720 | ComputeExpressions(obja, expx, expz, expz, expwt, expcut, loop, nt, NULL, NULL);
|
---|
[333] | 721 |
|
---|
| 722 | if (!nt) return;
|
---|
| 723 | if (nt->NEntry() < 1) {
|
---|
[357] | 724 | cout << "Services2NObjMgr::ExpressionToVector() Warning Zero points satisfy cut !" << endl;
|
---|
[333] | 725 | delete nt;
|
---|
| 726 | return;
|
---|
| 727 | }
|
---|
| 728 |
|
---|
| 729 | Vector* vec = new Vector(nt->NEntry());
|
---|
| 730 | int k;
|
---|
| 731 | float* xn;
|
---|
| 732 | for(k=0; k<nt->NEntry(); k++) {
|
---|
| 733 | xn = nt->GetVec(k);
|
---|
| 734 | (*vec)(k) = xn[0];
|
---|
| 735 | }
|
---|
| 736 | delete nt;
|
---|
| 737 | mOmg->AddObj(vec, nomvec);
|
---|
| 738 | mOmg->DisplayObj(nomvec, dopt);
|
---|
| 739 | return;
|
---|
| 740 | }
|
---|
| 741 |
|
---|
| 742 | /* --Methode-- */
|
---|
[447] | 743 | void Services2NObjMgr::NtFromASCIIFile(string& nom,string& filename,double def_val)
|
---|
| 744 | // Pour remplir un ntuple "nom" existant a partir du fichier
|
---|
| 745 | // ASCII table "filename". Si il y a plus de variables dans le
|
---|
| 746 | // ntuple que dans le fichier "filename",
|
---|
| 747 | // les sur-numeraires sont mises a "def_val" par defaut.
|
---|
| 748 | {
|
---|
[455] | 749 | AnyDataObj* mobj = mOmg->GetObj(nom);
|
---|
[447] | 750 | if(mobj == NULL)
|
---|
| 751 | {cout<<"NtFromASCIIFile() Error, object "<<nom<<" not existing"<<endl;
|
---|
| 752 | return;}
|
---|
| 753 | if(typeid(*mobj) != typeid(NTuple))
|
---|
| 754 | {cout<<"NtFromASCIIFile() Error, object "<<nom<<" not an NTuple"<<endl;
|
---|
| 755 | return;}
|
---|
| 756 | if (!mImgapp) return;
|
---|
| 757 |
|
---|
| 758 | NTuple* nt = (NTuple*) mobj;
|
---|
[449] | 759 | nt->FillFromASCIIFile(filename, def_val);
|
---|
[447] | 760 | return;
|
---|
| 761 | }
|
---|
| 762 |
|
---|
| 763 | /* --Methode-- */
|
---|
[333] | 764 | void Services2NObjMgr::FillNT(string& nom, string& expx, string& expy, string& expz,
|
---|
[357] | 765 | string& expt, string& expcut, string& nomnt, string loop)
|
---|
[333] | 766 | {
|
---|
| 767 | NObjMgrAdapter* obja=NULL;
|
---|
| 768 | obja = mOmg->GetObjAdapter(nom);
|
---|
| 769 | if (obja == NULL) {
|
---|
[449] | 770 | cout << "Services2NObjMgr::FillNT() Error , No such object " << nom << endl;
|
---|
[333] | 771 | return;
|
---|
| 772 | }
|
---|
| 773 | if (!mImgapp) return;
|
---|
| 774 |
|
---|
| 775 | bool fgnnt = false;
|
---|
| 776 | NTuple* nt = NULL;
|
---|
| 777 | AnyDataObj* oh = NULL;
|
---|
| 778 | if (nomnt.length() > 0) oh=mOmg->GetObj(nomnt);
|
---|
| 779 | else nomnt = "/tmp/fillnt";
|
---|
| 780 | if ( (oh != NULL) && (typeid(*oh) == typeid(NTuple)) ) {
|
---|
| 781 | nt = (NTuple*)oh;
|
---|
| 782 | if (nt->NVar() > 10) {
|
---|
[449] | 783 | cout << "Services2NObjMgr::FillNT() Warning , Max 10 var in NTuple -> new NTuple" << endl;
|
---|
[333] | 784 | nt = NULL;
|
---|
| 785 | }
|
---|
| 786 | }
|
---|
| 787 | if (nt == NULL) {
|
---|
| 788 | char* ntn[4]= {"x", "y","z","t"};
|
---|
| 789 | nt = new NTuple(4,ntn); // Creation NTuple
|
---|
| 790 | fgnnt = true;
|
---|
| 791 | }
|
---|
| 792 |
|
---|
[357] | 793 | ComputeExpressions(obja, expx, expy, expz, expt, expcut, loop, nt, NULL, NULL);
|
---|
[333] | 794 |
|
---|
| 795 | if (fgnnt) mOmg->AddObj(nt, nomnt);
|
---|
| 796 | return;
|
---|
| 797 |
|
---|
| 798 | }
|
---|
| 799 |
|
---|
| 800 | /* --Methode-- */
|
---|
| 801 | void Services2NObjMgr::FillNTFrCFile(string & nom, string const & fname,
|
---|
[357] | 802 | string const & funcname, string & nomnt, string loop)
|
---|
[333] | 803 | {
|
---|
| 804 | if (!mImgapp) return;
|
---|
| 805 |
|
---|
| 806 | NObjMgrAdapter* obja=NULL;
|
---|
| 807 | obja = mOmg->GetObjAdapter(nom);
|
---|
| 808 | if (obja == NULL) {
|
---|
| 809 | cout << "Services2NObjMgr::FillNTFrCFile( " << nom << "...) No such object" <<endl;
|
---|
| 810 | return;
|
---|
| 811 | }
|
---|
[344] | 812 | bool adel = true;
|
---|
| 813 | NTupleInterface* objnt = obja->GetNTupleInterface(adel);
|
---|
[333] | 814 | if (objnt == NULL) {
|
---|
[449] | 815 | cout << "Services2NObjMgr::FillNTFrCFile( " << nom << "...) Not an NTupleInterface !" <<endl;
|
---|
[333] | 816 | return;
|
---|
| 817 | }
|
---|
| 818 |
|
---|
| 819 | NTLoopExprFunc f = (NTLoopExprFunc)LinkFunctionFromFile(fname, funcname);
|
---|
| 820 | if (!f) {
|
---|
| 821 | cerr << "Services2NObjMgr::FillNTFrCFile Error Creation NTLoopExprFunc" << endl;
|
---|
[344] | 822 | if (adel) delete objnt; // Delete de l'objet NTupleInterface si necessaire
|
---|
[333] | 823 | return;
|
---|
| 824 | }
|
---|
| 825 |
|
---|
| 826 | bool fgnnt = false;
|
---|
| 827 | NTuple* nt = NULL;
|
---|
| 828 | if (nomnt.length() > 0) {
|
---|
| 829 | AnyDataObj* oh = NULL;
|
---|
| 830 | oh=mOmg->GetObj(nomnt);
|
---|
| 831 | if ( (oh != NULL) && (typeid(*oh) == typeid(NTuple)) ) {
|
---|
| 832 | nt = (NTuple*)oh;
|
---|
| 833 | if (nt->NVar() > 10) {
|
---|
[449] | 834 | cout << "Services2NObjMgr::FillNTFrCFile() Warning , Max 10 var in NTuple -> new NTuple" << endl;
|
---|
[333] | 835 | nt = NULL;
|
---|
| 836 | }
|
---|
| 837 | }
|
---|
| 838 | if (nt == NULL) {
|
---|
| 839 | char* ntn[4]= {"x", "y","z","t"};
|
---|
| 840 | nt = new NTuple(4,ntn); // Creation NTuple
|
---|
| 841 | fgnnt = true;
|
---|
| 842 | }
|
---|
| 843 | }
|
---|
| 844 |
|
---|
| 845 | double xnt[10];
|
---|
| 846 | float fxnt[10];
|
---|
| 847 |
|
---|
| 848 | int i,k;
|
---|
| 849 | for(i=0; i<10; i++) fxnt[i] = xnt[i] = 0.;
|
---|
| 850 |
|
---|
| 851 |
|
---|
| 852 | // $CHECK$ A virer des que possible - Pb blocage application quand trop d'impression
|
---|
| 853 | // redirige - On redirige la sortie sur le terminal
|
---|
| 854 | bool red = mImgapp->HasRedirectedStdOutErr();
|
---|
| 855 | mImgapp->RedirectStdOutErr(false);
|
---|
| 856 |
|
---|
[357] | 857 | int k1,k2,dk;
|
---|
| 858 | k1 = 0; k2 = objnt->NbLines(); dk = 1;
|
---|
| 859 | DecodeLoopParameters(loop, k1, k2, dk);
|
---|
| 860 | if (k1 < 0) k1 = 0;
|
---|
| 861 | if (k2 < 0) k2 = objnt->NbLines();
|
---|
| 862 | if (k2 > objnt->NbLines()) k2 = objnt->NbLines();
|
---|
| 863 | if (dk <= 0) dk = 1;
|
---|
| 864 |
|
---|
[500] | 865 | try {
|
---|
[333] | 866 | double* xn;
|
---|
[357] | 867 | int kmax = k2;
|
---|
| 868 | for(k=k1; k<kmax; k+=dk) {
|
---|
[333] | 869 | xn = objnt->GetLineD(k);
|
---|
| 870 | if (f(xn, xnt, xnt+1, xnt+2, xnt+3, k, kmax) != 0) {
|
---|
| 871 | if (nt) {
|
---|
| 872 | for(i=0; i<4; i++) fxnt[i] = xnt[i];
|
---|
| 873 | nt->Fill(fxnt);
|
---|
| 874 | }
|
---|
| 875 | }
|
---|
| 876 | }
|
---|
| 877 | }
|
---|
[500] | 878 | #ifdef SANS_EVOLPLANCK
|
---|
[333] | 879 | CATCH(merr) {
|
---|
| 880 | fflush(stdout);
|
---|
| 881 | cout << endl;
|
---|
| 882 | cerr << endl;
|
---|
| 883 | string es = PeidaExc(merr);
|
---|
| 884 | cerr << "Services2NObjMgr::FillNTFrCFile() Exception :" << merr << es;
|
---|
| 885 | } ENDTRY;
|
---|
[500] | 886 | #else
|
---|
| 887 | catch ( PException exc ) {
|
---|
| 888 | fflush(stdout);
|
---|
| 889 | cout << endl;
|
---|
| 890 | cerr << endl;
|
---|
| 891 | cerr << "Services2NObjMgr::FillNTFrCFile() Exception :" << exc.Msg() << endl;
|
---|
| 892 | }
|
---|
| 893 | #endif
|
---|
[344] | 894 |
|
---|
| 895 | if (adel) delete objnt; // Delete de l'objet NTupleInterface si necessaire
|
---|
[333] | 896 | CloseDLL();
|
---|
| 897 |
|
---|
| 898 | // $CHECK$ A virer des que possible On redirige la sortie sur la fenetre PIConsole
|
---|
| 899 | mImgapp->RedirectStdOutErr(red);
|
---|
| 900 |
|
---|
| 901 | if (fgnnt) mOmg->AddObj(nt, nomnt);
|
---|
| 902 | return;
|
---|
| 903 | }
|
---|
| 904 |
|
---|
| 905 | /* --Methode-- */
|
---|
| 906 | void Services2NObjMgr::PrepareNTExpressionCFile(string & nom, string const & fname,
|
---|
| 907 | string const & funcname)
|
---|
| 908 | {
|
---|
| 909 | NObjMgrAdapter* obja=NULL;
|
---|
| 910 | obja = mOmg->GetObjAdapter(nom);
|
---|
| 911 | if (obja == NULL) {
|
---|
| 912 | cout << "Services2NObjMgr::PrepareNTExpressionCFile( " << nom << "...) No such object" <<endl;
|
---|
| 913 | return;
|
---|
| 914 | }
|
---|
[344] | 915 | bool adel = true;
|
---|
| 916 | NTupleInterface* objnt = obja->GetNTupleInterface(adel);
|
---|
[333] | 917 | if (objnt == NULL) {
|
---|
| 918 | cout << "Services2NObjMgr::PrepareNTExpressionCFile( " << nom
|
---|
| 919 | << "...) No NTupleInterface !" <<endl;
|
---|
| 920 | return;
|
---|
| 921 | }
|
---|
| 922 | string vardec = objnt->VarList_C("_xnti_");
|
---|
| 923 |
|
---|
| 924 | FILE *fip;
|
---|
| 925 | if ((fip = fopen(fname.c_str(), "w")) == NULL) {
|
---|
| 926 | cout << "Services2NObjMgr::PrepareNTExpressionCFile()_Error: fopen " << fname << endl;
|
---|
[344] | 927 | if (adel) delete objnt; // Delete de l'objet NTupleInterface si necessaire
|
---|
[333] | 928 | return;
|
---|
| 929 | }
|
---|
[344] | 930 |
|
---|
[333] | 931 | // constitution du fichier des decalarations des variables de l'interface NTuple
|
---|
| 932 | fputs("#include <stdlib.h> \n", fip);
|
---|
| 933 | fputs("#include <stdio.h> \n", fip);
|
---|
| 934 | fputs("#include <math.h> \n\n", fip);
|
---|
[344] | 935 |
|
---|
| 936 | fputs("/* ------ Some random number generators --------- */ \n", fip);
|
---|
| 937 | fputs("#define frand01() ( (float) drand48() ) \n", fip);
|
---|
| 938 | fputs("#define drand01() drand48() \n", fip);
|
---|
| 939 | fputs("#define rand01() drand48() \n", fip);
|
---|
| 940 | fputs("#define frandpm1() ( 2. * frand01() - 1.) \n", fip);
|
---|
| 941 | fputs("#define drandpm1() ( 2. * drand01() - 1.) \n", fip);
|
---|
| 942 | fputs("#define randpm1() ( 2. * drand01() - 1.) \n", fip);
|
---|
| 943 | fputs("double NorRand(void) \n", fip);
|
---|
| 944 | fputs(" { \n double x,A,B; \n LAB10: \n A = drand01(); \n", fip);
|
---|
| 945 | fputs(" if ( A == 0. ) goto LAB10; \n B = drand01(); \n", fip);
|
---|
[345] | 946 | fputs(" x = sqrt(-2.*log(A))*cos(2.*M_PI*B); \n", fip);
|
---|
[344] | 947 | fputs(" return(x); \n } \n", fip);
|
---|
| 948 | fputs("#define GauRand() NorRand() \n", fip);
|
---|
| 949 | fputs("#define gaurand() NorRand() \n\n", fip);
|
---|
| 950 |
|
---|
[333] | 951 | fputs("/* NTupleInterface Variable declaration - Generated by piapp \n", fip);
|
---|
| 952 | fputs(" -- Services2NObjMgr::PrepareNTExpressionCFile() -- */ \n\n", fip);
|
---|
| 953 | fprintf(fip,"int %s(double* _xnti_, double* _rx_, double* _ry_, double* _rz_, \n",
|
---|
| 954 | funcname.c_str());
|
---|
| 955 | fprintf(fip," double* _rt_, int _n_, int _nmax_) \n");
|
---|
| 956 | fprintf(fip, "{ \n %s \n", vardec.c_str());
|
---|
| 957 | fputs(" if (!1) { /* Cut Expression failed */ \n", fip);
|
---|
| 958 | fputs(" *_rx_ = *_ry_ = *_rz_ = *_rt_ = 0.; return(0);", fip);
|
---|
| 959 | fputs(" } \n /* Cut expression satisfied */ \n", fip);
|
---|
| 960 | fputs(" *_rx_ = 1.; \n *_ry_ = 1.; \n *_rz_ = 1.; \n *_rt_ = 1.; \n", fip);
|
---|
| 961 | fputs(" return(1); \n} \n", fip);
|
---|
| 962 |
|
---|
| 963 | fclose(fip);
|
---|
[344] | 964 |
|
---|
| 965 | if (adel) delete objnt; // Delete de l'objet NTupleInterface si necessaire
|
---|
[333] | 966 | return;
|
---|
| 967 | }
|
---|
| 968 |
|
---|
| 969 | /* --Methode-- cmv 13/10/98 */
|
---|
| 970 | void Services2NObjMgr::FillGFD(string& nom, string& expx, string& expy, string& expz,
|
---|
[357] | 971 | string& experr, string& expcut, string& nomgfd, string loop)
|
---|
[333] | 972 | // Pour remplir un ``GeneralFitData'' a partir de divers objets:
|
---|
| 973 | //| nom = nom de l'objet a transcrire selon 1D: Z=f(X) ou 2D: Z=f(X,Y) .
|
---|
| 974 | //| Vector,Matrix,Histo,HProf,Histo2D,Image<T>,StarList,NTuple,GeneralFitData
|
---|
| 975 | //| expx = expression X du GeneralFitData (1er abscisse)
|
---|
| 976 | //| expy = expression Y du GeneralFitData (2sd abscisse si non "", Z=f(X,Y))
|
---|
| 977 | //| expz = expression Z du GeneralFitData (valeur de l'ordonnee)
|
---|
| 978 | //| experr = expression de l'erreur sur l'ordonnee Z
|
---|
| 979 | //| expcut = expression du test de selection
|
---|
| 980 | //| nomgfd = nom du GeneralFitData engendre (optionnel)
|
---|
| 981 | {
|
---|
| 982 | NObjMgrAdapter* obja=NULL;
|
---|
| 983 | obja = mOmg->GetObjAdapter(nom);
|
---|
| 984 | if (obja == NULL) {
|
---|
[449] | 985 | cout << "Services2NObjMgr::FillGFD() Error , No such object "<<nom<<endl;
|
---|
[333] | 986 | return;
|
---|
| 987 | }
|
---|
| 988 | if(!mImgapp) return;
|
---|
| 989 |
|
---|
| 990 | // 2D ou 3D?
|
---|
| 991 | int nvar = 2;
|
---|
| 992 | if(expy.length()<=0) {nvar = 1; expy = "0.";}
|
---|
| 993 |
|
---|
| 994 | // Creation NTuple Buffer
|
---|
| 995 | char* ntn[4]= {"x","y","f","e"};
|
---|
| 996 | NTuple*nt = new NTuple(4,ntn);
|
---|
| 997 |
|
---|
| 998 | // Remplissage NTuple buffer
|
---|
[357] | 999 | ComputeExpressions(obja, expx, expy, expz, experr, expcut, loop, nt, NULL, NULL);
|
---|
[333] | 1000 | if(nt->NEntry() < 1)
|
---|
| 1001 | {cout<<"Services2NObjMgr::FillGFD() Warning Zero points satisfy cut !"<<endl;
|
---|
| 1002 | delete nt; return;}
|
---|
| 1003 |
|
---|
| 1004 | //Remplissage de la structure GeneraFitData
|
---|
| 1005 | if (nt->NEntry() <= 0) {
|
---|
| 1006 | cout<<"Services2NObjMgr::FillGFD() Warning - NData= " << nt->NEntry() << endl;
|
---|
| 1007 | delete nt;
|
---|
| 1008 | return;
|
---|
| 1009 | }
|
---|
| 1010 |
|
---|
| 1011 | GeneralFitData* gfd = new GeneralFitData(nvar,nt->NEntry(),0);
|
---|
| 1012 | int k;
|
---|
| 1013 | float* xn;
|
---|
| 1014 | for(k=0; k<nt->NEntry(); k++) {
|
---|
| 1015 | xn = nt->GetVec(k);
|
---|
| 1016 | gfd->AddData(xn,xn[2],xn[3]);
|
---|
| 1017 | }
|
---|
| 1018 |
|
---|
| 1019 | // Menage et table d'objets
|
---|
| 1020 | delete nt;
|
---|
| 1021 | mOmg->AddObj(gfd, nomgfd);
|
---|
| 1022 | return;
|
---|
| 1023 | }
|
---|
| 1024 |
|
---|
| 1025 |
|
---|
| 1026 | /* --Methode-- */
|
---|
| 1027 | void Services2NObjMgr::ComputeExpressions(NObjMgrAdapter* obja, string& expx,
|
---|
[357] | 1028 | string& expy, string& expz, string& expt, string& expcut, string& loop,
|
---|
[333] | 1029 | NTuple* nt, Histo* h1, Histo2D* h2, HProf* hp)
|
---|
| 1030 | {
|
---|
| 1031 | if (obja == NULL) return;
|
---|
[344] | 1032 | bool adel = true;
|
---|
| 1033 | NTupleInterface* objnt = obja->GetNTupleInterface(adel);
|
---|
[333] | 1034 | if (objnt == NULL) return;
|
---|
| 1035 | string vardec = objnt->VarList_C("_zz6qi_");
|
---|
| 1036 |
|
---|
| 1037 | PlotExprFunc f = LinkExprFunc(vardec, expx, expy, expz, expt, expcut);
|
---|
| 1038 | if (!f) {
|
---|
| 1039 | cerr << "Services2NObjMgr::::ComputeExpressions() Error Creation PlotExprFunc " << endl;
|
---|
[344] | 1040 | if (adel) delete objnt; // Delete de l'objet NTupleInterface si necessaire
|
---|
[333] | 1041 | return;
|
---|
| 1042 | }
|
---|
| 1043 |
|
---|
| 1044 | double xnt[10];
|
---|
| 1045 | float fxnt[10];
|
---|
| 1046 |
|
---|
| 1047 | int i,k;
|
---|
| 1048 | for(i=0; i<10; i++) xnt[i] = 0.;
|
---|
[357] | 1049 | int k1,k2,dk;
|
---|
| 1050 | k1 = 0; k2 = objnt->NbLines(); dk = 1;
|
---|
| 1051 | DecodeLoopParameters(loop, k1, k2, dk);
|
---|
| 1052 | if (k1 < 0) k1 = 0;
|
---|
| 1053 | if (k2 < 0) k2 = objnt->NbLines();
|
---|
| 1054 | if (k2 > objnt->NbLines()) k2 = objnt->NbLines();
|
---|
| 1055 | if (dk <= 0) dk = 1;
|
---|
[500] | 1056 |
|
---|
| 1057 | try {
|
---|
[333] | 1058 | double* xn;
|
---|
[357] | 1059 | for(k=k1; k<k2; k += dk) {
|
---|
[333] | 1060 | xn = objnt->GetLineD(k);
|
---|
| 1061 | if (f(xn, xnt, xnt+1, xnt+2, xnt+3) != 0) {
|
---|
| 1062 | if (nt) {
|
---|
| 1063 | for(i=0; i<4; i++) fxnt[i] = xnt[i];
|
---|
| 1064 | nt->Fill(fxnt);
|
---|
| 1065 | }
|
---|
| 1066 | if (h1) h1->Add(xnt[0], xnt[3]);
|
---|
| 1067 | if (h2) h2->Add(xnt[0], xnt[1], xnt[3]);
|
---|
| 1068 | if (hp) hp->Add(xnt[0], xnt[1], xnt[3]);
|
---|
| 1069 | }
|
---|
| 1070 | }
|
---|
| 1071 | }
|
---|
[500] | 1072 | #ifdef SANS_EVOLPLANCK
|
---|
[333] | 1073 | CATCH(merr) {
|
---|
| 1074 | fflush(stdout);
|
---|
| 1075 | cout << endl;
|
---|
| 1076 | cerr << endl;
|
---|
| 1077 | string es = PeidaExc(merr);
|
---|
| 1078 | cerr << "Services2NObjMgr::ComputeExpressions() Exception :" << merr << es;
|
---|
| 1079 | } ENDTRY;
|
---|
[500] | 1080 | #else
|
---|
| 1081 | catch ( PException exc ) {
|
---|
| 1082 | fflush(stdout);
|
---|
| 1083 | cout << endl;
|
---|
| 1084 | cerr << endl;
|
---|
| 1085 | cerr << "Services2NObjMgr::ComputeExpressions() Exception :" << exc.Msg() << endl;
|
---|
| 1086 | }
|
---|
| 1087 | #endif
|
---|
[333] | 1088 |
|
---|
[344] | 1089 | if (adel) delete objnt; // Delete de l'objet NTupleInterface si necessaire
|
---|
[333] | 1090 | // Fermeture du fichier .so
|
---|
| 1091 | CloseDLL();
|
---|
| 1092 | return;
|
---|
| 1093 | }
|
---|
| 1094 |
|
---|
| 1095 |
|
---|
| 1096 | /* --Methode-- */
|
---|
| 1097 | PlotExprFunc Services2NObjMgr::LinkExprFunc(string& vardec, string& expx, string& expy,
|
---|
| 1098 | string& expz, string& expt, string& cut)
|
---|
| 1099 | {
|
---|
| 1100 | FILE *fip;
|
---|
| 1101 | string fname = TmpDir + "expf_pia_dl.c";
|
---|
| 1102 | string cmd;
|
---|
| 1103 | int rc;
|
---|
| 1104 |
|
---|
| 1105 | cmd = "rm -f " + fname;
|
---|
| 1106 | rc = system(cmd.c_str());
|
---|
| 1107 | //DBG printf("LinkExprFunc_Do> %s (Rc=%d)\n", cmd.c_str(), rc);
|
---|
| 1108 |
|
---|
| 1109 | if ((fip = fopen(fname.c_str(), "w")) == NULL) {
|
---|
| 1110 | string sn = fname;
|
---|
[449] | 1111 | cout << "Services2NObjMgr/LinkExprFunc_Error: fopen( " << sn << endl;
|
---|
[333] | 1112 | return(NULL);
|
---|
| 1113 | }
|
---|
| 1114 |
|
---|
| 1115 | // constitution du fichier a compiler
|
---|
| 1116 | fputs("#include <stdlib.h> \n", fip);
|
---|
| 1117 | fputs("#include <math.h> \n", fip);
|
---|
[344] | 1118 |
|
---|
| 1119 | fputs("/* ------ Some random number generators --------- */ \n", fip);
|
---|
| 1120 | fputs("#define frand01() ( (float) drand48() ) \n", fip);
|
---|
| 1121 | fputs("#define drand01() drand48() \n", fip);
|
---|
| 1122 | fputs("#define rand01() drand48() \n", fip);
|
---|
| 1123 | fputs("#define frandpm1() ( 2. * frand01() - 1.) \n", fip);
|
---|
| 1124 | fputs("#define drandpm1() ( 2. * drand01() - 1.) \n", fip);
|
---|
| 1125 | fputs("#define randpm1() ( 2. * drand01() - 1.) \n", fip);
|
---|
| 1126 | fputs("double NorRand(void) \n", fip);
|
---|
| 1127 | fputs(" { \n double x,A,B; \n LAB10: \n A = drand01(); \n", fip);
|
---|
| 1128 | fputs(" if ( A == 0. ) goto LAB10; \n B = drand01(); \n", fip);
|
---|
[345] | 1129 | fputs(" x = sqrt(-2.*log(A))*cos(2.*M_PI*B); \n", fip);
|
---|
[344] | 1130 | fputs(" return(x); \n } \n", fip);
|
---|
| 1131 | fputs("#define GauRand() NorRand() \n", fip);
|
---|
| 1132 | fputs("#define gaurand() NorRand() \n\n", fip);
|
---|
| 1133 |
|
---|
[333] | 1134 | fputs("int expf_pia_dl_func(double* _zz6qi_, double* _rx_6q_, double* _ry_6q_, double* _rz_6q_, double* _rt_6q_) \n{\n", fip);
|
---|
| 1135 | fprintf(fip,"%s \n", vardec.c_str());
|
---|
| 1136 | fprintf(fip, "if (!(%s)) { *_rx_6q_ = *_ry_6q_ = *_rz_6q_ = *_rt_6q_ = 0.; return(0); } \n", cut.c_str());
|
---|
| 1137 | fprintf(fip, "*_rx_6q_ = %s ; \n", expx.c_str());
|
---|
| 1138 | fprintf(fip, "*_ry_6q_ = %s ; \n", expy.c_str());
|
---|
| 1139 | fprintf(fip, "*_rz_6q_ = %s ; \n", expz.c_str());
|
---|
| 1140 | fprintf(fip, "*_rt_6q_ = %s ; \n", expt.c_str());
|
---|
| 1141 | fputs("return(1); \n} \n", fip);
|
---|
| 1142 | fclose(fip);
|
---|
| 1143 | string func = "expf_pia_dl_func";
|
---|
| 1144 | return((PlotExprFunc)LinkFunctionFromFile(fname, func));
|
---|
| 1145 | }
|
---|
| 1146 |
|
---|
| 1147 |
|
---|
| 1148 | /* --Methode-- */
|
---|
| 1149 | DlFunction Services2NObjMgr::LinkFunctionFromFile(string const & fname, string const & funcname)
|
---|
| 1150 | {
|
---|
| 1151 | // Le link dynamique
|
---|
| 1152 | CloseDLL();
|
---|
| 1153 | dynlink = PDynLinkMgr::BuildFromCFile(fname);
|
---|
| 1154 | if (dynlink == NULL) {
|
---|
| 1155 | cerr << "Services2NObjMgr/LinkFunctionFromFile_Erreur: Erreur creation/Ouverture SO " << endl;
|
---|
| 1156 | return(NULL);
|
---|
| 1157 | }
|
---|
| 1158 |
|
---|
| 1159 | DlFunction retfunc = dynlink->GetFunction(funcname);
|
---|
| 1160 | if (retfunc == NULL) {
|
---|
| 1161 | string sn = funcname;
|
---|
| 1162 | cerr << "Services2NObjMgr/LinkExprFunc_Erreur: Erreur linking " << sn << endl;
|
---|
| 1163 | CloseDLL();
|
---|
| 1164 | return(NULL);
|
---|
| 1165 | }
|
---|
| 1166 | else return(retfunc);
|
---|
| 1167 | }
|
---|
| 1168 |
|
---|
| 1169 | /* --Methode-- */
|
---|
| 1170 | void Services2NObjMgr::CloseDLL()
|
---|
| 1171 | {
|
---|
| 1172 | if (dynlink) delete dynlink; dynlink = NULL;
|
---|
| 1173 | }
|
---|
| 1174 |
|
---|
[357] | 1175 | // Fonction static
|
---|
| 1176 | /* --Methode-- */
|
---|
| 1177 | void Services2NObjMgr::DecodeLoopParameters(string& loop, int& i1, int& i2, int& di)
|
---|
| 1178 | {
|
---|
| 1179 | // Decode des paramatres de boucle for(int i=i1; i<i2; i+=di) specifies
|
---|
| 1180 | // sous forme i1[:i2[:di]]
|
---|
| 1181 | // cout << "LoopParam() " << loop << " I1=" << i1 << " I2=" << i2 << " DI=" << di;
|
---|
| 1182 | size_t l = loop.length();
|
---|
| 1183 | if (l < 1) return;
|
---|
| 1184 | size_t p = loop.find(':');
|
---|
| 1185 | if (p >= l) { i1 = atoi(loop.c_str()); return; }
|
---|
| 1186 | i1 = atoi(loop.substr(0, p).c_str());
|
---|
| 1187 | string aa = loop.substr(p+1);
|
---|
| 1188 | p = aa.find(':');
|
---|
| 1189 | if (p < aa.length() ) {
|
---|
| 1190 | i2 = atoi(aa.substr(0,p).c_str());
|
---|
| 1191 | di = atoi(aa.substr(p+1).c_str());
|
---|
| 1192 | }
|
---|
| 1193 | else i2 = atoi(aa.c_str());
|
---|
| 1194 | // cout << "-> I1= " << i1 << " I2= " << i2 << " DI= " << di << endl;
|
---|
| 1195 | return;
|
---|
| 1196 | }
|
---|
[333] | 1197 |
|
---|
| 1198 | /* --Methode-- */
|
---|
[165] | 1199 | string Services2NObjMgr::FileName2Name(string const & fn)
|
---|
| 1200 | {
|
---|
| 1201 |
|
---|
| 1202 | char fsep[2] = {FILESEP, '\0'};
|
---|
| 1203 | char tsep[2] = {'.', '\0'};
|
---|
| 1204 | size_t p = fn.find_last_of(fsep);
|
---|
[194] | 1205 | size_t l = fn.length();
|
---|
| 1206 | if (p >= l) p = 0;
|
---|
| 1207 | else p++;
|
---|
| 1208 | size_t q = fn.find_first_of(tsep,p);
|
---|
| 1209 | if (q < p) q = l;
|
---|
[165] | 1210 | return(fn.substr(p,q-p));
|
---|
| 1211 | }
|
---|
| 1212 |
|
---|
| 1213 |
|
---|
[546] | 1214 | // Variable pour stocker l'option de stat des drawers
|
---|
| 1215 | static bool stats_option = true;
|
---|
| 1216 | /* --Methode-- */
|
---|
| 1217 | void Services2NObjMgr::SetDefaultStatsOption(bool opt)
|
---|
| 1218 | {
|
---|
| 1219 | stats_option = opt;
|
---|
| 1220 | }
|
---|
| 1221 |
|
---|
[165] | 1222 | typedef vector<string> GraTok;
|
---|
| 1223 |
|
---|
| 1224 | /* --Methode-- */
|
---|
[546] | 1225 | bool Services2NObjMgr::GetStatsOption(string& gratt)
|
---|
| 1226 | {
|
---|
| 1227 | int ropt = Disp_Next;
|
---|
| 1228 | for(int i=0; i<gratt.length(); i++) gratt[i] = tolower(gratt[i]);
|
---|
| 1229 | // On separe en mots separes par des virgules
|
---|
| 1230 | gratt = ","+gratt;
|
---|
| 1231 | size_t p = 0;
|
---|
| 1232 | size_t q = 0;
|
---|
| 1233 | size_t l = gratt.length();
|
---|
| 1234 | string token;
|
---|
| 1235 |
|
---|
| 1236 | GraTok grt;
|
---|
| 1237 |
|
---|
| 1238 | while (q < l) {
|
---|
| 1239 | p = gratt.find_first_not_of(" ,",q+1); // au debut d'un token
|
---|
| 1240 | if (p>=l) break;
|
---|
| 1241 | q = gratt.find_first_of(" ,",p); // la fin du token;
|
---|
| 1242 | token = gratt.substr(p,q-p);
|
---|
| 1243 | grt.push_back(token);
|
---|
| 1244 | }
|
---|
| 1245 | int k;
|
---|
| 1246 | bool fgsame = false;
|
---|
| 1247 | int option = 0;
|
---|
| 1248 | for(k=0; k<grt.size(); k++) {
|
---|
| 1249 | if ( (grt[k] == "same") || (grt[k] == "s") ) option = 1;
|
---|
| 1250 | else if ( (grt[k] == "stat") || (grt[k] == "stats") ) option = 2;
|
---|
| 1251 | else if ( (grt[k] == "nostat") || (grt[k] == "nostats") ) option = 3;
|
---|
| 1252 | }
|
---|
| 1253 |
|
---|
| 1254 | if (option == 0) return(stats_option);
|
---|
| 1255 | else if ( (option == 1) || (option == 3) ) return(false);
|
---|
| 1256 | else return(true);
|
---|
| 1257 | }
|
---|
| 1258 |
|
---|
| 1259 | /* --Methode-- */
|
---|
[165] | 1260 | int Services2NObjMgr::DecodeDispOption(string& gratt, bool& fgsrgr)
|
---|
| 1261 | {
|
---|
| 1262 | int ropt = Disp_Next;
|
---|
| 1263 | if (!mImgapp) return(ropt);
|
---|
| 1264 |
|
---|
| 1265 | for(int i=0; i<gratt.length(); i++) gratt[i] = tolower(gratt[i]);
|
---|
| 1266 |
|
---|
| 1267 | if (fgsrgr) mImgapp->SaveGraphicAtt();
|
---|
| 1268 |
|
---|
[326] | 1269 | if ( (gratt == "def") || (gratt == "default") ) { // Remise aux valeurs par defaut = non defini
|
---|
[165] | 1270 | mImgapp->SetColAtt();
|
---|
| 1271 | mImgapp->SetLineAtt();
|
---|
| 1272 | mImgapp->SetFontAtt();
|
---|
| 1273 | mImgapp->SetMarkerAtt();
|
---|
| 1274 | mImgapp->SetColMapId();
|
---|
| 1275 | mImgapp->SetZoomAtt();
|
---|
[331] | 1276 | mImgapp->SetAxesAtt();
|
---|
| 1277 | mImgapp->SetXYLimits();
|
---|
| 1278 | mImgapp->UseXYLimits();
|
---|
[506] | 1279 | mImgapp->SetXLogScale();
|
---|
| 1280 | mImgapp->SetYLogScale();
|
---|
[546] | 1281 | stats_option = true;
|
---|
[165] | 1282 | return(ropt);
|
---|
| 1283 | }
|
---|
| 1284 |
|
---|
| 1285 | // On separe en mots separes par des virgules
|
---|
| 1286 | gratt = ","+gratt;
|
---|
| 1287 | size_t p = 0;
|
---|
| 1288 | size_t q = 0;
|
---|
| 1289 | size_t l = gratt.length();
|
---|
| 1290 | string token;
|
---|
| 1291 |
|
---|
| 1292 | GraTok grt;
|
---|
| 1293 |
|
---|
| 1294 | while (q < l) {
|
---|
| 1295 | p = gratt.find_first_not_of(" ,",q+1); // au debut d'un token
|
---|
| 1296 | if (p>=l) break;
|
---|
| 1297 | q = gratt.find_first_of(" ,",p); // la fin du token;
|
---|
| 1298 | token = gratt.substr(p,q-p);
|
---|
| 1299 | grt.push_back(token);
|
---|
| 1300 | }
|
---|
| 1301 |
|
---|
| 1302 |
|
---|
| 1303 | static GrAttNames::iterator it;
|
---|
| 1304 |
|
---|
| 1305 | int k;
|
---|
| 1306 | bool fgcont = true;
|
---|
| 1307 | fgsrgr = false;
|
---|
| 1308 |
|
---|
| 1309 | for(k=0; k<grt.size(); k++) {
|
---|
| 1310 | // cout << "--DBG--SetGraphicAttributes() " << grt[k] << endl;
|
---|
| 1311 |
|
---|
| 1312 | // Decodage option affichage (win, next, etc
|
---|
| 1313 | fgcont = true;
|
---|
| 1314 | if ( (grt[k] == "win") || (grt[k] == "w") ) ropt = Disp_Win;
|
---|
| 1315 | else if ( (grt[k] == "same") || (grt[k] == "s") ) ropt = Disp_Same;
|
---|
[548] | 1316 | else if ( (grt[k] == "inset") || (grt[k] == "ins") ) ropt = Disp_Inset;
|
---|
[165] | 1317 | else if ( (grt[k] == "stack") || (grt[k] == "st") ) ropt = Disp_Stack;
|
---|
| 1318 | else fgcont = false;
|
---|
| 1319 | if (fgcont) continue;
|
---|
[331] | 1320 |
|
---|
| 1321 | // Utilisation limites X-Y
|
---|
[506] | 1322 | if ( grt[k] == "xylimits" ) { mImgapp->UseXYLimits(true); fgsrgr = true; continue; }
|
---|
| 1323 | // Echelle logarithmique d'axe
|
---|
| 1324 | if ( grt[k] == "logx" ) { mImgapp->SetXLogScale(true); fgsrgr = true; continue; }
|
---|
| 1325 | if ( grt[k] == "linx" ) { mImgapp->SetXLogScale(false); fgsrgr = true; continue; }
|
---|
| 1326 | if ( grt[k] == "logy" ) { mImgapp->SetYLogScale(true); fgsrgr = true; continue; }
|
---|
| 1327 | if ( grt[k] == "liny" ) { mImgapp->SetYLogScale(false); fgsrgr = true; continue; }
|
---|
| 1328 |
|
---|
[165] | 1329 | // Si c'est une couleur
|
---|
| 1330 | it = GrAcolors.find(grt[k]);
|
---|
| 1331 | if (it != GrAcolors.end()) { mImgapp->SetColAtt((PIColors)((*it).second.a1)); fgsrgr = true; continue; }
|
---|
| 1332 | // Si c'est un attribut de lignes
|
---|
| 1333 | it = GrAlines.find(grt[k]);
|
---|
| 1334 | if (it != GrAlines.end()) { mImgapp->SetLineAtt((PILineAtt)((*it).second.a1)); fgsrgr = true; continue; }
|
---|
| 1335 | // Si c'est un attribut de fontes
|
---|
| 1336 | it = GrAfonts.find(grt[k]);
|
---|
| 1337 | if (it != GrAfonts.end()) { mImgapp->SetFontAtt((PIFontSize)((*it).second.a2), (PIFontAtt)((*it).second.a1) );
|
---|
| 1338 | fgsrgr = true; continue; }
|
---|
| 1339 | // Si c'est un attribut de markers
|
---|
| 1340 | it = GrAmarkers.find(grt[k]);
|
---|
| 1341 | if (it != GrAmarkers.end()) { mImgapp->SetMarkerAtt((*it).second.a2, (PIMarker)((*it).second.a1) );
|
---|
| 1342 | fgsrgr = true; continue; }
|
---|
| 1343 | // Si c'est un colormap
|
---|
| 1344 | it = GrAcmap.find(grt[k]);
|
---|
| 1345 | if (it != GrAcmap.end()) { mImgapp->SetColMapId( (CMapId)((*it).second.a1) ); fgsrgr = true; continue; }
|
---|
| 1346 | // Si c'est un facteur de zoom
|
---|
| 1347 | it = GrAzoom.find(grt[k]);
|
---|
| 1348 | if (it != GrAzoom.end()) { mImgapp->SetZoomAtt( (*it).second.a1 ); fgsrgr = true; continue; }
|
---|
[203] | 1349 | // Si c'est un attribut d'axe
|
---|
| 1350 | it = GrAaxes.find(grt[k]);
|
---|
| 1351 | if (it != GrAaxes.end()) { mImgapp->SetAxesAtt( (*it).second.a1 ); fgsrgr = true; continue; }
|
---|
[165] | 1352 |
|
---|
| 1353 | }
|
---|
| 1354 |
|
---|
| 1355 | return(ropt);
|
---|
| 1356 | }
|
---|
| 1357 |
|
---|
| 1358 |
|
---|
| 1359 | // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
---|
| 1360 | // Initialisation des chaines de caracteres designant les attributs graphiques
|
---|
| 1361 |
|
---|
| 1362 | /* --Methode-- */
|
---|
| 1363 | void Services2NObjMgr::InitGrAttNames()
|
---|
| 1364 | {
|
---|
| 1365 | gratt_item gi;
|
---|
| 1366 | // Les couleurs
|
---|
| 1367 | gi.a2 = 0;
|
---|
| 1368 | gi.a1 = PI_NotDefColor;
|
---|
| 1369 | GrAcolors["defcol"] = gi;
|
---|
| 1370 | gi.a1 = PI_Black;
|
---|
| 1371 | GrAcolors["black"] = gi;
|
---|
| 1372 | gi.a1 = PI_White;
|
---|
| 1373 | GrAcolors["white"] = gi;
|
---|
| 1374 | gi.a1 = PI_Grey;
|
---|
| 1375 | GrAcolors["grey"] = gi;
|
---|
| 1376 | gi.a1 = PI_Red;
|
---|
| 1377 | GrAcolors["red"] = gi;
|
---|
| 1378 | gi.a1 = PI_Blue;
|
---|
| 1379 | GrAcolors["blue"] = gi;
|
---|
| 1380 | gi.a1 = PI_Green;
|
---|
| 1381 | GrAcolors["green"] = gi;
|
---|
| 1382 | gi.a1 = PI_Yellow;
|
---|
| 1383 | GrAcolors["yellow"] = gi;
|
---|
| 1384 | gi.a1 = PI_Magenta;
|
---|
| 1385 | GrAcolors["magenta"] = gi;
|
---|
| 1386 |
|
---|
| 1387 | gi.a1 = PI_Cyan;
|
---|
| 1388 | GrAcolors["cyan"] = gi;
|
---|
| 1389 | gi.a1 = PI_Turquoise;
|
---|
| 1390 | GrAcolors["turquoise"] = gi;
|
---|
| 1391 | gi.a1 = PI_NavyBlue;
|
---|
| 1392 | GrAcolors["navyblue"] = gi;
|
---|
| 1393 | gi.a1 = PI_Orange;
|
---|
| 1394 | GrAcolors["orange"] = gi;
|
---|
| 1395 | gi.a1 = PI_SiennaRed;
|
---|
| 1396 | GrAcolors["siennared"] = gi;
|
---|
| 1397 | gi.a1 = PI_Purple;
|
---|
| 1398 | GrAcolors["purple"] = gi;
|
---|
| 1399 | gi.a1 = PI_LimeGreen;
|
---|
| 1400 | GrAcolors["limegreen"] = gi;
|
---|
| 1401 | gi.a1 = PI_Gold;
|
---|
| 1402 | GrAcolors["gold"] = gi;
|
---|
| 1403 |
|
---|
| 1404 | // Les attributs de lignes
|
---|
| 1405 | gi.a2 = 0;
|
---|
| 1406 | gi.a1 = PI_NotDefLineAtt;
|
---|
| 1407 | GrAlines["defline"] = gi;
|
---|
| 1408 | gi.a1 = PI_NormalLine;
|
---|
| 1409 | GrAlines["normalline"] = gi;
|
---|
| 1410 | gi.a1 = PI_ThinLine;
|
---|
| 1411 | GrAlines["thinline"] = gi;
|
---|
| 1412 | gi.a1 = PI_ThickLine;
|
---|
| 1413 | GrAlines["thickline"] = gi;
|
---|
| 1414 | gi.a1 = PI_DashedLine;
|
---|
| 1415 | GrAlines["dashedline"] = gi;
|
---|
| 1416 | gi.a1 = PI_ThinDashedLine;
|
---|
| 1417 | GrAlines["thindashedline"] = gi;
|
---|
| 1418 | gi.a1 = PI_ThickDashedLine;
|
---|
| 1419 | GrAlines["thickdashedline"] = gi;
|
---|
[192] | 1420 | gi.a1 = PI_DottedLine;
|
---|
| 1421 | GrAlines["dottedline"] = gi;
|
---|
| 1422 | gi.a1 = PI_ThinDottedLine;
|
---|
| 1423 | GrAlines["thindottedline"] = gi;
|
---|
| 1424 | gi.a1 = PI_ThickDottedLine;
|
---|
| 1425 | GrAlines["thickdottedline"] = gi;
|
---|
[165] | 1426 |
|
---|
[293] | 1427 | // Les fontes
|
---|
[165] | 1428 | gi.a2 = PI_NotDefFontSize;
|
---|
| 1429 | gi.a1 = PI_NotDefFontAtt;
|
---|
[349] | 1430 | GrAfonts["deffont"] = gi;
|
---|
[165] | 1431 |
|
---|
| 1432 | gi.a2 = PI_NormalSizeFont;
|
---|
| 1433 | gi.a1 = PI_RomanFont;
|
---|
[349] | 1434 | GrAfonts["normalfont"] = gi;
|
---|
[165] | 1435 | gi.a1 = PI_BoldFont;
|
---|
[349] | 1436 | GrAfonts["boldfont"] = gi;
|
---|
[165] | 1437 | gi.a1 = PI_ItalicFont;
|
---|
[349] | 1438 | GrAfonts["italicfont"] = gi;
|
---|
[165] | 1439 | gi.a2 = PI_SmallSizeFont;
|
---|
| 1440 | gi.a1 = PI_RomanFont;
|
---|
[349] | 1441 | GrAfonts["smallfont"] = gi;
|
---|
[165] | 1442 | gi.a1 = PI_BoldFont;
|
---|
[349] | 1443 | GrAfonts["smallboldfont"] = gi;
|
---|
[165] | 1444 | gi.a1 = PI_ItalicFont;
|
---|
[349] | 1445 | GrAfonts["smallitalicfont"] = gi;
|
---|
[165] | 1446 | gi.a2 = PI_BigSizeFont;
|
---|
| 1447 | gi.a1 = PI_RomanFont;
|
---|
[349] | 1448 | GrAfonts["bigfont"] = gi;
|
---|
[165] | 1449 | gi.a1 = PI_BoldFont;
|
---|
[349] | 1450 | GrAfonts["bigboldfont"] = gi;
|
---|
[165] | 1451 | gi.a1 = PI_ItalicFont;
|
---|
[349] | 1452 | GrAfonts["bigitalicfont"] = gi;
|
---|
[192] | 1453 | gi.a2 = PI_HugeSizeFont;
|
---|
| 1454 | gi.a1 = PI_RomanFont;
|
---|
[349] | 1455 | GrAfonts["hugefont"] = gi;
|
---|
[192] | 1456 | gi.a1 = PI_BoldFont;
|
---|
[349] | 1457 | GrAfonts["hugeboldfont"] = gi;
|
---|
[192] | 1458 | gi.a1 = PI_ItalicFont;
|
---|
[349] | 1459 | GrAfonts["hugeitalicfont"] = gi;
|
---|
[165] | 1460 |
|
---|
| 1461 |
|
---|
| 1462 | // Les markers
|
---|
[176] | 1463 | const char* mrkn[11] = { "dotmarker", "plusmarker", "crossmarker",
|
---|
| 1464 | "circlemarker", "fcirclemarker", "boxmarker", "fboxmarker",
|
---|
| 1465 | "trianglemarker", "ftrianglemarker", "starmarker", "fstarmarker"};
|
---|
[165] | 1466 | PIMarker mrk[11] = { PI_DotMarker, PI_PlusMarker, PI_CrossMarker,
|
---|
| 1467 | PI_CircleMarker, PI_FCircleMarker, PI_BoxMarker, PI_FBoxMarker,
|
---|
| 1468 | PI_TriangleMarker, PI_FTriangleMarker, PI_StarMarker, PI_FStarMarker};
|
---|
| 1469 |
|
---|
| 1470 | gi.a2 = 0;
|
---|
| 1471 | gi.a1 = PI_NotDefMarker;
|
---|
| 1472 | GrAmarkers["defmarker"] = gi;
|
---|
| 1473 |
|
---|
| 1474 | for(int j=0; j<11; j++) {
|
---|
| 1475 | string smrk;
|
---|
| 1476 | char buff[16];
|
---|
| 1477 | for(int m=1; m<10; m+=2) {
|
---|
| 1478 | sprintf(buff,"%d",m);
|
---|
| 1479 | smrk = (string)mrkn[j] + (string)buff;
|
---|
| 1480 | gi.a1 = mrk[j]; gi.a2 = m;
|
---|
| 1481 | GrAmarkers[smrk] = gi;
|
---|
| 1482 | }
|
---|
| 1483 | }
|
---|
| 1484 |
|
---|
| 1485 | // Les tables de couleurs
|
---|
| 1486 | gi.a2 = 0;
|
---|
| 1487 | gi.a1 = CMAP_OTHER;
|
---|
| 1488 | GrAcmap["defcmap"] = gi;
|
---|
| 1489 | gi.a1 = CMAP_GREY32;
|
---|
| 1490 | GrAcmap["grey32"] = gi;
|
---|
| 1491 | gi.a1 = CMAP_GREYINV32;
|
---|
| 1492 | GrAcmap["greyinv32"] = gi;
|
---|
| 1493 | gi.a1 = CMAP_COLRJ32;
|
---|
| 1494 | GrAcmap["colrj32"] = gi;
|
---|
| 1495 | gi.a1 = CMAP_COLBR32;
|
---|
| 1496 | GrAcmap["colbr32"] = gi;
|
---|
| 1497 | gi.a1 = CMAP_GREY128;
|
---|
| 1498 | GrAcmap["grey128"] = gi;
|
---|
| 1499 | gi.a1 = CMAP_GREYINV128;
|
---|
| 1500 | GrAcmap["greyinv128"] = gi;
|
---|
| 1501 | gi.a1 = CMAP_COLRJ128;
|
---|
| 1502 | GrAcmap["colrj128"] = gi;
|
---|
| 1503 | gi.a1 = CMAP_COLBR128;
|
---|
| 1504 | GrAcmap["colbr128"] = gi;
|
---|
| 1505 |
|
---|
[203] | 1506 | // La valeur de zoom
|
---|
[165] | 1507 | gi.a2 = 0;
|
---|
| 1508 | gi.a1 = 0;
|
---|
| 1509 | GrAzoom["defzoom"] = gi;
|
---|
| 1510 | gi.a1 = 1;
|
---|
| 1511 | GrAzoom["zoomx1"] = gi;
|
---|
| 1512 | gi.a1 = 2;
|
---|
| 1513 | GrAzoom["zoomx2"] = gi;
|
---|
| 1514 | gi.a1 = 3;
|
---|
| 1515 | GrAzoom["zoomx3"] = gi;
|
---|
| 1516 | gi.a1 = 4;
|
---|
| 1517 | GrAzoom["zoomx4"] = gi;
|
---|
| 1518 | gi.a1 = 5;
|
---|
| 1519 | GrAzoom["zoomx5"] = gi;
|
---|
| 1520 | gi.a1 = -2;
|
---|
| 1521 | GrAzoom["zoom/2"] = gi;
|
---|
| 1522 | gi.a1 = -3;
|
---|
| 1523 | GrAzoom["zoom/3"] = gi;
|
---|
| 1524 | gi.a1 = -4;
|
---|
| 1525 | GrAzoom["zoom/4"] = gi;
|
---|
| 1526 | gi.a1 = -5;
|
---|
| 1527 | GrAzoom["zoom/5"] = gi;
|
---|
[203] | 1528 |
|
---|
| 1529 | // Attributs d'axes
|
---|
| 1530 | gi.a2 = 0;
|
---|
| 1531 | gi.a1 = (int)(kBoxAxes | kExtTicks | kLabels);
|
---|
| 1532 | GrAaxes["stdaxes"] = gi;
|
---|
| 1533 | GrAaxes["defaxes"] = gi;
|
---|
| 1534 | GrAaxes["boxaxes"] = gi;
|
---|
| 1535 | gi.a1 = (int)kAxesDflt;
|
---|
| 1536 | GrAaxes["simpleaxes"] = gi;
|
---|
| 1537 | gi.a1 = (int)(kBoxAxes | kExtTicks | kLabels | kGridOn);
|
---|
| 1538 | GrAaxes["boxaxesgrid"] = gi;
|
---|
| 1539 |
|
---|
| 1540 | gi.a1 = (int)(kBoxAxes | kTicks | kLabels | kMinTicks | kMajTicks);
|
---|
| 1541 | GrAaxes["fineaxes"] = gi;
|
---|
| 1542 | gi.a1 = (int)(kBoxAxes | kTicks | kLabels | kMinTicks | kMajTicks | kGridOn);
|
---|
| 1543 | GrAaxes["grid"] = gi;
|
---|
| 1544 | GrAaxes["fineaxesgrid"] = gi;
|
---|
| 1545 |
|
---|
[165] | 1546 | }
|
---|
[333] | 1547 |
|
---|
| 1548 |
|
---|
| 1549 | // SANS_EVOLPLANCK Attention !
|
---|
| 1550 | #include "pclassids.h"
|
---|
| 1551 |
|
---|
| 1552 | /* --Methode-- */
|
---|
| 1553 | char* Services2NObjMgr::PClassIdToClassName(int cid)
|
---|
| 1554 | {
|
---|
| 1555 | switch (cid) {
|
---|
| 1556 | case ClassId_Poly1 :
|
---|
| 1557 | return("Poly1");
|
---|
| 1558 | case ClassId_Poly2 :
|
---|
| 1559 | return("Poly2");
|
---|
| 1560 | case ClassId_Matrix :
|
---|
| 1561 | return("Matrix");
|
---|
| 1562 | case ClassId_Vector :
|
---|
| 1563 | return("Vector");
|
---|
| 1564 |
|
---|
| 1565 | case ClassId_DVList :
|
---|
| 1566 | return("DVList");
|
---|
| 1567 |
|
---|
| 1568 | case ClassId_Histo1D :
|
---|
| 1569 | return("Histo1D");
|
---|
| 1570 | case ClassId_Histo2D :
|
---|
| 1571 | return("Histo2D");
|
---|
| 1572 | case ClassId_HProf :
|
---|
| 1573 | return("HProf");
|
---|
| 1574 | case ClassId_NTuple :
|
---|
| 1575 | return("NTuple");
|
---|
[361] | 1576 | case ClassId_XNTuple :
|
---|
| 1577 | return("XNTuple");
|
---|
[333] | 1578 | case ClassId_GeneralFitData :
|
---|
| 1579 | return("GeneralFitData");
|
---|
| 1580 |
|
---|
| 1581 | case ClassId_Image :
|
---|
| 1582 | return("RzImage");
|
---|
| 1583 | case ClassId_Image + kuint_1 :
|
---|
| 1584 | return("ImageU1");
|
---|
| 1585 | case ClassId_Image + kint_1 :
|
---|
| 1586 | return("ImageI1");
|
---|
| 1587 | case ClassId_Image + kuint_2 :
|
---|
| 1588 | return("ImageU2");
|
---|
| 1589 | case ClassId_Image + kint_2 :
|
---|
| 1590 | return("ImageI2");
|
---|
| 1591 | case ClassId_Image + kuint_4 :
|
---|
| 1592 | return("ImageU4");
|
---|
| 1593 | case ClassId_Image + kint_4 :
|
---|
| 1594 | return("ImageI4");
|
---|
| 1595 | case ClassId_Image + kr_4 :
|
---|
| 1596 | return("ImageR4");
|
---|
| 1597 | case ClassId_Image + kr_8 :
|
---|
| 1598 | return("ImageR8");
|
---|
| 1599 |
|
---|
| 1600 | case ClassId_ZFidu :
|
---|
| 1601 | return("ZFidu");
|
---|
| 1602 |
|
---|
| 1603 | case ClassId_StarList :
|
---|
| 1604 | return("StarList");
|
---|
| 1605 | case ClassId_Transfo :
|
---|
| 1606 | return("Transfo");
|
---|
| 1607 | case ClassId_PSF :
|
---|
| 1608 | return("PSF");
|
---|
| 1609 |
|
---|
| 1610 |
|
---|
| 1611 | // - Ajout objet PPF
|
---|
| 1612 | default:
|
---|
| 1613 | return("AnyDataObj");
|
---|
| 1614 | }
|
---|
| 1615 | }
|
---|
| 1616 |
|
---|