8 #include "Pythia8/Info.h"
24 const int Info::TIMESTOPRINT = 1;
27 const double Info::CONVERTMB2PB = 1e9;
33 void Info::list(ostream& os)
const {
36 os <<
"\n -------- PYTHIA Info Listing ------------------------"
37 <<
"---------------- \n \n"
38 << scientific << setprecision(3)
39 <<
" Beam A: id = " << setw(6) << idASave <<
", pz = " << setw(10)
40 << pzASave <<
", e = " << setw(10) << eASave <<
", m = " << setw(10)
42 <<
" Beam B: id = " << setw(6) << idBSave <<
", pz = " << setw(10)
43 << pzBSave <<
", e = " << setw(10) << eBSave <<
", m = " << setw(10)
47 if (codeSave == 0 && nFinalSave == 0) {
48 os <<
" No process has been set; something must have gone wrong! \n"
49 <<
"\n -------- End PYTHIA Info Listing --------------------"
50 <<
"----------------" << endl;
56 os <<
" In 1: id = " << setw(4) << id1pdfSave[0] <<
", x = "
57 << setw(10) << x1pdfSave[0] <<
", pdf = " << setw(10) << pdf1Save[0]
58 <<
" at Q2 = " << setw(10) << Q2FacSave[0] <<
".\n"
59 <<
" In 2: id = " << setw(4) << id2pdfSave[0] <<
", x = "
60 << setw(10) << x2pdfSave[0] <<
", pdf = " << setw(10) << pdf2Save[0]
63 if (id1pdfSave[0] != id1Save[0] || id2pdfSave[0] != id2Save[0])
65 if (abs(x1pdfSave[0] - x1Save[0]) > 1e-4 * x1Save[0]) matchIdX =
false;
66 if (abs(x2pdfSave[0] - x2Save[0]) > 1e-4 * x2Save[0]) matchIdX =
false;
67 if (!matchIdX) os <<
" Warning: above flavour/x info does not match"
68 <<
" incoming partons in event!\n";
73 os << ((isRes && !hasSubSave[0]) ?
" Subprocess " :
" Process ") << nameSave
74 <<
" with code " << codeSave <<
" is 2 -> " << nFinalSave <<
".\n";
78 os <<
" Subprocess " << nameSubSave[0] <<
" with code " << codeSubSave[0]
79 <<
" is 2 -> " << nFinalSubSave[0] <<
".\n";
82 if ( isRes && nFinalSave == 1)
83 os <<
" It has sHat = " << setw(10) << sH[0] <<
".\n";
84 else if ( isRes && nFinalSave == 2)
85 os <<
" It has sHat = " << setw(10) << sH[0] <<
", tHat = "
86 << setw(10) << tH[0] <<
", uHat = " << setw(10) << uH[0] <<
",\n"
87 <<
" pTHat = " << setw(10) << pTH[0] <<
", m3Hat = "
88 << setw(10) << m3H[0] <<
", m4Hat = " << setw(10) << m4H[0] <<
",\n"
89 <<
" thetaHat = " << setw(10) << thetaH[0] <<
", phiHat = "
90 << setw(10) << phiH[0] <<
".\n";
91 else if ( nFinalSave == 2)
92 os <<
" It has s = " << setw(10) << sH[0] <<
", t = " << setw(10)
93 << tH[0] <<
", u = " << setw(10) << uH[0] <<
",\n"
94 <<
" pT = " << setw(10) << pTH[0] <<
", m3 = " << setw(10)
95 << m3H[0] <<
", m4 = " << setw(10) << m4H[0] <<
",\n"
96 <<
" theta = " << setw(10) << thetaH[0] <<
", phi = " << setw(10)
98 else if ( isRes && nFinalSave == 3)
99 os <<
" It has sHat = " << setw(10) << sH[0] <<
", <pTHat> = "
100 << setw(10) << pTH[0] <<
".\n";
101 else if ( nFinalSave == 3)
102 os <<
" It has s = " << setw(10) << sH[0] <<
", t_A = " << setw(10)
103 << tH[0] <<
", t_B = " << setw(10) << uH[0] <<
",\n"
104 <<
" <pT> = " << setw(10) << pTH[0] <<
".\n";
107 if (isRes) os <<
" alphaEM = " << setw(10) << alphaEMSave[0]
108 <<
", alphaS = " << setw(10) << alphaSSave[0] <<
" at Q2 = "
109 << setw(10) << Q2RenSave[0] <<
".\n";
112 for (
int iDS = 1; iDS < 4; ++iDS)
if (id1Save[iDS] != 0) {
113 if (iDS == 1) os <<
"\n Diffractive system on side A: \n";
114 if (iDS == 2) os <<
"\n Diffractive system on side B: \n";
115 if (iDS == 3) os <<
"\n Central diffractive system: \n";
116 os <<
" In 1: id = " << setw(4) << id1pdfSave[iDS] <<
", x = "
117 << setw(10) << x1pdfSave[iDS] <<
", pdf = " << setw(10)
118 << pdf1Save[iDS] <<
" at Q2 = " << setw(10) << Q2FacSave[iDS]
119 <<
".\n" <<
" In 2: id = " << setw(4) << id2pdfSave[iDS]
120 <<
", x = " << setw(10) << x2pdfSave[iDS] <<
", pdf = "
121 << setw(10) << pdf2Save[iDS] <<
" at same Q2.\n";
122 os <<
" Subprocess " << nameSubSave[iDS] <<
" with code "
123 << codeSubSave[iDS] <<
" is 2 -> " << nFinalSubSave[iDS] <<
".\n";
124 if (nFinalSubSave[iDS] == 1)
125 os <<
" It has sHat = " << setw(10) << sH[iDS] <<
".\n";
126 else if (nFinalSubSave[iDS] == 2)
127 os <<
" It has sHat = " << setw(10) << sH[iDS] <<
", tHat = "
128 << setw(10) << tH[iDS] <<
", uHat = " << setw(10) << uH[iDS]
129 <<
",\n" <<
" pTHat = " << setw(10) << pTH[iDS]
130 <<
", m3Hat = " << setw(10) << m3H[iDS] <<
", m4Hat = "
131 << setw(10) << m4H[iDS] <<
",\n" <<
" thetaHat = " << setw(10)
132 << thetaH[iDS] <<
", phiHat = " << setw(10) << phiH[iDS] <<
".\n";
133 os <<
" alphaEM = " << setw(10) << alphaEMSave[iDS]
134 <<
", alphaS = " << setw(10) << alphaSSave[iDS] <<
" at Q2 = "
135 << setw(10) << Q2RenSave[iDS] <<
".\n";
139 if (bIsSet) os <<
"\n Impact parameter b = " << setw(10) << bMPISave
140 <<
" gives enhancement factor = " << setw(10) << enhanceMPISave
144 if (evolIsSet) os <<
" Max pT scale for MPI = " << setw(10) << pTmaxMPISave
145 <<
", ISR = " << setw(10) << pTmaxISRSave <<
", FSR = " << setw(10)
146 << pTmaxISRSave <<
".\n Number of MPI = " << setw(5) << nMPISave
147 <<
", ISR = " << setw(5) << nISRSave <<
", FSRproc = " << setw(5)
148 << nFSRinProcSave <<
", FSRreson = " << setw(5) << nFSRinResSave
152 os <<
"\n -------- End PYTHIA Info Listing --------------------"
153 <<
"----------------" << endl;
161 double Info::weight()
const {
return (abs(lhaStrategySave) == 4)
162 ? CONVERTMB2PB * weightSave : weightSave;
165 double Info::weightSum()
const {
return (abs(lhaStrategySave) == 4)
166 ? CONVERTMB2PB * wtAccSum : wtAccSum;
173 vector<int> Info::codesHard() {
174 vector<int> codesNow;
175 for (map<int, long>::iterator nTryEntry = nTryM.begin();
176 nTryEntry != nTryM.end(); ++nTryEntry)
177 codesNow.push_back( nTryEntry->first );
185 void Info::errorMsg(
string messageIn,
string extraIn,
bool showAlways,
189 int times = messages[messageIn];
190 ++messages[messageIn];
193 if (times < TIMESTOPRINT || showAlways) os <<
" PYTHIA "
194 << messageIn <<
" " << extraIn << endl;
202 int Info::errorTotalNumber() {
205 for ( map<string, int>::iterator messageEntry = messages.begin();
206 messageEntry != messages.end(); ++messageEntry)
207 nTot += messageEntry->second;
216 void Info::errorStatistics(ostream& os) {
219 os <<
"\n *------- PYTHIA Error and Warning Messages Statistics "
220 <<
"----------------------------------------------------------* \n"
223 <<
" | times message "
229 map<string, int>::iterator messageEntry = messages.begin();
230 if (messageEntry == messages.end())
231 os <<
" | 0 no errors or warnings to report "
233 while (messageEntry != messages.end()) {
235 string temp = messageEntry->first;
236 int len = temp.length();
237 temp.insert( len, max(0, 102 - len),
' ');
238 os <<
" | " << setw(6) << messageEntry->second <<
" "
246 <<
" *------- End PYTHIA Error and Warning Messages Statistics"
247 <<
" ------------------------------------------------------* "