]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PYTHIA8/pythia8130/src/Info.cxx
using option '-treename HLTesdTree' for EsdCollector, adding default parameter for...
[u/mrichter/AliRoot.git] / PYTHIA8 / pythia8130 / src / Info.cxx
CommitLineData
5ad4eb21 1// Info.cc is a part of the PYTHIA event generator.
2// Copyright (C) 2008 Torbjorn Sjostrand.
3// PYTHIA is licenced under the GNU GPL version 2, see COPYING for details.
4// Please respect the MCnet Guidelines, see GUIDELINES for details.
5
6// Function definitions (not found in the header) for the Info class.
7
8#include "Info.h"
9
10namespace Pythia8 {
11
12//**************************************************************************
13
14// Info class.
15// This class contains a mixed bag of information on the event generation
16// activity, especially on the current subprocess properties.
17
18//*********
19
20// Constants: could be changed here if desired, but normally should not.
21// These are of technical nature, as described for each.
22
23// Number of times the same error message will be repeated at most.
24const int Info::TIMESTOPRINT = 1;
25
26//*********
27
28// List (almost) all information currently set.
29
30void Info::list(ostream& os) {
31
32 // Header and beam info.
33 os << "\n -------- PYTHIA Info Listing ------------------------"
34 << "---------------- \n \n"
35 << scientific << setprecision(3)
36 << " Beam A: id = " << setw(6) << idASave << ", pz = " << setw(10)
37 << pzASave << ", e = " << setw(10) << eASave << ", m = " << setw(10)
38 << mASave << ".\n"
39 << " Beam B: id = " << setw(6) << idBSave << ", pz = " << setw(10)
40 << pzBSave << ", e = " << setw(10) << eBSave << ", m = " << setw(10)
41 << mBSave << ".\n\n";
42
43 // Done if no subprocess has been defined.
44 if (codeSave == 0 && nFinalSave == 0) {
45 os << " No process has been set; something must have gone wrong! \n"
46 << "\n -------- End PYTHIA Info Listing --------------------"
47 << "----------------" << endl;
48 return;
49 }
50
51 // Colliding parton info.
52 if (isRes)
53 os << " In 1: id = " << setw(4) << id1Save << ", x = " << setw(10)
54 << x1Save << ", pdf = " << setw(10) << pdf1Save << " at Q2 = "
55 << setw(10) << Q2FacSave << ".\n"
56 << " In 2: id = " << setw(4) << id2Save << ", x = " << setw(10)
57 << x2Save << ", pdf = " << setw(10) << pdf2Save << " at same Q2.\n\n";
58
59 // Process name and code.
60 os << ((isRes && !hasSubSave) ? " Subprocess " : " Process ") << nameSave
61 << " with code " << codeSave << " is 2 -> " << nFinalSave << ".\n";
62
63 // Subprocess name and code for minimum bias processes.
64 if (hasSubSave)
65 os << " Subprocess " << nameSubSave << " with code " << codeSubSave
66 << " is 2 -> " << nFinalSubSave << ".\n";
67
68 // Process-type-specific kinematics information.
69 if (isRes && nFinalSave == 1)
70 os << " It has sHat = " << setw(10) << sH << ".\n";
71 else if ( isRes && nFinalSave == 2)
72 os << " It has sHat = " << setw(10) << sH << ", tHat = "
73 << setw(10) << tH << ", uHat = " << setw(10) << uH << ",\n"
74 << " pTHat = " << setw(10) << pTH << ", m3Hat = "
75 << setw(10) << m3H << ", m4Hat = " << setw(10) << m4H << ",\n"
76 << " thetaHat = " << setw(10) << thetaH << ", phiHat = "
77 << setw(10) << phiH << ".\n";
78 else if ( nFinalSave == 2)
79 os << " It has s = " << setw(10) << sH << ", t = " << setw(10)
80 << tH << ", u = " << setw(10) << uH << ",\n"
81 << " pT = " << setw(10) << pTH << ", m3 = " << setw(10)
82 << m3H << ", m4 = " << setw(10) << m4H << ",\n"
83 << " theta = " << setw(10) << thetaH << ", phi = " << setw(10)
84 << phiH << ".\n";
85 else if ( isRes && nFinalSave == 3)
86 os << " It has sHat = " << setw(10) << sH << ", <pTHat> = "
87 << setw(10) << pTH << ".\n";
88
89 // Couplings.
90 if (isRes) os << " alphaEM = " << setw(10) << alphaEMSave
91 << ", alphaS = " << setw(10) << alphaSSave << " at Q2 = "
92 << setw(10) << Q2RenSave << ".\n";
93
94 // Impact parameter.
95 if (bIsSet) os << "\n Impact parameter b =" << setw(10) << bMISave
96 << " gives enhancement factor = " << setw(10) << enhanceMISave
97 << ".\n";
98
99 // Multiple interactions and shower evolution.
100 if (evolIsSet) os << " Max pT scale for MI = " << setw(10) << pTmaxMISave
101 << ", ISR = " << setw(10) << pTmaxISRSave << ", FSR = " << setw(10)
102 << pTmaxISRSave << ".\n Number of MI = " << setw(5) << nMISave
103 << ", ISR = " << setw(5) << nISRSave << ", FSRproc = " << setw(5)
104 << nFSRinProcSave << ", FSRreson = " << setw(5) << nFSRinResSave
105 << ".\n";
106
107 // Listing finished.
108 os << "\n -------- End PYTHIA Info Listing --------------------"
109 << "----------------" << endl;
110
111}
112
113//*********
114
115// Print a message the first few times. Insert in database.
116
117void Info::errorMsg(string messageIn, string extraIn, ostream& os) {
118
119 // Recover number of times message occured. Also inserts new string.
120 int times = messages[messageIn];
121 ++messages[messageIn];
122
123 // Print message the first few times.
124 if (times < TIMESTOPRINT) os << " PYTHIA " << messageIn << " "
125 << extraIn << endl;
126
127}
128
129//*********
130
131// Provide total number of errors/aborts/warnings experienced to date.
132
133int Info::errorTotalNumber() {
134
135 int nTot = 0;
136 for ( map<string, int>::iterator messageEntry = messages.begin();
137 messageEntry != messages.end(); ++messageEntry)
138 nTot += messageEntry->second;
139 return nTot;
140
141}
142
143//*********
144
145// Print statistics on errors/aborts/warnings.
146
147void Info::errorStatistics(ostream& os) {
148
149 // Header.
150 os << "\n *------- PYTHIA Error and Warning Messages Statistics "
151 << "----------------------------------------------------------* \n"
152 << " | "
153 << " | \n"
154 << " | times message "
155 << " | \n"
156 << " | "
157 << " | \n";
158
159 // Loop over all messages
160 map<string, int>::iterator messageEntry = messages.begin();
161 if (messageEntry == messages.end())
162 os << " | 0 no errors or warnings to report "
163 << " | \n";
164 while (messageEntry != messages.end()) {
165 // Debug printout.
166 string temp = messageEntry->first;
167 int len = temp.length();
168 temp.insert( len, max(0, 102 - len), ' ');
169 os << " | " << setw(6) << messageEntry->second << " "
170 << temp << " | \n";
171 ++messageEntry;
172 }
173
174 // Done.
175 os << " | "
176 << " | \n"
177 << " *------- End PYTHIA Error and Warning Messages Statistics"
178 << " ------------------------------------------------------* "
179 << endl;
180
181}
182
183//**************************************************************************
184
185} // end namespace Pythia8
186