1 /******************************************************************************
2 * T H E R M I N A T O R *
3 * THERMal heavy-IoN generATOR *
6 * Authors of the model: Wojciech Broniowski, Wojciech.Broniowski@ifj.edu.pl, *
7 * Wojciech Florkowski, Wojciech.Florkowski@ifj.edu.pl *
8 * Authors of the code: Adam Kisiel, kisiel@if.pw.edu.pl *
9 * Tomasz Taluc, ttaluc@if.pw.edu.pl *
10 * Code designers: Adam Kisiel, Tomasz Taluc, Wojciech Broniowski, *
11 * Wojciech Florkowski *
13 * For the detailed description of the program and furhter references *
14 * to the description of the model plesase refer to: nucl-th/0504047, *
15 * accessibile at: http://www.arxiv.org/nucl-th/0504047 *
17 * Homepage: http://hirg.if.pw.edu.pl/en/therminator/ *
19 * This code can be freely used and redistributed. However if you decide to *
20 * make modifications to the code, please contact the authors, especially *
21 * if you plan to publish the results obtained with such modified code. *
22 * Any publication of results obtained using this code must include the *
23 * reference to nucl-th/0504047 and the published version of it, when *
26 *****************************************************************************/
39 ReadPar::ReadPar(const char *aFName)
41 fname = strdup(aFName);
45 int ReadPar::readFile(const char *aFName) throw (int)
52 std::ifstream infile(aFName);
53 std::istringstream *instream;
55 if (!infile.is_open())
56 throw RP_Exception_NoParFile;
60 infile.getline(buff, 200);
61 instream = new std::istringstream(buff);
65 PRINT_DEBUG_3("Read " << dummy);;
66 read_opt.keyword = dummy;
70 PRINT_DEBUG_3("Read " << dummy);
71 if (strstr(dummy,"="))
77 PRINT_DEBUG_3("Read " << dummy);
79 read_opt.value = dummy;
80 options.push_back(read_opt);
88 int ReadPar::printOptions()
92 for (c=options.begin(); c != options.end(); c++)
93 PRINT_DEBUG_3("Keyword: " << c->keyword << " Value: " << c->value);
98 STR ReadPar::getPar(const char *name) throw(STR)
103 for (c=options.begin(); c != options.end(); c++)
104 if (c->keyword == pname)
106 PRINT_DEBUG_2("Returning value " << c->value << " for keyword " << c->keyword);
109 throw *(new STR(name));