source: HiSusy/trunk/Pythia8/pythia8170/xmldoc/worksheet.tex @ 1

Last change on this file since 1 was 1, checked in by zerwas, 11 years ago

first import of structure, PYTHIA8 and DELPHES

File size: 37.3 KB
Line 
1\documentclass[12pt,a4paper]{article}
2
3%packages
4%\renewcommand{\familydefault}{phv}
5\usepackage{epsfig}
6\usepackage{axodraw}
7
8%define page size
9\setlength{\textheight}{233mm}
10\setlength{\topmargin}{14mm}
11\setlength{\headheight}{0mm}
12\setlength{\headsep}{0mm}
13\setlength{\footskip}{10mm}
14\setlength{\textwidth}{160mm}
15\setlength{\oddsidemargin}{0mm}
16\setlength{\evensidemargin}{0mm}
17\setlength{\parindent}{0mm}
18\setlength{\parskip}{0.35\baselineskip}
19
20%define math alphabets for teletype, roman, overline
21\newcommand{\ttt}[1]{\texttt{#1}}
22\newcommand{\tbl}[1]{{\color{blue}\texttt{#1}}}
23\newcommand{\trd}[1]{{\color{red}\texttt{#1}}}
24\newcommand{\tol}[1]{{\color{olive}\texttt{#1}}}
25\newcommand{\mrm}[1]{\mathrm{#1}}
26\newcommand{\mbf}[1]{\mathbf{#1}}
27\newcommand{\br}[1]{\overline{#1}}
28 
29%some frequent math symbols
30\newcommand{\gtrsim}{\raisebox{-2mm}%
31{\hspace{1mm}$\stackrel{>}{\sim}$\hspace{1mm}}}
32\newcommand{\lessim}{\raisebox{-2mm}%
33{\hspace{1mm}$\stackrel{<}{\sim}$\hspace{1mm}}}
34
35%shorthands
36\newcommand{\as}{\alpha_{\mathrm{s}}}
37\newcommand{\aem}{\alpha_{\mathrm{em}}}
38\newcommand{\kT}{k_{\perp}}
39\newcommand{\pT}{p_{\perp}}
40\newcommand{\pTs}{p^2_{\perp}}
41\newcommand{\pTe}{\p_{\perp\mrm{evol}}}
42\newcommand{\pTse}{\p^2_{\perp\mrm{evol}}}
43\newcommand{\pTmin}{p_{\perp\mathrm{min}}}
44\newcommand{\pTsmim}{p^2_{\perp\mathrm{min}}}
45\newcommand{\pTmax}{p_{\perp\mathrm{max}}}
46\newcommand{\pTsmax}{p^2_{\perp\mathrm{max}}}
47\newcommand{\pTL}{p_{\perp\mathrm{L}}}
48\newcommand{\pTD}{p_{\perp\mathrm{D}}}
49\newcommand{\pTA}{p_{\perp\mathrm{A}}}
50\newcommand{\pTsL}{p^2_{\perp\mathrm{L}}}
51\newcommand{\pTsD}{p^2_{\perp\mathrm{D}}}
52\newcommand{\pTsA}{p^2_{\perp\mathrm{A}}}
53\newcommand{\pTo}{p_{\perp 0}}
54\newcommand{\shat}{\hat{s}}
55 
56%roman names for particles in math mode
57\renewcommand{\a}{{\mathrm a}}
58\renewcommand{\b}{{\mathrm b}}
59\renewcommand{\c}{{\mathrm c}}
60\renewcommand{\d}{{\mathrm d}}
61\newcommand{\e}{{\mathrm e}}
62\newcommand{\f}{{\mathrm f}}
63\newcommand{\g}{{\mathrm g}}
64\newcommand{\hrm}{{\mathrm h}}
65\newcommand{\lrm}{{\mathrm l}}
66\newcommand{\n}{{\mathrm n}}
67\newcommand{\p}{{\mathrm p}}
68\newcommand{\q}{{\mathrm q}}
69\newcommand{\s}{{\mathrm s}}
70\renewcommand{\t}{{\mathrm t}}
71\renewcommand{\u}{{\mathrm u}}
72\newcommand{\A}{{\mathrm A}}
73\renewcommand{\B}{{\mathrm B}}
74\newcommand{\D}{{\mathrm D}}
75\newcommand{\F}{{\mathrm F}}
76\renewcommand{\H}{{\mathrm H}}
77\newcommand{\J}{{\mathrm J}}
78\newcommand{\K}{{\mathrm K}}
79\renewcommand{\L}{{\mathrm L}}
80\newcommand{\Q}{{\mathrm Q}}
81\newcommand{\R}{{\mathrm R}}
82\newcommand{\T}{{\mathrm T}}
83\newcommand{\W}{{\mathrm W}}
84\newcommand{\Z}{{\mathrm Z}}
85\newcommand{\bbar}{\overline{\mathrm b}}
86\newcommand{\cbar}{\overline{\mathrm c}}
87\newcommand{\dbar}{\overline{\mathrm d}}
88\newcommand{\fbar}{\overline{\mathrm f}}
89\newcommand{\pbar}{\overline{\mathrm p}}
90\newcommand{\qbar}{\overline{\mathrm q}}
91\newcommand{\rbar}{\overline{\mathrm{r}}}
92\newcommand{\sbar}{\overline{\mathrm s}}
93\newcommand{\tbar}{\overline{\mathrm t}}
94\newcommand{\ubar}{\overline{\mathrm u}}
95\newcommand{\Bbar}{\overline{\mathrm B}}
96\newcommand{\Fbar}{\overline{\mathrm F}}
97\newcommand{\Qbar}{\overline{\mathrm Q}}
98
99%
100%new list environments to replace itemize and enumerate
101\newenvironment{Itemize}{\begin{list}{$\bullet$}%
102{\setlength{\topsep}{0.4mm}\setlength{\partopsep}{0.4mm}%
103\setlength{\itemsep}{0.4mm}\setlength{\parsep}{0.4mm}}}%
104{\end{list}}
105\newcounter{enumct}
106\newenvironment{Enumerate}{\begin{list}{\arabic{enumct}.}%
107{\usecounter{enumct}\setlength{\topsep}{0.4mm}%
108\setlength{\partopsep}{0.4mm}\setlength{\itemsep}{0.4mm}%
109\setlength{\parsep}{0.4mm}}}{\end{list}}
110
111\begin{document}
112 
113%set sloppy attitude to line breaks
114\sloppy
115
116\begin{flushright}
117For tutorials\\
118at Summer Schools
119\end{flushright}
120
121\vspace{-20mm}
122\mbox{\epsfig{file=lejon2.eps,width=40mm}}%
123\hspace{30mm}%
124\raisebox{4mm}[0mm][0mm]{\epsfig{file=pythiapicture.eps,width=20mm}}\\[6mm]
125
126\begin{center}
127{\LARGE\bf PYTHIA 8 Worksheet}\\[10mm]
128{\large Torbj\"orn Sj\"ostrand, Richard Corke}\\[1mm]
129Department of Theoretical Physics, Lund University\\[4mm]
130{\large Peter Skands}\\[1mm]
131Theoretical Physics, CERN\\[15mm]
132\end{center}
133
134\section{Introduction}
135
136The objective of this exercise is to teach you the basics of how to use
137the \textsc{Pythia}~8.1 event generator to study various physics aspects.
138As you become more familiar you will better understand the tools at
139your disposal, and can develop your own style to use them. Within this
140first exercise it is not possible to describe the physics models used
141in the program; for this we refer to the \textsc{Pythia}~8.1 brief
142introduction \cite{pythiaeight}, to the full \textsc{Pythia}~6.4
143physics description \cite{pythiasix}, and to all the further references
144found in them.
145
146\textsc{Pythia}~8 is, by today's standards, a small package.
147It is completely self-contained, and is therefore easy to install for
148standalone usage, e.g. if you want to have it on your own laptop,
149or if you want to explore physics or debug code without any danger
150of destructive interference between different libraries. Section 2
151describes the installation procedure, which is what we will need for
152this introductory session.
153
154When you use \textsc{Pythia} you are expected to write the main program
155yourself, for maximal flexibility and power. Several examples of such
156main programs are included with the code, to illustrate common tasks
157and help getting started. Section 3 gives you a simple step-by-step
158recipe how to write a minimal main program, that can then gradually
159be expanded in different directions, e.g.\ as in Section 4.
160
161In Section 5 you will see how the parameters of a run can be read in
162from a file, so that the main program can be kept fixed. Many of the
163provided main programs therefore allow you to create executables that
164can be used for different physics studies without recompilation,
165but potentially at the cost of some flexibility.   
166
167While \textsc{Pythia} can be run standalone, it can also be interfaced
168with a set of other libraries. One example is \textsc{HepMC}, which
169is the standard format used by experimentalists to store generated
170events. Since the \textsc{HepMC} library location is
171installation-dependent it is not possible to give a fool-proof linking
172procedure, but some hints are provided for the interested in Section 6.
173
174Finally, Section 7 gives some suggestions for the study of other possible
175physics topics, and Appendix A contains a brief summary of the event-record
176structure.
177
178\section{Installation}
179
180Denoting a generic \textsc{Pythia}~8 version \texttt{pythia81xx}
181(at the time of writing \texttt{xx} = 60), here is how to install
182\textsc{Pythia}~8 on a Linux/Unix/MacOSX system as a standalone package.
183
184\begin{Enumerate}
185\item In a browser, go to\\
186\hspace*{10mm}\texttt{http://www.thep.lu.se/}$\sim$%
187\texttt{torbjorn/Pythia.html}
188\item Download the (current) program package\\
189\hspace*{10mm}\texttt{pythia81xx.tgz}\\
190to a directory of your choice (e.g. by right-clicking on the link).
191\item In a terminal window, \texttt{cd} to where \texttt{pythia81xx.tgz} 
192was downloaded, and type\\
193\hspace*{10mm}\texttt{tar xvfz pythia81xx.tgz}\\
194This will create a new (sub)directory \texttt{pythia81xx} where all
195the \textsc{Pythia} source files are now ready and unpacked.
196\item Move to this directory (\texttt{cd pythia81xx}) and do a
197\texttt{make}. This will take $\sim$3 minutes
198(computer-dependent). The \textsc{Pythia}~8 libraries are now
199compiled and ready for physics.
200\item For test runs, \texttt{cd} to the \texttt{examples/} subdirectory.
201An \texttt{ls} reveals a list of programs, \texttt{mainNN}, with
202\texttt{NN} from \texttt{01} through \texttt{28} (and beyond). These
203example programs each illustrate an aspect of \textsc{Pythia}~8.
204For a list of what they do, see the ``Sample Main Programs'' page
205in the online manual (point 6 below).\\ 
206Initially only use one or two of them to check that the installation
207 works. Once you have worked your way though the introductory exercises
208in the next sections you can return and study the programs and their
209output in more detail.\\
210To execute one of the test programs, do\\
211\hspace*{10mm}\texttt{make mainNN}\\
212\hspace*{10mm}\texttt{./mainNN.exe}\\
213The output is now just written to the terminal, \texttt{stdout}.
214To save the output to a file instead, do
215\texttt{./mainNN.exe >  mainNN.out}, after which you can study the
216test output at leisure by opening \texttt{mainNN.out}. See Appendix A
217for an explanation of the event record that is listed in several of
218the runs.
219\item If you use a web browser to open the file\\
220\hspace*{10mm}\texttt{pythia81xx/htmldoc/Welcome.html}\\
221you will gain access to the online manual, where all available methods
222and parameters are described. Use the left-column index to navigate among
223the topics, which are then displayed in the larger right-hand field.
224\end{Enumerate}
225
226\section{A ``Hello World'' program}
227
228We will now generate a single $\g \g \to \t \tbar$ event at the LHC,
229using \textsc{Pythia} standalone.
230
231Open a new file \texttt{mymain.cc} in the \texttt{examples} subdirectory
232with a text editor, e.g.\ Emacs.
233Then type the following lines (here with explanatory comments added):
234\begin{verbatim}
235     // Headers and Namespaces.
236     #include "Pythia.h"      // Include Pythia headers.
237     using namespace Pythia8; // Let Pythia8:: be implicit.
238
239     int main() {             // Begin main program.
240
241       // Set up generation.
242       Pythia pythia;         // Declare Pythia object
243       pythia.readString("Top:gg2ttbar = on"); // Switch on process.
244       pythia.readString("Beams:eCM = 7000."); // 7 TeV CM energy.     
245       pythia.init(); // Initialize; incoming pp beams is default.
246
247       // Generate event(s).
248       pythia.next();         // Generate an(other) event. Fill event record.
249
250       return 0;
251     }                        // End main program with error-free return.
252\end{verbatim}
253
254Next you need to edit the \texttt{Makefile} (the one in the \texttt{examples} 
255subdirectory) so it knows what to do with \texttt{mymain.cc}.
256The lines\\
257\hspace*{10mm}\texttt{\# Create an executable for one of the normal test
258programs}\\
259\hspace*{10mm}\texttt{main00  main01 main02 main03 ... main09 main10
260main10}~\verb+\+ \\
261and the three next enumerate the main programs that do not need any
262external libraries. Edit the last of these lines to include also
263\texttt{mymain}:\\
264\hspace*{10mm}\texttt{        main31 ... main40 mymain:}~\verb+\+
265
266Now it should work as before with the other examples:\\
267\hspace*{10mm}\texttt{make mymain}\\
268\hspace*{10mm}\texttt{./mymain.exe > mymain.out}\\
269whereafter you can study \texttt{mymain.out}, especially the
270example of a complete event record (preceded by initialization information,
271and by kinematical-variable and hard-process listing for the same event).
272At this point you need to turn to Appendix A for a brief overview of the
273information stored in the event record.
274
275An important part of the event record is that many copies of the same
276particle may exist, but only those with a positive status code are still
277present in the final state. To exemplify, consider a top quark
278produced in the hard interaction, initially with positive status code. When
279later, a shower branching $\t \to \t \g$ occurs, the new $\t$ and $\g$ are
280added at the bottom of the then-current event record, but the old $\t$ is
281not removed. It is marked as decayed, however, by negating its status code.
282At any stage of the shower there is thus only one ``current'' copy of the
283top. After the shower, when the final top decays, $\t \to \b \W^+$, also
284that copy receives a negative status code. When you understand the basic
285principles, see if you can find several copies of the top quarks, and check
286the status codes to figure out why each new copy has been added. Also note
287how the mother/daughter indices tie together the various copies.
288
289\section{A first realistic analysis}
290
291We will now gradually expand the skeleton \texttt{mymain} program from
292above, towards what would be needed for a more realistic analysis setup.
293\begin{Itemize}
294\item Often, we wish to mix several processes together.
295To add the process $\q \qbar \to \t \tbar$ to the above example,
296just include a second \texttt{pythia.readString} call\\
297\texttt{
298\hspace*{10mm} pythia.readString("Top:qqbar2ttbar = on");
299}
300\item Now we wish to generate more than one event. To do this, introduce a
301loop around \texttt{pythia.next()}, so the
302code now reads\\
303\texttt{
304\hspace*{10mm} for (int iEvent = 0; iEvent < 5; ++iEvent) \{ \\
305\hspace*{15mm}   pythia.next(); \\
306\hspace*{10mm} \} } \\
307Hereafter, we will call this the \textbf{event loop}. The program will
308now generate 5 events; each call to \texttt{pythia.next()} 
309resets the event record and fills it with a new event. To list
310more of the events, you also need to add\\
311\texttt{
312\hspace*{10mm} pythia.readString("Next:numberShowEvent = 5");
313}\\
314along with the other \texttt{pythia.readString} commands.
315
316\item To obtain statistics on the number of events generated of the
317different kinds, and the estimated cross sections, add a \\
318\hspace*{10mm}\texttt{pythia.stat();}\\
319just before the end of the program.
320\item During the run you may receive problem messages. These come in
321three kinds:
322\begin{Itemize}
323\item a \textit{warning} is a minor problem that is automatically fixed by
324the program, at least approximately;
325\item an \textit{error} is a bigger problem, that is normally still
326automatically fixed by the program, by backing up and trying again;
327\item an \textit{abort} is such a major problem that the current
328 event could not be completed; in such a rare case \texttt{pythia.next()} 
329is \texttt{false} and the event should be skipped. 
330\end{Itemize}
331Thus the user need only be on the lookout for aborts. During event
332generation, a problem message is printed only the first time it occurs.
333The above-mentioned \texttt{pythia.stat()} will then tell you how many
334times each problem was encountered over the entire run.
335\item Looking at the event listing for a few events
336at the beginning of each run is useful to make sure you are generating the
337right kind of events, at the right energies, etc. For real analyses,
338however, you need automated access to the event record. The Pythia event
339record provides many utilities to make this as simple and efficient as
340possible. To access all the particles in the event record, insert the
341following loop after \texttt{pythia.next()} (but fully enclosed by the
342\textbf{event loop}) \\
343\texttt{
344\hspace*{10mm} for (int i = 0; i < pythia.event.size(); ++i) \{ \\
345\hspace*{15mm}   cout << "i = " << i \\
346\hspace*{26mm}        << ", id = " << pythia.event[i].id() << endl; \\
347\hspace*{10mm} \} \\
348}
349which we will call the \textbf{particle loop}. Inside this loop, you
350can access the properties of each particle \texttt{pythia.event[i]}. For
351instance, the method \texttt{id()} returns the PDG identity code of a
352particle (see Appendix A). The \texttt{cout} statement, therefore, will
353give a list of the PDG code of every particle in the event record.
354\item As mentioned above, the event listing contains all partons and
355particles, traced through a number of intermediate steps. Eventually, the
356top will decay ($\t \to \W \b$), and by implication it is the last copy of
357this top in the event record that gives the ``final'' answer. You can obtain
358the location of this final top e.g. by a line just before the
359\textbf{particle loop} \\
360\hspace*{10mm}\texttt{int iTop = 0;} \\
361and a line inside the \textbf{particle loop} \\
362\hspace*{10mm}\texttt{if (pythia.event[i].id() == 6) iTop = i;} \\ 
363The value of \texttt{iTop} will be set every time a top is found in the
364event record. When the \textbf{particle loop} is complete, \texttt{iTop}
365will now point to the final top in the event record (which can be accessed
366as \texttt{pythia.event[iTop]}).
367\item In addition to the particle properties in the event listing, 
368there are also methods that return many derived quantities for a
369particle, such as transverse momentum, \texttt{pythia.event[iTop].pT()},
370and pseudorapidity, \texttt{pythia.event[iTop].eta()}. Use these methods
371to print out the values for the final top found above.
372\item We now want to generate more events, say 1000, to view the shape
373of these distributions. Inside \textsc{Pythia} is a very simple
374histogramming class, that can be used for rapid check/debug purposes. To
375book the histograms, insert before the \textbf{event loop} \\
376\hspace*{10mm}\texttt{Hist pT("top transverse momentum", 100, 0., 200.);}\\
377\hspace*{10mm}\texttt{Hist eta("top pseudorapidity", 100, -5., 5.);}\\
378where the last three arguments are the number of bins, the lower edge and
379the upper edge of the histogram, respectively. Now we want to fill the
380histograms in each event, so before the end of the \textbf{event loop}
381insert \\
382\hspace*{10mm}\texttt{pT.fill( pythia.event[iTop].pT() );}\\
383\hspace*{10mm}\texttt{eta.fill( pythia.event[iTop].eta() );}\\
384Finally, to write out the histograms, after the \textbf{event loop} we need
385a line like
386\hspace*{10mm}\texttt{cout << pT << eta;}
387\item As a final standalone exercise, consider plotting the charged
388multiplicity of events. You then need to have a counter set to zero
389for each new event. Inside the \textbf{particle loop} this counter should
390be incremented whenever the particle \texttt{isCharged()} and
391\texttt{isFinal()}. For the histogram, note that it can be treacherous to
392have bin limits at integers, where roundoff errors decide whichever way
393they go. In this particular case only even numbers are possible, so 100
394bins from $-1$ to 399 would still be acceptable.
395\end{Itemize}
396
397\section{Input files}
398
399With the \texttt{mymain.cc} structure developed above it is necessary to
400recompile the main program for each minor change, e.g. if you want to
401rerun with more statistics. This is not time-consuming for a simple
402standalone run, but may become so for more realistic applications.
403Therefore, parameters can be put in special input ``card'' files
404that are read by the main program.
405
406We will now create such a file, with the same settings used in the
407\texttt{mymain} example program. Open a new file, \texttt{mymain.cmnd}, and
408input the following
409\begin{verbatim}
410     ! t tbar production at the LHC
411     Beams:idA = 2212     ! first incoming beam is a 2212, i.e. a proton. 
412     Beams:idB = 2212     ! second beam is also a proton.
413     Beams:eCM = 7000.    ! the cm energy of collisions.
414     Top:gg2ttbar = on    ! switch on the process g g -> t tbar. 
415     Top:qqbar2ttbar = on ! switch on the process q qbar -> t tbar. 
416\end{verbatim}
417
418The \texttt{mymain.cmnd} file can contain one command per line,
419of the type\\
420\hspace*{10mm}\texttt{variable = value}\\
421All variable names are case-insensitive (the mixing of cases has been
422chosen purely to improve readability) and non-alphanumeric characters
423(such as !, \# or \$) will be interpreted as the start of a comment. All
424valid variables are listed in the online manual (see Section 2, point 6,
425above). Cut-and-paste of variable names can be used to avoid spelling
426mistakes.
427
428The final step is to modify our program to use this input file. The name of
429this input file can be hardcoded in the main program, but for more
430flexibility, it can also be provided as a command-line argument. To do
431this, replace the \texttt{int main() \{} line by \\
432\hspace*{10mm} \texttt{int main(int argc, char* argv[]) \{}\\
433and replace all \texttt{pythia.readString(...)} commands with the single
434command\\
435\hspace*{10mm}\texttt{pythia.readFile(argv[1]);} 
436
437The executable \texttt{mymain.exe} is then run with a command line like\\
438\hspace*{10mm}\texttt{./mymain.exe mymain.cmnd > mymain.out}\\
439and should give the same output as before.
440
441In addition to all the internal \texttt{Pythia} variables there exist a
442few defined in the database but not actually used. These are intended to
443be useful in the main program, and thus begin with \texttt{Main:}.
444The most basic of those is \texttt{Main:numberOfEvents}, which you can
445use to specify how many events you want to generate. To make this have
446any effect, you need to read it in the main program, after
447the \texttt{pythia.readFile(...)} command, by a line like\\
448\hspace*{10mm}\texttt{int nEvent = pythia.mode("Main:numberOfEvents");}\\
449and set up the \textbf{event loop} like\\
450\hspace*{10mm}\texttt{for (int iEvent = 0; iEvent < nEvent; ++iEvent) \{ }
451
452You are now free to play with further options in the input file, such as:
453\begin{Itemize}
454\item \texttt{6:m0 = 175.}\\ 
455change the top mass, which by default is 171 GeV.
456\item \texttt{PartonLevel:FSR = off}\\ 
457switch off final-state radiation.
458\item \texttt{PartonLevel:ISR = off}\\ 
459switch off initial-state radiation.
460\item \texttt{PartonLevel:MPI = off}\\
461switch off multiparton interactions. 
462\item \texttt{Tune:pp = 3} (or other values between 1 and 7) \\
463different combined tunes, in particular to radiation and multiparton
464interactions parameters. In part this reflects that no generator
465is perfect, and also not all data is perfect, so different emphasis
466will result in different optima. In addition, detailed tuning of
467\texttt{Pythia}~8 is still in its infancy. 
468\item \texttt{Random:setSeed = on}\\
469\texttt{Random:seed = 123456789}\\
470all runs by default use the same random-number sequence, for reproducibility,
471but you can pick any number between 1 and 900,000,000 to obtain a unique
472sequence.
473\end{Itemize}
474For instance, check the importance of FSR, ISR and MPI on the charged
475multiplicity of events by switching off one component at a time.
476
477The usage of further \texttt{Main:} variables is illustrated e.g.\ in
478\texttt{main03.cc}, and the possibility to use command-line input
479files in \texttt{main16.cc} and \texttt{main42.cc}.
480
481The online manual also exists in an interactive variant, where you
482semi-automatically can construct a file with all the command lines you
483wish to have. This requires that somebody installs the
484\texttt{pythia81xx/phpdoc} directory in a webserver. If you lack a local
485installation you can use the one at\\
486\hspace*{10mm}\texttt{http://home.thep.lu.se/}$\sim$%
487\texttt{torbjorn/php81xx/Welcome.php}\\
488This is not a commercial-quality product, however, and requires some
489user discipline. Full instructions are provided on the ``Save Settings''
490page.
491
492\section{Interface to HepMC}
493
494The standard \textsc{HepMC} event-record format will be frequently used
495in subsequent training sessions, with a ready-made installation. However,
496for the ambitious, here is described how to set up the \textsc{Pythia} 
497interface, assuming you already know where \textsc{HepMC} is installed.
498Note: the interface to \textsc{HepMC} version 1 is no longer supported;
499you must use version 2. Preferably 2.04 or later.
500
501To begin with, you need to go back to the installation procedure
502of section 2 and insert/redo some steps.
503\begin{Enumerate}
504\item Move back to the main \texttt{pythia81xx} directory
505(\texttt{cd ..} if you are in \texttt{examples}).
506\item Remove the currently compiled version with\\
507\hspace*{10mm}\texttt{make clean}
508\item Configure the program in preparation for the compilation:\\
509\hspace*{10mm}\texttt{./configure --with-hepmc=path}\\
510where the directory-tree \texttt{path} would depend on your local
511installation.
512\item Should \texttt{configure} not recognise the version number
513you can supply that with an optional argument, like\\
514\hspace*{10mm}\texttt{./configure --with-hepmc=path --with-hepmcversion=2.06.07}
515\item Recompile the program, now including the \textsc{HepMC} interface,
516with \texttt{make} as before, and move back to the \texttt{examples} 
517subdirectory.
518\item Do either of\\
519\hspace*{10mm}\texttt{source config.csh}\\
520\hspace*{10mm}\texttt{source config.sh}\\
521the former when you use the csh or tcsh shells, otherwise the latter.
522(Use \texttt{echo \$SHELL} if uncertain.) 
523\item You can now also use the \texttt{main41.cc} and \texttt{main42.cc}
524examples to produce \textsc{HepMC} event files. The latter may be most useful;
525it presents a slight generalisation of the command-line-driven main program
526you constructed in Section 5. After you have built the executable you can
527run it with\\ 
528\hspace*{10mm}\texttt{./main42.exe infile hepmcfile > main42.out}\\
529where \texttt{infile} is an input ``card'' file (e.g. \texttt{mymain.cmnd})
530and \texttt{hepmcfile} is your chosen name for the output file with
531\textsc{HepMC} events.
532\end{Enumerate}
533
534Note that the above procedure is based on the assumption that you will
535be running your main programs from the \texttt{examples} subdirectory.
536If not you will have to create your own scripts and/or makefiles to handle
537the linking. If you have no experience with such tasks then it is better
538to use any existing instructions for your local installation. If you do
539have such experience then a short summary of what you need to know
540to get going is provided.
541
542Before you run a \textsc{Pythia} program the \texttt{PYTHIA8DATA} 
543environment variable needs to be set to point to the \texttt{xmldoc} 
544subdirectory where all settings and particle data are stored. If you
545use the csh or tcsh shells this means a line like\\
546\hspace*{10mm}\texttt{setenv PYTHIA8DATA /path/pythia81xx/xmldoc}\\
547or else\\   
548\hspace*{10mm}\texttt{export PYTHIA8DATA=/path/pythia81xx/xmldoc}\\
549where the correct \texttt{path} has to be found by you.
550Similarly, to use \textsc{HepMC}, you also have to set or append its
551location to the \texttt{LD\_LIBRARY\_PATH} (the
552\texttt{DYLD\_LIBRARY\_PATH} on Mac OSX); the \texttt{config.csh} 
553and \texttt{config.sh} files generated above well illustrate the code
554needed to achieve this. Finally, the necessary linking stage can
555be understood from the relevant parts of the \texttt{examples/Makefile}.
556
557\section{Further studies}
558
559If you have time left, you should take the opportunity to try
560a few other processes or options. Below are given some examples,
561but feel free to pick something else that you would be more
562interested in. 
563
564\begin{Itemize}
565\item One popular misconception is that the energy and momentum of a
566$\B$ meson has to be smaller than that of its mother $\b$ quark, and
567similarly for charm. The fallacy is twofold. Firstly, if the $\b$ 
568quark is surrounded by nearby colour-connected gluons, the $\B$ meson
569may also pick up some of the momentum of these gluons. Secondly, the
570concept of smaller momentum is not Lorentz-frame-independent:
571if the other end of the $\b$ colour force field is a parton with a
572higher momentum (such as a beam remnant) the ``drag'' of the
573hadronization process may imply an acceleration in the lab frame
574(but a deceleration in the beam rest frame).\\
575To study this, simulate $\b$ production, e.g.\ the process
576\texttt{HardQCD:gg2bbbar}. Identify $\B / \B^*$ mesons that
577come directly from the hadronization, for simplicity those with
578status code $-83$ or $-84$. In the former case the mother $\b$
579quark is in the \texttt{mother1()} position, in the latter in
580\texttt{mother2()} (study a few event listings to see how it works).
581Plot the ratio of $\B$ to $\b$ energy to see what it looks like.       
582
583\item One of the characteristics of multiparton-interactions (MPI) models
584is that they lead to strong long-range correlations, as observed in
585data. That is, if many hadrons are produced in one rapidity range
586of an event, then most likely this is an event where many MPI's
587occurred (and the impact parameter between the two colliding protons
588was small), and then one may expect a larger activity also at other
589rapidities.\\
590To study this, select two symmetrically located, one unit wide bins
591in rapidity (or pseudorapidity), with a variable central separation
592$\Delta y$: $\left[ \Delta y/2, \Delta y/2 + 1 \right]$ and
593$\left[ - \Delta y/2 - 1, - \Delta y/2 \right]$.
594For each event you may find $n_F$ and $n_B$, the charged multiplicity
595in the ``forward'' and ``backward'' rapidity bins. Suitable averages
596over a sample of events then gives the forward--backward correlation
597coefficient
598\[
599\rho_{FB}(\Delta y) = \frac{\langle n_F \, n_B \rangle 
600- \langle n_F \rangle \langle n_B \rangle}%
601{\sqrt{(\langle n_F^2 \rangle - \langle n_F \rangle^2)
602(\langle n_B^2 \rangle - \langle n_B \rangle^2)}}
603= \frac{\langle n_F \, n_B \rangle - \langle n_F \rangle^2}%
604{\langle n_F^2 \rangle - \langle n_F \rangle^2} ~,
605\]
606where the last equality holds for symmetric distributions such as
607in $\p\p$ and $\pbar\p$.\\
608Compare how $\rho_{FB}(\Delta y)$ changes for increasing
609$\Delta y = 0, 1, 2, 3, \ldots$, with and without MPI switched on
610(\texttt{PartonLevel:MPI = on/off}) for minimum-bias events
611(\texttt{SoftQCD:minBias = on}).
612
613\item Higgs production can proceed through several different
614production processes. For the Standard Model Higgs some process
615switches are:\\
616\texttt{HiggsSM:ffbar2H} for $\f \fbar \to \H^0$ 
617($\f$ generic fermion, here mainly $\b \bbar \to \H^0$); \\ 
618\texttt{HiggsSM:gg2H} for $\g \g \to \H^0$; \\ 
619\texttt{HiggsSM:ffbar2HZ} for $\f \fbar \to \H^0 \Z^0$; \\ 
620\texttt{HiggsSM:ffbar2HW} for $\f \fbar \to \H^0 \W^{\pm}$; \\ 
621\texttt{HiggsSM:ff2Hff(t:ZZ)}  for $\f \fbar \to \H^0\f \fbar$
622via $\Z^0\Z^0$ fusion; \\ 
623\texttt{HiggsSM:ff2Hff(t:WW)}  for $\f \fbar \to \H^0\f \fbar$
624via $\W^+\W^-$ fusion; \\ 
625\texttt{HiggsSM:all} for all of the above (and some more). \\
626Study the $\pT$ and $\eta$ spectrum of the Higgs in these processes,
627and compare.
628\item You can also vary the Higgs mass with a \texttt{25:m0 = ...}
629and switch off FSR/ISR/MPI as above for top.
630\item $\Z^0$ production to lowest order only involves one process,
631accessible with \texttt{WeakSingleBoson:ffbar2gmZ = on}. The problem
632here is that the process is $\f \fbar \to \gamma^*/\Z^0$ with full
633$\gamma^*/\Z^0$ interference and so a signficiant enhancement at low
634masses. The combined particle is always classified with code 23,
635however. So generate events and study the $\gamma^*/\Z^0$ mass and
636$\pT$ distributions. Then restrict to a more ``$\Z^0$-like'' 
637mass range with \texttt{PhaseSpace:mHatMin = 75.} and
638\texttt{PhaseSpace:mHatMax = 120.}
639\item Using your favourite jet cluster algorithm, study the number
640of jets found in association with the $\Z^0$ above. You can switch
641off Z0 decay with \texttt{23:mayDecay = no}. If you do not have a jet
642finder around, to begin with you can use the simple \texttt{SlowJet} 
643one that comes with \textsc{Pythia}, see the ``Event Analysis'' page
644in the online manual, which offers a choice of the $k_{\perp}$,
645Cambridge/Aachen and anti-$k_{\perp}$ algorithms. Again check the
646importance of FSR/ISR/MPI.
647\end{Itemize}
648
649\appendix
650\section{The Event Record}
651
652The event record is set up to store every step in the evolution from
653an initial low-multiplicity partonic process to a final high-multiplicity
654hadronic state, in the order that new particles are generated. The record
655is a vector of particles, that expands to fit the needs of the current
656event (plus some additional pieces of information not discussed here).
657Thus \texttt{event[i]} is the \texttt{i}'th particle of the current
658event, and you may study its properties by using various
659\texttt{event[i].method()} possibilities.
660
661The \texttt{event.list()} listing provides the main properties of
662each particles, by column:
663\begin{Itemize}
664\item \texttt{no}, the index number of the particle (\texttt{i}
665above);
666\item \texttt{id}, the PDG particle identity code
667(method \texttt{id()});
668\item \texttt{name}, a plaintext rendering of the particle name
669(method \texttt{name()}), within brackets for initial or intermediate
670particles and without for final-state ones;
671\item \texttt{status}, the reason why a new particle was added to
672the event record (method \texttt{status()});
673\item \texttt{mothers} and \texttt{daughters}, documentation on
674the event history (methods \texttt{mother1()}, \texttt{mother2()},
675\texttt{daughter1()} and \texttt{daughter2()});
676\item \texttt{colours}, the colour flow of the process (methods
677\texttt{col()} and \texttt{acol()});
678\item \texttt{p\_x}, \texttt{p\_y}, \texttt{p\_z} and \texttt{e},
679the components of the momentum four-vector $(p_x, p_y, p_z, E)$,
680in units of GeV with $c = 1$ (methods \texttt{px()}, \texttt{py()},
681\texttt{pz()} and \texttt{e()});
682\item \texttt{m}, the mass, in units as above (method \texttt{m()}).
683\end{Itemize}
684For a complete description of these and other particle properties
685(such as production and decay vertices, rapidity, $p_\perp$, etc),
686open the program's online documentation in a browser (see Section 2,
687point 6, above), scroll down to the ``Study Output'' section, and follow
688the ``Particle Properties'' link in the left-hand-side menu.  For brief
689summaries on the less trivial of the ones above, read on.
690
691\subsection{Identity codes}
692
693A complete specification of the PDG codes is found in the
694Review of Particle Physics \cite{rpp}. An online listing is
695available from\\
696\hspace*{10mm}\texttt{http://pdg.lbl.gov/2008/mcdata/mc\_particle\_id\_contents.html}
697
698A short summary of the most common \texttt{id} codes would be\\[2mm] 
699\begin{tabular}{|cc|cc|cc|cc|cc|cc|cc|}
700\hline
7011 & $\d$ & 11 & $\e^-$      & 21  & $\g$ & 211 & $\pi^+$ 
702& 111 & $\pi^0$ & 213 & $\rho^+$ & 2112 & $\n$ \\
7032 & $\u$ & 12 & $\nu_{\e}$   & 22 & $\gamma$ & 311 & $\K^0$
704& 221 & $\eta$ & 313 & $\K^{*0}$ & 2212 & $\p$  \\
7053 & $\s$ & 13 & $\mu^-$     & 23 & $\Z^0$  & 321 & $\K^+$
706& 331 & $\eta'$ & 323 & $\K^{*+}$ & 3122 & $\Lambda^0$ \\
7074 & $\c$ & 14 & $\nu_{\mu}$  & 24 & $\W^+$ & 411 & $\D^+$
708& 130 & $\K^0_{\mrm{L}}$ & 113 & $\rho^0$ & 3112 & $\Sigma^-$ \\
7095 & $\b$ & 15 & $\tau^-$    & 25 & $\H^0$ & 421 & $\D^0$
710& 310 & $\K^0_{\mrm{S}}$ & 223 & $\omega$ & 3212 & $\Sigma^0$  \\
7116 & $\t$ & 16 & $\nu_{\tau}$ &  &  & 431 & $\D_{\s}^+$
712& & & 333 & $\phi$ & 3222 & $\Sigma^+$ \\
713\hline
714\end{tabular}\\[2mm]
715Antiparticles to the above, where existing as separate entities,
716are given with a negative sign.\\
717Note that simple meson and baryon codes are constructed from
718the constituent (anti)quark codes, with a final spin-state-counting digit
719$2 s + 1$ ($\K^0_{\mrm{L}}$ and $\K^0_{\mrm{S}}$ being exceptions), and with
720a set of further rules to make the codes unambiguous. 
721
722\subsection{Status codes}
723
724When a new particle is added to the event record, it is assigned
725a positive status code that describes why it has been added,
726as follows:\\[2mm] 
727\begin{tabular}{|c|l|}
728\hline
729code range & explanation \\
730\hline
73111 -- 19 & beam particles\\
73221 -- 29 & particles of the hardest subprocess\\
73331 -- 39 & particles of subsequent subprocesses in multiparton interactions\\
73441 -- 49 & particles produced by initial-state-showers\\
73551 -- 59 & particles produced by final-state-showers\\
73661 -- 69 & particles produced by beam-remnant treatment\\
73771 -- 79 & partons in preparation of hadronization process\\
73881 -- 89 & primary hadrons produced by hadronization process\\
73991 -- 99 & particles produced in decay process, or by Bose-Einstein effects\\ 
740\hline
741\end{tabular}\\[2mm]
742Whenever a particle is allowed to branch or decay further its status
743code is negated (but it is \textit{never} removed from the event record),
744such that only particles in the final state remain with positive codes. The
745\texttt{isFinal()} method returns \texttt{true/false} for
746positive/negative status codes.
747
748\subsection{History information}
749
750The two mother and two daughter indices of each particle provide
751information on the history relationship between the different entries
752in the event record. The detailed rules depend on the particular physics
753step being described, as defined by the status code. As an example,
754in a $2 \to 2$ process $a b \to c d$, the locations of $a$ and $b$
755would set the mothers of $c$ and $d$, with the reverse relationship
756for daughters. When the two mother or daughter indices are not
757consecutive they define a range between the first and last entry,
758such as a string system consisting of several partons fragment into
759several hadrons.
760
761There are also several special cases. One such is when ``the same''
762particle appears as a second copy, e.g. because its momentum has
763been shifted by it taking a recoil in the dipole picture of parton
764showers. Then the original has both daughter indices pointing to the
765same particle, which in its turn has both mother pointers referring
766back to the original. Another special case is the description of
767ISR by backwards evolution, where the mother is constructed at a
768later stage than the daughter, and therefore appears below in the
769event listing.
770
771If you get confused by the different special-case storage options, the
772two \texttt{pythia.event.motherList(i)} and
773\texttt{pythia.event.daughterList(i)} methods are able to return a
774\texttt{vector} of all mother or daughter indices of particle
775\texttt{i}.
776
777\subsection{Colour flow information}
778
779The colour flow information is based on the Les Houches Accord
780convention \cite{leshouchesaccord}. In it, the number of colours
781is assumed infinite, so that each new colour line can be assigned
782a new separate colour. These colours are given consecutive labels:
783101, 102, 103, \ldots . A gluon has both a colour and an anticolour
784label, an (anti)quark only (anti)colour.
785
786While colours are traced consistently through hard processes and
787parton showers, the subsequent beam-remnant-handling step often
788involves a drastic change of colour labels. Firstly, previously
789unrelated colours and anticolours taken from the beams may at this
790stage be associated with each other, and be relabelled accordingly.
791Secondly, it appears that the close space--time overlap of many
792colour fields leads to reconnections, i.e. a swapping of colour labels,
793that tends to reduce the total length of field lines.
794
795\begin{thebibliography}{99}
796
797\bibitem{pythiaeight}
798T. Sj\"ostrand, S. Mrenna and P. Skands,
799Comput. Phys. Comm. {\bf 178} (2008) 852 [arXiv:0710.3820]
800
801\bibitem{pythiasix}
802T. Sj\"ostrand, S. Mrenna and P. Skands,
803JHEP {\bf 05} (2006) 026 [hep-ph/0603175]
804
805\bibitem{rpp}
806Particle Data Group, C. Amsler et al.,
807Physics Letters {\bf B667} (2008) 1
808
809\bibitem{leshouchesaccord}
810E. Boos et al., in the Proceedings of the Workshop on Physics at TeV
811Colliders, Les Houches, France, 21 May - 1 Jun 2001 [hep-ph/0109068]
812
813\end{thebibliography}
814
815\end{document}
816
817
Note: See TracBrowser for help on using the repository browser.