9 #include "Pythia8/PartonSystems.h"
21 void PartonSystems::replace(
int iSys,
int iPosOld,
int iPosNew) {
23 if (systems[iSys].iInA == iPosOld) {
24 systems[iSys].iInA = iPosNew;
27 if (systems[iSys].iInB == iPosOld) {
28 systems[iSys].iInB = iPosNew;
31 if (systems[iSys].iInRes == iPosOld) {
32 systems[iSys].iInRes = iPosNew;
34 for (
int i = 0; i < sizeOut(iSys); ++i)
35 if (systems[iSys].iOut[i] == iPosOld) {
36 systems[iSys].iOut[i] = iPosNew;
46 int PartonSystems::getAll(
int iSys,
int iMem)
const {
49 if (iMem == 0)
return systems[iSys].iInA;
50 if (iMem == 1)
return systems[iSys].iInB;
51 return systems[iSys].iOut[iMem - 2];
52 }
else if (hasInRes(iSys)) {
53 if (iMem == 0)
return systems[iSys].iInRes;
54 return systems[iSys].iOut[iMem - 1];
56 return systems[iSys].iOut[iMem];
67 int PartonSystems::getSystemOf(
int iPos,
bool alsoIn)
const {
71 for (
int iSys = 0; iSys < sizeSys(); ++iSys) {
72 if (systems[iSys].iInA == iPos)
return iSys;
73 if (systems[iSys].iInB == iPos)
return iSys;
74 if (systems[iSys].iInRes == iPos)
return iSys;
79 for (
int iSys = 0; iSys < sizeSys(); ++iSys) {
80 for (
int iMem = 0; iMem < sizeOut(iSys); ++iMem)
81 if (systems[iSys].iOut[iMem] == iPos)
return iSys;
93 int PartonSystems::getIndexOfOut(
int iSys,
int iPos)
const {
94 for (
int iMem = 0; iMem < sizeOut(iSys); ++iMem)
95 if (systems[iSys].iOut[iMem] == iPos)
return iMem;
106 void PartonSystems::list()
const {
109 cout <<
"\n -------- PYTHIA Parton Systems Listing -------------------"
110 <<
"--------------------------------- "
111 <<
"\n \n no inA inB out members \n";
114 for (
int iSys = 0; iSys < sizeSys(); ++iSys) {
115 cout <<
" " << setw(3) << iSys <<
" ";
117 cout << setw(4) << systems[iSys].iInA
118 <<
" " << setw(4) << systems[iSys].iInB;
119 }
else if (hasInRes(iSys)) {
120 cout <<
" (" << setw(4) << systems[iSys].iInRes
122 }
else cout<< setw(9) <<
" "<<endl;
123 for (
int iMem = 0; iMem < sizeOut(iSys); ++iMem) {
124 if (iMem%16 == 0 && iMem > 0) cout <<
"\n ";
125 cout <<
" " << setw(4) << systems[iSys].iOut[iMem];
131 if (sizeSys() == 0) cout <<
" no systems defined \n";
132 cout <<
"\n -------- End PYTHIA Parton Systems Listing ---------------"
133 <<
"---------------------------------" << endl;