291 {
292
293 string path = filenm;
294 char line[512];
295 FILE *ifl = fopen(path.c_str(),"r");
296
297 if(0 == ifl) cout<<" Pdt::readMCppTable: please copy " <<
298 filenm << " in to your run directory!"<<
299 std::endl;
300 assert(0!=ifl);
301
302 while ( fgets(line,512,ifl) )
303 {
304 if (strlen(line) >= 511)
305 {
306 cerr << "Pdt.read : input line is too long\n";
307 assert(0);
308 }
309 istrstream linestr(line);
310 string opcode;
311 char subcode;
312 linestr >> opcode >> subcode;
313
314 if( opcode == "end" )
315 break;
316
317 else if( opcode == "add" )
318 {
319 switch (subcode)
320 {
321 case 'p':
322 {
323 string classname;
324 linestr >> classname;
325
326 if (classname == "Collision" )
327 continue;
328
329 string name;
330 int type;
332
333 linestr >> name >> type;
336
338 if (classname != "Meson")
340
341
344
346 break;
347 }
348
349 case 'c':
350 {
352 float bf;
353 string decayer;
354
355 linestr >>
ptype >> bf >> decayer >> nchild;
357 if (parent == 0) continue;
358
359 vector<PdtEntry*> *kids = new vector<PdtEntry*>;
360
361 int i;
362 for(i=0; i<nchild; i++ )
363 {
364 int ctype;
365 linestr >> ctype;
367 if( secondary ==0 ) break;
368 kids->push_back(secondary);
369 }
370
372 break;
373 }
374
375 case 'd':
376 break;
377
378 default:
379 cerr << "Pdt.readMCppTable : unknown subcode '" << subcode
380 << "' for operation add\n";
381 break;
382 }
383 }
384 }
385
386
387
388
389 fclose(ifl);
390
391}
string::const_iterator ptype
static float lifetime(PdtLund::LundType id)
static void addParticle(const char *pname, PdtLund::LundType id, float spin, float charge, float mass, float width=0.0, float cut=0.0)