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 for (
int i = 0; i < sizeOut(iSys); ++i)
32 if (systems[iSys].iOut[i] == iPosOld) {
33 systems[iSys].iOut[i] = iPosNew;
43 int PartonSystems::getAll(
int iSys,
int iMem)
const {
46 if (iMem == 0)
return systems[iSys].iInA;
47 if (iMem == 1)
return systems[iSys].iInB;
48 return systems[iSys].iOut[iMem - 2];
49 }
else return systems[iSys].iOut[iMem];
57 int PartonSystems::getSystemOf(
int iPos,
bool alsoIn)
const {
60 for (
int iSys = 0; iSys < sizeSys(); ++iSys) {
62 if (systems[iSys].iInA == iPos)
return iSys;
63 if (systems[iSys].iInB == iPos)
return iSys;
65 for (
int iMem = 0; iMem < sizeOut(iSys); ++iMem)
66 if (systems[iSys].iOut[iMem] == iPos)
return iSys;
78 int PartonSystems::getIndexOfOut(
int iSys,
int iPos)
const {
79 for (
int iMem = 0; iMem < sizeOut(iSys); ++iMem)
80 if (systems[iSys].iOut[iMem] == iPos)
return iMem;
91 void PartonSystems::list()
const {
94 cout <<
"\n -------- PYTHIA Parton Systems Listing -------------------"
95 <<
"--------------------------------- "
96 <<
"\n \n no inA inB out members \n";
99 for (
int iSys = 0; iSys < sizeSys(); ++iSys) {
100 cout <<
" " << setw(3) << iSys <<
" " << setw(4) << systems[iSys].iInA
101 <<
" " << setw(4) << systems[iSys].iInB;
102 for (
int iMem = 0; iMem < sizeOut(iSys); ++iMem) {
103 if (iMem%16 == 0 && iMem > 0) cout <<
"\n ";
104 cout <<
" " << setw(4) << systems[iSys].iOut[iMem];
110 if (sizeSys() == 0) cout <<
" no systems defined \n";
111 cout <<
"\n -------- End PYTHIA Parton Systems Listing ---------------"
112 <<
"---------------------------------" << endl;