[2615] | 1 | #include "sopnamsp.h"
|
---|
[293] | 2 | #include "piacmd.h"
|
---|
| 3 |
|
---|
| 4 | #include <stdio.h>
|
---|
| 5 | #include <stdlib.h>
|
---|
| 6 | #include <math.h>
|
---|
| 7 |
|
---|
| 8 | #include "basexecut.h"
|
---|
| 9 |
|
---|
| 10 | #include "pdlmgr.h"
|
---|
| 11 | #include "ctimer.h"
|
---|
[2263] | 12 | #include "strutilxx.h"
|
---|
[293] | 13 |
|
---|
| 14 | #include "pistdimgapp.h"
|
---|
| 15 | #include "nobjmgr.h"
|
---|
[326] | 16 | #include "servnobjm.h"
|
---|
[2305] | 17 | #include "nomgadapter.h"
|
---|
[293] | 18 |
|
---|
| 19 | #include "histos.h"
|
---|
| 20 | #include "histos2.h"
|
---|
| 21 | #include "hisprof.h"
|
---|
| 22 | #include "ntuple.h"
|
---|
| 23 | #include "generaldata.h"
|
---|
[2792] | 24 | #include "datatable.h"
|
---|
[769] | 25 |
|
---|
| 26 | #ifdef SANS_EVOLPLANCK
|
---|
[333] | 27 | #include "cvector.h"
|
---|
[769] | 28 | #else
|
---|
| 29 | #include "tvector.h"
|
---|
| 30 | #endif
|
---|
[293] | 31 |
|
---|
| 32 |
|
---|
| 33 | /* --Methode-- */
|
---|
| 34 | PIABaseExecutor::PIABaseExecutor(PIACmd* piac, NamedObjMgr* omg, PIStdImgApp* app)
|
---|
| 35 | {
|
---|
| 36 | mpiac = piac;
|
---|
| 37 | mObjMgr = omg;
|
---|
| 38 | mImgApp = app;
|
---|
[312] | 39 | dynlink = NULL;
|
---|
[1276] | 40 | dynlink2 = NULL;
|
---|
[293] | 41 | RegisterCommands();
|
---|
| 42 | }
|
---|
| 43 |
|
---|
| 44 | PIABaseExecutor::~PIABaseExecutor()
|
---|
| 45 | {
|
---|
[1276] | 46 | if (dynlink) delete dynlink;
|
---|
| 47 | if (dynlink2) delete dynlink2;
|
---|
[293] | 48 | }
|
---|
| 49 |
|
---|
| 50 |
|
---|
[2755] | 51 |
|
---|
[293] | 52 | /* --Methode-- */
|
---|
[1268] | 53 | int PIABaseExecutor::Execute(string& kw, vector<string>& tokens, string& toks)
|
---|
[293] | 54 | {
|
---|
[333] | 55 | Services2NObjMgr* srvo = mObjMgr->GetServiceObj();
|
---|
[293] | 56 | // >>>>> Chargement de modules
|
---|
[2307] | 57 | if (kw == "loadmodule") {
|
---|
[293] | 58 | if (tokens.size() < 2) { cout << "Usage: loadmodule fnameso modulename" << endl; return(0); }
|
---|
| 59 | mpiac->LoadModule(tokens[0], tokens[1]);
|
---|
| 60 | }
|
---|
[349] | 61 |
|
---|
[293] | 62 | // >>>>>>>>>>> Link dynamique de fonctions C++
|
---|
| 63 | else if (kw == "link" ) {
|
---|
| 64 | if (tokens.size() < 2) { cout << "Usage: link fnameso f1 [f2 f3]" << endl; return(0); }
|
---|
| 65 | string sph = "";
|
---|
| 66 | for(int gg=0; gg<5; gg++) tokens.push_back(sph);
|
---|
| 67 | int rc = LinkUserFuncs(tokens[0], tokens[1], tokens[2], tokens[3]);
|
---|
| 68 | if (rc == 0) cout << "PIABaseExecutor: Link from " << tokens[0] << " OK " << endl;
|
---|
| 69 | }
|
---|
[1276] | 70 | else if (kw == "linkff2" ) {
|
---|
| 71 | if (tokens.size() < 2) { cout << "Usage: linkff2 fnameso f1 [f2 f3]" << endl; return(0); }
|
---|
| 72 | string sph = "";
|
---|
| 73 | for(int gg=0; gg<5; gg++) tokens.push_back(sph);
|
---|
| 74 | int rc = LinkUserFuncs2(tokens[0], tokens[1], tokens[2], tokens[3]);
|
---|
| 75 | if (rc == 0) cout << "PIABaseExecutor: Link2 from " << tokens[0] << " OK " << endl;
|
---|
| 76 | }
|
---|
[293] | 77 | else if (kw == "call" ) {
|
---|
| 78 | if (tokens.size() < 1) { cout << "Usage: call userf [arg1 arg2 ...]" << endl; return(0); }
|
---|
[1276] | 79 | UsFmap::iterator it;
|
---|
| 80 | UsFmap::iterator it1 = usfmap.find(tokens[0]);
|
---|
| 81 | UsFmap::iterator it2 = usfmap2.find(tokens[0]);
|
---|
| 82 | if ((it1 == usfmap.end()) && (it2 == usfmap2.end()) ) {
|
---|
[293] | 83 | cerr << "PIABaseExecutor: No User Function " << tokens[0] << endl;
|
---|
| 84 | return(0);
|
---|
| 85 | }
|
---|
[1276] | 86 | if (it1 == usfmap.end()) it = it2;
|
---|
| 87 | else it = it1;
|
---|
[293] | 88 | cout << "PIABaseExecutor: Call " << tokens[0] << "( ... )" << endl;
|
---|
| 89 | // on est oblige de faire un cast etant donne qu'on
|
---|
| 90 | // utilise donc des DlFunction (Reza 20/08/98) voir commentaire ds .h (pb g++)
|
---|
| 91 | DlUserProcFunction fuf = (DlUserProcFunction)(*it).second;
|
---|
[2494] | 92 | /*DEL----- Plus besoin en multi-thread ? / Reza 06/01/2004
|
---|
[293] | 93 | // On redirige la sortie sur le terminal
|
---|
| 94 | bool red = mImgApp->HasRedirectedStdOutErr();
|
---|
| 95 | mImgApp->RedirectStdOutErr(false);
|
---|
[2494] | 96 | --------DEL */
|
---|
[1276] | 97 | #ifdef SANS_EVOLPLANCK
|
---|
[293] | 98 | TRY {
|
---|
| 99 | tokens.erase(tokens.begin());
|
---|
| 100 | fuf(tokens);
|
---|
| 101 | } CATCH(merr) {
|
---|
| 102 | fflush(stdout);
|
---|
[1276] | 103 | string es = PeidaExc(merr);
|
---|
| 104 | cerr << "\n PIABaseExecutor: Call UserFunc Exception :" << merr << es;
|
---|
[293] | 105 | cout << endl;
|
---|
| 106 | }
|
---|
[1276] | 107 | #else
|
---|
| 108 | try {
|
---|
| 109 | tokens.erase(tokens.begin());
|
---|
| 110 | fuf(tokens);
|
---|
| 111 | }
|
---|
| 112 | catch ( PThrowable & exc ) {
|
---|
| 113 | cerr << "\n PIABaseExecutor: Call / Catched Exception :"
|
---|
| 114 | << (string)typeid(exc).name() << " Msg= "
|
---|
| 115 | << exc.Msg() << endl;
|
---|
| 116 | cout << endl;
|
---|
| 117 | }
|
---|
| 118 | catch ( ... ) {
|
---|
| 119 | cerr << "\n PIABaseExecutor: Call / Catched Exception ... "
|
---|
| 120 | << endl;
|
---|
| 121 | cout << endl;
|
---|
| 122 | }
|
---|
| 123 | #endif
|
---|
[2494] | 124 | /*DEL----- Plus besoin en multi-thread ? / Reza 06/01/2004
|
---|
[293] | 125 | mImgApp->RedirectStdOutErr(red);
|
---|
[2494] | 126 | --------DEL */
|
---|
[293] | 127 | }
|
---|
| 128 |
|
---|
| 129 | else if (kw == "openppf" ) {
|
---|
[2645] | 130 | if (tokens.size()<1) {cout<<"Usage: openppf file [objname1 objname2 ...]"<<endl; return(0); }
|
---|
| 131 | else if (tokens.size()==1) mObjMgr->ReadAll(tokens[0]);
|
---|
| 132 | else mObjMgr->ReadObj(tokens);
|
---|
[293] | 133 | }
|
---|
[2132] | 134 | else if ((kw == "saveobjs") || (kw == "saveppf")) {
|
---|
[333] | 135 | if (tokens.size() < 2) { cout << "Usage: saveobjs patt filename " << endl; return(0); }
|
---|
| 136 | mObjMgr->SaveObjects(tokens[0], tokens[1]);
|
---|
| 137 | }
|
---|
[2669] | 138 | else if (kw == "savelist") {
|
---|
| 139 | if (tokens.size() < 2) {
|
---|
| 140 | cout << "Usage: savelist objname1 [objname2 ...] filename "<<endl;
|
---|
| 141 | return(0);
|
---|
| 142 | }
|
---|
| 143 | mObjMgr->SaveListObjects(tokens);
|
---|
| 144 | }
|
---|
[293] | 145 | else if (kw == "saveall" ) {
|
---|
| 146 | if (tokens.size() < 1) { cout << "Usage: saveall file " << endl; return(0); }
|
---|
| 147 | mObjMgr->SaveAll(tokens[0]);
|
---|
| 148 | }
|
---|
| 149 | else if (kw == "print" ) {
|
---|
| 150 | if (tokens.size() < 1) { cout << "Usage: print nameobj " << endl; return(0); }
|
---|
| 151 | mObjMgr->PrintObj(tokens[0]);
|
---|
| 152 | }
|
---|
[333] | 153 | else if ( (kw == "rename" ) || (kw == "mv") ) {
|
---|
[2132] | 154 | if (tokens.size() < 2) { cout << "Usage: rename/mv nameobj namenew" << endl; return(0); }
|
---|
[293] | 155 | mObjMgr->RenameObj(tokens[0], tokens[1]);
|
---|
| 156 | }
|
---|
[333] | 157 | else if ( (kw == "del" ) || (kw == "rm") ) {
|
---|
[1655] | 158 | if (tokens.size() < 1) { cout << "Usage: del nameobj [nameobj2 ...]" << endl; return(0); }
|
---|
| 159 | if (tokens.size()>0)
|
---|
| 160 | for(uint_4 i=0;i<tokens.size();i++) mObjMgr->DelObj(tokens[i]);
|
---|
[293] | 161 | }
|
---|
| 162 | else if (kw == "delobjs" ) {
|
---|
| 163 | if (tokens.size() < 1) { cout << "Usage: delobjs nomobjpattern (*,?) " << endl; return(0); }
|
---|
| 164 | mObjMgr->DelObjects(tokens[0]);
|
---|
| 165 | }
|
---|
[333] | 166 | else if ( (kw == "listobjs") || (kw == "ls") ) {
|
---|
[331] | 167 | if (tokens.size() < 1) tokens.push_back("*");
|
---|
[2519] | 168 | if (tokens.size() < 2) mObjMgr->ListObjs(tokens[0]);
|
---|
| 169 | else {
|
---|
| 170 | vector<string> olv;
|
---|
| 171 | mObjMgr->GetObjList(tokens[0], olv);
|
---|
| 172 | mpiac->SetVar(tokens[1], olv);
|
---|
| 173 | }
|
---|
[331] | 174 | }
|
---|
[2519] | 175 |
|
---|
[333] | 176 | // Gestion des repertoires
|
---|
| 177 | else if (kw == "mkdir" ) {
|
---|
[344] | 178 | if (tokens.size() < 1) { cout << "Usage: mkdir dirname [true]" << endl; return(0); }
|
---|
| 179 | bool crd = mObjMgr->CreateDir(tokens[0]);
|
---|
| 180 | if ( crd && (tokens.size() > 1) && (tokens[1] == "true") )
|
---|
| 181 | mObjMgr->SetKeepOldDirAtt(tokens[0], true);
|
---|
[333] | 182 | }
|
---|
| 183 | else if (kw == "rmdir" ) {
|
---|
| 184 | if (tokens.size() < 1) { cout << "Usage: rmdir dirname " << endl; return(0); }
|
---|
| 185 | mObjMgr->DeleteDir(tokens[0]);
|
---|
| 186 | }
|
---|
[2132] | 187 | else if (kw == "setdiratt" ) {
|
---|
| 188 | if (tokens.size() < 2) { cout << "Usage: setdiratt dirname true/false" << endl; return(0); }
|
---|
| 189 | if (tokens[1] == "true") mObjMgr->SetKeepOldDirAtt(tokens[0], true);
|
---|
| 190 | else mObjMgr->SetKeepOldDirAtt(tokens[0], false);
|
---|
| 191 | }
|
---|
[333] | 192 | else if (kw == "cd") {
|
---|
| 193 | if (tokens.size() < 1) tokens.push_back("home");
|
---|
| 194 | mObjMgr->SetCurrentDir(tokens[0]);
|
---|
| 195 | }
|
---|
[345] | 196 | else if (kw == "pwd") {
|
---|
| 197 | string dirn;
|
---|
| 198 | mObjMgr->GetCurrentDir(dirn);
|
---|
| 199 | cout << "CurrentDirectory: " << dirn << endl;
|
---|
| 200 | }
|
---|
[333] | 201 | else if (kw == "listdirs") {
|
---|
| 202 | if (tokens.size() < 1) tokens.push_back("*");
|
---|
| 203 | mObjMgr->ListDirs(tokens[0]);
|
---|
| 204 | }
|
---|
[293] | 205 |
|
---|
| 206 | // >>>>>>>>>>> Creation d'histos 1D-2D
|
---|
| 207 | else if (kw == "newh1d") {
|
---|
| 208 | if (tokens.size() < 4) { cout << "Usage: newh1d name xmin xmax nbin" << endl; return(0); }
|
---|
[1091] | 209 | int_4 nbx = 100;
|
---|
| 210 | r_8 xmin = 0., xmax = 1.;
|
---|
[293] | 211 | nbx = atoi(tokens[3].c_str());
|
---|
| 212 | xmin = atof(tokens[1].c_str()); xmax = atof(tokens[2].c_str());
|
---|
| 213 | Histo* h = new Histo(xmin, xmax, nbx);
|
---|
| 214 | mObjMgr->AddObj(h, tokens[0]);
|
---|
| 215 | }
|
---|
| 216 | else if (kw == "newh2d") {
|
---|
| 217 | if (tokens.size() < 7) {
|
---|
| 218 | cout << "Usage: newh2d name xmin xmax nbinx ymin ymax nbiny" << endl;
|
---|
| 219 | return(0);
|
---|
| 220 | }
|
---|
[1091] | 221 | int_4 nbx = 50, nby = 50;
|
---|
| 222 | r_8 xmin = 0., xmax = 1.;
|
---|
| 223 | r_8 ymin = 0., ymax = 1.;
|
---|
[293] | 224 | nbx = atoi(tokens[3].c_str());
|
---|
| 225 | nby = atoi(tokens[6].c_str());
|
---|
| 226 | xmin = atof(tokens[1].c_str()); xmax = atof(tokens[2].c_str());
|
---|
| 227 | ymin = atof(tokens[4].c_str()); ymax = atof(tokens[5].c_str());
|
---|
| 228 | Histo2D* h = new Histo2D(xmin, xmax, nbx, ymin, ymax, nby);
|
---|
| 229 | mObjMgr->AddObj(h, tokens[0]);
|
---|
| 230 | }
|
---|
[1035] | 231 | else if (kw == "newprof" || kw == "newprofe") {
|
---|
[293] | 232 | if (tokens.size() < 4)
|
---|
[1035] | 233 | { cout << "Usage: newprof[e] name xmin xmax nbin [ymin ymax]" << endl; return(0); }
|
---|
[1091] | 234 | int_4 nbx = 100;
|
---|
| 235 | r_8 xmin = 0., xmax = 1., ymin = 1., ymax = -1.;
|
---|
[293] | 236 | if(tokens.size() > 5)
|
---|
| 237 | {ymin = atof(tokens[4].c_str()); ymax = atof(tokens[5].c_str());}
|
---|
| 238 | nbx = atoi(tokens[3].c_str());
|
---|
| 239 | xmin = atof(tokens[1].c_str()); xmax = atof(tokens[2].c_str());
|
---|
| 240 | HProf* h = new HProf(xmin, xmax, nbx, ymin, ymax);
|
---|
[1035] | 241 | if(kw == "newprofe") h->SetErrOpt(false);
|
---|
[293] | 242 | mObjMgr->AddObj(h, tokens[0]);
|
---|
| 243 | }
|
---|
[447] | 244 |
|
---|
| 245 | // Creation de NTuple
|
---|
| 246 | else if (kw == "newnt") {
|
---|
| 247 | if(tokens.size() < 2)
|
---|
| 248 | {cout<<"Usage: newnt name v1 v2 ... vn / newnt name nvar"<<endl; return(0);}
|
---|
| 249 | vector<string> varname;
|
---|
| 250 | int nvar = 0;
|
---|
| 251 | const char *c = tokens[1].c_str();
|
---|
| 252 | if(isdigit(c[0])) {
|
---|
| 253 | nvar = atoi(tokens[1].c_str());
|
---|
| 254 | if(nvar<=0 || nvar>=10000)
|
---|
| 255 | {cout<<"newnt name nvar : nvar must be an positive integer<10000"<<endl;
|
---|
| 256 | return(0);}
|
---|
| 257 | for(int i=0;i<nvar;i++) {
|
---|
| 258 | char str[16]; sprintf(str,"%d",i);
|
---|
| 259 | string dum = "v"; dum += str;
|
---|
| 260 | varname.push_back(dum.c_str());
|
---|
| 261 | }
|
---|
| 262 | } else if( islower(c[0]) || isupper(c[0]) ) {
|
---|
[1548] | 263 | for(int i=1;i<(int)tokens.size();i++) {
|
---|
[447] | 264 | varname.push_back(tokens[i].c_str());
|
---|
| 265 | nvar++;
|
---|
| 266 | }
|
---|
| 267 | } else {
|
---|
| 268 | cout<<"newnt name v1 v2 ... vn : name vi must begin by a letter"<<endl
|
---|
| 269 | <<"newnt name nvar : nvar must be an positive integer"<<endl;
|
---|
| 270 | return(0);
|
---|
| 271 | }
|
---|
| 272 | char **noms = new char*[nvar];
|
---|
| 273 | for(int i=0;i<nvar;i++) noms[i] = (char *)varname[i].c_str();
|
---|
| 274 | NTuple* nt = new NTuple(nvar,noms);
|
---|
| 275 | delete [] noms;
|
---|
| 276 | mObjMgr->AddObj(nt,tokens[0]);
|
---|
| 277 | }
|
---|
| 278 |
|
---|
[2792] | 279 | // Creation de DataTable
|
---|
| 280 | else if (kw == "newdt") {
|
---|
| 281 | if(tokens.size() < 2)
|
---|
| 282 | {cout<<"Usage: newdt name v1:t1 v2:t2 ... vn:tn / newdt name nvar"<<endl; return(0);}
|
---|
| 283 | DataTable* dt = new DataTable();
|
---|
| 284 | const char *c = tokens[1].c_str();
|
---|
| 285 | if(isdigit(c[0])) {
|
---|
| 286 | int n = atoi(tokens[1].c_str());
|
---|
| 287 | if(n<=0 || n>=10000) {
|
---|
| 288 | cout<<"newdt name nvar : nvar="<<n<<" must be an positive integer<10000"<<endl;
|
---|
| 289 | delete dt; return(0);
|
---|
| 290 | }
|
---|
| 291 | for(int i=0;i<n;i++) {
|
---|
| 292 | char str[16]; sprintf(str,"v%d",i);
|
---|
| 293 | dt->AddDoubleColumn(str);
|
---|
| 294 | }
|
---|
| 295 | } else {
|
---|
| 296 | for(int i=1;i<tokens.size();i++) {
|
---|
| 297 | string vname = tokens[i];
|
---|
| 298 | uint_4 p = tokens[i].find(':');
|
---|
| 299 | if(p<tokens[i].size()) vname = vname.substr(0,p);
|
---|
| 300 | if(vname.size()<1) {
|
---|
| 301 | cout<<"Zero size name for variable: tokens["<<i<<"]="<<tokens[i]<<endl;
|
---|
| 302 | delete dt; return(0);
|
---|
| 303 | }
|
---|
| 304 | if (tokens[i].find(":r4")<tokens[i].size()) dt->AddFloatColumn(vname);
|
---|
| 305 | else if(tokens[i].find(":r8")<tokens[i].size()) dt->AddDoubleColumn(vname);
|
---|
| 306 | else if(tokens[i].find(":i4")<tokens[i].size()) dt->AddIntegerColumn(vname);
|
---|
| 307 | else if(tokens[i].find(":i8")<tokens[i].size()) dt->AddLongColumn(vname);
|
---|
| 308 | else if(tokens[i].find(":s") <tokens[i].size()) dt->AddStringColumn(vname);
|
---|
| 309 | else dt->AddDoubleColumn(vname);
|
---|
| 310 | }
|
---|
| 311 | }
|
---|
| 312 | mObjMgr->AddObj(dt,tokens[0]);
|
---|
| 313 | }
|
---|
| 314 |
|
---|
[447] | 315 | // Creation de GeneralFitData
|
---|
[293] | 316 | else if (kw == "newgfd") {
|
---|
| 317 | if (tokens.size() < 3)
|
---|
| 318 | { cout << "Usage: newgfd nvar nalloc [errx(0/1)]" << endl; return(0); }
|
---|
| 319 | int nvar, nalloc, errx=0;
|
---|
| 320 | if (tokens.size() > 3)
|
---|
| 321 | { errx = atoi(tokens[3].c_str()); if(errx>0) errx=1; else errx = 0;}
|
---|
| 322 | nvar = atoi(tokens[1].c_str()); nalloc = atoi(tokens[2].c_str());
|
---|
| 323 | if(nvar>0 && nalloc>0) {
|
---|
| 324 | GeneralFitData* gfd = new GeneralFitData(nvar,nalloc,errx);
|
---|
| 325 | mObjMgr->AddObj(gfd, tokens[0]);
|
---|
| 326 | }
|
---|
| 327 | }
|
---|
| 328 |
|
---|
[333] | 329 | // Creation/remplissage de vecteur et de matrice
|
---|
| 330 | else if (kw == "newvec") {
|
---|
| 331 | if (tokens.size() < 2) {
|
---|
| 332 | cout << "Usage: newvec name size [f(i) dopt] " << endl; return(0);
|
---|
| 333 | }
|
---|
| 334 | int n = atoi(tokens[1].c_str());
|
---|
| 335 | double xmin, xmax;
|
---|
| 336 | xmin = 0.; xmax = n;
|
---|
[357] | 337 | if (tokens.size() < 3) {
|
---|
| 338 | Vector* v = new Vector(n);
|
---|
| 339 | mObjMgr->AddObj(v, tokens[0]);
|
---|
| 340 | }
|
---|
| 341 | else {
|
---|
| 342 | if (tokens.size() < 4) tokens.push_back("");
|
---|
| 343 | mObjMgr->GetServiceObj()->PlotFunc(tokens[2], tokens[0], xmin, xmax, n, tokens[3]);
|
---|
| 344 | }
|
---|
[333] | 345 | }
|
---|
| 346 | else if (kw == "newmtx") {
|
---|
| 347 | if (tokens.size() < 3) {
|
---|
[1917] | 348 | cout << "Usage: newmtx name sizeX(Col) sizeY(Lines) [f(i,j) dopt] " << endl; return(0);
|
---|
[333] | 349 | }
|
---|
| 350 | int nx = atoi(tokens[1].c_str());
|
---|
| 351 | int ny = atoi(tokens[2].c_str());
|
---|
| 352 | double xmin, xmax, ymin, ymax;
|
---|
| 353 | xmin = 0.; xmax = nx;
|
---|
| 354 | ymin = 0.; ymax = ny;
|
---|
[357] | 355 | if (tokens.size() < 4) {
|
---|
| 356 | Matrix* mtx = new Matrix(ny,nx);
|
---|
| 357 | mObjMgr->AddObj(mtx, tokens[0]);
|
---|
| 358 | }
|
---|
| 359 | else {
|
---|
[1971] | 360 | if (tokens.size() < 5) tokens.push_back("next");
|
---|
[357] | 361 | mObjMgr->GetServiceObj()->PlotFunc2D(tokens[3], tokens[0], xmin, xmax, ymin, ymax,
|
---|
| 362 | nx, ny, tokens[4]);
|
---|
| 363 | }
|
---|
[333] | 364 | }
|
---|
[2305] | 365 | // ----- Vecteur/NTuple <> Lignes/variables interpreteur
|
---|
| 366 | // Creation de vecteur depuis le contenu de la ligne
|
---|
| 367 | else if (kw == "line2vec") {
|
---|
| 368 | if (tokens.size() < 2) {
|
---|
| 369 | cout << "Usage: line2vec vecname v0 v1 v2 ... " << endl; return(0);
|
---|
| 370 | }
|
---|
| 371 | int vsz = tokens.size()-1;
|
---|
| 372 | Vector* v = new Vector(vsz);
|
---|
| 373 | for(int kkv=0; kkv<vsz; kkv++) (*v)(kkv) = atof(tokens[kkv+1].c_str());
|
---|
| 374 | mObjMgr->AddObj(v, tokens[0]);
|
---|
| 375 | }
|
---|
| 376 | // Remplissage de NTuple depuis la ligne
|
---|
| 377 | else if (kw == "line2nt") {
|
---|
| 378 | if (tokens.size() < 2) {
|
---|
| 379 | cout << "Usage: line2nt ntname col0 col1 ..." << endl; return(0);
|
---|
| 380 | }
|
---|
| 381 | AnyDataObj* obj;
|
---|
| 382 | obj = mObjMgr->GetObj(tokens[0]);
|
---|
| 383 | if(obj == NULL) {
|
---|
| 384 | cerr << "line2nt Error , No such object " << tokens[0] << endl;
|
---|
| 385 | return(0);
|
---|
| 386 | }
|
---|
| 387 | NTuple* nt = dynamic_cast<NTuple *>(obj);
|
---|
| 388 | if(nt == NULL) {
|
---|
| 389 | cerr << "line2nt Error " << tokens[0] << " not an NTuple ! " << endl;
|
---|
| 390 | return(0);
|
---|
| 391 | }
|
---|
| 392 | if (nt->NbColumns() < 1) {
|
---|
| 393 | cerr << "line2nt Error: NbColumns < 1" << endl;
|
---|
| 394 | return(0);
|
---|
| 395 | }
|
---|
| 396 | r_4* xnt = new r_4[ nt->NbColumns() ];
|
---|
| 397 | int kkx;
|
---|
| 398 | for(kkx=0; kkx<nt->NbColumns(); kkx++) {
|
---|
| 399 | if (kkx < tokens.size()-1) xnt[kkx] = atof(tokens[kkx+1].c_str());
|
---|
| 400 | else xnt[kkx] = 0.;
|
---|
| 401 | }
|
---|
| 402 | nt->Fill(xnt);
|
---|
| 403 | delete[] xnt;
|
---|
| 404 | }
|
---|
| 405 | // Contenu du vecteur vers variable interpreteur
|
---|
| 406 | #define MAXNWORDSO2V 32768
|
---|
| 407 | else if (kw == "vec2var") {
|
---|
| 408 | if (tokens.size() < 2) {
|
---|
| 409 | cout << "Usage: vec2var vecname varname [loop_param start:end:step] " << endl; return(0);
|
---|
| 410 | }
|
---|
| 411 | AnyDataObj* obj;
|
---|
| 412 | obj = mObjMgr->GetObj(tokens[0]);
|
---|
| 413 | if(obj == NULL) {
|
---|
| 414 | cerr << "vec2var Error , No such object " << tokens[0] << endl;
|
---|
| 415 | return(0);
|
---|
| 416 | }
|
---|
| 417 | Vector* v = dynamic_cast<Vector *>(obj);
|
---|
| 418 | if(v == NULL) {
|
---|
| 419 | cerr << "vec2var Error " << tokens[0] << " not a Vector ! " << endl;
|
---|
| 420 | return(0);
|
---|
| 421 | }
|
---|
[2419] | 422 | int_8 kks = 0;
|
---|
| 423 | int_8 kke = v->NElts();
|
---|
| 424 | int_8 kkp = 1;
|
---|
[2305] | 425 | if (tokens.size() > 2) Services2NObjMgr::DecodeLoopParameters(tokens[2], kks, kke, kkp);
|
---|
| 426 | if (kks < 0) kks = 0;
|
---|
[2419] | 427 | if (kke > (int_8)v->NElts()) kke = v->NElts();
|
---|
[2305] | 428 | if (kkp < 1) kkp = 1;
|
---|
| 429 | int nelt = (kke-kks-1)/kkp;
|
---|
| 430 | if (nelt > MAXNWORDSO2V) {
|
---|
| 431 | nelt = MAXNWORDSO2V;
|
---|
| 432 | cout << "vec2var Warning: Only " << nelt
|
---|
| 433 | << " elements will be converted to string" << endl;
|
---|
| 434 | kke = kks+nelt*kkp;
|
---|
| 435 | }
|
---|
| 436 | string v2str;
|
---|
| 437 | char buff[64];
|
---|
| 438 | for(int kkv=kks; kkv<kke; kkv+=kkp) {
|
---|
| 439 | sprintf(buff, "%lg ", (*v)(kkv));
|
---|
| 440 | v2str += buff;
|
---|
| 441 | }
|
---|
| 442 |
|
---|
| 443 | mObjMgr->SetVar(tokens[1], v2str);
|
---|
| 444 | }
|
---|
| 445 | // Une ligne du NTuple/NTupleInterface -> variable interpreteur
|
---|
| 446 | else if ((kw == "ntline2var") || (kw == "ntcol2var")) {
|
---|
| 447 | if (tokens.size() < 3) {
|
---|
| 448 | cout << "Usage: ntline/col2var objname line_number varname" << endl;
|
---|
| 449 | return(0);
|
---|
| 450 | }
|
---|
| 451 | NObjMgrAdapter* oa = mObjMgr->GetObjAdapter(tokens[0]);
|
---|
| 452 | if(oa == NULL) {
|
---|
| 453 | cerr << "ntline/col2var Error , No such object " << tokens[0] << endl;
|
---|
| 454 | return(0);
|
---|
| 455 | }
|
---|
| 456 | bool adel = false;
|
---|
| 457 | NTupleInterface* nti = oa->GetNTupleInterface(adel);
|
---|
| 458 | if(nti == NULL) {
|
---|
| 459 | cerr << "ntline/col2var Error: objet" << tokens[0] << " has no NTupleInterface" << endl;
|
---|
| 460 | return(0);
|
---|
| 461 | }
|
---|
[333] | 462 |
|
---|
[2305] | 463 | if (nti->NbColumns() < 1 || nti->NbLines() < 1) {
|
---|
| 464 | cerr << "ntline/col2var Error: NbColumns or NbLines < 1" << endl;
|
---|
| 465 | return(0);
|
---|
| 466 | }
|
---|
| 467 | string v2str;
|
---|
| 468 | char buff[64];
|
---|
| 469 | if (kw == "ntline2var") {
|
---|
| 470 | int numline = atoi(tokens[1].c_str());
|
---|
| 471 | if ( (numline >= nti->NbLines()) || (numline < 0) ) {
|
---|
| 472 | cerr << "ntline2var Error: numline" << tokens[1] << " out of bounds" << endl;
|
---|
| 473 | return(0);
|
---|
| 474 | }
|
---|
| 475 | r_8* dline = nti->GetLineD(numline);
|
---|
| 476 | for(int kkv=0; kkv<nti->NbColumns(); kkv++) {
|
---|
| 477 | sprintf(buff, "%lg ", dline[kkv]);
|
---|
| 478 | v2str += buff;
|
---|
| 479 | }
|
---|
| 480 | }
|
---|
| 481 | else {
|
---|
| 482 | int numcol = atoi(tokens[1].c_str());
|
---|
| 483 | if ( (numcol >= nti->NbColumns()) || (numcol < 0) ) {
|
---|
| 484 | cerr << "ntcol2var Error: numcol" << tokens[1] << " out of bounds" << endl;
|
---|
| 485 | return(0);
|
---|
| 486 | }
|
---|
[2419] | 487 | int_8 kks = 0;
|
---|
| 488 | int_8 kke = nti->NbLines();
|
---|
| 489 | int_8 kkp = 1;
|
---|
[2305] | 490 | if (tokens.size() > 3) Services2NObjMgr::DecodeLoopParameters(tokens[3], kks, kke, kkp);
|
---|
| 491 | if (kks < 0) kks = 0;
|
---|
[2419] | 492 | if (kke > (int_8)nti->NbLines()) kke = nti->NbLines();
|
---|
[2305] | 493 | if (kkp < 1) kkp = 1;
|
---|
| 494 | int nelt = (kke-kks-1)/kkp;
|
---|
| 495 | if (nelt > MAXNWORDSO2V) {
|
---|
| 496 | nelt = MAXNWORDSO2V;
|
---|
| 497 | cout << "ntcol2var Warning: Only " << nelt
|
---|
| 498 | << " lines " << " will be converted to string" << endl;
|
---|
| 499 | kke = kks+nelt*kkp;
|
---|
| 500 | }
|
---|
| 501 | r_8* dline;
|
---|
| 502 | for(int kkl=kks; kkl<kke; kkl+=kkp) {
|
---|
| 503 | dline = nti->GetLineD(kkl);
|
---|
| 504 | sprintf(buff, "%lg ", dline[numcol]);
|
---|
| 505 | v2str += buff;
|
---|
| 506 | }
|
---|
| 507 | }
|
---|
| 508 | mObjMgr->SetVar(tokens[2], v2str);
|
---|
| 509 | if (adel) delete nti;
|
---|
| 510 | }
|
---|
| 511 |
|
---|
| 512 | // -------------------------------------------------------
|
---|
[455] | 513 | // Copie d'objets
|
---|
[2176] | 514 | else if ( (kw == "copy") || (kw == "cp") ) {
|
---|
[455] | 515 | if(tokens.size()<2) {
|
---|
| 516 | cout<<"Usage: copy name_from name_to"<<endl;return(0);
|
---|
| 517 | }
|
---|
[463] | 518 | mObjMgr->CopyObj(tokens[0],tokens[1]);
|
---|
[455] | 519 | }
|
---|
| 520 |
|
---|
| 521 |
|
---|
[293] | 522 | // >>>>>>>>>>> Trace de fonctions
|
---|
| 523 | else if ( (kw == "func") ) {
|
---|
[1938] | 524 | if(tokens.size()<3) {cout<<"Usage: func f(x) xmin xmax [npt opt]"<<endl; return(0);}
|
---|
| 525 | int np = 100;
|
---|
| 526 | double xmin=0., xmax=1.;
|
---|
| 527 | string opt = "", nom = "";
|
---|
| 528 | xmin = atof(tokens[1].c_str()); xmax = atof(tokens[2].c_str());
|
---|
| 529 | if (tokens.size() > 3) np = atoi(tokens[3].c_str());
|
---|
[293] | 530 | if (tokens.size() > 4) opt = tokens[4];
|
---|
[333] | 531 | mObjMgr->GetServiceObj()->PlotFunc(tokens[0], nom, xmin, xmax, np, opt);
|
---|
[293] | 532 | }
|
---|
[326] | 533 | else if ( (kw == "funcff") ) {
|
---|
[1938] | 534 | if (tokens.size()<4) {cout<<"Usage: funcff C-filename f(x)-name xmin xmax [npt opt]"<<endl; return(0);}
|
---|
| 535 | int np = 100;
|
---|
| 536 | double xmin=0., xmax=1.;
|
---|
| 537 | string opt = "", nom = "";
|
---|
| 538 | xmin = atof(tokens[2].c_str()); xmax = atof(tokens[3].c_str());
|
---|
| 539 | if(tokens.size()>4) np = atoi(tokens[4].c_str());
|
---|
| 540 | if(tokens.size()>5) opt = tokens[5];
|
---|
[333] | 541 | mObjMgr->GetServiceObj()->PlotFuncFrCFile(tokens[0], tokens[1], nom, xmin, xmax, np, opt);
|
---|
[326] | 542 | }
|
---|
[293] | 543 | else if ( (kw == "func2d") ) {
|
---|
| 544 | if (tokens.size() < 7) {
|
---|
[357] | 545 | cout << "Usage: func2d f(x,y) xmin xmax nptx ymin ymax npty [opt]" << endl;
|
---|
[293] | 546 | return(0);
|
---|
| 547 | }
|
---|
| 548 | int npx, npy;
|
---|
[333] | 549 | double xmin, xmax;
|
---|
| 550 | double ymin, ymax;
|
---|
[293] | 551 | npx = npy = 50;
|
---|
| 552 | xmin = 0.; xmax = 1.;
|
---|
| 553 | ymin = 0.; ymax = 1.;
|
---|
| 554 | npx = atoi(tokens[3].c_str());
|
---|
| 555 | npy = atoi(tokens[6].c_str());
|
---|
| 556 | xmin = atof(tokens[1].c_str()); xmax = atof(tokens[2].c_str());
|
---|
| 557 | ymin = atof(tokens[4].c_str()); ymax = atof(tokens[5].c_str());
|
---|
[357] | 558 | string opt = "";
|
---|
[293] | 559 | if (tokens.size() > 7) opt = tokens[7];
|
---|
[333] | 560 | string nom = "";
|
---|
| 561 | mObjMgr->GetServiceObj()->PlotFunc2D(tokens[0], nom, xmin, xmax, ymin, ymax, npx, npy, opt);
|
---|
[293] | 562 | }
|
---|
[326] | 563 | else if ( (kw == "func2dff") ) {
|
---|
| 564 | if (tokens.size() < 8) {
|
---|
[357] | 565 | cout << "Usage: func2d C-filename F(x,y)-name xmax nptx ymin ymax npty [opt]" << endl;
|
---|
[326] | 566 | return(0);
|
---|
| 567 | }
|
---|
| 568 | int npx, npy;
|
---|
[333] | 569 | double xmin, xmax;
|
---|
| 570 | double ymin, ymax;
|
---|
[326] | 571 | npx = npy = 50;
|
---|
| 572 | xmin = 0.; xmax = 1.;
|
---|
| 573 | ymin = 0.; ymax = 1.;
|
---|
| 574 | npx = atoi(tokens[4].c_str());
|
---|
| 575 | npy = atoi(tokens[7].c_str());
|
---|
| 576 | xmin = atof(tokens[2].c_str()); xmax = atof(tokens[3].c_str());
|
---|
| 577 | ymin = atof(tokens[5].c_str()); ymax = atof(tokens[6].c_str());
|
---|
[357] | 578 | string opt = "";
|
---|
[326] | 579 | if (tokens.size() > 8) opt = tokens[8];
|
---|
[333] | 580 | string nom = "";
|
---|
| 581 | mObjMgr->GetServiceObj()->PlotFunc2DFrCFile(tokens[0], tokens[1], nom, xmin, xmax, ymin, ymax, npx, npy, opt);
|
---|
[326] | 582 | }
|
---|
[293] | 583 |
|
---|
| 584 | // >>>>>>>>>>> Trace d'expressions de N_Tuple, StarList, etc ...
|
---|
| 585 | else if (kw == "plot2d" ) {
|
---|
[357] | 586 | if (tokens.size() < 3) {
|
---|
| 587 | cout << "Usage: plot2d nameobj expx expy [expcut opt loop_par]" << endl;
|
---|
[293] | 588 | return(0);
|
---|
| 589 | }
|
---|
[357] | 590 | string errx = ""; string erry = "";
|
---|
| 591 | if (tokens.size() < 4) tokens.push_back("1");
|
---|
| 592 | while (tokens.size() < 6) tokens.push_back("");
|
---|
| 593 | srvo->DisplayPoints2D(tokens[0],tokens[1],tokens[2],errx,erry,tokens[3],tokens[4],tokens[5]);
|
---|
| 594 | }
|
---|
| 595 |
|
---|
| 596 | else if (kw == "plot2de" ) { // Plot2D avec les erreurs
|
---|
| 597 | if (tokens.size() < 5) {
|
---|
| 598 | cout << "Usage: plot2de nameobj expx expy experrx experry [expcut opt loop_par]" << endl;
|
---|
| 599 | return(0);
|
---|
[293] | 600 | }
|
---|
[357] | 601 | if (tokens.size() < 6) tokens.push_back("1");
|
---|
| 602 | while (tokens.size() < 8) tokens.push_back("");
|
---|
| 603 | srvo->DisplayPoints2D(tokens[0],tokens[1],tokens[2],tokens[3],tokens[4],
|
---|
| 604 | tokens[5],tokens[6],tokens[7]);
|
---|
[293] | 605 | }
|
---|
| 606 |
|
---|
[357] | 607 | else if (kw == "plot2dw" ) { // Plot2d avec poids
|
---|
| 608 | if (tokens.size() < 4) {
|
---|
| 609 | cout << "Usage: plot2dw nomobj expx expy expwt [expcut opt loop_par]" << endl;
|
---|
[333] | 610 | return(0);
|
---|
| 611 | }
|
---|
[357] | 612 | if (tokens.size() < 5) tokens.push_back("1");
|
---|
| 613 | while (tokens.size() < 7) tokens.push_back("");
|
---|
| 614 | srvo->DisplayPoints2DW(tokens[0],tokens[1],tokens[2],tokens[3], tokens[4], tokens[5], tokens[6]);
|
---|
[333] | 615 | }
|
---|
[357] | 616 | else if (kw == "plot3d" ) {
|
---|
| 617 | if (tokens.size() < 4) {
|
---|
| 618 | cout << "Usage: plot3d nomobj expx expy expz [expcut opt loop_par]" << endl;
|
---|
[293] | 619 | return(0);
|
---|
| 620 | }
|
---|
[357] | 621 | if (tokens.size() < 5) tokens.push_back("1");
|
---|
| 622 | while (tokens.size() < 7) tokens.push_back("");
|
---|
| 623 | srvo->DisplayPoints3D(tokens[0],tokens[1],tokens[2],tokens[3], tokens[4], tokens[5], tokens[6]);
|
---|
[293] | 624 | }
|
---|
| 625 |
|
---|
| 626 | else if (kw == "projh1d" ) {
|
---|
[357] | 627 | if (tokens.size() < 3) {
|
---|
| 628 | cout << "Usage: projh1d nomh1 nomobj expx [expwt expcut opt loop_par]" << endl;
|
---|
[293] | 629 | return(0);
|
---|
| 630 | }
|
---|
[357] | 631 | if (tokens.size() < 4) tokens.push_back("1.");
|
---|
| 632 | if (tokens.size() < 5) tokens.push_back("1");
|
---|
| 633 | while (tokens.size() < 7) tokens.push_back("");
|
---|
| 634 | srvo->ProjectH1(tokens[1], tokens[2], tokens[3], tokens[4], tokens[0], tokens[5], tokens[6] );
|
---|
[293] | 635 | }
|
---|
| 636 |
|
---|
[357] | 637 |
|
---|
| 638 | // Projection dans histogrammes
|
---|
[293] | 639 | else if (kw == "projh2d" ) {
|
---|
[357] | 640 | if (tokens.size() < 4) {
|
---|
| 641 | cout << "Usage: projh2d nomh2 nomobj expx expy [expwt expcut opt loop_par]" << endl;
|
---|
[293] | 642 | return(0);
|
---|
| 643 | }
|
---|
[357] | 644 | if (tokens.size() < 5) tokens.push_back("1.");
|
---|
| 645 | if (tokens.size() < 6) tokens.push_back("1");
|
---|
| 646 | while (tokens.size() < 8) tokens.push_back("");
|
---|
| 647 | srvo->ProjectH2(tokens[1], tokens[2], tokens[3], tokens[4], tokens[5], tokens[0],
|
---|
| 648 | tokens[6], tokens[7] );
|
---|
[293] | 649 | }
|
---|
| 650 |
|
---|
| 651 | else if (kw == "projprof" ) {
|
---|
[357] | 652 | if (tokens.size() < 4) {
|
---|
| 653 | cout << "Usage: projprof nomprof nomobj expx expy [expwt expcut opt loop_par]" << endl;
|
---|
[293] | 654 | return(0);
|
---|
| 655 | }
|
---|
[357] | 656 | if (tokens.size() < 5) tokens.push_back("1.");
|
---|
| 657 | if (tokens.size() < 6) tokens.push_back("1");
|
---|
| 658 | while (tokens.size() < 8) tokens.push_back("");
|
---|
| 659 | srvo->ProjectHProf(tokens[1], tokens[2], tokens[3], tokens[4], tokens[5], tokens[0],
|
---|
[1091] | 660 | tokens[6], tokens[7] );
|
---|
[357] | 661 | }
|
---|
[293] | 662 |
|
---|
[357] | 663 | // Projection dans vector/matrix
|
---|
| 664 | else if (kw == "fillvec" ) {
|
---|
| 665 | if (tokens.size() < 4) {
|
---|
| 666 | cout << "Usage: fillvec nomvec nomobj expx expv [expcut opt loop_par]" << endl;
|
---|
| 667 | return(0);
|
---|
| 668 | }
|
---|
| 669 | if (tokens.size() < 5) tokens.push_back("1");
|
---|
| 670 | while (tokens.size() < 7) tokens.push_back("");
|
---|
| 671 | srvo->FillVect(tokens[1], tokens[2], tokens[3], tokens[4], tokens[0], tokens[5], tokens[6] );
|
---|
[293] | 672 | }
|
---|
| 673 |
|
---|
[357] | 674 | else if (kw == "fillmtx" ) {
|
---|
| 675 | if (tokens.size() < 5) {
|
---|
| 676 | cout << "Usage: fillmtx nommtx nomobj expx expy expv [expcut opt loop_par]" << endl;
|
---|
| 677 | return(0);
|
---|
| 678 | }
|
---|
| 679 | if (tokens.size() < 6) tokens.push_back("1");
|
---|
| 680 | while (tokens.size() < 8) tokens.push_back("");
|
---|
| 681 | srvo->FillMatx(tokens[1], tokens[2], tokens[3], tokens[4], tokens[5], tokens[0],
|
---|
| 682 | tokens[6], tokens[7] );
|
---|
| 683 | }
|
---|
| 684 |
|
---|
| 685 | // Remplissage NTuple,Vecteurs, ... , boucle de NTuple
|
---|
[447] | 686 | else if (kw == "ntfrascii" ) {
|
---|
| 687 | if(tokens.size() < 2) {
|
---|
| 688 | cout<<"Usage: ntfrascii nt_name file_name [def_init_val]"<<endl;
|
---|
| 689 | return(0);
|
---|
| 690 | }
|
---|
| 691 | double def_val = 0.;
|
---|
| 692 | if(tokens.size()>=3) def_val = atof(tokens[2].c_str());
|
---|
| 693 | srvo->NtFromASCIIFile(tokens[0],tokens[1],def_val);
|
---|
| 694 | }
|
---|
| 695 |
|
---|
[2263] | 696 | #ifndef SANS_EVOLPLANCK
|
---|
| 697 | /* Lecture matrice/vecteur depuis fichier ASCII */
|
---|
| 698 | else if ((kw == "mtxfrascii") || (kw == "vecfrascii") ) {
|
---|
| 699 | if(tokens.size() < 2) {
|
---|
[2289] | 700 | cout<<"Usage: mtxfrascii/vecfrascii mtx/vec_name file_name [CommLine Separator]"<<endl;
|
---|
[2263] | 701 | return(0);
|
---|
| 702 | }
|
---|
| 703 | TMatrix<r_8> mtx;
|
---|
| 704 | TVector<r_8> vec;
|
---|
| 705 | FILE* fip = fopen(tokens[1].c_str(), "r");
|
---|
| 706 | if (fip == NULL) {
|
---|
| 707 | cout << "vec/mtxfrascii: can not open file " << tokens[1] << endl;
|
---|
| 708 | return(0);
|
---|
| 709 | }
|
---|
| 710 | fclose(fip);
|
---|
| 711 | ifstream is(tokens[1].c_str());
|
---|
| 712 | sa_size_t nr, nc;
|
---|
[2289] | 713 | char clm = '#';
|
---|
| 714 | string sep = " \t";
|
---|
| 715 | if (tokens.size()>2) clm = tokens[2][0];
|
---|
| 716 | if (tokens.size()>3) sep = tokens[3];
|
---|
[2263] | 717 | if (kw == "mtxfrascii") {
|
---|
[2289] | 718 | mtx.ReadASCII(is, nr, nc, clm, sep.c_str());
|
---|
[2263] | 719 | mObjMgr->AddObj(mtx, tokens[0]);
|
---|
| 720 | cout << "mtxfrascii: TMatrix<r_8> " << tokens[0] << " read from file "
|
---|
| 721 | << tokens[1] << endl;
|
---|
| 722 | }
|
---|
| 723 | else {
|
---|
[2289] | 724 | vec.ReadASCII(is, nr, nc, clm, sep.c_str());
|
---|
[2263] | 725 | mObjMgr->AddObj(vec, tokens[0]);
|
---|
| 726 | cout << "vecfrascii: TVector<r_8> " << tokens[0] << " read from file "
|
---|
| 727 | << tokens[1] << endl;
|
---|
| 728 | }
|
---|
| 729 | }
|
---|
[2268] | 730 | else if (kw == "arrtoascii") {
|
---|
| 731 | if(tokens.size() < 2) {
|
---|
| 732 | cout<<"Usage: arrtoascii array_name file_name "<<endl;
|
---|
| 733 | return(0);
|
---|
| 734 | }
|
---|
| 735 |
|
---|
| 736 | AnyDataObj* obj;
|
---|
| 737 | obj = mObjMgr->GetObj(tokens[0]);
|
---|
| 738 | if(obj == NULL) {
|
---|
| 739 | cerr << "arrtoascii Error , No such object " << tokens[0] << endl;
|
---|
| 740 | return(0);
|
---|
| 741 | }
|
---|
| 742 | BaseArray* ba = dynamic_cast<BaseArray *>(obj);
|
---|
| 743 | if(ba == NULL) {
|
---|
| 744 | cerr << "arrtoascii Error " << tokens[0] << " not a BaseArray ! " << endl;
|
---|
| 745 | return(0);
|
---|
| 746 | }
|
---|
| 747 | ofstream os(tokens[1].c_str());
|
---|
| 748 | ba->WriteASCII(os);
|
---|
| 749 | cout << "arrtoascii: Array " << tokens[0] << " written to file " << tokens[1] << endl;
|
---|
| 750 | }
|
---|
| 751 |
|
---|
[2263] | 752 | #endif
|
---|
| 753 |
|
---|
[293] | 754 | else if (kw == "fillnt" ) {
|
---|
[357] | 755 | if (tokens.size() < 5) {
|
---|
| 756 | cout << "Usage: fillnt nameobj expx expy expz expt [expcut ntname loop_par]" << endl;
|
---|
[293] | 757 | return(0);
|
---|
| 758 | }
|
---|
[357] | 759 | while (tokens.size() < 8) tokens.push_back("");
|
---|
| 760 | srvo->FillNT(tokens[0],tokens[1],tokens[2], tokens[3], tokens[4], tokens[5], tokens[6], tokens[7] );
|
---|
[293] | 761 | }
|
---|
| 762 |
|
---|
[333] | 763 | else if (kw == "ntloop" ) {
|
---|
| 764 | if (tokens.size() < 3) {
|
---|
[357] | 765 | cout << "Usage: ntloop nameobj fname funcname [ntname loop_par ]" << endl;
|
---|
[333] | 766 | return(0);
|
---|
| 767 | }
|
---|
[357] | 768 | while (tokens.size() < 5) tokens.push_back("");
|
---|
| 769 | srvo->FillNTFrCFile(tokens[0],tokens[1], tokens[2], tokens[3], tokens[4]);
|
---|
[333] | 770 | }
|
---|
| 771 |
|
---|
| 772 | else if (kw == "ntexpcfile" ) {
|
---|
| 773 | if (tokens.size() < 3) {
|
---|
| 774 | cout << "Usage: ntexpcfile nameobj fname funcname" << endl;
|
---|
| 775 | return(0);
|
---|
| 776 | }
|
---|
| 777 | srvo->PrepareNTExpressionCFile(tokens[0],tokens[1], tokens[2]);
|
---|
| 778 | }
|
---|
| 779 |
|
---|
[2922] | 780 | else if (kw == "expmeansig" ) {
|
---|
| 781 | if (tokens.size() < 2) {
|
---|
| 782 | cout << "Usage: expmeansig nameobj expx [expcut loop_par]" << endl;
|
---|
| 783 | return(0);
|
---|
| 784 | }
|
---|
| 785 | while (tokens.size() < 4) tokens.push_back("");
|
---|
| 786 | string dummy = "";
|
---|
| 787 | cout << " expmeansig: computing mean/sigma + min/max for " << tokens[0]
|
---|
| 788 | << "." << tokens[1] << endl;
|
---|
| 789 | srvo->ExpressionToVector(tokens[0],tokens[1],tokens[2],dummy,dummy,tokens[3]);
|
---|
| 790 | }
|
---|
| 791 |
|
---|
[357] | 792 | else if (kw == "exptovec" ) {
|
---|
| 793 | if (tokens.size() < 3) {
|
---|
| 794 | cout << "Usage: exptovec nomvec nameobj expx [expcut opt loop_par]" << endl;
|
---|
[293] | 795 | return(0);
|
---|
| 796 | }
|
---|
[357] | 797 | while (tokens.size() < 6) tokens.push_back("");
|
---|
| 798 | srvo->ExpressionToVector(tokens[1],tokens[2],tokens[3],tokens[0],tokens[4],tokens[5]);
|
---|
[293] | 799 | }
|
---|
| 800 |
|
---|
| 801 | else if (kw == "fillgd1" ) {
|
---|
| 802 | if (tokens.size() < 5) {
|
---|
[357] | 803 | cout << "Usage: fillgd1 nomgfd nomobj expx expy experry [expcut loop_par] " << endl;
|
---|
[293] | 804 | return(0);
|
---|
| 805 | }
|
---|
[357] | 806 | if (tokens.size() < 6) tokens.push_back("1");
|
---|
| 807 | if (tokens.size() < 7) tokens.push_back("");
|
---|
[293] | 808 | string expy = "";
|
---|
[357] | 809 | srvo->FillGFD(tokens[1],tokens[2], expy, tokens[3], tokens[4], tokens[5], tokens[0]);
|
---|
[293] | 810 | }
|
---|
| 811 |
|
---|
| 812 | else if (kw == "fillgd2" ) {
|
---|
| 813 | if (tokens.size() < 6) {
|
---|
[357] | 814 | cout << "Usage: fillgd2 nomgfd nomobj expx expy expz experrz [expcut loop_par]" << endl;
|
---|
[293] | 815 | return(0);
|
---|
| 816 | }
|
---|
[357] | 817 | if (tokens.size() < 7) tokens.push_back("1");
|
---|
| 818 | if (tokens.size() < 8) tokens.push_back("");
|
---|
| 819 | srvo->FillGFD(tokens[1],tokens[2],tokens[3], tokens[4], tokens[5], tokens[6], tokens[0], tokens[7]);
|
---|
[293] | 820 | }
|
---|
| 821 |
|
---|
[1067] | 822 | else if (kw == "gdfrvec" ) {
|
---|
| 823 | if(tokens.size()<3) {
|
---|
| 824 | cout<<"Usage: gdfrvec namegfd X Y\n"
|
---|
| 825 | <<" gdfrvec namegfd X Y"
|
---|
| 826 | <<" gdfrvec namegfd X Y ! EY\n"
|
---|
| 827 | <<" gdfrvec namegfd X Y Z\n"
|
---|
| 828 | <<" gdfrvec namegfd X Y Z EZ"<<endl;
|
---|
| 829 | return(0);
|
---|
| 830 | }
|
---|
| 831 | while(tokens.size()<5) tokens.push_back("!");
|
---|
| 832 | srvo->FillGFDfrVec(tokens[0],tokens[1],tokens[2],tokens[3],tokens[4]);
|
---|
| 833 | }
|
---|
[293] | 834 |
|
---|
[2180] | 835 | // >>>>>>>>>>> Calcul d'expression arithmetique
|
---|
| 836 | else if ( (kw == "eval") ) {
|
---|
| 837 | if(tokens.size()<2)
|
---|
| 838 | {cout<<"Usage: eval resultvarname arithmetic expression...."<<endl; return(0);}
|
---|
| 839 | string expval = "";
|
---|
| 840 | for(unsigned int i=1;i<tokens.size();i++) expval+=tokens[i];
|
---|
| 841 | string resultvarname = "";
|
---|
| 842 | if(isalpha(tokens[0][0])) resultvarname=tokens[0];
|
---|
| 843 | mObjMgr->GetServiceObj()->ExpVal(expval,resultvarname);
|
---|
| 844 | }
|
---|
[293] | 845 |
|
---|
| 846 | else {
|
---|
| 847 | cerr << "PIABaseExecutor::Do() Erreur - Commande " << kw << " inconuue ! " << endl;
|
---|
| 848 | return(-1);
|
---|
| 849 | }
|
---|
| 850 |
|
---|
| 851 | return(0);
|
---|
| 852 | }
|
---|
| 853 |
|
---|
[2755] | 854 | /* --Methode-- */
|
---|
| 855 | bool PIABaseExecutor::IsThreadable(string const & keyw)
|
---|
| 856 | {
|
---|
| 857 | if ( (keyw == "fillvec") || (keyw == "fillmtx") ||
|
---|
| 858 | (keyw == "fillnt") || (keyw == "ntloop") ) return true;
|
---|
| 859 | else if (keyw.substr(0,4) == "func") return true;
|
---|
| 860 | else {
|
---|
| 861 | string skw = keyw.substr(0,5);
|
---|
| 862 | if ( (skw == "plot2") || (skw == "plot3") || (skw == "projh") ) return true;
|
---|
| 863 | }
|
---|
| 864 | return false;
|
---|
| 865 | }
|
---|
| 866 |
|
---|
[388] | 867 |
|
---|
[293] | 868 | /* --Methode-- */
|
---|
| 869 | void PIABaseExecutor::RegisterCommands()
|
---|
| 870 | {
|
---|
[2419] | 871 | string kw, usage, grp;
|
---|
[2781] | 872 | //--------- Commandes du groupe modules externes
|
---|
[2465] | 873 | grp = "External Modules";
|
---|
| 874 | string gdesc = "Dynamic load (shared object modules) management command group";
|
---|
| 875 | mpiac->AddHelpGroup(grp, gdesc);
|
---|
[293] | 876 | kw = "loadmodule";
|
---|
| 877 | usage = "To load and initialize modules \n Usage: loadmodule fnameso modulename";
|
---|
| 878 | usage += "\n Related commands: link";
|
---|
[2465] | 879 | mpiac->RegisterCommand(kw, usage, this, grp);
|
---|
[293] | 880 | kw = "link";
|
---|
| 881 | usage = "Dynamic linking of compiled user functions \n Usage: link fnameso f1 [f2 f3]";
|
---|
| 882 | usage += "\n fnameso: Shared-object file name, f1,f2,f3 : User function names ";
|
---|
[1276] | 883 | usage += "\n Related commands: call loadmodule linkff2";
|
---|
[2465] | 884 | mpiac->RegisterCommand(kw, usage, this, grp);
|
---|
[1276] | 885 | kw = "linkff2";
|
---|
| 886 | usage = "Dynamic linking of compiled user functions (Set 2)\n Usage: linkff2 fnameso f1 [f2 f3]";
|
---|
| 887 | usage += "\n fnameso: Shared-object file name, f1,f2,f3 : User function names ";
|
---|
| 888 | usage += "\n Related commands: call link loadmodule";
|
---|
[2465] | 889 | mpiac->RegisterCommand(kw, usage, this, grp);
|
---|
[293] | 890 | kw = "call";
|
---|
| 891 | usage = "Dynamically linked user function call \n Usage: call userf [arg1 arg2 ...]";
|
---|
| 892 | usage += "\n User function : f(vector<string>& args)";
|
---|
| 893 | usage += "\n Related commands: link";
|
---|
[2465] | 894 | mpiac->RegisterCommand(kw, usage, this, grp);
|
---|
[293] | 895 |
|
---|
| 896 | kw = "openppf";
|
---|
[2645] | 897 | usage = "Reads all or some objects from a PPF file \n Usage: openppf filename [objname1 objname2 ...]";
|
---|
[2933] | 898 | usage += "\n Related commands: saveall ";
|
---|
[330] | 899 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
|
---|
[2132] | 900 | kw = "saveppf";
|
---|
| 901 | usage = "Saves objects with names matching a pattern into a\n";
|
---|
| 902 | usage += " PPF file (pattern: x?y*) - Alias saveppf\n";
|
---|
| 903 | usage += "Usage: saveppf nameobjpattern filename";
|
---|
[2933] | 904 | usage += "\n Related commands: saveobjs savelist saveall openppf";
|
---|
[2132] | 905 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
|
---|
[333] | 906 | kw = "saveobjs";
|
---|
[2132] | 907 | usage = "Saves objects with names matching a pattern into a\n";
|
---|
| 908 | usage += " PPF file (pattern: x?y*) - Alias saveppf\n";
|
---|
[1068] | 909 | usage += "Usage: saveobjs nameobjpattern filename";
|
---|
[2933] | 910 | usage += "\n Related commands: saveppf savelist saveall openppf ";
|
---|
[333] | 911 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
|
---|
[293] | 912 | kw = "saveall";
|
---|
| 913 | usage = "Saves all objects into a PPF file \n Usage: saveall filename";
|
---|
[2933] | 914 | usage += "\n Related commands: saveobj savelist openppf";
|
---|
[2669] | 915 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
|
---|
| 916 | kw = "savelist";
|
---|
| 917 | usage = "Saves a list of objects into a PPF file";
|
---|
| 918 | usage = "\n Usage: savelist objname1 [objname2 ...] filename";
|
---|
[2933] | 919 | usage += "\n Related commands: saveobj openppf";
|
---|
[330] | 920 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
|
---|
[449] | 921 | kw = "ntfrascii";
|
---|
[2792] | 922 | usage = "Fills an existing NTuple or DataTable from ASCII table file";
|
---|
[449] | 923 | usage += "\n Usage: ntfrascii nt_name file_name [def_init_val]";
|
---|
| 924 | usage += "\n Related commands: ntloop fillnt ";
|
---|
| 925 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
|
---|
[2263] | 926 | #ifndef SANS_EVOLPLANCK
|
---|
| 927 | kw = "mtxfrascii";
|
---|
| 928 | usage = "Reads a matrix from an ASCII file (TMatrix<r_8>)";
|
---|
[2289] | 929 | usage += "\n Usage: mtxfrascii mtx_name file_name [CommChar Separator]";
|
---|
[2268] | 930 | usage += "\n Related commands: arrtoascii vecfrascii ntfrascii ";
|
---|
[2263] | 931 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
|
---|
| 932 | kw = "vecfrascii";
|
---|
[2268] | 933 | usage = "Reads a vector from an ASCII file (TVector<r_8>)";
|
---|
[2263] | 934 | usage += "\n Usage: vecfrascii vec_name file_name";
|
---|
[2289] | 935 | usage += "\n Related commands: arrtoascii mtxfrascii ntfrascii [CommChar Separator]";
|
---|
[2263] | 936 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
|
---|
[2268] | 937 | kw = "arrtoascii";
|
---|
| 938 | usage = "Writes an array (TArray<T>) to an ASCII file ";
|
---|
| 939 | usage += "\n Usage: arrtoascii array_name file_name";
|
---|
| 940 | usage += "\n Related commands: mtxfrascii vecfrascii ntfrascii ";
|
---|
| 941 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
|
---|
[2263] | 942 | #endif
|
---|
[293] | 943 |
|
---|
| 944 | kw = "print";
|
---|
| 945 | usage = "Prints an object \n Usage: print nameobj";
|
---|
[330] | 946 | mpiac->RegisterCommand(kw, usage, this, "FileIO");
|
---|
[293] | 947 |
|
---|
[2781] | 948 | //------- Commandes gestion de repertoires et d'objets
|
---|
[333] | 949 | kw = "mkdir";
|
---|
| 950 | usage = "Create a directory";
|
---|
[344] | 951 | usage += "\n Usage: mkdir dirname [true]";
|
---|
| 952 | usage += "\n if second argument==true, the directory's KeepOld attribute is set to true";
|
---|
[463] | 953 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
[333] | 954 | kw = "rmdir";
|
---|
| 955 | usage = "Removes an empty directory";
|
---|
| 956 | usage += "\n Usage: remove dirname";
|
---|
[463] | 957 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
[2132] | 958 | kw = "setdiratt";
|
---|
| 959 | usage = "Sets directory attributes";
|
---|
| 960 | usage += "\n Usage: setdiratt dirname KeepOldFlag(=true/false)";
|
---|
| 961 | usage += "\n KeepOldFlag=true Object with the same name is moved to old";
|
---|
| 962 | usage += "\n when adding objects";
|
---|
| 963 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
[333] | 964 | kw = "cd";
|
---|
| 965 | usage = "Change current directory";
|
---|
| 966 | usage += "\n Usage: cd [dirname]";
|
---|
[463] | 967 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
[333] | 968 | kw = "pwd";
|
---|
| 969 | usage = "Prints current directory";
|
---|
| 970 | usage += "\n Usage: pwd";
|
---|
[463] | 971 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
[333] | 972 | kw = "listdirs";
|
---|
| 973 | usage = "Prints the list of directories";
|
---|
| 974 | usage += "\n Usage: listdirs [patt=*] \n patt : * , ? ";
|
---|
[463] | 975 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
[295] | 976 | kw = "listobjs";
|
---|
[333] | 977 | usage = "Prints the list of objects (Alias: ls)";
|
---|
| 978 | usage += "\n Usage: listobjs [patt=*] \n patt : /*/x?y* ... ";
|
---|
[463] | 979 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
[293] | 980 | kw = "rename";
|
---|
[333] | 981 | usage = "Rename an object (Alias: mv) \n Usage: rename nameobj namenew";
|
---|
[2132] | 982 | usage += "\n Related commands: mv del delobjs";
|
---|
[463] | 983 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
[2132] | 984 | kw = "mv";
|
---|
| 985 | usage = "Rename an object (Alias: rename) \n Usage: mv nameobj namenew";
|
---|
| 986 | usage += "\n Related commands: rename del delobjs";
|
---|
| 987 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
[463] | 988 | kw = "copy";
|
---|
[2132] | 989 | usage = "Copy objects (Alias cp) \n";
|
---|
[463] | 990 | usage +=" Usage: copy name_from name_to";
|
---|
[2132] | 991 | usage += "\n Related commands: cp new...";
|
---|
[2176] | 992 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
[2132] | 993 | kw = "cp";
|
---|
| 994 | usage = "Copy objects (Alias copy) \n";
|
---|
| 995 | usage +=" Usage: cp name_from name_to";
|
---|
| 996 | usage += "\n Related commands: copy new...";
|
---|
[463] | 997 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
[293] | 998 | kw = "del";
|
---|
[1655] | 999 | usage = "Deletes an object (Alias: rm) \n Usage: del nameobj [nameobj2 ...]";
|
---|
[2132] | 1000 | usage += "\n Related commands: rm delobjs rename";
|
---|
[463] | 1001 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
[2132] | 1002 | kw = "rm";
|
---|
| 1003 | usage = "Deletes an object (Alias: del) \n Usage: rm nameobj [nameobj2 ...]";
|
---|
| 1004 | usage += "\n Related commands: del delobjs rename";
|
---|
| 1005 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
[293] | 1006 | kw = "delobjs";
|
---|
| 1007 | usage = "Delete a set of objects with names matching a pattern (x?y*)";
|
---|
| 1008 | usage += "\n Usage: delobjs nameobjpattern \n";
|
---|
| 1009 | usage += "\n Related commands: del rename";
|
---|
[463] | 1010 | mpiac->RegisterCommand(kw, usage, this, "Object Management");
|
---|
[293] | 1011 |
|
---|
[2781] | 1012 | //------- Commandes creation/manipulation d'objets
|
---|
[293] | 1013 | kw = "newh1d";
|
---|
| 1014 | usage = "Creates a 1D histogramm \n Usage: newh1d name xmin xmax nbin";
|
---|
[2792] | 1015 | usage += "\n Related commands: newh2d newprof[e] newdt newnt newgfd ";
|
---|
[333] | 1016 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
[293] | 1017 | kw = "newh2d";
|
---|
| 1018 | usage = "Creates a 2D histogramm \n Usage: newh2d name xmin xmax nbinx ymin ymax nbiny";
|
---|
[2792] | 1019 | usage += "\n Related commands: newh1d newprof[e] newdt newnt newgfd ";
|
---|
[333] | 1020 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
[293] | 1021 | kw = "newprof";
|
---|
| 1022 | usage = "Creates a profile histogramm \n Usage: newprof name xmin xmax nbin [ymin ymax]";
|
---|
[1035] | 1023 | usage += "\n Errors represent the data spread in the X bin ";
|
---|
[2792] | 1024 | usage += "\n Related commands: newh1d newh2d newprofe newdt newnt newgfd ";
|
---|
[333] | 1025 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
[1035] | 1026 | kw = "newprofe";
|
---|
| 1027 | usage = "Creates a profile histogramm \n Usage: newprofe name xmin xmax nbin [ymin ymax]";
|
---|
| 1028 | usage += "\n Errors represent the error on the data mean in the X bin ";
|
---|
[2792] | 1029 | usage += "\n Related commands: newh1d newh2d newprof newdt newnt newgfd ";
|
---|
[1035] | 1030 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
[447] | 1031 | kw = "newnt";
|
---|
| 1032 | usage = "Creates a ntuple \n Usage: newnt name v1 v2 v3 .. vn";
|
---|
| 1033 | usage += "\n newnt name nvar";
|
---|
[2792] | 1034 | usage += "\n Related commands: newdt newh1d newh2d newprof[e] newgfd ";
|
---|
[447] | 1035 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
[2792] | 1036 | kw = "newdt";
|
---|
| 1037 | usage = "Creates a datatable \n Usage: newdt name v1:t1 v2:t2 v3:t3 .. vn:tn";
|
---|
| 1038 | usage += "\n newdt name nvar";
|
---|
| 1039 | usage += "\n vi : variable name";
|
---|
| 1040 | usage += "\n ti : variable type";
|
---|
| 1041 | usage += "\n r8,r4 for 8 and 4 bytes float";
|
---|
| 1042 | usage += "\n i8,i4 for 8 and 4 bytes signed integer";
|
---|
| 1043 | usage += "\n s for string";
|
---|
| 1044 | usage += "\n Related commands: newnt newh1d newh2d newprof[e] newgfd";
|
---|
| 1045 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
[293] | 1046 | kw = "newgfd";
|
---|
| 1047 | usage = "Creates GeneralFit Data object \n Usage: newgfd nvar nalloc [errx(0/1)]";
|
---|
[2792] | 1048 | usage += "\n Related commands: newh1d newh2d newprof[e] newdt newnt ";
|
---|
[333] | 1049 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
| 1050 | kw = "newvec";
|
---|
[357] | 1051 | usage = "Creates (and optionaly fills) a vector \n Usage: newvec name size [f(i) [dopt] ] ";
|
---|
[2305] | 1052 | usage += "\n Related commands: newmtx line2vec";
|
---|
[357] | 1053 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
[333] | 1054 | kw = "newmtx";
|
---|
[357] | 1055 | usage = "Creates (and optionaly fills) a matrix \n";
|
---|
[1917] | 1056 | usage +=" Usage: newmtx name sizeX(Col) sizeY(Lines) [f(i,j) [dopt] ] ";
|
---|
[333] | 1057 | usage += "\n Related commands: newvec";
|
---|
[357] | 1058 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
[2305] | 1059 | kw = "line2vec";
|
---|
| 1060 | usage = "Creates a vector from the line \n";
|
---|
| 1061 | usage += " Usage: line2vec vecname v0 v1 v2 ... \n";
|
---|
| 1062 | usage += " Related commands: newvec line2nt";
|
---|
| 1063 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
| 1064 | kw = "line2nt";
|
---|
| 1065 | usage = "Fills (append) an NTuple from the line content \n";
|
---|
| 1066 | usage += " Usage: line2nt ntname col0 col1 ... \n";
|
---|
| 1067 | usage += " Related commands: newnt line2vec ntline2var ntcol2var";
|
---|
| 1068 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
| 1069 | kw = "vec2var";
|
---|
| 1070 | usage = "Vector content to an interpreter variable varname = 'v0 v1 v2 ...' \n";
|
---|
| 1071 | usage += " Usage: line2vec vecname varname [LoopParam start:end[:step] ]\n";
|
---|
| 1072 | usage += " Related commands: line2vec ntline2var";
|
---|
| 1073 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
| 1074 | kw = "ntline2var";
|
---|
| 1075 | usage = "Object NTupleInterface line to an interpreter variable \n";
|
---|
| 1076 | usage += " Usage: ntline2var objname line_number varname \n";
|
---|
| 1077 | usage += " Related commands: vec2var ntcol2var";
|
---|
| 1078 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
| 1079 | kw = "ntcol2var";
|
---|
| 1080 | usage = "Object NTupleInterface column to an interpreter variable \n";
|
---|
| 1081 | usage += " Usage: ntline2var objname column_number varname [LoopParam start:end[:step] ] \n";
|
---|
| 1082 | usage += " Related commands: vec2var ntline2var";
|
---|
| 1083 | mpiac->RegisterCommand(kw, usage, this, "Objects");
|
---|
[293] | 1084 |
|
---|
[2781] | 1085 | //------- Commandes trace de fonctions
|
---|
[293] | 1086 | kw = "func";
|
---|
| 1087 | usage = "Displays a function y=f(x) (Fills a vector with function values)";
|
---|
[1938] | 1088 | usage += "\n Usage: func f(x) xmin xmax [npt graphic_attributes]";
|
---|
[326] | 1089 | usage += "\n Related commands: funcff func2d func2dff ";
|
---|
[330] | 1090 | mpiac->RegisterCommand(kw, usage, this, "Func Plot");
|
---|
[326] | 1091 | kw = "funcff";
|
---|
| 1092 | usage = "Displays a function y=f(x) from a C-file (Fills a vector with function values)";
|
---|
[1938] | 1093 | usage += "\n Usage: funcff C-FileName FunctionName xmin xmax [npt graphic_attributes]";
|
---|
[326] | 1094 | usage += "\n Related commands: func func2d func2dff ";
|
---|
[330] | 1095 | mpiac->RegisterCommand(kw, usage, this, "Func Plot");
|
---|
[293] | 1096 | kw = "func2d";
|
---|
| 1097 | usage = "Displays a function z=f(x,y) (Fills a matrix with function values)";
|
---|
| 1098 | usage += "\n Usage: func2d f(x,y) xmin xmax nptx ymin ymax npty [graphic_attributes]";
|
---|
| 1099 | usage += "\n Related commands: func";
|
---|
[330] | 1100 | mpiac->RegisterCommand(kw, usage, this, "Func Plot");
|
---|
[326] | 1101 | kw = "func2dff";
|
---|
| 1102 | usage = "Displays a function z=f(x,y) from a C-file (Fills a matrix with function values)";
|
---|
| 1103 | usage += "\n Usage: func2dff C-FileName FunctionName xmin xmax nptx ymin ymax npty [graphic_attributes]";
|
---|
| 1104 | usage += "\n Related commands: func funcff func2d ";
|
---|
[330] | 1105 | mpiac->RegisterCommand(kw, usage, this, "Func Plot");
|
---|
[293] | 1106 |
|
---|
[2781] | 1107 | //------ Commandes trace d'expression
|
---|
[357] | 1108 | kw = "ObjectExpressions";
|
---|
| 1109 | usage = "Any mathematical expression (math.h) with object variables can be used";
|
---|
| 1110 | usage += "\n ------ Object Variable names (double) -------- ";
|
---|
[2419] | 1111 | usage += "\n (_nl is the table line number or the sequential index)";
|
---|
| 1112 | usage += "\n- NTuple: ntuple variable names,_nl";
|
---|
| 1113 | usage += "\n- Histo1D/HProf: i,x,val,err,_nl";
|
---|
| 1114 | usage += "\n- Histo2D: i,j,x,y,val,err,_nl";
|
---|
| 1115 | usage += "\n- Vector/Matrix: n,r,c,val,real,imag,mod,phas,_nl";
|
---|
| 1116 | usage += "\n- TArray: n,x,y,z,t,u,val,real,imag,mod,phas,_nl";
|
---|
| 1117 | usage += "\n- Image: i,j,x,y,val(=pix),_nl";
|
---|
| 1118 | usage += "\n- GeneralFitData: x0,ex0 x1,ex1 ... xn,exn y,ey ok ,_nl";
|
---|
[1548] | 1119 | usage += "\n- LocalMap/SphereThetaPhi/SphereHEALPix: ";
|
---|
[2419] | 1120 | usage += "\n- i,k,val,real,imag,mod,phas,teta,phi,_nl";
|
---|
| 1121 | usage += "\n- FITS Binary/ASCII table: fits column names,_nl";
|
---|
[2128] | 1122 | #ifdef SANS_EVOLPLANCK
|
---|
| 1123 | usage += "\n ------ Eros Variable names (double) -------- ";
|
---|
| 1124 | usage += "\n- StarList: x,y,flux,fond,pixmax,flags,";
|
---|
[2419] | 1125 | usage += "\n- xref,yref,fluxref,fondref,pixmaxref,_nl";
|
---|
[2128] | 1126 | #endif
|
---|
[1548] | 1127 | usage += "\n ------ Other parameters -------- ";
|
---|
[357] | 1128 | usage += "\nLoop parameters can be specified as I1[:I2[:DI]] for(int i=I1; i<I2; i+=DI)";
|
---|
| 1129 | usage += "\nThe default Cut() expression in true (=1) for all";
|
---|
[1548] | 1130 | usage += "\n\n Related commands: plot2d plot2de plot2dw plot3d ";
|
---|
[357] | 1131 | usage += "\n projh1d projh2d projprof fillvec fillmtx ";
|
---|
| 1132 | usage += "\n fillnt fillgd1 fillgd2 ntloop exptovec ... ";
|
---|
[2419] | 1133 | grp = "Expr. Plotting";
|
---|
| 1134 | mpiac->RegisterHelp(kw, usage, grp);
|
---|
[293] | 1135 | kw = "plot2d";
|
---|
| 1136 | usage = "Plots (2D) Y=g(Object) vs. X=f(Object) --- Object Variable names (double) :";
|
---|
[357] | 1137 | usage += "\n Usage: plot2d nameobj f_X() g_Y() [f_Cut() graphic_attributes loop_param]";
|
---|
| 1138 | usage += "\n Related commands: plot2de plot2dw plot3d ObjectExpressions ...";
|
---|
[330] | 1139 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
[357] | 1140 | kw = "plot2de";
|
---|
| 1141 | usage = "Plots (2D) Y=g(Object) vs. X=f(Object) with error bars eX/Y=f_ErrX/Y(Object) ";
|
---|
| 1142 | usage += "\n Usage: plot2de nameobj f_X() g_Y() f_ErrX() f_ErrY() [f_Cut() graphic_attributes loop_param]";
|
---|
| 1143 | usage += "\n Related commands: plot2d plot2dw plot3d ObjectExpressions ...";
|
---|
| 1144 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
[333] | 1145 | kw = "plot2dw";
|
---|
| 1146 | usage = "Plots (2D) Y=g(Object) vs. X=f(Object) with Weight W=h(Object) ";
|
---|
[357] | 1147 | usage += "\n Usage: plot2dw nameobj f_X() g_Y() h_Wt() [Cut() graphic_attributes loop_param]";
|
---|
| 1148 | usage += "\n Related commands: plot2d plot2dw plot3d ObjectExpressions ...";
|
---|
[333] | 1149 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
[293] | 1150 | kw = "plot3d";
|
---|
| 1151 | usage = "Plots (3D) Z=h(Object) vs. Y=g(Object) vs. X=f(Object) vs ";
|
---|
[357] | 1152 | usage += "\n Usage: plot3d nameobj f_X() g_Y() h_Z() [Cut() graphic_attributes loop_param]";
|
---|
| 1153 | usage += "\n Related commands: plot2d plot2dw plot2de plot3d ObjectExpressions ...";
|
---|
[330] | 1154 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
[293] | 1155 |
|
---|
| 1156 | kw = "projh1d";
|
---|
| 1157 | usage = "Projects X=f(Object) with weight WT=h(Object) into a 1D histogram ";
|
---|
[357] | 1158 | usage += "\n Usage: projh1d nameh1d nameobj f_X() [h_WT()=1. Cut() graphic_attributes loop_param]";
|
---|
[293] | 1159 | usage += "\n Histo1D nameh1d is created if necessary ";
|
---|
[357] | 1160 | usage += "\n Related commands: projh2d projprof ObjectExpressions ...";
|
---|
[330] | 1161 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
[293] | 1162 | kw = "projh2d";
|
---|
| 1163 | usage = "Projects (X=f(Object),Y=g(Object)) with weight WT=h(Object) into a 2D histogram ";
|
---|
[357] | 1164 | usage += "\n Usage: projh2d nameh2d nameobj f_X() g_Y() [h_WT()=1. Cut() graphic_attributes loop_param]";
|
---|
[293] | 1165 | usage += "\n Histo2D nameh2d is created if necessary ";
|
---|
[357] | 1166 | usage += "\n Related commands: projh1d projprof ObjectExpressions ...";
|
---|
[330] | 1167 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
[293] | 1168 | kw = "projprof";
|
---|
| 1169 | usage = "Projects (X=f(Object),Y=g(Object)) with weight WT=h(Object) into a profile histogram ";
|
---|
[709] | 1170 | usage += "\n Usage: projprof nameprof nameobj f_X() g_Y() [h_WT()=1. Cut() graphic_attributes loop_param]";
|
---|
[293] | 1171 | usage += "\n HProf nameprof is created if necessary ";
|
---|
[357] | 1172 | usage += "\n Related commands: projh1d projh2d ObjectExpressions ...";
|
---|
[330] | 1173 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
[357] | 1174 | kw = "fillvec";
|
---|
| 1175 | usage = "Fills a Vector V((int)(f_X(Object)+0.5)) = h_V(Object) ";
|
---|
| 1176 | usage += "\n Usage: fillvec namevec nameobj f_X() h_V() [Cut() graphic_attributes loop_param]";
|
---|
| 1177 | usage += "\n Related commands: fillmtx fillnt ObjectExpressions ...";
|
---|
| 1178 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
| 1179 | kw = "fillmtx";
|
---|
| 1180 | usage = "Fills a Matrix M(Line=g_Y(Object)+0.5, Col=f_X(Object)+0.5)) = h_V(Object) ";
|
---|
| 1181 | usage += "\n Usage: fillvec namevec nameobj f_X() g_Y() h_V() [Cut() graphic_attributes loop_param]";
|
---|
| 1182 | usage += "\n Related commands: fillvec fillnt ObjectExpressions ...";
|
---|
| 1183 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
[293] | 1184 |
|
---|
| 1185 | kw = "fillnt";
|
---|
| 1186 | usage = "Creates and Fills an NTuple(x,y,z,t) with (X=f(Object),Y=g(...),Z=h(...),T=k(...))";
|
---|
[357] | 1187 | usage += "\n Usage: fillnt nameobj f_X() g_Y() h_Z() k_T() [Cut() nameNt loop_param]";
|
---|
[333] | 1188 | usage += "\n Related commands: ntloop plot2d projh1d projh2d projprof ";
|
---|
[357] | 1189 | usage += "\n Related commands: fillvec fillmtx ntloop exptovec fillgd1 fillgd2 ObjectExpressions ...";
|
---|
[330] | 1190 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
[357] | 1191 |
|
---|
[333] | 1192 | kw = "ntloop";
|
---|
| 1193 | usage = "Loops over an Object NTupleInterface calling a function from a C-file \n";
|
---|
| 1194 | usage += "and optionaly fills an NTuple(x,y,z,t) with (X=f(Object),Y=g(...),Z=h(...),T=k(...))";
|
---|
[357] | 1195 | usage += "\n Usage: ntloop nameobj CFileName FuncName [NtupleName loop_param]";
|
---|
| 1196 | usage += "\n Related commands: fillvec fillmtx fillnt fillgd1 fillgd2 exptovec ObjectExpressions ...";
|
---|
[333] | 1197 | usage += "\n Related commands: ntexpcfile fillnt";
|
---|
| 1198 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
[357] | 1199 |
|
---|
[333] | 1200 | kw = "ntexpcfile";
|
---|
| 1201 | usage = "Creates a C-File with declarations suitable to be used for ntloop";
|
---|
| 1202 | usage += "\n Usage: ntexpcfile nameobj CFileName FuncName ";
|
---|
| 1203 | usage += "\n Related commands: ntloop";
|
---|
| 1204 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
| 1205 |
|
---|
[2922] | 1206 | kw = "expmeansig";
|
---|
| 1207 | usage = "Computes Mean/Sigma (+Min/Max) for an expression X=f(Object)";
|
---|
| 1208 | usage += "\n Usage: expmeansig nameobj f_X() [Cut() loop_param]";
|
---|
| 1209 | usage += "\n Related commands: exptovec ntloop fillnt ObjectExpressions ...";
|
---|
| 1210 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
| 1211 |
|
---|
[357] | 1212 | kw = "exptovec";
|
---|
[293] | 1213 | usage = "Creates and Fills a Vector with X=f(Object)";
|
---|
[357] | 1214 | usage += "\n Usage: exptovec namevec nameobj f_X() [Cut() graphic_attributes loop_param]";
|
---|
| 1215 | usage += "\n Related commands: ntloop fillnt ObjectExpressions ...";
|
---|
[330] | 1216 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
[2922] | 1217 |
|
---|
[293] | 1218 | kw = "fillgd1";
|
---|
| 1219 | usage = "Creates and Fills a GeneralFitData with (X=f(Object), Y=g(...), ErrY=h(...))";
|
---|
[357] | 1220 | usage += "\n Usage: fillgd1 namegfd nameobj f_X() g_Y() h_ErrY() [Cut() loop_param]";
|
---|
| 1221 | usage += "\n Related commands: ntloop fillnt ObjectExpressions ...";
|
---|
[330] | 1222 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
[293] | 1223 | kw = "fillgd2";
|
---|
| 1224 | usage = "Creates and Fills a GeneralFitData with (X=f(Object), Y=g(...), Z=h(...)) ErrZ=k(...)";
|
---|
[357] | 1225 | usage += "\n Usage: fillgd1 namegfd nameobj f_X() g_Y() h_Z() k_ErrZ() [Cut() loop_param]";
|
---|
| 1226 | usage += "\n Related commands: ntloop fillnt ObjectExpressions ...";
|
---|
[330] | 1227 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
[1067] | 1228 | kw = "gdfrvec";
|
---|
| 1229 | usage = "Fills a GeneralFitData with vectors X,Y,Z,EZ";
|
---|
| 1230 | usage += "\n Usage: gdfrvec namegfd X Y";
|
---|
| 1231 | usage += "\n Usage: gdfrvec namegfd X Y ! EY";
|
---|
| 1232 | usage += "\n Usage: gdfrvec namegfd X Y Z";
|
---|
| 1233 | usage += "\n Usage: gdfrvec namegfd X Y Z EZ";
|
---|
| 1234 | usage += "\n Related commands: fillgd1 fillgd2 ...";
|
---|
| 1235 | mpiac->RegisterCommand(kw, usage, this, "Expr. Plotting");
|
---|
[293] | 1236 |
|
---|
[2180] | 1237 |
|
---|
| 1238 | kw = "eval";
|
---|
| 1239 | usage = "Compute arithmetic expression\n";
|
---|
| 1240 | usage += "\n Usage: eval resultvarname arithmetic expression....";
|
---|
| 1241 | usage += "\n resultvarname: store result in variable resultvarname";
|
---|
| 1242 | usage += "\n - If first character is not alphabetic, just print result";
|
---|
| 1243 | usage += "\n arithmetic expression:";
|
---|
| 1244 | usage += "\n ex: x + sqrt(y)+z +3.14 (x,y,z are variables)";
|
---|
| 1245 | usage += "\n ex: $x + sqrt($y)+$z +3.14 (x,y,z are variables)";
|
---|
| 1246 | usage += "\n ex: 360 * M_PI / 180.";
|
---|
| 1247 | mpiac->RegisterCommand(kw, usage, this, "Expr. Arithmetic");
|
---|
| 1248 |
|
---|
[293] | 1249 | }
|
---|
| 1250 |
|
---|
| 1251 | /* --Methode-- */
|
---|
| 1252 | int PIABaseExecutor::LinkUserFuncs(string& fnameso, string& func1, string& func2, string& func3)
|
---|
| 1253 | // string& func4, string& func5)
|
---|
| 1254 | {
|
---|
| 1255 | string cmd;
|
---|
| 1256 |
|
---|
| 1257 | if (dynlink) delete dynlink; dynlink = NULL;
|
---|
| 1258 | usfmap.clear();
|
---|
| 1259 |
|
---|
| 1260 | dynlink = new PDynLinkMgr(fnameso, true);
|
---|
| 1261 | if (dynlink == NULL) {
|
---|
| 1262 | string sn = fnameso;
|
---|
| 1263 | cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur ouverture SO " << sn << endl;
|
---|
| 1264 | return(2);
|
---|
| 1265 | }
|
---|
| 1266 |
|
---|
| 1267 | int nok=0;
|
---|
| 1268 | // on utilise donc des DlFunction (Reza 20/08/98) voir commentaire ds .h (pb g++)
|
---|
| 1269 | // DlUserProcFunction f = NULL;
|
---|
| 1270 | DlFunction f = NULL;
|
---|
| 1271 | if ((func1.length() < 1) || (func1 == "-") || (func1 == ".") ) goto fin;
|
---|
| 1272 | // f = (DlUserProcFunction) dlsym(dlhandle, func1.c_str());
|
---|
| 1273 | f = dynlink->GetFunction(func1);
|
---|
| 1274 | if (f) { nok++; usfmap[func1] = f; }
|
---|
| 1275 | else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func1 << endl;
|
---|
| 1276 |
|
---|
| 1277 | if ((func2.length() < 1) || (func2 == "-") || (func2 == ".") ) goto fin;
|
---|
| 1278 | // f = (DlUserProcFunction) dlsym(dlhandle, func2.c_str());
|
---|
| 1279 | f = dynlink->GetFunction(func2);
|
---|
| 1280 | if (f) { nok++; usfmap[func2] = f; }
|
---|
| 1281 | else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func2 << endl;
|
---|
| 1282 |
|
---|
| 1283 | if ((func3.length() < 1) || (func3 == "-") || (func3 == ".") ) goto fin;
|
---|
| 1284 | // f = (DlUserProcFunction) dlsym(dlhandle, func3.c_str());
|
---|
| 1285 | f = dynlink->GetFunction(func3);
|
---|
| 1286 | if (f) { nok++; usfmap[func3] = f; }
|
---|
| 1287 | else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func3 << endl;
|
---|
| 1288 |
|
---|
| 1289 | /* Pb compile g++ 2.7.2
|
---|
| 1290 | if ((func4.length() < 1) || (func4 == "-") || (func4 == ".") ) goto fin;
|
---|
| 1291 | // f = (DlUserProcFunction) dlsym(dlhandle, func4.c_str());
|
---|
| 1292 | f = dynlink->GetFunction(func4);
|
---|
| 1293 | if (f) { nok++; usfmap[func4] = f; }
|
---|
| 1294 | else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func4 << endl;
|
---|
| 1295 |
|
---|
| 1296 | if ((func5.length() < 1) || (func5 == "-") || (func5 == ".") ) goto fin;
|
---|
| 1297 | // f = (DlUserProcFunction) dlsym(dlhandle, func5.c_str());
|
---|
| 1298 | f = dynlink->GetFunction(func5);
|
---|
| 1299 | if (f) { nok++; usfmap[func5] = f; }
|
---|
| 1300 | else cerr << "PIABaseExecutor/LinkUserFuncs_Erreur: Erreur linking " << func5 << endl;
|
---|
| 1301 | */
|
---|
| 1302 | fin:
|
---|
| 1303 | if (nok < 1) { if (dynlink) delete dynlink; dynlink = NULL; return(3); }
|
---|
| 1304 | else return(0);
|
---|
| 1305 | }
|
---|
| 1306 |
|
---|
[1276] | 1307 | /* --Methode-- */
|
---|
| 1308 | int PIABaseExecutor::LinkUserFuncs2(string& fnameso, string& func1, string& func2, string& func3)
|
---|
| 1309 | {
|
---|
| 1310 | string cmd;
|
---|
| 1311 |
|
---|
| 1312 | if (dynlink2) delete dynlink2; dynlink2 = NULL;
|
---|
| 1313 | usfmap2.clear();
|
---|
| 1314 |
|
---|
| 1315 | dynlink2 = new PDynLinkMgr(fnameso, true);
|
---|
| 1316 | if (dynlink2 == NULL) {
|
---|
| 1317 | string sn = fnameso;
|
---|
| 1318 | cerr << "PIABaseExecutor/LinkUserFuncs2_Erreur: Erreur ouverture SO " << sn << endl;
|
---|
| 1319 | return(2);
|
---|
| 1320 | }
|
---|
| 1321 |
|
---|
| 1322 | int nok=0;
|
---|
| 1323 | // on utilise donc des DlFunction (Reza 20/08/98) voir commentaire ds .h (pb g++)
|
---|
| 1324 | // DlUserProcFunction f = NULL;
|
---|
| 1325 | DlFunction f = NULL;
|
---|
| 1326 | if ((func1.length() < 1) || (func1 == "-") || (func1 == ".") ) goto fin;
|
---|
| 1327 | f = dynlink2->GetFunction(func1);
|
---|
| 1328 | if (f) { nok++; usfmap2[func1] = f; }
|
---|
| 1329 | else cerr << "PIABaseExecutor/LinkUserFuncs2_Erreur: Erreur linking " << func1 << endl;
|
---|
| 1330 |
|
---|
| 1331 | if ((func2.length() < 1) || (func2 == "-") || (func2 == ".") ) goto fin;
|
---|
| 1332 | f = dynlink2->GetFunction(func2);
|
---|
| 1333 | if (f) { nok++; usfmap2[func2] = f; }
|
---|
| 1334 | else cerr << "PIABaseExecutor/LinkUserFuncs2_Erreur: Erreur linking " << func2 << endl;
|
---|
| 1335 |
|
---|
| 1336 | if ((func3.length() < 1) || (func3 == "-") || (func3 == ".") ) goto fin;
|
---|
| 1337 | f = dynlink2->GetFunction(func3);
|
---|
| 1338 | if (f) { nok++; usfmap2[func3] = f; }
|
---|
| 1339 | else cerr << "PIABaseExecutor/LinkUserFuncs2_Erreur: Erreur linking " << func3 << endl;
|
---|
| 1340 |
|
---|
| 1341 | fin:
|
---|
| 1342 | if (nok < 1) { if (dynlink2) delete dynlink2; dynlink2 = NULL; return(3); }
|
---|
| 1343 | else return(0);
|
---|
| 1344 | }
|
---|
| 1345 |
|
---|