11 #ifndef Pythia8_ParticleData_H
12 #define Pythia8_ParticleData_H
14 #include "Pythia8/Basics.h"
15 #include "Pythia8/Info.h"
16 #include "Pythia8/PythiaStdlib.h"
17 #include "Pythia8/Settings.h"
18 #include "Pythia8/StandardModel.h"
26 class ResonanceWidths;
29 class SUSYResonanceWidths;
39 DecayChannel(
int onModeIn = 0,
double bRatioIn = 0.,
int meModeIn = 0,
40 int prod0 = 0,
int prod1 = 0,
int prod2 = 0,
int prod3 = 0,
41 int prod4 = 0,
int prod5 = 0,
int prod6 = 0,
int prod7 = 0)
42 : onModeSave(onModeIn), bRatioSave(bRatioIn), currentBRSave(0.),
43 onShellWidthSave(0.), openSecPos(1.), openSecNeg(1.),
44 meModeSave(meModeIn), nProd(0), hasChangedSave(true) {
45 prod[0] = prod0; prod[1] = prod1; prod[2] = prod2; prod[3] = prod3;
46 prod[4] = prod4; prod[5] = prod5; prod[6] = prod6; prod[7] = prod7;
47 for (
int j = 0; j < 8; ++j)
if (prod[j] != 0 && j == nProd) ++nProd; }
50 void onMode(
int onModeIn) {onModeSave = onModeIn; hasChangedSave =
true;}
51 void bRatio(
double bRatioIn,
bool countAsChanged =
true) {
52 bRatioSave = bRatioIn;
if (countAsChanged) hasChangedSave =
true;}
53 void rescaleBR(
double fac) {bRatioSave *= fac; hasChangedSave =
true;}
54 void meMode(
int meModeIn) {meModeSave = meModeIn; hasChangedSave =
true;}
55 void multiplicity(
int multIn) {nProd = multIn; hasChangedSave =
true;}
56 void product(
int i,
int prodIn) {prod[i] = prodIn; nProd = 0;
57 for (
int j = 0; j < 8; ++j)
if (prod[j] != 0 && j == nProd) ++nProd;
58 hasChangedSave =
true;}
59 void setHasChanged(
bool hasChangedIn) {hasChangedSave = hasChangedIn;}
62 int onMode()
const {
return onModeSave;}
63 double bRatio()
const {
return bRatioSave;}
64 int meMode()
const {
return meModeSave;}
65 int multiplicity()
const {
return nProd;}
66 int product(
int i)
const {
return (i >= 0 && i < nProd) ? prod[i] : 0;}
67 bool hasChanged()
const {
return hasChangedSave;}
70 bool contains(
int id1)
const;
71 bool contains(
int id1,
int id2)
const;
72 bool contains(
int id1,
int id2,
int id3)
const;
76 void currentBR(
double currentBRIn) {currentBRSave = currentBRIn;}
77 double currentBR()
const {
return currentBRSave;}
80 void onShellWidth(
double onShellWidthIn) {
81 onShellWidthSave = onShellWidthIn;}
82 double onShellWidth()
const {
return onShellWidthSave;}
83 void onShellWidthFactor(
double factor) {onShellWidthSave *= factor;}
86 void openSec(
int idSgn,
double openSecIn) {
87 if (idSgn > 0) openSecPos = openSecIn;
else openSecNeg = openSecIn;}
88 double openSec(
int idSgn)
const {
89 return (idSgn > 0) ? openSecPos : openSecNeg;}
95 double bRatioSave, currentBRSave, onShellWidthSave, openSecPos,
97 int meModeSave, nProd, prod[8];
106 class ParticleDataEntry {
111 ParticleDataEntry(
int idIn = 0,
string nameIn =
" ",
112 int spinTypeIn = 0,
int chargeTypeIn = 0,
int colTypeIn = 0,
113 double m0In = 0.,
double mWidthIn = 0.,
double mMinIn = 0.,
114 double mMaxIn = 0.,
double tau0In = 0.) : idSave(abs(idIn)),
115 nameSave(nameIn), antiNameSave(
"void"), spinTypeSave(spinTypeIn),
116 chargeTypeSave(chargeTypeIn), colTypeSave(colTypeIn), m0Save(m0In),
117 mWidthSave (mWidthIn), mMinSave(mMinIn), mMaxSave(mMaxIn),
118 tau0Save(tau0In), hasAntiSave(false), hasChangedSave(true),
119 resonancePtr(0) {setDefaults();}
120 ParticleDataEntry(
int idIn,
string nameIn,
string antiNameIn,
121 int spinTypeIn = 0,
int chargeTypeIn = 0,
int colTypeIn = 0,
122 double m0In = 0.,
double mWidthIn = 0.,
double mMinIn = 0.,
123 double mMaxIn = 0.,
double tau0In = 0.) : idSave(abs(idIn)),
124 nameSave(nameIn), antiNameSave(antiNameIn), spinTypeSave(spinTypeIn),
125 chargeTypeSave(chargeTypeIn), colTypeSave(colTypeIn), m0Save(m0In),
126 mWidthSave (mWidthIn), mMinSave(mMinIn), mMaxSave(mMaxIn),
127 tau0Save(tau0In), hasAntiSave(true), hasChangedSave(true),
128 resonancePtr(0) {setDefaults();
129 if (toLower(antiNameIn) ==
"void") hasAntiSave =
false;}
132 ~ParticleDataEntry();
138 void initPtr( ParticleData* particleDataPtrIn) {
139 particleDataPtr = particleDataPtrIn;}
142 void setAll(
string nameIn,
string antiNameIn,
int spinTypeIn = 0,
143 int chargeTypeIn = 0,
int colTypeIn = 0,
double m0In = 0.,
144 double mWidthIn = 0.,
double mMinIn = 0.,
double mMaxIn = 0.,
146 {nameSave = nameIn; antiNameSave = antiNameIn; hasAntiSave =
true;
147 if (toLower(antiNameIn) ==
"void") hasAntiSave =
false;
148 spinTypeSave = spinTypeIn; chargeTypeSave = chargeTypeIn;
149 colTypeSave = colTypeIn; m0Save = m0In; mWidthSave = mWidthIn;
150 mMinSave = mMinIn; mMaxSave = mMaxIn; tau0Save = tau0In;
151 setDefaults(); hasChangedSave =
true;}
155 void setName(
string nameIn) {nameSave = nameIn; hasChangedSave =
true;}
156 void setAntiName(
string antiNameIn) {antiNameSave = antiNameIn;
157 hasChangedSave =
true;}
158 void setNames(
string nameIn,
string antiNameIn) {nameSave = nameIn;
159 antiNameSave = antiNameIn; hasAntiSave =
true;
if (toLower(antiNameIn)
160 ==
"void") hasAntiSave =
false; hasChangedSave =
true;}
161 void setSpinType(
int spinTypeIn) {spinTypeSave = spinTypeIn;
162 hasChangedSave =
true;}
163 void setChargeType(
int chargeTypeIn) {chargeTypeSave = chargeTypeIn;
164 hasChangedSave =
true;}
165 void setColType(
int colTypeIn) {colTypeSave = colTypeIn;
166 hasChangedSave =
true;}
167 void setM0(
double m0In) {m0Save = m0In; setConstituentMass();
168 hasChangedSave =
true;}
169 void setMWidth(
double mWidthIn,
bool countAsChanged =
true) {
170 mWidthSave = mWidthIn;
if (countAsChanged) hasChangedSave =
true;}
171 void setMMin(
double mMinIn) {mMinSave = mMinIn; hasChangedSave =
true;}
172 void setMMax(
double mMaxIn) {mMaxSave = mMaxIn; hasChangedSave =
true;}
174 void setMMinNoChange(
double mMinIn) {mMinSave = mMinIn;}
175 void setMMaxNoChange(
double mMaxIn) {mMaxSave = mMaxIn;}
176 void setTau0(
double tau0In) {tau0Save = tau0In; hasChangedSave =
true;}
177 void setIsResonance(
bool isResonanceIn) {isResonanceSave = isResonanceIn;
178 hasChangedSave =
true;}
179 void setMayDecay(
bool mayDecayIn,
bool countAsChanged =
true) {
180 mayDecaySave = mayDecayIn;
if (countAsChanged) hasChangedSave =
true;}
181 void setDoExternalDecay(
bool doExternalDecayIn)
182 {doExternalDecaySave = doExternalDecayIn; hasChangedSave =
true;}
183 void setIsVisible(
bool isVisibleIn) {isVisibleSave = isVisibleIn;
184 hasChangedSave =
true;}
185 void setDoForceWidth(
bool doForceWidthIn) {doForceWidthSave = doForceWidthIn;
186 hasChangedSave =
true;}
187 void setHasChanged(
bool hasChangedIn) {hasChangedSave = hasChangedIn;
188 for (
int i = 0; i < int(channels.size()); ++i)
189 channels[i].setHasChanged(hasChangedIn);}
192 int id()
const {
return idSave; }
193 bool hasAnti()
const {
return hasAntiSave; }
194 string name(
int idIn = 1)
const {
195 return (idIn > 0) ? nameSave : antiNameSave; }
196 int spinType()
const {
return spinTypeSave; }
197 int chargeType(
int idIn = 1)
const {
198 return (idIn > 0) ? chargeTypeSave : -chargeTypeSave; }
199 double charge(
int idIn = 1)
const {
200 return (idIn > 0) ? chargeTypeSave / 3. : -chargeTypeSave / 3.; }
201 int colType(
int idIn = 1)
const {
202 if (colTypeSave == 2)
return colTypeSave;
203 return (idIn > 0) ? colTypeSave : -colTypeSave; }
204 double m0()
const {
return m0Save; }
205 double mWidth()
const {
return mWidthSave; }
206 double mMin()
const {
return mMinSave; }
207 double mMax()
const {
return mMaxSave; }
208 double m0Min()
const {
209 return (modeBWnow == 0) ? m0Save : mMinSave; }
210 double m0Max()
const {
211 return (modeBWnow == 0) ? m0Save : mMaxSave; }
212 double tau0()
const {
return tau0Save; }
213 bool isResonance()
const {
return isResonanceSave; }
214 bool mayDecay()
const {
return mayDecaySave; }
215 bool doExternalDecay()
const {
return doExternalDecaySave; }
216 bool isVisible()
const {
return isVisibleSave; }
217 bool doForceWidth()
const {
return doForceWidthSave; }
218 bool hasChanged()
const {
if (hasChangedSave)
return true;
219 for (
int i = 0; i < int(channels.size()); ++i)
220 if (channels[i].hasChanged())
return true;
return false;}
224 double constituentMass()
const {
return constituentMassSave; }
226 double mRun(
double mH);
229 bool useBreitWigner()
const {
return (modeBWnow > 0); }
230 bool canDecay()
const {
return (channels.size() > 0);}
231 bool isLepton()
const {
return (idSave > 10 && idSave < 19);}
232 bool isQuark()
const {
return (idSave != 0 && idSave < 9);}
233 bool isGluon()
const {
return (idSave == 21);}
234 bool isDiquark()
const {
return (idSave > 1000 && idSave < 10000
235 && (idSave/10)%10 == 0);}
236 bool isParton()
const {
return ( idSave == 21
237 || (idSave != 0 && idSave < 6)
238 || (idSave > 1000 && idSave < 5510 && (idSave/10)%10 == 0) );}
239 bool isHadron()
const;
240 bool isMeson()
const;
241 bool isBaryon()
const;
244 bool isOctetHadron()
const {
return idSave >= 9940000
245 && idSave < 9960000; }
246 int heaviestQuark(
int idIn = 1)
const;
247 int baryonNumberType(
int idIn = 1)
const;
250 void clearChannels() {channels.resize(0);}
253 void addChannel(
int onMode = 0,
double bRatio = 0.,
int meMode = 0,
254 int prod0 = 0,
int prod1 = 0,
int prod2 = 0,
int prod3 = 0,
255 int prod4 = 0,
int prod5 = 0,
int prod6 = 0,
int prod7 = 0) {
256 channels.push_back( DecayChannel( onMode, bRatio, meMode, prod0,
257 prod1, prod2, prod3, prod4, prod5, prod6, prod7) ); }
260 int sizeChannels()
const {
return channels.size();}
263 DecayChannel& channel(
int i){
return channels[i];}
264 const DecayChannel& channel(
int i)
const {
return channels[i];}
267 void rescaleBR(
double newSumBR = 1.);
270 bool preparePick(
int idSgn,
double mHat = 0.,
int idInFlav = 0);
271 DecayChannel& pickChannel();
274 void setResonancePtr(ResonanceWidths* resonancePtrIn);
275 ResonanceWidths* getResonancePtr() {
return resonancePtr;}
276 void resInit(Info* infoPtrIn, Settings* settingsPtrIn,
277 ParticleData* particleDataPtrIn, Couplings* couplingsPtrIn);
278 double resWidth(
int idSgn,
double mHat,
int idIn = 0,
279 bool openOnly =
false,
bool setBR =
false);
280 double resWidthOpen(
int idSgn,
double mHat,
int idIn = 0);
281 double resWidthStore(
int idSgn,
double mHat,
int idIn = 0);
282 double resOpenFrac(
int idSgn);
283 double resWidthRescaleFactor();
284 double resWidthChan(
double mHat,
int idAbs1 = 0,
int idAbs2 = 0);
289 static const int INVISIBLENUMBER, INVISIBLETABLE[50], KNOWNNOWIDTH[3];
290 static const double MAXTAU0FORDECAY,MINMASSRESONANCE, NARROWMASS,
291 CONSTITUENTMASSTABLE[10];
295 string nameSave, antiNameSave;
296 int spinTypeSave, chargeTypeSave, colTypeSave;
297 double m0Save, mWidthSave, mMinSave, mMaxSave, tau0Save,
299 bool hasAntiSave, isResonanceSave, mayDecaySave, doExternalDecaySave,
300 isVisibleSave, doForceWidthSave, hasChangedSave;
304 double atanLow, atanDif, mThr;
307 vector<DecayChannel> channels;
313 ResonanceWidths* resonancePtr;
316 ParticleData* particleDataPtr;
319 void setConstituentMass();
322 string toLower(
const string& nameConv) {
string temp(nameConv);
323 for (
int i = 0; i < int(temp.length()); ++i) temp[i] = tolower(temp[i]);
337 ParticleData() : infoPtr(0), settingsPtr(0), rndmPtr(0), couplingsPtr(0),
338 particlePtr(0), isInit(false), readingFailedSave(false) {}
341 void initPtr(Info* infoPtrIn, Settings* settingsPtrIn, Rndm* rndmPtrIn,
342 Couplings* couplingsPtrIn) {infoPtr = infoPtrIn;
343 settingsPtr = settingsPtrIn; rndmPtr = rndmPtrIn;
344 couplingsPtr = couplingsPtrIn;}
347 bool init(
string startFile =
"../xmldoc/ParticleData.xml") {
348 initCommon();
return readXML(startFile);}
351 bool reInit(
string startFile,
bool xmlFormat =
true) { initCommon();
352 return (xmlFormat) ? readXML(startFile) : readFF(startFile);}
355 void initWidths(vector<ResonanceWidths*> resonancePtrs);
358 bool readXML(
string inFile,
bool reset =
true) ;
359 void listXML(
string outFile);
362 bool readFF(
string inFile,
bool reset =
true) ;
363 void listFF(
string outFile);
366 bool readString(
string lineIn,
bool warn =
true, ostream& os = cout) ;
369 bool readingFailed() {
return readingFailedSave;}
372 void listAll(ostream& os = cout) {list(
false,
true, os);}
373 void listChanged(ostream& os = cout) {list(
true,
false, os);}
374 void listChanged(
bool changedRes, ostream& os = cout) {
375 list(
true, changedRes, os);}
376 void list(
bool changedOnly =
false,
bool changedRes =
true,
380 void list(
int idList, ostream& os = cout) {vector<int> idListTemp;
381 idListTemp.push_back(idList); list( idListTemp, os);}
382 void list(vector<int> idList, ostream& os = cout);
385 void checkTable(ostream& os = cout) {checkTable(1, os);};
386 void checkTable(
int verbosity, ostream& os = cout) ;
389 void addParticle(
int idIn,
string nameIn =
" ",
int spinTypeIn = 0,
390 int chargeTypeIn = 0,
int colTypeIn = 0,
double m0In = 0.,
391 double mWidthIn = 0.,
double mMinIn = 0.,
double mMaxIn = 0.,
392 double tau0In = 0.) { pdt[abs(idIn)] = ParticleDataEntry(idIn,
393 nameIn, spinTypeIn, chargeTypeIn, colTypeIn, m0In, mWidthIn,
394 mMinIn, mMaxIn, tau0In); pdt[abs(idIn)].initPtr(
this); }
395 void addParticle(
int idIn,
string nameIn,
string antiNameIn,
396 int spinTypeIn = 0,
int chargeTypeIn = 0,
int colTypeIn = 0,
397 double m0In = 0.,
double mWidthIn = 0.,
double mMinIn = 0.,
398 double mMaxIn = 0.,
double tau0In = 0.) { pdt[abs(idIn)]
399 = ParticleDataEntry(idIn, nameIn, antiNameIn, spinTypeIn,
400 chargeTypeIn, colTypeIn, m0In, mWidthIn, mMinIn, mMaxIn, tau0In);
401 pdt[abs(idIn)].initPtr(
this); }
404 void setAll(
int idIn,
string nameIn,
string antiNameIn,
405 int spinTypeIn = 0,
int chargeTypeIn = 0,
int colTypeIn = 0,
406 double m0In = 0.,
double mWidthIn = 0.,
double mMinIn = 0.,
407 double mMaxIn = 0.,
double tau0In = 0.) {
if (isParticle(idIn))
408 pdt[abs(idIn)].setAll( nameIn, antiNameIn, spinTypeIn, chargeTypeIn,
409 colTypeIn, m0In, mWidthIn, mMinIn, mMaxIn, tau0In); }
412 bool isParticle(
int idIn) {
413 if (pdt.find(abs(idIn)) == pdt.end())
return false;
414 if (idIn > 0 || pdt[abs(idIn)].hasAnti())
return true;
418 int nextId(
int idIn) ;
421 void name(
int idIn,
string nameIn) {
422 if (isParticle(idIn)) pdt[abs(idIn)].setName(nameIn); }
423 void antiName(
int idIn,
string antiNameIn) {
424 if (isParticle(idIn)) pdt[abs(idIn)].setAntiName(antiNameIn); }
425 void names(
int idIn,
string nameIn,
string antiNameIn) {
426 if (isParticle(idIn)) pdt[abs(idIn)].setNames(nameIn, antiNameIn); }
427 void spinType(
int idIn,
int spinTypeIn) {
428 if (isParticle(idIn)) pdt[abs(idIn)].setSpinType(spinTypeIn); }
429 void chargeType(
int idIn,
int chargeTypeIn) {
430 if (isParticle(idIn)) pdt[abs(idIn)].setChargeType(chargeTypeIn); }
431 void colType(
int idIn,
int colTypeIn) {
432 if (isParticle(idIn)) pdt[abs(idIn)].setColType(colTypeIn); }
433 void m0(
int idIn,
double m0In) {
434 if (isParticle(idIn)) pdt[abs(idIn)].setM0(m0In); }
435 void mWidth(
int idIn,
double mWidthIn) {
436 if (isParticle(idIn)) pdt[abs(idIn)].setMWidth(mWidthIn); }
437 void mMin(
int idIn,
double mMinIn) {
438 if (isParticle(idIn)) pdt[abs(idIn)].setMMin(mMinIn); }
439 void mMax(
int idIn,
double mMaxIn) {
440 if (isParticle(idIn)) pdt[abs(idIn)].setMMax(mMaxIn); }
441 void tau0(
int idIn,
double tau0In) {
442 if (isParticle(idIn)) pdt[abs(idIn)].setTau0(tau0In); }
443 void isResonance(
int idIn,
bool isResonanceIn) {
444 if (isParticle(idIn)) pdt[abs(idIn)].setIsResonance(isResonanceIn); }
445 void mayDecay(
int idIn,
bool mayDecayIn) {
446 if (isParticle(idIn)) pdt[abs(idIn)].setMayDecay(mayDecayIn); }
447 void doExternalDecay(
int idIn,
bool doExternalDecayIn) {
448 if (isParticle(idIn))
449 pdt[abs(idIn)].setDoExternalDecay(doExternalDecayIn); }
450 void isVisible(
int idIn,
bool isVisibleIn) {
451 if (isParticle(idIn)) pdt[abs(idIn)].setIsVisible(isVisibleIn); }
452 void doForceWidth(
int idIn,
bool doForceWidthIn) {
453 if (isParticle(idIn)) pdt[abs(idIn)].setDoForceWidth(doForceWidthIn); }
454 void hasChanged(
int idIn,
bool hasChangedIn) {
455 if (isParticle(idIn)) pdt[abs(idIn)].setHasChanged(hasChangedIn); }
458 bool hasAnti(
int idIn) {
459 return isParticle(idIn) ? pdt[abs(idIn)].hasAnti() : false ; }
460 string name(
int idIn) {
461 return (isParticle(abs(idIn))) ? pdt[abs(idIn)].name(idIn) :
" "; }
462 int spinType(
int idIn) {
463 return isParticle(idIn) ? pdt[abs(idIn)].spinType() : 0 ; }
464 int chargeType(
int idIn) {
465 return isParticle(idIn) ? pdt[abs(idIn)].chargeType(idIn) : 0 ; }
466 double charge(
int idIn) {
467 return isParticle(idIn) ? pdt[abs(idIn)].charge(idIn) : 0 ; }
468 int colType(
int idIn) {
469 return isParticle(idIn) ? pdt[abs(idIn)].colType(idIn) : 0 ; }
470 double m0(
int idIn) {
471 return isParticle(idIn) ? pdt[abs(idIn)].m0() : 0. ; }
472 double mWidth(
int idIn) {
473 return isParticle(idIn) ? pdt[abs(idIn)].mWidth() : 0. ; }
474 double mMin(
int idIn) {
475 return isParticle(idIn) ? pdt[abs(idIn)].mMin() : 0. ; }
476 double m0Min(
int idIn) {
477 return isParticle(idIn) ? pdt[abs(idIn)].m0Min() : 0. ; }
478 double mMax(
int idIn) {
479 return isParticle(idIn) ? pdt[abs(idIn)].mMax() : 0. ; }
480 double m0Max(
int idIn) {
481 return isParticle(idIn) ? pdt[abs(idIn)].m0Max() : 0. ; }
482 double tau0(
int idIn) {
483 return isParticle(idIn) ? pdt[abs(idIn)].tau0() : 0. ; }
484 bool isResonance(
int idIn) {
485 return isParticle(idIn) ? pdt[abs(idIn)].isResonance() : false ; }
486 bool mayDecay(
int idIn) {
487 return isParticle(idIn) ? pdt[abs(idIn)].mayDecay() : false ; }
488 bool doExternalDecay(
int idIn) {
489 return isParticle(idIn) ? pdt[abs(idIn)].doExternalDecay() : false ; }
490 bool isVisible(
int idIn) {
491 return isParticle(idIn) ? pdt[abs(idIn)].isVisible() : false ; }
492 bool doForceWidth(
int idIn) {
493 return isParticle(idIn) ? pdt[abs(idIn)].doForceWidth() : false ; }
494 bool hasChanged(
int idIn) {
495 return isParticle(idIn) ? pdt[abs(idIn)].hasChanged() : false ; }
498 bool useBreitWigner(
int idIn) {
499 return isParticle(idIn) ? pdt[abs(idIn)].useBreitWigner() : false ; }
500 double constituentMass(
int idIn) {
501 return isParticle(idIn) ? pdt[abs(idIn)].constituentMass() : 0. ; }
502 double mSel(
int idIn) {
503 return isParticle(idIn) ? pdt[abs(idIn)].mSel() : 0. ; }
504 double mRun(
int idIn,
double mH) {
505 return isParticle(idIn) ? pdt[abs(idIn)].mRun(mH) : 0. ; }
508 bool canDecay(
int idIn) {
509 return isParticle(idIn) ? pdt[abs(idIn)].canDecay() : false ; }
510 bool isLepton(
int idIn) {
511 return isParticle(idIn) ? pdt[abs(idIn)].isLepton() : false ; }
512 bool isQuark(
int idIn) {
513 return isParticle(idIn) ? pdt[abs(idIn)].isQuark() : false ; }
514 bool isGluon(
int idIn) {
515 return isParticle(idIn) ? pdt[abs(idIn)].isGluon() : false ; }
516 bool isDiquark(
int idIn) {
517 return isParticle(idIn) ? pdt[abs(idIn)].isDiquark() : false ; }
518 bool isParton(
int idIn) {
519 return isParticle(idIn) ? pdt[abs(idIn)].isParton() : false ; }
520 bool isHadron(
int idIn) {
521 return isParticle(idIn) ? pdt[abs(idIn)].isHadron() : false ; }
522 bool isMeson(
int idIn) {
523 return isParticle(idIn) ? pdt[abs(idIn)].isMeson() : false ; }
524 bool isBaryon(
int idIn) {
525 return isParticle(idIn) ? pdt[abs(idIn)].isBaryon() : false ; }
526 bool isOctetHadron(
int idIn) {
527 return isParticle(idIn) ? pdt[abs(idIn)].isOctetHadron() : false ; }
528 int heaviestQuark(
int idIn) {
529 return isParticle(idIn) ? pdt[abs(idIn)].heaviestQuark(idIn) : 0 ; }
530 int baryonNumberType(
int idIn) {
531 return isParticle(idIn) ? pdt[abs(idIn)].baryonNumberType(idIn) : 0 ; }
534 void rescaleBR(
int idIn,
double newSumBR = 1.) {
535 if (isParticle(idIn)) pdt[abs(idIn)].rescaleBR(newSumBR); }
538 void setResonancePtr(
int idIn, ResonanceWidths* resonancePtrIn) {
539 if (isParticle(idIn)) pdt[abs(idIn)].setResonancePtr( resonancePtrIn);}
540 void resInit(
int idIn) {
if (isParticle(idIn))
541 pdt[abs(idIn)].resInit(infoPtr, settingsPtr,
this, couplingsPtr);}
542 double resWidth(
int idIn,
double mHat,
int idInFlav = 0,
543 bool openOnly =
false,
bool setBR =
false) {
544 return isParticle(idIn) ? pdt[abs(idIn)].resWidth(idIn, mHat,
545 idInFlav, openOnly, setBR) : 0.;}
546 double resWidthOpen(
int idIn,
double mHat,
int idInFlav = 0) {
547 return isParticle(idIn) ? pdt[abs(idIn)].resWidthOpen(idIn, mHat,
549 double resWidthStore(
int idIn,
double mHat,
int idInFlav = 0) {
550 return isParticle(idIn) ? pdt[abs(idIn)].resWidthStore(idIn, mHat,
552 double resOpenFrac(
int id1In,
int id2In = 0,
int id3In = 0);
553 double resWidthRescaleFactor(
int idIn) {
return isParticle(idIn)
554 ? pdt[abs(idIn)].resWidthRescaleFactor() : 0.;}
555 double resWidthChan(
int idIn,
double mHat,
int idAbs1 = 0,
556 int idAbs2 = 0) {
return isParticle(idIn)
557 ? pdt[abs(idIn)].resWidthChan( mHat, idAbs1, idAbs2) : 0.;}
560 ParticleDataEntry* particleDataEntryPtr(
int idIn) {
561 return (isParticle(idIn)) ? &pdt[abs(idIn)] : &pdt[0]; }
567 double maxEnhanceBW, mQRun[7], Lambda5Run;
570 friend class ParticleDataEntry;
576 Settings* settingsPtr;
582 Couplings* couplingsPtr;
585 map<int, ParticleDataEntry> pdt;
588 ParticleDataEntry* particlePtr;
591 bool isInit, readingFailedSave;
597 string toLower(
const string& nameConv) {
string temp(nameConv);
598 for (
int i = 0; i < int(temp.length()); ++i) temp[i] = tolower(temp[i]);
600 bool boolString(
string tag) {
string tagLow = toLower(tag);
601 return ( tagLow ==
"true" || tagLow ==
"1" || tagLow ==
"on"
602 || tagLow ==
"yes" || tagLow ==
"ok" ); }
605 string attributeValue(
string line,
string attribute);
606 bool boolAttributeValue(
string line,
string attribute);
607 int intAttributeValue(
string line,
string attribute);
608 double doubleAttributeValue(
string line,
string attribute);
616 #endif // Pythia8_ParticleData_H