13 #ifndef Pythia8_Settings_H
14 #define Pythia8_Settings_H
17 #include "PythiaStdlib.h"
30 Flag(
string nameIn =
" ",
bool defaultIn =
false) : name(nameIn),
31 valNow(defaultIn) , valDefault(defaultIn) { }
35 bool valNow, valDefault;
48 Mode(
string nameIn =
" ",
int defaultIn = 0,
bool hasMinIn =
false,
49 bool hasMaxIn =
false,
int minIn = 0,
int maxIn = 0) : name(nameIn),
50 valNow(defaultIn), valDefault(defaultIn), hasMin(hasMinIn),
51 hasMax(hasMaxIn), valMin(minIn), valMax(maxIn) { }
55 int valNow, valDefault;
70 Parm(
string nameIn =
" ",
double defaultIn = 0.,
71 bool hasMinIn =
false,
bool hasMaxIn =
false,
double minIn = 0.,
72 double maxIn = 0.) : name(nameIn), valNow(defaultIn),
73 valDefault(defaultIn), hasMin(hasMinIn), hasMax(hasMaxIn),
74 valMin(minIn), valMax(maxIn) { }
78 double valNow, valDefault;
80 double valMin, valMax;
93 Word(
string nameIn =
" ",
string defaultIn =
" ") : name(nameIn),
94 valNow(defaultIn) , valDefault(defaultIn) { }
97 string name, valNow, valDefault;
114 void initPtr(
Info* infoPtrIn) {infoPtr = infoPtrIn;}
117 bool init(
string startFile =
"../xmldoc/Index.xml",
bool append =
false,
118 ostream& os = cout) ;
121 bool reInit(
string startFile =
"../xmldoc/Index.xml", ostream& os = cout) ;
124 bool readString(
string line,
bool warn =
true, ostream& os = cout) ;
127 bool writeFile(
string toFile,
bool writeAll =
false) ;
128 bool writeFile(ostream& os = cout,
bool writeAll =
false) ;
132 void listAll(ostream& os = cout) {
133 list(
true,
false,
" ", os); }
134 void listChanged(ostream& os = cout) {
135 list (
false,
false,
" ", os); }
136 void list(
string match, ostream& os = cout) {
137 list (
false,
true, match, os); }
143 bool isFlag(
string keyIn) {
144 return (flags.find(toLower(keyIn)) != flags.end()); }
145 bool isMode(
string keyIn) {
146 return (modes.find(toLower(keyIn)) != modes.end()); }
147 bool isParm(
string keyIn) {
148 return (parms.find(toLower(keyIn)) != parms.end()); }
149 bool isWord(
string keyIn) {
150 return (words.find(toLower(keyIn)) != words.end()); }
153 void addFlag(
string keyIn,
bool defaultIn) {
154 flags[toLower(keyIn)] =
Flag(keyIn, defaultIn); }
155 void addMode(
string keyIn,
int defaultIn,
bool hasMinIn,
156 bool hasMaxIn,
int minIn,
int maxIn) { modes[toLower(keyIn)]
157 =
Mode(keyIn, defaultIn, hasMinIn, hasMaxIn, minIn, maxIn); }
158 void addParm(
string keyIn,
double defaultIn,
bool hasMinIn,
159 bool hasMaxIn,
double minIn,
double maxIn) { parms[toLower(keyIn)]
160 =
Parm(keyIn, defaultIn, hasMinIn, hasMaxIn, minIn, maxIn); }
161 void addWord(
string keyIn,
string defaultIn) {
162 words[toLower(keyIn)] =
Word(keyIn, defaultIn); }
165 bool flag(
string keyIn);
166 int mode(
string keyIn);
167 double parm(
string keyIn);
168 string word(
string keyIn);
171 map<string, Flag> getFlagMap(
string match);
172 map<string, Mode> getModeMap(
string match);
173 map<string, Parm> getParmMap(
string match);
174 map<string, Word> getWordMap(
string match);
177 void flag(
string keyIn,
bool nowIn);
178 void mode(
string keyIn,
int nowIn);
179 void parm(
string keyIn,
double nowIn);
180 void word(
string keyIn,
string nowIn);
183 void forceMode(
string keyIn,
int nowIn);
184 void forceParm(
string keyIn,
double nowIn);
187 void resetFlag(
string keyIn);
188 void resetMode(
string keyIn);
189 void resetParm(
string keyIn);
190 void resetWord(
string keyIn);
198 map<string, Flag> flags;
201 map<string, Mode> modes;
204 map<string, Parm> parms;
207 map<string, Word> words;
213 void list(
bool doListAll,
bool doListString,
string match,
217 void initTuneEE(
int eeTune);
218 void initTunePP(
int ppTune);
221 string toLower(
const string& name);
222 bool boolString(
string tag);
223 string attributeValue(
string line,
string attribute);
224 bool boolAttributeValue(
string line,
string attribute);
225 int intAttributeValue(
string line,
string attribute);
226 double doubleAttributeValue(
string line,
string attribute);
234 #endif // Pythia8_Settings_H