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), 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; }
51 DecayChannel& operator=(
const DecayChannel& oldDC) {
if (
this != &oldDC) {
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; }
return *
this; }
60 void onMode(
int onModeIn) {onModeSave = onModeIn; hasChangedSave =
true;}
61 void bRatio(
double bRatioIn,
bool countAsChanged =
true) {
62 bRatioSave = bRatioIn;
if (countAsChanged) hasChangedSave =
true;}
63 void rescaleBR(
double fac) {bRatioSave *= fac; hasChangedSave =
true;}
64 void meMode(
int meModeIn) {meModeSave = meModeIn; hasChangedSave =
true;}
65 void multiplicity(
int multIn) {nProd = multIn; hasChangedSave =
true;}
66 void product(
int i,
int prodIn) {prod[i] = prodIn; nProd = 0;
67 for (
int j = 0; j < 8; ++j)
if (prod[j] != 0 && j == nProd) ++nProd;
68 hasChangedSave =
true;}
69 void setHasChanged(
bool hasChangedIn) {hasChangedSave = hasChangedIn;}
72 int onMode()
const {
return onModeSave;}
73 double bRatio()
const {
return bRatioSave;}
74 int meMode()
const {
return meModeSave;}
75 int multiplicity()
const {
return nProd;}
76 int product(
int i)
const {
return (i >= 0 && i < nProd) ? prod[i] : 0;}
77 bool hasChanged()
const {
return hasChangedSave;}
80 bool contains(
int id1)
const;
81 bool contains(
int id1,
int id2)
const;
82 bool contains(
int id1,
int id2,
int id3)
const;
86 void currentBR(
double currentBRIn) {currentBRSave = currentBRIn;}
87 double currentBR()
const {
return currentBRSave;}
90 void onShellWidth(
double onShellWidthIn) {
91 onShellWidthSave = onShellWidthIn;}
92 double onShellWidth()
const {
return onShellWidthSave;}
93 void onShellWidthFactor(
double factor) {onShellWidthSave *= factor;}
96 void openSec(
int idSgn,
double openSecIn) {
97 if (idSgn > 0) openSecPos = openSecIn;
else openSecNeg = openSecIn;}
98 double openSec(
int idSgn)
const {
99 return (idSgn > 0) ? openSecPos : openSecNeg;}
105 double bRatioSave, currentBRSave, onShellWidthSave, openSecPos,
107 int meModeSave, nProd, prod[8];
116 class ParticleDataEntry {
121 ParticleDataEntry(
int idIn = 0,
string nameIn =
" ",
122 int spinTypeIn = 0,
int chargeTypeIn = 0,
int colTypeIn = 0,
123 double m0In = 0.,
double mWidthIn = 0.,
double mMinIn = 0.,
124 double mMaxIn = 0.,
double tau0In = 0.) : idSave(abs(idIn)),
125 nameSave(nameIn), antiNameSave(
"void"), spinTypeSave(spinTypeIn),
126 chargeTypeSave(chargeTypeIn), colTypeSave(colTypeIn), m0Save(m0In),
127 mWidthSave (mWidthIn), mMinSave(mMinIn), mMaxSave(mMaxIn),
128 tau0Save(tau0In), hasAntiSave(false), hasChangedSave(true),
129 resonancePtr(0) {setDefaults();}
130 ParticleDataEntry(
int idIn,
string nameIn,
string antiNameIn,
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.) : idSave(abs(idIn)),
134 nameSave(nameIn), antiNameSave(antiNameIn), spinTypeSave(spinTypeIn),
135 chargeTypeSave(chargeTypeIn), colTypeSave(colTypeIn), m0Save(m0In),
136 mWidthSave (mWidthIn), mMinSave(mMinIn), mMaxSave(mMaxIn),
137 tau0Save(tau0In), hasAntiSave(true), hasChangedSave(true),
138 resonancePtr(0) {setDefaults();
139 if (toLower(antiNameIn) ==
"void") hasAntiSave =
false;}
142 ParticleDataEntry& operator=(
const ParticleDataEntry& oldPDE) {
143 if (
this != &oldPDE) { idSave = oldPDE.idSave;
144 nameSave = oldPDE.nameSave; antiNameSave = oldPDE.antiNameSave;
145 spinTypeSave = oldPDE.spinTypeSave; chargeTypeSave = oldPDE.chargeTypeSave;
146 colTypeSave = oldPDE.colTypeSave; m0Save = oldPDE.m0Save;
147 mWidthSave = oldPDE.mWidthSave; mMinSave = oldPDE.mMinSave;
148 mMaxSave = oldPDE.mMaxSave; tau0Save = oldPDE.tau0Save;
149 constituentMassSave = oldPDE.constituentMassSave;
150 hasAntiSave = oldPDE.hasAntiSave; isResonanceSave = oldPDE.isResonanceSave;
151 mayDecaySave = oldPDE.mayDecaySave; doExternalDecaySave
152 = oldPDE.doExternalDecaySave; isVisibleSave = oldPDE.isVisibleSave;
153 doForceWidthSave = oldPDE.doForceWidthSave; hasChangedSave
154 = oldPDE.hasChangedSave; hasChangedMMinSave = oldPDE.hasChangedMMinSave;
155 hasChangedMMaxSave = oldPDE.hasChangedMMaxSave;
156 modeBWnow = oldPDE.modeBWnow; atanLow = oldPDE.atanLow;
157 atanDif = oldPDE.atanDif; mThr = oldPDE.mThr;
158 for (
int i = 0; i < int(oldPDE.channels.size()); ++i) {
159 DecayChannel oldDC = oldPDE.channels[i]; channels.push_back(oldDC); }
160 currentBRSum = oldPDE.currentBRSum; resonancePtr = 0;
161 particleDataPtr = 0; }
return *
this; }
164 ~ParticleDataEntry();
170 void initPtr( ParticleData* particleDataPtrIn) {
171 particleDataPtr = particleDataPtrIn;}
174 void setAll(
string nameIn,
string antiNameIn,
int spinTypeIn = 0,
175 int chargeTypeIn = 0,
int colTypeIn = 0,
double m0In = 0.,
176 double mWidthIn = 0.,
double mMinIn = 0.,
double mMaxIn = 0.,
178 {nameSave = nameIn; antiNameSave = antiNameIn; hasAntiSave =
true;
179 if (toLower(antiNameIn) ==
"void") hasAntiSave =
false;
180 spinTypeSave = spinTypeIn; chargeTypeSave = chargeTypeIn;
181 colTypeSave = colTypeIn; m0Save = m0In; mWidthSave = mWidthIn;
182 setMMin(mMinIn); setMMax(mMaxIn); tau0Save = tau0In;
183 setDefaults(); hasChangedSave =
true;}
187 void setName(
string nameIn) {nameSave = nameIn; hasChangedSave =
true;}
188 void setAntiName(
string antiNameIn) {antiNameSave = antiNameIn;
189 hasAntiSave = (toLower(antiNameIn) !=
"void"); hasChangedSave =
true;}
190 void setNames(
string nameIn,
string antiNameIn) {nameSave = nameIn;
191 antiNameSave = antiNameIn; hasAntiSave = (toLower(antiNameIn) !=
"void");
192 hasChangedSave =
true;}
193 void setSpinType(
int spinTypeIn) {spinTypeSave = spinTypeIn;
194 hasChangedSave =
true;}
195 void setChargeType(
int chargeTypeIn) {chargeTypeSave = chargeTypeIn;
196 hasChangedSave =
true;}
197 void setColType(
int colTypeIn) {colTypeSave = colTypeIn;
198 hasChangedSave =
true;}
199 void setM0(
double m0In) {m0Save = m0In; setConstituentMass();
200 hasChangedSave =
true;}
201 void setMWidth(
double mWidthIn,
bool countAsChanged =
true) {
202 mWidthSave = mWidthIn;
if (countAsChanged) hasChangedSave =
true;}
203 void setMMin(
double mMinIn) {mMinSave = mMinIn; hasChangedSave =
true;
204 hasChangedMMinSave=
true;}
205 void setMMax(
double mMaxIn) {mMaxSave = mMaxIn; hasChangedSave =
true;
206 hasChangedMMaxSave=
true;}
208 void setMMinNoChange(
double mMinIn) {mMinSave = mMinIn;}
209 void setMMaxNoChange(
double mMaxIn) {mMaxSave = mMaxIn;}
210 void setTau0(
double tau0In) {tau0Save = tau0In; hasChangedSave =
true;}
211 void setIsResonance(
bool isResonanceIn) {isResonanceSave = isResonanceIn;
212 hasChangedSave =
true;}
213 void setMayDecay(
bool mayDecayIn,
bool countAsChanged =
true) {
214 mayDecaySave = mayDecayIn;
if (countAsChanged) hasChangedSave =
true;}
215 void setDoExternalDecay(
bool doExternalDecayIn)
216 {doExternalDecaySave = doExternalDecayIn; hasChangedSave =
true;}
217 void setIsVisible(
bool isVisibleIn) {isVisibleSave = isVisibleIn;
218 hasChangedSave =
true;}
219 void setDoForceWidth(
bool doForceWidthIn) {doForceWidthSave = doForceWidthIn;
220 hasChangedSave =
true;}
221 void setHasChanged(
bool hasChangedIn) {hasChangedSave = hasChangedIn;
222 for (
int i = 0; i < int(channels.size()); ++i)
223 channels[i].setHasChanged(hasChangedIn);
224 if (!hasChangedIn) {hasChangedMMinSave=
false; hasChangedMMaxSave=
false;}}
227 int id()
const {
return idSave; }
228 bool hasAnti()
const {
return hasAntiSave; }
229 string name(
int idIn = 1)
const {
230 return (idIn > 0) ? nameSave : antiNameSave; }
231 int spinType()
const {
return spinTypeSave; }
232 int chargeType(
int idIn = 1)
const {
233 return (idIn > 0) ? chargeTypeSave : -chargeTypeSave; }
234 double charge(
int idIn = 1)
const {
235 return (idIn > 0) ? chargeTypeSave / 3. : -chargeTypeSave / 3.; }
236 int colType(
int idIn = 1)
const {
237 if (colTypeSave == 2)
return colTypeSave;
238 return (idIn > 0) ? colTypeSave : -colTypeSave; }
239 double m0()
const {
return m0Save; }
240 double mWidth()
const {
return mWidthSave; }
241 double mMin()
const {
return mMinSave; }
242 double mMax()
const {
return mMaxSave; }
243 double m0Min()
const {
244 return (modeBWnow == 0) ? m0Save : mMinSave; }
245 double m0Max()
const {
246 return (modeBWnow == 0) ? m0Save : mMaxSave; }
247 double tau0()
const {
return tau0Save; }
248 bool isResonance()
const {
return isResonanceSave; }
249 bool mayDecay()
const {
return mayDecaySave; }
250 bool doExternalDecay()
const {
return doExternalDecaySave; }
251 bool isVisible()
const {
return isVisibleSave; }
252 bool doForceWidth()
const {
return doForceWidthSave; }
253 bool hasChanged()
const {
if (hasChangedSave)
return true;
254 for (
int i = 0; i < int(channels.size()); ++i)
255 if (channels[i].hasChanged())
return true;
257 bool hasChangedMMin()
const {
return hasChangedMMinSave; }
258 bool hasChangedMMax()
const {
return hasChangedMMaxSave; }
262 double constituentMass()
const {
return constituentMassSave; }
264 double mRun(
double mH);
267 bool useBreitWigner()
const {
return (modeBWnow > 0); }
268 bool canDecay()
const {
return (channels.size() > 0);}
269 bool isLepton()
const {
return (idSave > 10 && idSave < 19);}
270 bool isQuark()
const {
return (idSave != 0 && idSave < 9);}
271 bool isGluon()
const {
return (idSave == 21);}
272 bool isDiquark()
const {
return (idSave > 1000 && idSave < 10000
273 && (idSave/10)%10 == 0);}
274 bool isParton()
const {
return ( idSave == 21
275 || (idSave != 0 && idSave < 6)
276 || (idSave > 1000 && idSave < 5510 && (idSave/10)%10 == 0) );}
277 bool isHadron()
const;
278 bool isMeson()
const;
279 bool isBaryon()
const;
282 bool isOctetHadron()
const {
return idSave >= 9940000
283 && idSave < 9960000; }
284 int heaviestQuark(
int idIn = 1)
const;
285 int baryonNumberType(
int idIn = 1)
const;
286 int nQuarksInCode(
int idQIn)
const;
289 void clearChannels() {channels.resize(0);}
292 void addChannel(
int onMode = 0,
double bRatio = 0.,
int meMode = 0,
293 int prod0 = 0,
int prod1 = 0,
int prod2 = 0,
int prod3 = 0,
294 int prod4 = 0,
int prod5 = 0,
int prod6 = 0,
int prod7 = 0) {
295 channels.push_back( DecayChannel( onMode, bRatio, meMode, prod0,
296 prod1, prod2, prod3, prod4, prod5, prod6, prod7) ); }
299 int sizeChannels()
const {
return channels.size();}
302 DecayChannel& channel(
int i){
return channels[i];}
303 const DecayChannel& channel(
int i)
const {
return channels[i];}
306 void rescaleBR(
double newSumBR = 1.);
309 bool preparePick(
int idSgn,
double mHat = 0.,
int idInFlav = 0);
310 DecayChannel& pickChannel();
313 void setResonancePtr(ResonanceWidths* resonancePtrIn);
314 ResonanceWidths* getResonancePtr() {
return resonancePtr;}
315 void resInit(Info* infoPtrIn, Settings* settingsPtrIn,
316 ParticleData* particleDataPtrIn, Couplings* couplingsPtrIn);
317 double resWidth(
int idSgn,
double mHat,
int idIn = 0,
318 bool openOnly =
false,
bool setBR =
false);
319 double resWidthOpen(
int idSgn,
double mHat,
int idIn = 0);
320 double resWidthStore(
int idSgn,
double mHat,
int idIn = 0);
321 double resOpenFrac(
int idSgn);
322 double resWidthRescaleFactor();
323 double resWidthChan(
double mHat,
int idAbs1 = 0,
int idAbs2 = 0);
328 static const int INVISIBLENUMBER, INVISIBLETABLE[80], KNOWNNOWIDTH[3];
329 static const double MAXTAU0FORDECAY,MINMASSRESONANCE, NARROWMASS,
330 CONSTITUENTMASSTABLE[10];
334 string nameSave, antiNameSave;
335 int spinTypeSave, chargeTypeSave, colTypeSave;
336 double m0Save, mWidthSave, mMinSave, mMaxSave, tau0Save,
338 bool hasAntiSave, isResonanceSave, mayDecaySave, doExternalDecaySave,
339 isVisibleSave, doForceWidthSave, hasChangedSave, hasChangedMMinSave,
343 int modeBWnow, modeTau0now;
344 double atanLow, atanDif, mThr;
347 vector<DecayChannel> channels;
353 ResonanceWidths* resonancePtr;
356 ParticleData* particleDataPtr;
359 void setConstituentMass();
372 ParticleData() : infoPtr(0), settingsPtr(0), rndmPtr(0), couplingsPtr(0),
373 particlePtr(0), isInit(false), readingFailedSave(false) {}
376 ParticleData& operator=(
const ParticleData& oldPD) {
if (
this != &oldPD) {
377 modeBreitWigner = oldPD.modeBreitWigner; maxEnhanceBW = oldPD.maxEnhanceBW;
378 for (
int i = 0; i < 7; ++i) mQRun[i] = oldPD.mQRun[i];
379 Lambda5Run = oldPD.Lambda5Run;
380 infoPtr = 0; settingsPtr = 0; rndmPtr = 0; couplingsPtr = 0;
381 for ( map<int, ParticleDataEntry>::const_iterator pde = oldPD.pdt.begin();
382 pde != oldPD.pdt.end(); pde++) {
int idTmp = pde->first;
383 pdt[idTmp] = pde->second; pdt[idTmp].initPtr(
this); }
384 particlePtr = 0; isInit = oldPD.isInit;
385 readingFailedSave = oldPD.readingFailedSave; }
return *
this; }
388 void initPtr(Info* infoPtrIn, Settings* settingsPtrIn, Rndm* rndmPtrIn,
389 Couplings* couplingsPtrIn) {infoPtr = infoPtrIn;
390 settingsPtr = settingsPtrIn; rndmPtr = rndmPtrIn;
391 couplingsPtr = couplingsPtrIn;}
394 bool init(
string startFile =
"../share/Pythia8/xmldoc/ParticleData.xml") {
395 initCommon();
return readXML(startFile);}
398 bool init(
const ParticleData& particleDataIn) {
399 initCommon();
return copyXML(particleDataIn);}
402 bool init(istream& is) { initCommon();
return readXML(is);}
405 bool reInit(
string startFile,
bool xmlFormat =
true) { initCommon();
406 return (xmlFormat) ? readXML(startFile) : readFF(startFile);}
409 void initWidths(vector<ResonanceWidths*> resonancePtrs);
412 bool readXML(
string inFile,
bool reset =
true) ;
413 void listXML(
string outFile);
414 bool readXML(istream& is,
bool reset=
true);
417 bool copyXML(
const ParticleData &particleDataIn);
420 bool loadXML(
string inFile,
bool reset =
true) ;
421 bool loadXML(istream& is,
bool reset=
true);
422 bool processXML(
bool reset =
true) ;
425 bool readFF(
string inFile,
bool reset =
true) ;
426 bool readFF(istream& is,
bool reset =
true);
427 void listFF(
string outFile);
430 bool readString(
string lineIn,
bool warn =
true) ;
433 bool readingFailed() {
return readingFailedSave;}
436 void listAll() {list(
false,
true);}
437 void listChanged(
bool changedRes =
false) {list(
true, changedRes);}
438 void list(
bool changedOnly =
false,
bool changedRes =
true);
441 void list(
int idList) {vector<int> idListTemp;
442 idListTemp.push_back(idList); list( idListTemp);}
443 void list(vector<int> idList);
447 vector<string> getReadHistory(
int subrun=-999) {
448 if (subrun == -999)
return readStringHistory;
449 else if (readStringSubrun.find(subrun) != readStringSubrun.end())
450 return readStringSubrun[subrun];
451 else return vector<string>();
455 void checkTable(
int verbosity = 1) ;
458 void addParticle(
int idIn,
string nameIn =
" ",
int spinTypeIn = 0,
459 int chargeTypeIn = 0,
int colTypeIn = 0,
double m0In = 0.,
460 double mWidthIn = 0.,
double mMinIn = 0.,
double mMaxIn = 0.,
461 double tau0In = 0.) { pdt[abs(idIn)] = ParticleDataEntry(idIn,
462 nameIn, spinTypeIn, chargeTypeIn, colTypeIn, m0In, mWidthIn,
463 mMinIn, mMaxIn, tau0In); pdt[abs(idIn)].initPtr(
this); }
464 void addParticle(
int idIn,
string nameIn,
string antiNameIn,
465 int spinTypeIn = 0,
int chargeTypeIn = 0,
int colTypeIn = 0,
466 double m0In = 0.,
double mWidthIn = 0.,
double mMinIn = 0.,
467 double mMaxIn = 0.,
double tau0In = 0.) { pdt[abs(idIn)]
468 = ParticleDataEntry(idIn, nameIn, antiNameIn, spinTypeIn,
469 chargeTypeIn, colTypeIn, m0In, mWidthIn, mMinIn, mMaxIn, tau0In);
470 pdt[abs(idIn)].initPtr(
this); }
473 void setAll(
int idIn,
string nameIn,
string antiNameIn,
474 int spinTypeIn = 0,
int chargeTypeIn = 0,
int colTypeIn = 0,
475 double m0In = 0.,
double mWidthIn = 0.,
double mMinIn = 0.,
476 double mMaxIn = 0.,
double tau0In = 0.) {
477 ParticleDataEntry* ptr = findParticle(idIn);
478 if ( ptr ) ptr->setAll( nameIn, antiNameIn, spinTypeIn, chargeTypeIn,
479 colTypeIn, m0In, mWidthIn, mMinIn, mMaxIn, tau0In); }
482 bool isParticle(
int idIn)
const {
483 map<int,ParticleDataEntry>::const_iterator found = pdt.find( abs(idIn) );
484 if ( found == pdt.end() )
return false;
485 if ( idIn > 0 || found->second.hasAnti() )
return true;
490 ParticleDataEntry* findParticle(
int idIn) {
491 map<int,ParticleDataEntry>::iterator found = pdt.find( abs(idIn) );
492 if( found == pdt.end() )
return NULL;
493 if ( idIn > 0 || found->second.hasAnti() )
return &((*found).second);
498 const ParticleDataEntry* findParticle(
int idIn)
const {
499 map<int,ParticleDataEntry>::const_iterator found = pdt.find( abs(idIn) );
500 if( found == pdt.end() )
return NULL;
501 if ( idIn > 0 || found->second.hasAnti() )
return &((*found).second);
506 int nextId(
int idIn) ;
509 void name(
int idIn,
string nameIn) {
510 ParticleDataEntry* ptr = findParticle(idIn);
511 if ( ptr ) ptr->setName(nameIn); }
512 void antiName(
int idIn,
string antiNameIn) {
513 ParticleDataEntry* ptr = findParticle(idIn);
514 if ( ptr ) ptr->setAntiName(antiNameIn); }
515 void names(
int idIn,
string nameIn,
string antiNameIn) {
516 ParticleDataEntry* ptr = findParticle(idIn);
517 if ( ptr ) ptr->setNames(nameIn, antiNameIn); }
518 void spinType(
int idIn,
int spinTypeIn) {
519 ParticleDataEntry* ptr = findParticle(idIn);
520 if ( ptr ) ptr->setSpinType(spinTypeIn); }
521 void chargeType(
int idIn,
int chargeTypeIn) {
522 ParticleDataEntry* ptr = findParticle(idIn);
523 if ( ptr ) ptr->setChargeType(chargeTypeIn); }
524 void colType(
int idIn,
int colTypeIn) {
525 ParticleDataEntry* ptr = findParticle(idIn);
526 if ( ptr ) ptr->setColType(colTypeIn); }
527 void m0(
int idIn,
double m0In) {
528 ParticleDataEntry* ptr = findParticle(idIn);
529 if ( ptr ) ptr->setM0(m0In); }
530 void mWidth(
int idIn,
double mWidthIn) {
531 ParticleDataEntry* ptr = findParticle(idIn);
532 if ( ptr ) ptr->setMWidth(mWidthIn); }
533 void mMin(
int idIn,
double mMinIn) {
534 ParticleDataEntry* ptr = findParticle(idIn);
535 if ( ptr ) ptr->setMMin(mMinIn); }
536 void mMax(
int idIn,
double mMaxIn) {
537 ParticleDataEntry* ptr = findParticle(idIn);
538 if ( ptr ) ptr->setMMax(mMaxIn); }
539 void tau0(
int idIn,
double tau0In) {
540 ParticleDataEntry* ptr = findParticle(idIn);
541 if ( ptr ) ptr->setTau0(tau0In); }
542 void isResonance(
int idIn,
bool isResonanceIn) {
543 ParticleDataEntry* ptr = findParticle(idIn);
544 if ( ptr ) ptr->setIsResonance(isResonanceIn); }
545 void mayDecay(
int idIn,
bool mayDecayIn) {
546 ParticleDataEntry* ptr = findParticle(idIn);
547 if ( ptr ) ptr->setMayDecay(mayDecayIn); }
548 void doExternalDecay(
int idIn,
bool doExternalDecayIn) {
549 ParticleDataEntry* ptr = findParticle(idIn);
550 if ( ptr ) ptr->setDoExternalDecay(doExternalDecayIn); }
551 void isVisible(
int idIn,
bool isVisibleIn) {
552 ParticleDataEntry* ptr = findParticle(idIn);
553 if ( ptr ) ptr->setIsVisible(isVisibleIn); }
554 void doForceWidth(
int idIn,
bool doForceWidthIn) {
555 ParticleDataEntry* ptr = findParticle(idIn);
556 if ( ptr ) ptr->setDoForceWidth(doForceWidthIn); }
557 void hasChanged(
int idIn,
bool hasChangedIn) {
558 ParticleDataEntry* ptr = findParticle(idIn);
559 if ( ptr ) ptr->setHasChanged(hasChangedIn); }
562 bool hasAnti(
int idIn)
const {
563 const ParticleDataEntry* ptr = findParticle(idIn);
564 return ( ptr ) ? ptr->hasAnti() :
false; }
565 string name(
int idIn)
const {
566 const ParticleDataEntry* ptr = findParticle(idIn);
567 return ( ptr ) ? ptr->name(idIn) :
" "; }
568 int spinType(
int idIn)
const {
569 const ParticleDataEntry* ptr = findParticle(idIn);
570 return ( ptr ) ? ptr->spinType() : 0; }
571 int chargeType(
int idIn) {
572 const ParticleDataEntry* ptr = findParticle(idIn);
573 return ( ptr ) ? ptr->chargeType(idIn) : 0; }
574 double charge(
int idIn) {
575 const ParticleDataEntry* ptr = findParticle(idIn);
576 return ( ptr ) ? ptr->charge(idIn) : 0; }
577 int colType(
int idIn) {
578 const ParticleDataEntry* ptr = findParticle(idIn);
579 return ( ptr ) ? ptr->colType(idIn) : 0 ; }
580 double m0(
int idIn) {
581 const ParticleDataEntry* ptr = findParticle(idIn);
582 return ( ptr ) ? ptr->m0() : 0. ; }
583 double mWidth(
int idIn) {
584 const ParticleDataEntry* ptr = findParticle(idIn);
585 return ( ptr ) ? ptr->mWidth() : 0. ; }
586 double mMin(
int idIn) {
587 const ParticleDataEntry* ptr = findParticle(idIn);
588 return ( ptr ) ? ptr->mMin() : 0. ; }
589 double m0Min(
int idIn) {
590 const ParticleDataEntry* ptr = findParticle(idIn);
591 return ( ptr ) ? ptr->m0Min() : 0. ; }
592 double mMax(
int idIn) {
593 const ParticleDataEntry* ptr = findParticle(idIn);
594 return ( ptr ) ? ptr->mMax() : 0. ; }
595 double m0Max(
int idIn) {
596 const ParticleDataEntry* ptr = findParticle(idIn);
597 return ( ptr ) ? ptr->m0Max() : 0. ; }
598 double tau0(
int idIn) {
599 const ParticleDataEntry* ptr = findParticle(idIn);
600 return ( ptr ) ? ptr->tau0() : 0. ; }
601 bool isResonance(
int idIn) {
602 const ParticleDataEntry* ptr = findParticle(idIn);
603 return ( ptr ) ? ptr->isResonance() : false ; }
604 bool mayDecay(
int idIn) {
605 const ParticleDataEntry* ptr = findParticle(idIn);
606 return ( ptr ) ? ptr->mayDecay() : false ; }
607 bool doExternalDecay(
int idIn) {
608 const ParticleDataEntry* ptr = findParticle(idIn);
609 return ( ptr ) ? ptr->doExternalDecay() : false ; }
610 bool isVisible(
int idIn) {
611 const ParticleDataEntry* ptr = findParticle(idIn);
612 return ( ptr ) ? ptr->isVisible() : false ; }
613 bool doForceWidth(
int idIn) {
614 const ParticleDataEntry* ptr = findParticle(idIn);
615 return ( ptr ) ? ptr->doForceWidth() : false ; }
616 bool hasChanged(
int idIn) {
617 const ParticleDataEntry* ptr = findParticle(idIn);
618 return ( ptr ) ? ptr->hasChanged() : false ; }
619 bool hasChangedMMin(
int idIn) {
620 const ParticleDataEntry* ptr = findParticle(idIn);
621 return ( ptr ) ? ptr->hasChangedMMin() : false ; }
622 bool hasChangedMMax(
int idIn) {
623 const ParticleDataEntry* ptr = findParticle(idIn);
624 return ( ptr ) ? ptr->hasChangedMMax() : false ; }
627 bool useBreitWigner(
int idIn) {
628 ParticleDataEntry* ptr = findParticle(idIn);
629 return ( ptr ) ? ptr->useBreitWigner() : false ; }
630 double constituentMass(
int idIn) {
631 ParticleDataEntry* ptr = findParticle(idIn);
632 return ( ptr ) ? ptr->constituentMass() : 0. ; }
633 double mSel(
int idIn) {
634 ParticleDataEntry* ptr = findParticle(idIn);
635 return ( ptr ) ? ptr->mSel() : 0. ; }
636 double mRun(
int idIn,
double mH) {
637 ParticleDataEntry* ptr = findParticle(idIn);
638 return ( ptr ) ? ptr->mRun(mH) : 0. ; }
641 bool canDecay(
int idIn) {
642 const ParticleDataEntry* ptr = findParticle(idIn);
643 return ( ptr ) ? ptr->canDecay() : false ; }
644 bool isLepton(
int idIn) {
645 const ParticleDataEntry* ptr = findParticle(idIn);
646 return ( ptr ) ? ptr->isLepton() : false ; }
647 bool isQuark(
int idIn) {
648 const ParticleDataEntry* ptr = findParticle(idIn);
649 return ( ptr ) ? ptr->isQuark() : false ; }
650 bool isGluon(
int idIn) {
651 const ParticleDataEntry* ptr = findParticle(idIn);
652 return ( ptr ) ? ptr->isGluon() : false ; }
653 bool isDiquark(
int idIn) {
654 const ParticleDataEntry* ptr = findParticle(idIn);
655 return ( ptr ) ? ptr->isDiquark() : false ; }
656 bool isParton(
int idIn) {
657 const ParticleDataEntry* ptr = findParticle(idIn);
658 return ( ptr ) ? ptr->isParton() : false ; }
659 bool isHadron(
int idIn) {
660 const ParticleDataEntry* ptr = findParticle(idIn);
661 return ( ptr ) ? ptr->isHadron() : false ; }
662 bool isMeson(
int idIn) {
663 const ParticleDataEntry* ptr = findParticle(idIn);
664 return ( ptr ) ? ptr->isMeson() : false ; }
665 bool isBaryon(
int idIn) {
666 const ParticleDataEntry* ptr = findParticle(idIn);
667 return ( ptr ) ? ptr->isBaryon() : false ; }
668 bool isOctetHadron(
int idIn) {
669 const ParticleDataEntry* ptr = findParticle(idIn);
670 return ( ptr ) ? ptr->isOctetHadron() : false ; }
671 int heaviestQuark(
int idIn) {
672 const ParticleDataEntry* ptr = findParticle(idIn);
673 return ( ptr ) ? ptr->heaviestQuark(idIn) : 0 ; }
674 int baryonNumberType(
int idIn) {
675 const ParticleDataEntry* ptr = findParticle(idIn);
676 return ( ptr ) ? ptr->baryonNumberType(idIn) : 0 ; }
677 int nQuarksInCode(
int idIn,
int idQIn) {
678 const ParticleDataEntry* ptr = findParticle(idIn);
679 return ( ptr ) ? ptr->nQuarksInCode(idQIn) : 0 ; }
682 void rescaleBR(
int idIn,
double newSumBR = 1.) {
683 ParticleDataEntry* ptr = findParticle(idIn);
684 if ( ptr ) ptr->rescaleBR(newSumBR); }
687 void setResonancePtr(
int idIn, ResonanceWidths* resonancePtrIn) {
688 ParticleDataEntry* ptr = findParticle(idIn);
689 if ( ptr ) ptr->setResonancePtr( resonancePtrIn);}
690 void resInit(
int idIn) {
691 ParticleDataEntry* ptr = findParticle(idIn);
692 if ( ptr ) ptr->resInit(infoPtr, settingsPtr,
this, couplingsPtr);}
693 double resWidth(
int idIn,
double mHat,
int idInFlav = 0,
694 bool openOnly =
false,
bool setBR =
false) {
695 ParticleDataEntry* ptr = findParticle(idIn);
696 return ( ptr ) ? ptr->resWidth(idIn, mHat,
697 idInFlav, openOnly, setBR) : 0.;}
698 double resWidthOpen(
int idIn,
double mHat,
int idInFlav = 0) {
699 ParticleDataEntry* ptr = findParticle(idIn);
700 return ( ptr ) ? ptr->resWidthOpen(idIn, mHat, idInFlav) : 0.;}
701 double resWidthStore(
int idIn,
double mHat,
int idInFlav = 0) {
702 ParticleDataEntry* ptr = findParticle(idIn);
703 return ( ptr ) ? ptr->resWidthStore(idIn, mHat, idInFlav) : 0.;}
704 double resOpenFrac(
int id1In,
int id2In = 0,
int id3In = 0);
705 double resWidthRescaleFactor(
int idIn) {
706 ParticleDataEntry* ptr = findParticle(idIn);
707 return ( ptr ) ? ptr->resWidthRescaleFactor() : 0.;}
708 double resWidthChan(
int idIn,
double mHat,
int idAbs1 = 0,
710 ParticleDataEntry* ptr = findParticle(idIn);
711 return ( ptr ) ? ptr->resWidthChan( mHat, idAbs1, idAbs2) : 0.;}
714 ParticleDataEntry* particleDataEntryPtr(
int idIn) {
715 ParticleDataEntry* ptr = findParticle(idIn);
716 return ( ptr ) ? ptr : &pdt[0]; }
719 bool getIsInit() {
return isInit;}
724 bool setRapidDecayVertex;
726 double maxEnhanceBW, mQRun[7], Lambda5Run, intermediateTau0;
729 friend class ParticleDataEntry;
735 Settings* settingsPtr;
741 Couplings* couplingsPtr;
744 map<int, ParticleDataEntry> pdt;
747 ParticleDataEntry* particlePtr;
750 bool isInit, readingFailedSave;
756 bool boolString(
string tag) {
string tagLow = toLower(tag);
757 return ( tagLow ==
"true" || tagLow ==
"1" || tagLow ==
"on"
758 || tagLow ==
"yes" || tagLow ==
"ok" ); }
761 string attributeValue(
string line,
string attribute);
762 bool boolAttributeValue(
string line,
string attribute);
763 int intAttributeValue(
string line,
string attribute);
764 double doubleAttributeValue(
string line,
string attribute);
767 vector<string> xmlFileSav;
770 vector<string> readStringHistory;
771 map<int, vector<string> > readStringSubrun;
779 #endif // Pythia8_ParticleData_H