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;
40 DecayChannel(
int onModeIn = 0,
double bRatioIn = 0.,
int meModeIn = 0,
41 int prod0 = 0,
int prod1 = 0,
int prod2 = 0,
int prod3 = 0,
42 int prod4 = 0,
int prod5 = 0,
int prod6 = 0,
int prod7 = 0)
43 : onModeSave(onModeIn), bRatioSave(bRatioIn), currentBRSave(0.),
44 onShellWidthSave(0.), openSecPos(1.), openSecNeg(1.),
45 meModeSave(meModeIn), nProd(0), prod(), hasChangedSave(true) {
46 prod[0] = prod0; prod[1] = prod1; prod[2] = prod2; prod[3] = prod3;
47 prod[4] = prod4; prod[5] = prod5; prod[6] = prod6; prod[7] = prod7;
48 for (
int j = 0; j < 8; ++j)
if (prod[j] != 0 && j == nProd) ++nProd; }
52 onModeSave = oldDC.onModeSave; bRatioSave = oldDC.bRatioSave;
53 currentBRSave = oldDC.currentBRSave;
54 onShellWidthSave = oldDC.onShellWidthSave; openSecPos = oldDC.openSecPos;
55 openSecNeg = oldDC.openSecNeg; meModeSave = oldDC.meModeSave;
56 nProd = oldDC.nProd;
for (
int j = 0; j < 8; ++j) prod[j] = oldDC.prod[j];
57 hasChangedSave = oldDC.hasChangedSave; }
61 onModeSave = oldDC.onModeSave; bRatioSave = oldDC.bRatioSave;
62 currentBRSave = oldDC.currentBRSave;
63 onShellWidthSave = oldDC.onShellWidthSave; openSecPos = oldDC.openSecPos;
64 openSecNeg = oldDC.openSecNeg; meModeSave = oldDC.meModeSave;
65 nProd = oldDC.nProd;
for (
int j = 0; j < 8; ++j) prod[j] = oldDC.prod[j];
66 hasChangedSave = oldDC.hasChangedSave; }
return *
this; }
69 void onMode(
int onModeIn) {onModeSave = onModeIn; hasChangedSave =
true;}
70 void bRatio(
double bRatioIn,
bool countAsChanged =
true) {
71 bRatioSave = bRatioIn;
if (countAsChanged) hasChangedSave =
true;}
72 void rescaleBR(
double fac) {bRatioSave *= fac; hasChangedSave =
true;}
73 void meMode(
int meModeIn) {meModeSave = meModeIn; hasChangedSave =
true;}
74 void multiplicity(
int multIn) {nProd = multIn; hasChangedSave =
true;}
75 void product(
int i,
int prodIn) {prod[i] = prodIn; nProd = 0;
76 for (
int j = 0; j < 8; ++j)
if (prod[j] != 0 && j == nProd) ++nProd;
77 hasChangedSave =
true;}
78 void setHasChanged(
bool hasChangedIn) {hasChangedSave = hasChangedIn;}
81 int onMode()
const {
return onModeSave;}
82 double bRatio()
const {
return bRatioSave;}
83 int meMode()
const {
return meModeSave;}
84 int multiplicity()
const {
return nProd;}
85 int product(
int i)
const {
return (i >= 0 && i < nProd) ? prod[i] : 0;}
86 bool hasChanged()
const {
return hasChangedSave;}
90 bool contains(
int id1,
int id2)
const;
91 bool contains(
int id1,
int id2,
int id3)
const;
95 void currentBR(
double currentBRIn) {currentBRSave = currentBRIn;}
96 double currentBR()
const {
return currentBRSave;}
100 onShellWidthSave = onShellWidthIn;}
102 void onShellWidthFactor(
double factor) {onShellWidthSave *= factor;}
106 if (idSgn > 0) openSecPos = openSecIn;
else openSecNeg = openSecIn;}
107 double openSec(
int idSgn)
const {
108 return (idSgn > 0) ? openSecPos : openSecNeg;}
114 double bRatioSave, currentBRSave, onShellWidthSave, openSecPos,
116 int meModeSave, nProd, prod[8];
131 int spinTypeIn = 0,
int chargeTypeIn = 0,
int colTypeIn = 0,
132 double m0In = 0.,
double mWidthIn = 0.,
double mMinIn = 0.,
133 double mMaxIn = 0.,
double tau0In = 0.,
bool varWidthIn =
false)
134 : idSave(abs(idIn)), nameSave(nameIn), antiNameSave(
"void"),
135 spinTypeSave(spinTypeIn), chargeTypeSave(chargeTypeIn),
136 colTypeSave(colTypeIn), m0Save(m0In), mWidthSave (mWidthIn),
137 mMinSave(mMinIn), mMaxSave(mMaxIn), tau0Save(tau0In),
138 constituentMassSave(), hasAntiSave(false), isResonanceSave(),
139 mayDecaySave(), tauCalcSave(true), varWidthSave(varWidthIn),
140 doExternalDecaySave(), isVisibleSave(), doForceWidthSave(),
141 hasChangedSave(true), hasChangedMMinSave(false),
142 hasChangedMMaxSave(false), modeBWnow(), modeTau0now(), atanLow(),
143 atanDif(), mThr(), currentBRSum(), resonancePtr(0), particleDataPtr() {
146 int spinTypeIn = 0,
int chargeTypeIn = 0,
int colTypeIn = 0,
147 double m0In = 0.,
double mWidthIn = 0.,
double mMinIn = 0.,
148 double mMaxIn = 0.,
double tau0In = 0.,
bool varWidthIn =
false)
149 : idSave(abs(idIn)), nameSave(nameIn), antiNameSave(antiNameIn),
150 spinTypeSave(spinTypeIn), chargeTypeSave(chargeTypeIn),
151 colTypeSave(colTypeIn), m0Save(m0In), mWidthSave (mWidthIn),
152 mMinSave(mMinIn), mMaxSave(mMaxIn), tau0Save(tau0In),
153 constituentMassSave(), hasAntiSave(
true), isResonanceSave(),
154 mayDecaySave(), tauCalcSave(
true), varWidthSave(varWidthIn),
155 doExternalDecaySave(), isVisibleSave(), doForceWidthSave(),
156 hasChangedSave(
true), hasChangedMMinSave(
false),
157 hasChangedMMaxSave(
false), modeBWnow(), modeTau0now(), atanLow(),
158 atanDif(), mThr(), currentBRSum(), resonancePtr(0), particleDataPtr() {
159 setDefaults();
if (
toLower(antiNameIn) ==
"void") hasAntiSave =
false;}
163 nameSave = oldPDE.nameSave; antiNameSave = oldPDE.antiNameSave;
164 spinTypeSave = oldPDE.spinTypeSave; chargeTypeSave = oldPDE.chargeTypeSave;
165 colTypeSave = oldPDE.colTypeSave; m0Save = oldPDE.m0Save;
166 mWidthSave = oldPDE.mWidthSave; mMinSave = oldPDE.mMinSave;
167 mMaxSave = oldPDE.mMaxSave; tau0Save = oldPDE.tau0Save;
168 varWidthSave = oldPDE.varWidthSave;
169 constituentMassSave = oldPDE.constituentMassSave;
170 hasAntiSave = oldPDE.hasAntiSave; isResonanceSave = oldPDE.isResonanceSave;
171 mayDecaySave = oldPDE.mayDecaySave; tauCalcSave = oldPDE.tauCalcSave;
172 doExternalDecaySave = oldPDE.doExternalDecaySave; isVisibleSave
173 = oldPDE.isVisibleSave; doForceWidthSave = oldPDE.doForceWidthSave;
174 hasChangedSave = oldPDE.hasChangedSave; hasChangedMMinSave
175 = oldPDE.hasChangedMMinSave; hasChangedMMaxSave
176 = oldPDE.hasChangedMMaxSave; modeTau0now = oldPDE.modeTau0now; modeBWnow
177 = oldPDE.modeBWnow; atanLow = oldPDE.atanLow; atanDif = oldPDE.atanDif;
179 for (
int i = 0; i < int(oldPDE.channels.size()); ++i) {
180 DecayChannel oldDC = oldPDE.channels[i]; channels.push_back(oldDC); }
181 currentBRSum = oldPDE.currentBRSum; resonancePtr = oldPDE.resonancePtr;
182 particleDataPtr = oldPDE.particleDataPtr; }
186 if (
this != &oldPDE) { idSave = oldPDE.idSave;
187 nameSave = oldPDE.nameSave; antiNameSave = oldPDE.antiNameSave;
188 spinTypeSave = oldPDE.spinTypeSave; chargeTypeSave = oldPDE.chargeTypeSave;
189 colTypeSave = oldPDE.colTypeSave; m0Save = oldPDE.m0Save;
190 mWidthSave = oldPDE.mWidthSave; mMinSave = oldPDE.mMinSave;
191 mMaxSave = oldPDE.mMaxSave; tau0Save = oldPDE.tau0Save;
192 varWidthSave = oldPDE.varWidthSave;
193 constituentMassSave = oldPDE.constituentMassSave;
194 hasAntiSave = oldPDE.hasAntiSave; isResonanceSave = oldPDE.isResonanceSave;
195 mayDecaySave = oldPDE.mayDecaySave; tauCalcSave = oldPDE.tauCalcSave;
196 doExternalDecaySave = oldPDE.doExternalDecaySave; isVisibleSave
197 = oldPDE.isVisibleSave; doForceWidthSave = oldPDE.doForceWidthSave;
198 hasChangedSave = oldPDE.hasChangedSave; hasChangedMMinSave
199 = oldPDE.hasChangedMMinSave; hasChangedMMaxSave
200 = oldPDE.hasChangedMMaxSave; modeBWnow = oldPDE.modeBWnow; atanLow
201 = oldPDE.atanLow; atanDif = oldPDE.atanDif; mThr = oldPDE.mThr;
202 for (
int i = 0; i < int(oldPDE.channels.size()); ++i) {
203 DecayChannel oldDC = oldPDE.channels[i]; channels.push_back(oldDC); }
204 currentBRSum = oldPDE.currentBRSum; resonancePtr = 0;
205 particleDataPtr = 0; }
return *
this; }
212 particleDataPtr = particleDataPtrIn;}
215 void setAll(
string nameIn,
string antiNameIn,
int spinTypeIn = 0,
216 int chargeTypeIn = 0,
int colTypeIn = 0,
double m0In = 0.,
217 double mWidthIn = 0.,
double mMinIn = 0.,
double mMaxIn = 0.,
218 double tau0In = 0.,
bool varWidthIn =
false)
219 {nameSave = nameIn; antiNameSave = antiNameIn; hasAntiSave =
true;
220 if (
toLower(antiNameIn) ==
"void") hasAntiSave =
false;
221 spinTypeSave = spinTypeIn; chargeTypeSave = chargeTypeIn;
222 colTypeSave = colTypeIn; m0Save = m0In; mWidthSave = mWidthIn;
223 setMMin(mMinIn); setMMax(mMaxIn); tau0Save = tau0In;
224 varWidthSave = varWidthIn; setDefaults(); hasChangedSave =
true;}
228 void setName(
string nameIn) {nameSave = nameIn; hasChangedSave =
true;}
229 void setAntiName(
string antiNameIn) {antiNameSave = antiNameIn;
230 hasAntiSave = (
toLower(antiNameIn) !=
"void"); hasChangedSave =
true;}
231 void setNames(
string nameIn,
string antiNameIn) {nameSave = nameIn;
232 antiNameSave = antiNameIn; hasAntiSave = (
toLower(antiNameIn) !=
"void");
233 hasChangedSave =
true;}
234 void setSpinType(
int spinTypeIn) {spinTypeSave = spinTypeIn;
235 hasChangedSave =
true;}
236 void setChargeType(
int chargeTypeIn) {chargeTypeSave = chargeTypeIn;
237 hasChangedSave =
true;}
238 void setColType(
int colTypeIn) {colTypeSave = colTypeIn;
239 hasChangedSave =
true;}
240 void setM0(
double m0In) {m0Save = m0In; setConstituentMass();
241 hasChangedSave =
true;}
242 void setMWidth(
double mWidthIn,
bool countAsChanged =
true) {
243 mWidthSave = mWidthIn;
if (countAsChanged) hasChangedSave =
true;}
244 void setMMin(
double mMinIn) {mMinSave = mMinIn; hasChangedSave =
true;
245 hasChangedMMinSave=
true;}
246 void setMMax(
double mMaxIn) {mMaxSave = mMaxIn; hasChangedSave =
true;
247 hasChangedMMaxSave=
true;}
250 void setMMaxNoChange(
double mMaxIn) {mMaxSave = mMaxIn;}
251 void setTau0(
double tau0In,
bool countAsChanged =
true)
252 {tau0Save = tau0In;
if (countAsChanged) hasChangedSave =
true;}
253 void setVarWidth(
bool varWidthIn) {varWidthSave = varWidthIn;}
254 void setIsResonance(
bool isResonanceIn) {isResonanceSave = isResonanceIn;
255 hasChangedSave =
true;}
256 void setMayDecay(
bool mayDecayIn,
bool countAsChanged =
true) {
257 mayDecaySave = mayDecayIn;
if (countAsChanged) hasChangedSave =
true;}
258 void setTauCalc(
bool tauCalcIn,
bool countAsChanged =
true) {
259 tauCalcSave = tauCalcIn;
if (countAsChanged) hasChangedSave =
true;}
260 void setDoExternalDecay(
bool doExternalDecayIn)
261 {doExternalDecaySave = doExternalDecayIn; hasChangedSave =
true;}
262 void setIsVisible(
bool isVisibleIn) {isVisibleSave = isVisibleIn;
263 hasChangedSave =
true;}
264 void setDoForceWidth(
bool doForceWidthIn) {doForceWidthSave = doForceWidthIn;
265 hasChangedSave =
true;}
266 void setHasChanged(
bool hasChangedIn) {hasChangedSave = hasChangedIn;
267 for (
int i = 0; i < int(channels.size()); ++i)
268 channels[i].setHasChanged(hasChangedIn);
269 if (!hasChangedIn) {hasChangedMMinSave=
false; hasChangedMMaxSave=
false;}}
272 int id()
const {
return idSave; }
274 return hasAntiSave ? -idSave : idSave; }
275 bool hasAnti()
const {
return hasAntiSave; }
276 string name(
int idIn = 1)
const {
277 return (idIn > 0) ? nameSave : antiNameSave; }
278 int spinType()
const {
return spinTypeSave; }
279 int chargeType(
int idIn = 1)
const {
280 return (idIn > 0) ? chargeTypeSave : -chargeTypeSave; }
281 double charge(
int idIn = 1)
const {
282 return (idIn > 0) ? chargeTypeSave / 3. : -chargeTypeSave / 3.; }
283 int colType(
int idIn = 1)
const {
284 if (colTypeSave == 2)
return colTypeSave;
285 return (idIn > 0) ? colTypeSave : -colTypeSave; }
286 double m0()
const {
return m0Save; }
287 double mWidth()
const {
return mWidthSave; }
288 double mMin()
const {
return mMinSave; }
289 double mMax()
const {
return mMaxSave; }
290 double m0Min()
const {
291 return (modeBWnow == 0) ? m0Save : mMinSave; }
292 double m0Max()
const {
293 return (modeBWnow == 0) ? m0Save : mMaxSave; }
294 double tau0()
const {
return tau0Save; }
295 bool isResonance()
const {
return isResonanceSave; }
296 bool varWidth()
const {
return varWidthSave; }
297 bool mayDecay()
const {
return mayDecaySave; }
298 bool tauCalc()
const {
return tauCalcSave; }
299 bool doExternalDecay()
const {
return doExternalDecaySave; }
300 bool isVisible()
const {
return isVisibleSave; }
301 bool doForceWidth()
const {
return doForceWidthSave; }
302 bool hasChanged()
const {
if (hasChangedSave)
return true;
303 for (
int i = 0; i < int(channels.size()); ++i)
304 if (channels[i].hasChanged())
return true;
306 bool hasChangedMMin()
const {
return hasChangedMMinSave; }
307 bool hasChangedMMax()
const {
return hasChangedMMaxSave; }
311 double constituentMass()
const {
return constituentMassSave; }
313 double mRun(
double mH)
const;
317 bool canDecay()
const {
return (channels.size() > 0)
319 bool isLepton()
const {
return (idSave > 10 && idSave < 19);}
320 bool isQuark()
const {
return (idSave != 0 && idSave < 9);}
321 bool isGluon()
const {
return (idSave == 21);}
322 bool isDiquark()
const {
return (idSave > 1000 && idSave < 10000
323 && (idSave/10)%10 == 0);}
326 || (idSave != 0 && idSave < 6)
327 || (idSave > 1000 && idSave < 5510 && (idSave/10)%10 == 0)
328 || (idSave > 4900100 && idSave < 4900109)
329 || (idSave > 4901000 && idSave < 4909000 && (idSave/10)%10 == 0) );}
330 bool isHadron()
const;
331 bool isMeson()
const;
332 bool isBaryon()
const;
333 bool isOnium()
const;
334 bool isExotic()
const;
338 && idSave < 9960000; }
339 int heaviestQuark(
int idIn = 1)
const;
340 int baryonNumberType(
int idIn = 1)
const;
341 int nQuarksInCode(
int idQIn)
const;
348 int prod0 = 0,
int prod1 = 0,
int prod2 = 0,
int prod3 = 0,
349 int prod4 = 0,
int prod5 = 0,
int prod6 = 0,
int prod7 = 0) {
351 prod1, prod2, prod3, prod4, prod5, prod6, prod7) ); }
358 const DecayChannel& channel(
int i)
const {
return channels[i];}
361 void rescaleBR(
double newSumBR = 1.);
364 bool preparePick(
int idSgn,
double mHat = 0.,
int idInFlav = 0);
369 resonancePtr = resonancePtrIn;}
370 ResonanceWidthsPtr getResonancePtr() {
return resonancePtr;}
371 void resInit(
Info* infoPtrIn);
372 double resWidth(
int idSgn,
double mHat,
int idIn = 0,
373 bool openOnly =
false,
bool setBR =
false);
374 double resWidthOpen(
int idSgn,
double mHat,
int idIn = 0);
375 double resWidthStore(
int idSgn,
double mHat,
int idIn = 0);
376 double resOpenFrac(
int idSgn);
377 double resWidthRescaleFactor();
378 double resWidthChan(
double mHat,
int idAbs1 = 0,
int idAbs2 = 0);
383 static const int INVISIBLENUMBER, INVISIBLETABLE[80], KNOWNNOWIDTH[3];
384 static const double MAXTAU0FORDECAY,MINMASSRESONANCE, NARROWMASS,
385 CONSTITUENTMASSTABLE[10];
389 string nameSave, antiNameSave;
390 int spinTypeSave, chargeTypeSave, colTypeSave;
391 double m0Save, mWidthSave, mMinSave, mMaxSave, tau0Save,
393 bool hasAntiSave, isResonanceSave, mayDecaySave, tauCalcSave, varWidthSave,
394 doExternalDecaySave, isVisibleSave, doForceWidthSave, hasChangedSave,
395 hasChangedMMinSave, hasChangedMMaxSave;
398 int modeBWnow, modeTau0now;
399 double atanLow, atanDif, mThr;
402 vector<DecayChannel> channels;
408 ResonanceWidthsPtr resonancePtr;
414 void setConstituentMass();
427 ParticleData() : setRapidDecayVertex(), modeBreitWigner(), maxEnhanceBW(),
428 mQRun(), Lambda5Run(), intermediateTau0(), infoPtr(nullptr),
429 settingsPtr(nullptr), rndmPtr(nullptr), coupSMPtr(nullptr),
430 particlePtr(nullptr), isInit(false), readingFailedSave(false) {}
434 modeBreitWigner = oldPD.modeBreitWigner; maxEnhanceBW = oldPD.maxEnhanceBW;
435 for (
int i = 0; i < 7; ++i) mQRun[i] = oldPD.mQRun[i];
436 Lambda5Run = oldPD.Lambda5Run; infoPtr =
nullptr; settingsPtr =
nullptr;
437 rndmPtr =
nullptr; coupSMPtr =
nullptr;
438 for (
auto pde = oldPD.pdt.begin(); pde != oldPD.pdt.end(); pde++) {
439 int idTmp = pde->first;
440 pdt[idTmp] = make_shared<ParticleDataEntry>(*pde->second);
441 pdt[idTmp]->initPtr(
this); }
442 particlePtr =
nullptr; isInit = oldPD.isInit;
443 readingFailedSave = oldPD.readingFailedSave; }
447 modeBreitWigner = oldPD.modeBreitWigner; maxEnhanceBW = oldPD.maxEnhanceBW;
448 for (
int i = 0; i < 7; ++i) mQRun[i] = oldPD.mQRun[i];
449 Lambda5Run = oldPD.Lambda5Run; infoPtr =
nullptr; settingsPtr =
nullptr;
450 rndmPtr =
nullptr; coupSMPtr =
nullptr;
451 for (
auto pde = oldPD.pdt.begin(); pde != oldPD.pdt.end(); pde++) {
452 int idTmp = pde->first;
453 pdt[idTmp] = make_shared<ParticleDataEntry>(*pde->second);
454 pdt[idTmp]->initPtr(
this); }
455 particlePtr =
nullptr; isInit = oldPD.isInit;
456 readingFailedSave = oldPD.readingFailedSave; }
return *
this; }
460 settingsPtr = infoPtr->
settingsPtr; loggerPtr = infoPtr->loggerPtr;
461 rndmPtr = infoPtr->rndmPtr; coupSMPtr = infoPtr->coupSMPtr;}
464 bool init(
string startFile =
"../share/Pythia8/xmldoc/ParticleData.xml") {
465 initCommon();
return readXML(startFile);}
469 initCommon();
return copyXML(particleDataIn);}
472 bool init(istream& is) { initCommon();
return readXML(is);}
475 bool reInit(
string startFile,
bool xmlFormat =
true) { initCommon();
476 return (xmlFormat) ? readXML(startFile) : readFF(startFile);}
479 void initWidths(vector<ResonanceWidthsPtr> resonancePtrs);
482 bool readXML(
string inFile,
bool reset =
true) ;
483 void listXML(
string outFile);
484 bool readXML(istream& is,
bool reset=
true);
490 bool loadXML(
string inFile,
bool reset =
true) ;
491 bool loadXML(istream& is,
bool reset=
true);
492 bool processXML(
bool reset =
true) ;
495 bool readFF(
string inFile,
bool reset =
true) ;
496 bool readFF(istream& is,
bool reset =
true);
497 void listFF(
string outFile);
500 bool readString(
string lineIn,
bool warn =
true) ;
506 void listAll(ostream& stream) {list(stream,
false,
true);}
507 void listAll() {listAll(cout);}
508 void listChanged(
bool changedRes =
false) {list(
true, changedRes);}
509 void list(ostream& stream,
bool chargedOnly =
false,
bool changedRes =
true);
510 void list(
bool changedOnly =
false,
bool changedRes =
true) {
511 list(cout, changedOnly, changedRes); }
514 void list(
int idList) {vector<int> idListTemp;
515 idListTemp.push_back(idList); list( idListTemp);}
516 void list(vector<int> idList);
521 if (subrun == -999)
return readStringHistory;
522 else if (readStringSubrun.find(subrun) != readStringSubrun.end())
523 return readStringSubrun[subrun];
524 else return vector<string>();
528 void checkTable(
int verbosity = 1) ;
531 void addParticle(
int idIn,
string nameIn =
" ",
int spinTypeIn = 0,
532 int chargeTypeIn = 0,
int colTypeIn = 0,
double m0In = 0.,
533 double mWidthIn = 0.,
double mMinIn = 0.,
double mMaxIn = 0.,
534 double tau0In = 0.,
bool varWidthIn =
false) {
535 pdt[abs(idIn)] = make_shared<ParticleDataEntry>(idIn, nameIn, spinTypeIn,
536 chargeTypeIn, colTypeIn, m0In, mWidthIn, mMinIn, mMaxIn, tau0In,
538 pdt[abs(idIn)]->initPtr(
this); }
539 void addParticle(
int idIn,
string nameIn,
string antiNameIn,
540 int spinTypeIn = 0,
int chargeTypeIn = 0,
int colTypeIn = 0,
541 double m0In = 0.,
double mWidthIn = 0.,
double mMinIn = 0.,
542 double mMaxIn = 0.,
double tau0In = 0.,
bool varWidthIn =
false) {
543 pdt[abs(idIn)] = make_shared<ParticleDataEntry>(idIn, nameIn, antiNameIn,
544 spinTypeIn, chargeTypeIn, colTypeIn, m0In, mWidthIn, mMinIn, mMaxIn,
546 pdt[abs(idIn)]->initPtr(
this); }
549 void setAll(
int idIn,
string nameIn,
string antiNameIn,
550 int spinTypeIn = 0,
int chargeTypeIn = 0,
int colTypeIn = 0,
551 double m0In = 0.,
double mWidthIn = 0.,
double mMinIn = 0.,
552 double mMaxIn = 0.,
double tau0In = 0.,
bool varWidthIn =
false) {
553 ParticleDataEntryPtr ptr = findParticle(idIn);
554 if ( ptr ) ptr->setAll( nameIn, antiNameIn, spinTypeIn, chargeTypeIn,
555 colTypeIn, m0In, mWidthIn, mMinIn, mMaxIn, tau0In, varWidthIn); }
559 auto found = pdt.find( abs(idIn) );
560 if ( found == pdt.end() )
return false;
561 if ( idIn > 0 || found->second->hasAnti() )
return true;
567 auto found = pdt.find( abs(idIn) );
568 if( found == pdt.end() )
return nullptr;
569 if ( idIn > 0 || found->second->hasAnti() )
return found->second;
575 auto found = pdt.find( abs(idIn) );
576 if( found == pdt.end() )
return nullptr;
577 if ( idIn > 0 || found->second->hasAnti() )
return found->second;
582 int nextId(
int idIn)
const;
585 map<int, ParticleDataEntryPtr>::iterator
begin() {
return pdt.begin(); }
586 map<int, ParticleDataEntryPtr>::iterator end() {
return pdt.end(); }
589 void name(
int idIn,
string nameIn) {
590 ParticleDataEntryPtr ptr = findParticle(idIn);
591 if ( ptr ) ptr->setName(nameIn); }
592 void antiName(
int idIn,
string antiNameIn) {
593 ParticleDataEntryPtr ptr = findParticle(idIn);
594 if ( ptr ) ptr->setAntiName(antiNameIn); }
595 void names(
int idIn,
string nameIn,
string antiNameIn) {
596 ParticleDataEntryPtr ptr = findParticle(idIn);
597 if ( ptr ) ptr->setNames(nameIn, antiNameIn); }
598 void spinType(
int idIn,
int spinTypeIn) {
599 ParticleDataEntryPtr ptr = findParticle(idIn);
600 if ( ptr ) ptr->setSpinType(spinTypeIn); }
601 void chargeType(
int idIn,
int chargeTypeIn) {
602 ParticleDataEntryPtr ptr = findParticle(idIn);
603 if ( ptr ) ptr->setChargeType(chargeTypeIn); }
604 void colType(
int idIn,
int colTypeIn) {
605 ParticleDataEntryPtr ptr = findParticle(idIn);
606 if ( ptr ) ptr->setColType(colTypeIn); }
607 void m0(
int idIn,
double m0In) {
608 ParticleDataEntryPtr ptr = findParticle(idIn);
609 if ( ptr ) ptr->setM0(m0In); }
610 void mWidth(
int idIn,
double mWidthIn) {
611 ParticleDataEntryPtr ptr = findParticle(idIn);
612 if ( ptr ) ptr->setMWidth(mWidthIn); }
613 void mMin(
int idIn,
double mMinIn) {
614 ParticleDataEntryPtr ptr = findParticle(idIn);
615 if ( ptr ) ptr->setMMin(mMinIn); }
616 void mMax(
int idIn,
double mMaxIn) {
617 ParticleDataEntryPtr ptr = findParticle(idIn);
618 if ( ptr ) ptr->setMMax(mMaxIn); }
619 void tau0(
int idIn,
double tau0In) {
620 ParticleDataEntryPtr ptr = findParticle(idIn);
621 if ( ptr ) ptr->setTau0(tau0In); }
622 void isResonance(
int idIn,
bool isResonanceIn) {
623 ParticleDataEntryPtr ptr = findParticle(idIn);
624 if ( ptr ) ptr->setIsResonance(isResonanceIn); }
625 void mayDecay(
int idIn,
bool mayDecayIn) {
626 ParticleDataEntryPtr ptr = findParticle(idIn);
627 if ( ptr ) ptr->setMayDecay(mayDecayIn); }
628 void tauCalc(
int idIn,
bool tauCalcIn) {
629 ParticleDataEntryPtr ptr = findParticle(idIn);
630 if ( ptr ) ptr->setTauCalc(tauCalcIn); }
631 void doExternalDecay(
int idIn,
bool doExternalDecayIn) {
632 ParticleDataEntryPtr ptr = findParticle(idIn);
633 if ( ptr ) ptr->setDoExternalDecay(doExternalDecayIn); }
634 void varWidth(
int idIn,
bool varWidthIn) {
635 ParticleDataEntryPtr ptr = findParticle(idIn);
636 if ( ptr ) ptr->setVarWidth(varWidthIn); }
637 void isVisible(
int idIn,
bool isVisibleIn) {
638 ParticleDataEntryPtr ptr = findParticle(idIn);
639 if ( ptr ) ptr->setIsVisible(isVisibleIn); }
640 void doForceWidth(
int idIn,
bool doForceWidthIn) {
641 ParticleDataEntryPtr ptr = findParticle(idIn);
642 if ( ptr ) ptr->setDoForceWidth(doForceWidthIn); }
643 void hasChanged(
int idIn,
bool hasChangedIn) {
644 ParticleDataEntryPtr ptr = findParticle(idIn);
645 if ( ptr ) ptr->setHasChanged(hasChangedIn); }
649 const ParticleDataEntryPtr ptr = findParticle(idIn);
650 return ( ptr ) ? ptr->hasAnti() :
false; }
651 int antiId(
int idIn)
const {
652 if (idIn < 0)
return -idIn;
653 const ParticleDataEntryPtr ptr = findParticle(idIn);
654 return ( ptr ) ? ptr->antiId() : 0; }
655 string name(
int idIn)
const {
656 const ParticleDataEntryPtr ptr = findParticle(idIn);
657 return ( ptr ) ? ptr->name(idIn) :
" "; }
658 int spinType(
int idIn)
const {
659 const ParticleDataEntryPtr ptr = findParticle(idIn);
660 return ( ptr ) ? ptr->spinType() : 0; }
661 int chargeType(
int idIn)
const {
662 const ParticleDataEntryPtr ptr = findParticle(idIn);
663 return ( ptr ) ? ptr->chargeType(idIn) : 0; }
664 double charge(
int idIn)
const {
665 const ParticleDataEntryPtr ptr = findParticle(idIn);
666 return ( ptr ) ? ptr->charge(idIn) : 0; }
667 int colType(
int idIn)
const {
668 const ParticleDataEntryPtr ptr = findParticle(idIn);
669 return ( ptr ) ? ptr->colType(idIn) : 0 ; }
670 double m0(
int idIn)
const {
671 const ParticleDataEntryPtr ptr = findParticle(idIn);
672 return ( ptr ) ? ptr->m0() : 0. ; }
673 double mWidth(
int idIn)
const {
674 const ParticleDataEntryPtr ptr = findParticle(idIn);
675 return ( ptr ) ? ptr->mWidth() : 0. ; }
676 double mMin(
int idIn)
const {
677 const ParticleDataEntryPtr ptr = findParticle(idIn);
678 return ( ptr ) ? ptr->mMin() : 0. ; }
679 double m0Min(
int idIn)
const {
680 const ParticleDataEntryPtr ptr = findParticle(idIn);
681 return ( ptr ) ? ptr->m0Min() : 0. ; }
682 double mMax(
int idIn)
const {
683 const ParticleDataEntryPtr ptr = findParticle(idIn);
684 return ( ptr ) ? ptr->mMax() : 0. ; }
685 double m0Max(
int idIn)
const {
686 const ParticleDataEntryPtr ptr = findParticle(idIn);
687 return ( ptr ) ? ptr->m0Max() : 0. ; }
688 double tau0(
int idIn)
const {
689 const ParticleDataEntryPtr ptr = findParticle(idIn);
690 return ( ptr ) ? ptr->tau0() : 0. ; }
691 bool isResonance(
int idIn)
const {
692 const ParticleDataEntryPtr ptr = findParticle(idIn);
693 return ( ptr ) ? ptr->isResonance() : false ; }
694 bool mayDecay(
int idIn)
const {
695 const ParticleDataEntryPtr ptr = findParticle(idIn);
696 return ( ptr ) ? ptr->mayDecay() : false ; }
697 bool tauCalc(
int idIn)
const {
698 const ParticleDataEntryPtr ptr = findParticle(idIn);
699 return ( ptr ) ? ptr->tauCalc() : false ; }
700 bool doExternalDecay(
int idIn)
const {
701 const ParticleDataEntryPtr ptr = findParticle(idIn);
702 return ( ptr ) ? ptr->doExternalDecay() : false ; }
703 bool isVisible(
int idIn)
const {
704 const ParticleDataEntryPtr ptr = findParticle(idIn);
705 return ( ptr ) ? ptr->isVisible() : false ; }
706 bool doForceWidth(
int idIn)
const {
707 const ParticleDataEntryPtr ptr = findParticle(idIn);
708 return ( ptr ) ? ptr->doForceWidth() : false ; }
709 bool hasChanged(
int idIn)
const {
710 const ParticleDataEntryPtr ptr = findParticle(idIn);
711 return ( ptr ) ? ptr->hasChanged() : false ; }
712 bool hasChangedMMin(
int idIn)
const {
713 const ParticleDataEntryPtr ptr = findParticle(idIn);
714 return ( ptr ) ? ptr->hasChangedMMin() : false ; }
715 bool hasChangedMMax(
int idIn)
const {
716 const ParticleDataEntryPtr ptr = findParticle(idIn);
717 return ( ptr ) ? ptr->hasChangedMMax() : false ; }
721 const ParticleDataEntryPtr ptr = findParticle(idIn);
722 return ( ptr ) ? ptr->useBreitWigner() : false ; }
723 bool varWidth(
int idIn)
const {
724 const ParticleDataEntryPtr ptr = findParticle(idIn);
725 return ( ptr ) ? ptr->varWidth() :
false; }
726 double constituentMass(
int idIn)
const {
727 const ParticleDataEntryPtr ptr = findParticle(idIn);
728 return ( ptr ) ? ptr->constituentMass() : 0. ; }
729 double mSel(
int idIn)
const {
730 const ParticleDataEntryPtr ptr = findParticle(idIn);
731 return ( ptr ) ? ptr->mSel() : 0. ; }
732 double mRun(
int idIn,
double mH)
const {
733 const ParticleDataEntryPtr ptr = findParticle(idIn);
734 return ( ptr ) ? ptr->mRun(mH) : 0. ; }
738 const ParticleDataEntryPtr ptr = findParticle(idIn);
739 return ( ptr ) ? ptr->canDecay() : false ; }
740 bool isLepton(
int idIn)
const {
741 const ParticleDataEntryPtr ptr = findParticle(idIn);
742 return ( ptr ) ? ptr->isLepton() : false ; }
743 bool isQuark(
int idIn)
const {
744 const ParticleDataEntryPtr ptr = findParticle(idIn);
745 return ( ptr ) ? ptr->isQuark() : false ; }
746 bool isGluon(
int idIn)
const {
747 const ParticleDataEntryPtr ptr = findParticle(idIn);
748 return ( ptr ) ? ptr->isGluon() : false ; }
749 bool isDiquark(
int idIn)
const {
750 const ParticleDataEntryPtr ptr = findParticle(idIn);
751 return ( ptr ) ? ptr->isDiquark() : false ; }
752 bool isParton(
int idIn)
const {
753 const ParticleDataEntryPtr ptr = findParticle(idIn);
754 return ( ptr ) ? ptr->isParton() : false ; }
755 bool isHadron(
int idIn)
const {
756 const ParticleDataEntryPtr ptr = findParticle(idIn);
757 return ( ptr ) ? ptr->isHadron() : false ; }
758 bool isMeson(
int idIn)
const {
759 const ParticleDataEntryPtr ptr = findParticle(idIn);
760 return ( ptr ) ? ptr->isMeson() : false ; }
761 bool isBaryon(
int idIn)
const {
762 const ParticleDataEntryPtr ptr = findParticle(idIn);
763 return ( ptr ) ? ptr->isBaryon() : false ; }
764 bool isOnium(
int idIn)
const {
765 const ParticleDataEntryPtr ptr = findParticle(idIn);
766 return ( ptr ) ? ptr->isOnium() : false ; }
767 bool isExotic(
int idIn)
const {
768 const ParticleDataEntryPtr ptr = findParticle(idIn);
769 return ( ptr ) ? ptr->isExotic() : false ; }
770 bool isOctetHadron(
int idIn)
const {
771 const ParticleDataEntryPtr ptr = findParticle(idIn);
772 return ( ptr ) ? ptr->isOctetHadron() : false ; }
773 int heaviestQuark(
int idIn)
const {
774 const ParticleDataEntryPtr ptr = findParticle(idIn);
775 return ( ptr ) ? ptr->heaviestQuark(idIn) : 0 ; }
776 int baryonNumberType(
int idIn)
const {
777 const ParticleDataEntryPtr ptr = findParticle(idIn);
778 return ( ptr ) ? ptr->baryonNumberType(idIn) : 0 ; }
779 int nQuarksInCode(
int idIn,
int idQIn)
const {
780 const ParticleDataEntryPtr ptr = findParticle(idIn);
781 return ( ptr ) ? ptr->nQuarksInCode(idQIn) : 0 ; }
785 ParticleDataEntryPtr ptr = findParticle(idIn);
786 if ( ptr ) ptr->rescaleBR(newSumBR); }
790 ParticleDataEntryPtr ptr = findParticle(idIn);
791 if ( ptr ) ptr->setResonancePtr( resonancePtrIn);}
792 void resInit(
int idIn) {
793 ParticleDataEntryPtr ptr = findParticle(idIn);
794 if ( ptr ) ptr->resInit(infoPtr);}
795 double resWidth(
int idIn,
double mHat,
int idInFlav = 0,
796 bool openOnly =
false,
bool setBR =
false) {
797 ParticleDataEntryPtr ptr = findParticle(idIn);
798 return ( ptr ) ? ptr->resWidth(idIn, mHat,
799 idInFlav, openOnly, setBR) : 0.;}
800 double resWidthOpen(
int idIn,
double mHat,
int idInFlav = 0) {
801 ParticleDataEntryPtr ptr = findParticle(idIn);
802 return ( ptr ) ? ptr->resWidthOpen(idIn, mHat, idInFlav) : 0.;}
803 double resWidthStore(
int idIn,
double mHat,
int idInFlav = 0) {
804 ParticleDataEntryPtr ptr = findParticle(idIn);
805 return ( ptr ) ? ptr->resWidthStore(idIn, mHat, idInFlav) : 0.;}
806 double resOpenFrac(
int id1In,
int id2In = 0,
int id3In = 0);
807 double resWidthRescaleFactor(
int idIn) {
808 ParticleDataEntryPtr ptr = findParticle(idIn);
809 return ( ptr ) ? ptr->resWidthRescaleFactor() : 0.;}
810 double resWidthChan(
int idIn,
double mHat,
int idAbs1 = 0,
812 ParticleDataEntryPtr ptr = findParticle(idIn);
813 return ( ptr ) ? ptr->resWidthChan( mHat, idAbs1, idAbs2) : 0.;}
817 ParticleDataEntryPtr ptr = findParticle(idIn);
818 return ( ptr ) ? ptr : pdt[0]; }
826 bool setRapidDecayVertex;
828 double maxEnhanceBW, mQRun[7], Lambda5Run, intermediateTau0;
849 map<int, ParticleDataEntryPtr> pdt;
852 ParticleDataEntryPtr particlePtr;
855 bool isInit, readingFailedSave;
861 bool boolString(
string tag) {
string tagLow =
toLower(tag);
862 return ( tagLow ==
"true" || tagLow ==
"1" || tagLow ==
"on" 863 || tagLow ==
"yes" || tagLow ==
"ok" ); }
866 string attributeValue(
string line,
string attribute);
867 bool boolAttributeValue(
string line,
string attribute);
868 int intAttributeValue(
string line,
string attribute);
869 double doubleAttributeValue(
string line,
string attribute);
872 vector<string> xmlFileSav;
875 vector<string> readStringHistory;
876 map<int, vector<string> > readStringSubrun;
void setResonancePtr(ResonanceWidthsPtr resonancePtrIn)
Access methods stored in ResonanceWidths.
Definition: ParticleData.h:368
void openSec(int idSgn, double openSecIn)
Input/output for fraction of secondary open widths; used by resonances.
Definition: ParticleData.h:105
This class holds info on a single particle species.
Definition: ParticleData.h:125
ParticleDataEntry & operator=(const ParticleDataEntry &oldPDE)
Assignment operator.
Definition: ParticleData.h:185
void setAll(string nameIn, string antiNameIn, int spinTypeIn=0, int chargeTypeIn=0, int colTypeIn=0, double m0In=0., double mWidthIn=0., double mMinIn=0., double mMaxIn=0., double tau0In=0., bool varWidthIn=false)
Reset all the properties of an existing particle.
Definition: ParticleData.h:215
bool isParton() const
Identify Hidden Valley partons as partons.
Definition: ParticleData.h:325
bool canDecay(int idIn) const
Give back other quantities.
Definition: ParticleData.h:737
void onMode(int onModeIn)
Member functions for input.
Definition: ParticleData.h:69
bool isParticle(int idIn) const
Query existence of an entry.
Definition: ParticleData.h:558
ParticleData()
Constructor.
Definition: ParticleData.h:427
void clearChannels()
Reset to empty decay table.
Definition: ParticleData.h:344
void list(int idList)
Print out specified particles.
Definition: ParticleData.h:514
ParticleDataEntryPtr particleDataEntryPtr(int idIn)
Return pointer to entry.
Definition: ParticleData.h:816
void currentBR(double currentBRIn)
Definition: ParticleData.h:95
string toLower(const string &name, bool trim=true)
Definition: PythiaStdlib.cc:17
ParticleDataEntry(int idIn=0, string nameIn=" ", int spinTypeIn=0, int chargeTypeIn=0, int colTypeIn=0, double m0In=0., double mWidthIn=0., double mMinIn=0., double mMaxIn=0., double tau0In=0., bool varWidthIn=false)
Constructors: for antiparticle exists or not.
Definition: ParticleData.h:130
void setResonancePtr(int idIn, ResonanceWidthsPtr resonancePtrIn)
Access methods stored in ResonanceWidths.
Definition: ParticleData.h:789
DecayChannel(const DecayChannel &oldDC)
Copy constructor.
Definition: ParticleData.h:51
const ParticleDataEntryPtr findParticle(int idIn) const
Query existence of an entry and return a const iterator.
Definition: ParticleData.h:574
ParticleDataEntryPtr findParticle(int idIn)
Query existence of an entry and return an iterator.
Definition: ParticleData.h:566
This class holds info on a single decay channel.
Definition: ParticleData.h:35
bool contains(int id1) const
Check for presence of particles anywhere in decay list.
Definition: ParticleData.cc:29
bool reInit(string startFile, bool xmlFormat=true)
Overwrite existing database by reading from specific file.
Definition: ParticleData.h:475
ParticleDataEntry(const ParticleDataEntry &oldPDE)
Copy constructor.
Definition: ParticleData.h:162
void addParticle(int idIn, string nameIn=" ", int spinTypeIn=0, int chargeTypeIn=0, int colTypeIn=0, double m0In=0., double mWidthIn=0., double mMinIn=0., double mMaxIn=0., double tau0In=0., bool varWidthIn=false)
Add new entry.
Definition: ParticleData.h:531
bool hasAnti(int idIn) const
Give back current values.
Definition: ParticleData.h:648
bool init(string startFile="../share/Pythia8/xmldoc/ParticleData.xml")
Read in database from specific file.
Definition: ParticleData.h:464
bool readingFailed()
Keep track whether any readings have failed, invalidating run setup.
Definition: ParticleData.h:503
map< int, ParticleDataEntryPtr >::iterator begin()
Define iterators over entries.
Definition: ParticleData.h:585
ParticleData & operator=(const ParticleData &oldPD)
Assignment operator.
Definition: ParticleData.h:446
void setName(string nameIn)
Definition: ParticleData.h:228
DecayChannel(int onModeIn=0, double bRatioIn=0., int meModeIn=0, int prod0=0, int prod1=0, int prod2=0, int prod3=0, int prod4=0, int prod5=0, int prod6=0, int prod7=0)
Constructor.
Definition: ParticleData.h:40
bool init(const ParticleData &particleDataIn)
Read in database from saved file stored in memory.
Definition: ParticleData.h:468
void rescaleBR(int idIn, double newSumBR=1.)
Change branching ratios.
Definition: ParticleData.h:784
void addChannel(int onMode=0, double bRatio=0., int meMode=0, int prod0=0, int prod1=0, int prod2=0, int prod3=0, int prod4=0, int prod5=0, int prod6=0, int prod7=0)
Add a decay channel to the decay table.
Definition: ParticleData.h:347
Definition: StandardModel.h:135
vector< string > getReadHistory(int subrun=-999)
Definition: ParticleData.h:520
void onShellWidth(double onShellWidthIn)
Input/output for nominal partial width; used by resonances.
Definition: ParticleData.h:99
bool useBreitWigner(int idIn) const
Give back special mass-related quantities.
Definition: ParticleData.h:720
ParticleData(const ParticleData &oldPD)
Copy constructor.
Definition: ParticleData.h:433
bool useBreitWigner() const
Give back other quantities.
Definition: ParticleData.h:316
void initPtrs(Info *infoPtrIn)
Initialize pointers.
Definition: ParticleData.h:459
int id() const
Give back current values.
Definition: ParticleData.h:272
bool getIsInit()
Check initialisation status.
Definition: ParticleData.h:821
Header for classes to set beam momentum and interaction vertex spread.
Definition: Analysis.h:20
void listAll(ostream &stream)
Print out table of whole database, or of only part of it.
Definition: ParticleData.h:506
int sizeChannels() const
Decay table size.
Definition: ParticleData.h:354
void setMMinNoChange(double mMinIn)
Special options specifically when cutting wings of Breit-Wigners.
Definition: ParticleData.h:249
DecayChannel & operator=(const DecayChannel &oldDC)
Assignment operator.
Definition: ParticleData.h:60
This class holds a map of all ParticleDataEntries.
Definition: ParticleData.h:422
void setAll(int idIn, string nameIn, string antiNameIn, int spinTypeIn=0, int chargeTypeIn=0, int colTypeIn=0, double m0In=0., double mWidthIn=0., double mMinIn=0., double mMaxIn=0., double tau0In=0., bool varWidthIn=false)
Reset all the properties of an entry in one go.
Definition: ParticleData.h:549
Settings * settingsPtr
Pointer to the settings database.
Definition: Info.h:80
DecayChannel & channel(int i)
Gain access to a channel in the decay table.
Definition: ParticleData.h:357
bool init(istream &is)
Read in database from an istream.
Definition: ParticleData.h:472
void name(int idIn, string nameIn)
Change current values one at a time (or set if not set before).
Definition: ParticleData.h:589
int onMode() const
Member functions for output.
Definition: ParticleData.h:81
Definition: Settings.h:195
void initPtr(ParticleData *particleDataPtrIn)
Store pointer to whole particle data table/database.
Definition: ParticleData.h:211
bool isOctetHadron() const
Intermediate octet ccbar or bbar states in colour-octet model.
Definition: ParticleData.h:337