source: HiSusy/trunk/Pythia8/pythia8170/phpdoc/SemiInternalProcesses.php @ 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: 33.2 KB
Line 
1<html>
2<head>
3<title>Semi-Internal Processes</title>
4<link rel="stylesheet" type="text/css" href="pythia.css"/>
5<link rel="shortcut icon" href="pythia32.gif"/>
6</head>
7<body>
8
9<script language=javascript type=text/javascript>
10function stopRKey(evt) {
11var evt = (evt) ? evt : ((event) ? event : null);
12var node = (evt.target) ? evt.target :((evt.srcElement) ? evt.srcElement : null);
13if ((evt.keyCode == 13) && (node.type=="text"))
14{return false;}
15}
16
17document.onkeypress = stopRKey;
18</script>
19<?php
20if($_POST['saved'] == 1) {
21if($_POST['filepath'] != "files/") {
22echo "<font color='red'>SETTINGS SAVED TO FILE</font><br/><br/>"; }
23else {
24echo "<font color='red'>NO FILE SELECTED YET.. PLEASE DO SO </font><a href='SaveSettings.php'>HERE</a><br/><br/>"; }
25}
26?>
27
28<form method='post' action='SemiInternalProcesses.php'>
29
30<h2>Semi-Internal Processes</h2>
31
32Normally users are expected to implement new processes via the
33<?php $filepath = $_GET["filepath"];
34echo "<a href='LesHouchesAccord.php?filepath=".$filepath."' target='page'>";?>Les Houches Accord</a>. Then
35you do all flavour, colour and phase-space selection externally,
36before your process-level events are input for further processing
37by PYTHIA. However, it is also possible to implement a
38new process in exactly the same way as the internal PYTHIA
39ones, thus making use of the internal phase space selection machinery
40to sample an externally provided cross-section expression.
41The MadGraph 5 program [<a href="Bibliography.php" target="page">Alw11</a>] allows you to do exactly that,
42i.e. it can be used to generate C++ code that can be linked into
43the existing PYTHIA framework, see
44<?php $filepath = $_GET["filepath"];
45echo "<a href='MadGraph5Processes.php?filepath=".$filepath."' target='page'>";?>here</a>.
46
47<p/>
48Should you decide to go ahead on your own,
49this page gives a brief summary how to do that. If you additionally
50want to introduce a new resonance species, with its own internal
51width calculations, you will find further instructions
52<?php $filepath = $_GET["filepath"];
53echo "<a href='SemiInternalResonances.php?filepath=".$filepath."' target='page'>";?>here</a>. It is strongly
54recommended to shop around for a similar process that has already
55been implemented, and to use that existing code as a template.
56Look for processes with the same combinations of incoming flavours
57and colour flows, rather than the shape of the cross section itself.
58With a reasonable such match the task should be of medium difficulty,
59without it more demanding.
60
61<p/>
62PYTHIA is rather good at handling the phase space of
63<i>2 -> 1</i> and <i>2 -> 2</i> processes, is more primitive for
64<i>2 -> 3</i> ones and does not at all address higher multiplicities.
65This limits the set of processes that you can implement in this
66framework. The produced particles may be resonances, however, so it is
67possible to end up with bigger "final" multiplicities through sequential
68decays, and to include further matrix-element weighting in those decays.   
69
70<p/>
71There are three steps involved in implementing a process:
72<ol>
73<li>making use of the PYTHIA-provided kinematics information to
74calculate the relevant cross section,</li>
75<li>writing a new class,  where the matrix elements are implemented,
76including information on incoming and outgoing flavours and colours,
77and</li>
78<li>making the process available.</li>
79</ol>
80We consider these aspects in turn. An example where it all comes
81together is found in <code>main22.cc</code>.
82
83<h3>The Cross Section Calculation</h3> 
84
85The key method for the cross section calculation is
86<code>SigmaProcess::sigmaHat()</code>, described below. At the point when
87it is called, the kinematics has already been set up, and from these
88phase space variables the differential cross section is to be calculated.
89
90<p/>
91For a <i>2 -> 1</i> process, the returned value should be
92<i>sigmaHat(sHat)</i>, where <code>mH</code> (= <i>mHat</i>),
93<code>sH</code> (= <i>sHat</i>) and <code>sH2</code> (= <i>sHat^2</i>)
94are available to be used. Incoming partons are massless. Overload the
95<code>convertM2()</code> method below if you instead plan to return
96<i>|M|^2</i>.
97
98<p/>
99For a <i>2 -> 2</i> process, instead <i>d(sigmaHat)/d(tHat)</i>
100should be returned, based on provided
101<code>mH, sH, sH2, tH, tH2, uH, uH2, m3, s3, m4, s4</code> and
102<code>pT2</code> values (<code>s3 = m3*m3</code> etc.). Incoming
103partons are massless. Overload the <code>convertM2()</code> method
104below if you instead plan to return <i>|M|^2</i>.
105
106<p/>
107For a <i>2 -> 3</i> process, instead <i>|M|^2</i> should be
108returned, with normalization such that <i>|M|^2 / (2 sHat)</i> integrated
109over the three-body phase space gives the cross section. Here no standard
110set of Mandelstam-style variables exists. Instead the obvious ones,
111<code>mH, sH, m3, s3, m4, s4, m5, s5</code>, are complemented by the
112four-vectors <code>p3cm, p4cm, p5cm</code>, from which further invariants
113may be calculated. The four-vectors are defined in the CM frame of the
114subcollision, with massless incoming partons along the <i>+-z</i> axis.   
115
116<p/>
117In either case, <i>alpha_s</i> and <i>alpha_em</i> have already
118been calculated, and are stored in <code>alpS</code> and <code>alpEM</code>.
119Also other standard variables may be used, like
120<code>CoupEW::sin2thetaW()</code>, and related flavour-dependent
121vector and axial couplings in <code>CoupEW</code> and CKM combinations
122in <code>VCKM</code>.
123
124<p/>
125In case some of the final-state particles are resonances, their
126squared masses have already been selected according to a Breit-Wigner
127with a linearly running width <i>Gamma(m) = Gamma(m_0) * m / m_0</i>.
128More precisely, the mass spectrum is weighted according to
129<i>w_BW(m^2) d(m^2)</i>, where
130<br/><i>
131w_BW(m^2) = (1/pi) * (m * Gamma(m)) / ( (m^2 - m_0^2)^2 + (m * Gamma(m))^2 ) .
132</i><br/>
133If you would like to have another expression, the above weights are stored
134in <code>runBW3</code>, <code>runBW4</code> and <code>runBW5</code>,
135respectively. If you divide out one of these factors, you just remain with
136a phase space selection <i>d(m^2)</i> for this particle,
137and can multiply on your desired shape factor instead. Unfortunately, the
138Monte Carlo efficiency will drop if your new mass distribution differs
139dramatically from the input one. Therefore it does make sense to adjust the
140database value of the width to be slightly (but not too much) broader
141than the distribution you have in mind. Also note that, already by default,
142the wings of the Breit-Wigner are oversampled (with a compensating lower
143internal weight) by partly sampling like <i>(a + b/m^2 + c/m^4) d(m^2)</i>,
144where the last term is only used for <i>gamma^*/Z^0</i>.
145
146<p/>
147As alternative to the kinematics variables defined above, also the two
148arrays <code>mME[5]</code> and <code>pME[5]</code>, for masses and
149four-momenta, respectively, can be used for cross-section calculations.
150Here indices 0 and 1 are the two incoming beams, and 2 and onwards the
151outgoing particles. Note that this differs by one step from the normal
152internal labelling, where slot 0 is left empty. The four-momenta are
153defined in the rest frame of the subcollision, with the incoming partons
154along the <i>+-z</i> direction. The kinematics need not agree with the
155"correct" one stored in the event record, for three reasons.
156<br/>1) Gauge invariance forces matrix-element calculations to use
157the same masses for incoming as outgoing legs of a particle species,
158say <i>b</i> quarks. Therefore the kinematics of the two incoming
159partons is recalculated, relative to the normal event record, to put
160the partons on the mass shell. (Note that initial masses is a technical
161issue, not the correct physics picture: the incoming partons are likely
162to be spacelike virtual rather than on the mass shell.)
163<br/>2) In principle each fermion flavour has to be treated separately,
164owing to a different mass. However, in many cases fermions can be
165assumed massless, which speeds up the calculations, and further gains
166occur if then different flavours can use the same cross-section
167expression. In MadGraph the default is that fermions up to and including
168the <i>c</i> quark and the <i>mu</i> lepton are considered massless,
169while the <i>b</i> quark and the <i>tau</i> lepton are considered
170massive. This can be modified however, and below we provide four flags
171that can be used to consider the "borderline" fermions either as
172massless or as massive when matrix elements are evaluated, to match the
173assumptions made for the matrix elements themselves.
174<br/>3) For <i>2 -> 2</i> and <i>2 -> 3</i> processes of massive
175identical particles (or antiparticles) in the final state, such as
176<i>t tbar</i> or <i>W^+ W^-</i>, the kinematics is here adjusted
177so that the two or three particles have the same mass, formed as a
178suitable average of the actual Breit-Wigner-distributed masses. This
179allows the evaluation of matrix-element expressions that only have
180meaning if the two/three have the same mass.
181<br/>Thus the mass array <code>mME[5]</code> and the four-momentum array
182<code>pME[5]</code> present values both for initial- and final-state
183particles based on these mass principles suited for matrix-element input.
184Note that these variables therefore differ from the kinematics stored in
185the event record proper, where incoming fermions are always massless and
186outgoing resonances have independent Breit-Wigner mass distributions.
187<br/>The conversion from the normal to the special kinematics is done
188by calling the <code>setupForME()</code> method. This you have to do
189yourself in the <code>SigmaHat()</code> member of your derived class.
190Alternatively it could be done in <code>SigmaKin()</code>, i.e. before
191the loop over incoming flavours, but then these would be considered
192massless. The identity of final-state particles is obtained from the
193<code>id3Mass()</code>, <code>id4Mass()</code> and <code>id5Mass()</code>
194methods. Should the conversion to <code>mME[5]</code> and
195<code>pME[5]</code> not work, <code>setupForME()</code> will return
196<code>false</code>, and then the cross section should be put zero.
197
198<br/><br/><strong>SigmaProcess:cMassiveME</strong>  <input type="radio" name="1" value="on"><strong>On</strong>
199<input type="radio" name="1" value="off" checked="checked"><strong>Off</strong>
200 &nbsp;&nbsp;(<code>default = <strong>off</strong></code>)<br/>
201Let the <i>c</i> quark be massive or not in the kinematics set up for
202external matrix-element evaluation.
203   
204
205<br/><br/><strong>SigmaProcess:bMassiveME</strong>  <input type="radio" name="2" value="on" checked="checked"><strong>On</strong>
206<input type="radio" name="2" value="off"><strong>Off</strong>
207 &nbsp;&nbsp;(<code>default = <strong>on</strong></code>)<br/>
208Let the <i>b</i> quark be massive or not in the kinematics set up for
209external matrix-element evaluation.
210   
211
212<br/><br/><strong>SigmaProcess:muMassiveME</strong>  <input type="radio" name="3" value="on"><strong>On</strong>
213<input type="radio" name="3" value="off" checked="checked"><strong>Off</strong>
214 &nbsp;&nbsp;(<code>default = <strong>off</strong></code>)<br/>
215Let the <i>mu</i> lepton be massive or not in the kinematics set up for
216external matrix-element evaluation.
217   
218
219<br/><br/><strong>SigmaProcess:tauMassiveME</strong>  <input type="radio" name="4" value="on" checked="checked"><strong>On</strong>
220<input type="radio" name="4" value="off"><strong>Off</strong>
221 &nbsp;&nbsp;(<code>default = <strong>on</strong></code>)<br/>
222Let the <i>tau</i> lepton be massive or not in the kinematics set up for
223external matrix-element evaluation.
224   
225
226
227<h3>The Cross Section Class</h3> 
228
229The matrix-element information has to be encoded in a new class.
230The relevant code could either be put before the main program in the
231same file, or be stored separately, e.g. in a matched pair
232of <code>.h</code> and <code>.cc</code> files. The latter may be more
233convenient, in particular if the cross sections are lengthy, or if you
234intend to build up your own little process library, but of course
235requires that these additional files are correctly compiled and linked.
236
237<p/>
238The class has to be derived either from 
239<code>Sigma1Process</code>, for <i>2 -> 1</i> processes, from
240<code>Sigma2Process</code>, for <i>2 -> 2</i> ones, or from
241<code>Sigma3Process</code>, for <i>2 -> 3</i> ones. (The
242<code>Sigma0Process</code> class is used for elastic, diffractive
243and minimum-bias events, and is not recommended for use beyond that.)
244These are in their turn derived from the <code>SigmaProcess</code>
245base class.
246
247<p/>
248The class can implement a number of methods. Some of these are
249compulsory, others strongly recommended, and the rest are to be
250used only when the need arises to override the default behaviour.
251The methods are:
252
253<p/>
254A <b>constructor</b> for the derived class obviously must be available.
255Here you are quite free to allow a list of arguments, to set
256the parameters of your model, or even to create a set of closely
257related but distinct processes. For instance, <i>g g -> Q Qbar</i>,
258<i>Q = c</i> or <i>b</i>, is only coded once, and then the
259constructor takes the quark code (4 or 5)  as argument,
260to allow the proper amount of differentiation.
261
262<p/>
263A <b>destructor</b> is only needed if you plan to delete the process
264before the natural end of the run, and require some special behaviour
265at that point. If you call such a destructor you will leave a pointer
266dangling inside the <code>Pythia</code> object you gave it in to,
267if that still exists.
268
269<a name="method1"></a>
270<p/><strong>void SigmaProcess::initProc() &nbsp;</strong> <br/>
271is called once during initalization, and can then be used to set up
272parameters, such as masses and couplings, and perform calculations
273that need not be repeated for each new event, thereby saving time.
274This method needs not be implemented, since in principle all
275calculations can be done in <code>sigmaHat</code> below.
276 
277
278<a name="method2"></a>
279<p/><strong>void SigmaProcess::sigmaKin() &nbsp;</strong> <br/>
280is called once a kinematical configuration has been determined, but
281before the two incoming flavours are known. This routine can therefore
282be used to perform calculations that otherwise might have to be repeated
283over and over again in <code>sigmaHat</code> below. For instance
284a flavour-independent cross section calculation for a <i>q g</i>
285initial state would be repeated 20 times in <code>sigmaHat</code>,
286five times for the five quark flavours allowed in the incoming beams,
287times twice to include antiquarks, times twice since the (anti)quark
288could be in either of the two beams. You could therefore calculate the
289result once only and store it as a private data member of the class.
290It is optional whether you want to use this method, however, or put
291everything in <code>sigmaHat</code>.
292 
293
294<a name="method3"></a>
295<p/><strong>double SigmaProcess::sigmaHat() &nbsp;</strong> <br/>
296is the key method for cross section calculations and returns a cross section
297value, as described in the previous section. It is called when also a
298preliminary set of incoming flavours has been picked, in addition to the
299kinematical ones already available for <code>sigmaKin</code>.
300Typically <code>sigmaHat</code> is called inside a loop over all allowed
301incoming flavour combinations, stored in <code>id1</code> and
302<code>id2</code>, with fixed kinematics, as already illustrated above.
303The sum over the different flavour combinations provides the total
304cross section, while their relative size is used to make a selection of
305a specific incomimg state.
306 
307
308<a name="method4"></a>
309<p/><strong>bool SigmaProcess::setupForME() &nbsp;</strong> <br/>
310to be called by the user from inside <code>sigmaHat()</code>
311(or possibly <code>sigmaKin()</code>) to setup alternative kinematics
312in the <code>mME[5]</code> and <code>pME[5]</code> arrays, better
313suited for matrix-element calculations. See the end of the previous
314section for a more detailed description. Should the method return
315<code>false</code> then the conversion did not work, and
316<code>sigmaHat()</code> (or <code>sigmaKin()</code>) should be set to
317vanish.
318 
319
320<a name="method5"></a>
321<p/><strong>void SigmaProcess::setIdColAcol() &nbsp;</strong> <br/>
322is called only once an initial state and a kinematical configuration has
323been picked. This routine must set the complete flavour information and
324the colour flow of the process. This may involve further random choices,
325between different possible final-state flavours or between possible
326competing colour flows. Private data members of the class may be used to
327retain some information from the previous steps above.
328<br/>When this routine is called the two incoming flavours have already
329been selected and are available in <code>id1</code> and <code>id2</code>,
330whereas the one, two or three outgoing ones either are fixed for a given
331process or can be determined from the instate (e.g. whether a <i>W^+</i>
332or <i>W^-</i> was produced).  There is also a standard method in
333<code>VCKM</code> to pick a final flavour from an initial one with CKM
334mixing. Once you have figured out the value of
335<code>id3</code> and, the case being, <code>id4</code> and
336<code>id5</code>, you store these values permanently by a call
337<code>setId( id1, id2, id3, id4, id5)</code>, where the last two may be
338omitted if irrelevant.
339<br/>Correspondingly, the colours are stored with
340<code>setColAcol( col1, acol1, col2, acol2, col3, acol3, col4, acol4,
341col5, acol5)</code>, where the final ones may be omitted if irrelevant.
342Les Houches style colour tags are used, but starting with number 1
343(and later shifted by the currently requested offset). The
344input is grouped particle by particle, with the colour index before the
345anticolour one. You may need to select colour flow dynamically, depending
346on the kinematics, when several distinct possibilities exist. Trivial
347operations, like swapping colours and anticolours, can be done with
348existing methods.
349<br/>When the <code>id3Mass()</code> and <code>id4Mass()</code>
350methods have been used, the order of the outgoing particles may be
351inconsistent with the way the <i>tHat</i> and <i>uHat</i>
352variables have been defined. A typical example would be a process like
353<i>q g -> q' W</i> with <i>tHat</i> defined between incoming and
354outgoing quark, but where <code>id3Mass() = 24</code> and so the
355process is to be stored as <i>q g -> W q'</i>. One should then put
356the variable <code>swapTU = true</code> in <code>setIdColAcol()</code>
357for each event where the <i>tHat</i> and <i>uHat</i> variables
358should be swapped before the event kinematics is reconstructed. This
359variable is automatically restored to <code>false</code> for each new
360event.
361 
362
363<a name="method6"></a>
364<p/><strong>double SigmaProcess::weightDecayFlav( Event& process) &nbsp;</strong> <br/>
365is called to allow a reweighting of the simultaneous flavour choices of
366resonance decay products. Is currently only used for the
367<i>q qbar -> gamma*/Z^0 gamma*/Z^0</i> process, and will likely not
368be of interest for you.
369 
370
371<a name="method7"></a>
372<p/><strong>double SigmaProcess::weightDecay( Event& process, int iResBeg, int iResEnd) &nbsp;</strong> <br/>
373is called when the basic process has one or several resonances, after each
374set of related resonances in <code>process[i]</code>,
375<code>iResBeg</code> &lt;= <code>i </code> &lt;= <code>iResEnd</code>,
376has been allowed to decay. The calculated weight, to be normalized
377to the range between 0 and 1, is used to decide whether to accept the
378decay(s) or try for a new decay configuration. The base-class version of
379this method returns unity, i.e. gives isotropic decays by default.
380This method may be called repeatedly for a single event. For instance, in
381<i>q qbar -> H^0 Z^0</i> with <i>H^0 -> W^+ W^-</i>, a first call
382would be made after the <i>H^0</i> and <i>Z^0</i> decays, and then
383depend only on the <i>Z^0</i> decay angles since the <i>H^0</i>
384decays isotropically. The second call would be after the <i>W^+ W^-</i>
385decays and then involve correlations between the four daughter fermions.
386 
387
388<a name="method8"></a>
389<p/><strong>string SigmaProcess::name() &nbsp;</strong> <br/>
390returns the name of the process, as you want it to be shown in listings.
391 
392
393<a name="method9"></a>
394<p/><strong>int SigmaProcess::code() &nbsp;</strong> <br/>
395returns an integer identifier of the process. This has no internal function,
396but is only intended as a service for the user to rapidly (and hopefully
397uniquely) identify which process occured in a given event. Numbers below
39810000 are reserved for internal PYTHIA use.
399 
400
401<a name="method10"></a>
402<p/><strong>string SigmaProcess::inFlux() &nbsp;</strong> <br/>
403this string specifies the combinations of incoming partons that are
404allowed for the process under consideration, and thereby which incoming
405flavours <code>id1</code> and <code>id2</code> the <code>sigmaHat()</code>
406calls will be looped over. It is always possible to pick a wider flavour
407selection than strictly required and then put to zero cross sections in
408the superfluous channels, but of course this may cost some extra execution
409time. Currently allowed options are:
410<br/>* <code>gg</code>: two gluons.
411<br/>* <code>qg</code>: one (anti)quark and one gluon.
412<br/>* <code>qq</code>: any combination of two quarks, two antiquarks or
413a quark and an antiquark.
414<br/>* <code>qqbarSame</code>: a quark and its antiquark;
415this is a subset of the above <code>qq</code> option.
416<br/>* <code>ff</code>: any combination of two fermions, two antifermions
417or a fermion and an antifermion; is the same as <code>qq</code> for
418hadron beams but also allows processes to work with lepton beams.
419<br/>* <code>ffbarSame</code>: a fermion and its antifermion; is the
420same as <code>qqbarSame</code> for hadron beams but also allows processes
421to work with lepton beams.
422<br/>* <code>ffbarChg</code>: a fermion and an antifermion that combine
423to give charge +-1.
424<br/>* <code>fgm</code>: a fermion and a photon (gamma).
425<br/>* <code>ggm</code>: a gluon and a photon.
426<br/>* <code>gmgm</code>: two photons.
427 
428
429<a name="method11"></a>
430<p/><strong>bool SigmaProcess::convert2mb() &nbsp;</strong> <br/>
431it is assumed that cross sections normally come in dimensions such that
432they, when integrated over the relevant phase space, obtain the dimension
433GeV^-2, and therefore need to be converted to mb. If the cross section
434is already encoded as mb then <code>convert2mb()</code> should be
435overloaded to instead return <code>false</code>.
436 
437
438<a name="method12"></a>
439<p/><strong>bool SigmaProcess::convertM2() &nbsp;</strong> <br/>
440it is assumed that <i>2 -> 1</i> cross sections are encoded as 
441<i>sigmaHat(sHat)</i>, and <i>2 -> 2</i> ones as
442<i>d(sigmaHat)/d(tHat)</i> in the <code>SigmaProcess::sigmaHat()</code>
443methods. If <code>convertM2()</code> is overloaded to instead return
444<code>true</code> then the return value is instead assumed to be the
445squared matrix element <i>|M|^2</i>, and
446<code>SigmaProcess::sigmaHatWrap(...)</code> converts to
447<i>sigmaHat(sHat)</i> or <i>d(sigmaHat)/d(tHat)</i>, respectively.
448This switch has no effect on <i>2 -> 3</i> processes, where
449<i>|M|^2</i> is the only allowed input anyway.
450 
451
452<a name="method13"></a>
453<p/><strong>int SigmaProcess::id3Mass() &nbsp;</strong> <br/>
454 
455<strong>int SigmaProcess::id4Mass() &nbsp;</strong> <br/>
456 
457<strong>int SigmaProcess::id5Mass() &nbsp;</strong> <br/>
458are the one, two or three final-state flavours, where masses are to be
459selected before the matrix elements are evaluated. Only the absolute value
460should be given. For massless particles, like gluons and photons, one need
461not give anything, i.e. one defaults to 0. The same goes for normal light
462quarks, where masses presumably are not implemented in the matrix elements. 
463Later on, these quarks can still (automatically) obtain constituent masses,
464once a <i>u</i>, <i>d</i> or <i>s</i> flavour has been selected.
465 
466
467<a name="method14"></a>
468<p/><strong>int SigmaProcess::resonanceA() &nbsp;</strong> <br/>
469 
470<strong>int SigmaProcess::resonanceB() &nbsp;</strong> <br/>
471are the codes of up to two <i>s</i>-channel resonances contributing to
472the matrix elements. These are used by the program to improve the phase-space
473selection efficiency, by partly sampling according to the relevant
474Breit-Wigners. Massless resonances (the gluon and photon) need not be
475specified.
476 
477
478<a name="method15"></a>
479<p/><strong>bool SigmaProcess::isSChannel() &nbsp;</strong> <br/>
480normally the choice of renormalization and factorization scales in
481<i>2 -> 2</i> and <i>2 -> 3</i> processes is based on the assumption
482that <i>t</i>- and <i>u</i>-channel exchanges dominates the
483cross section. In cases such as <i>f fbar -> gamma* -> f' fbar'</i> a
484<i>2 -> 2</i> process actually ought to be given scales as a
485<i>2 -> 1</i> one, in the sense that it proceeds entirely through
486an <i>s</i>-channel resonance. This can be achieved if you override the
487default <code>false</code> to return <code>true</code>. See further the
488page on <?php $filepath = $_GET["filepath"];
489echo "<a href='CouplingsAndScales.php?filepath=".$filepath."' target='page'>";?>couplings and scales</a>.
490 
491
492<a name="method16"></a>
493<p/><strong>int SigmaProcess::idSChannel() &nbsp;</strong> <br/>
494normally no intermediate state is shown in the event record for 
495<i>2 -> 2</i> and <i>2 -> 3</i> processes. However, in case
496that <code>idSChannel</code> is overloaded to return a nonzero value,
497an intermediate particle with that identity code is inserted into the
498event record, to make it a <i>2 -> 1 -> 2</i> or <i>2 -> 1 -> 3</i>
499process. Thus if both <code>isSChannel</code> and <code>idSChannel</code>
500are overloaded, a process will behave and look like it proceeded through
501a resonance. The one difference is that the implementation of the
502matrix element is not based on the division into a production and a
503decay of an intermediate resonance, but is directly describing the
504transition from the initial to the final state.
505 
506
507<a name="method17"></a>
508<p/><strong>int SigmaProcess::isQCD3body() &nbsp;</strong> <br/>
509there are two different 3-body phase-space selection machineries,
510of which the non-QCD one is default. If you overload this method
511instead the QCD-inspired machinery will be used. The differences
512between these two is related to which
513<?php $filepath = $_GET["filepath"];
514echo "<a href='PhaseSpaceCuts.php?filepath=".$filepath."' target='page'>";?>phase space cuts</a>
515can be set, and also that the QCD machinery assumes (almost) massless
516outgoing partons.
517 
518
519<a name="method18"></a>
520<p/><strong>int SigmaProcess::idTchan1() &nbsp;</strong> <br/>
521 
522<strong>int SigmaProcess::idTchan2() &nbsp;</strong> <br/>
523the non-QCD <i>2 -> 3</i> phase space selection machinery is rather
524primitive, as already mentioned. The efficiency can be improved in
525processes that proceed though <i>t</i>-channel exchanges, such as
526<i>q qbar' -> H^0 q qbar'</i> via <i>Z^0 Z^0</i> fusion, if the identity
527of the  <i>t</i>-channel-exchanged particles on the two side of the
528event are provided. Only the absolute value is of interest.
529 
530
531<a name="method19"></a>
532<p/><strong>double SigmaProcess::tChanFracPow1() &nbsp;</strong> <br/>
533 
534<strong>double SigmaProcess::tChanFracPow2() &nbsp;</strong> <br/>
535in the above kind of <i>2 -> 3</i> phase-space selection, the
536sampling of <i>pT^2</i> is done with one part flat, one part weighted
537like <i>1 / (pT^2 + m_R^2)</i> and one part  like
538<i>1 / (pT^2 + m_R^2)^2</i>. The above values provide the relative
539amount put in the latter two channels, respectively, with the first
540obtaining the rest. Thus the sum of <code>tChanFracPow1()</code> and
541<code>tChanFracPow2()</code> must be below unity. The final results
542should be independent of these numbers, but the Monte Carlo efficiency
543may be quite low for a bad choice. Here <i>m_R</i> is the mass of the
544exchanged resonance specified by <code>idTchan1()</code> or
545<code>idTchan2()</code>. Note that the order of the final-state
546listing is important in the above <i>q qbar' -> H^0 q qbar'</i> example,
547i.e. the <i>H^0</i> must be returned by <code>id3Mass()</code>,
548since it is actually the <i>pT^2</i> of the latter two that are
549selected independently, with the first <i>pT</i> then fixed 
550by transverse-momentum conservation.
551 
552
553<a name="method20"></a>
554<p/><strong>bool SigmaProcess::useMirrorWeight() &nbsp;</strong> <br/>
555in <i>2 -> 3</i> processes the phase space selection used here
556involves a twofold ambiguity basically corresponding to a flipping of
557the positions of last two outgoing particles. These are assumed equally
558likely by default, <code>false</code>, but for processes proceeding entirely
559through <i>t</i>-channel exchange the Monte Carlo efficiency can be
560improved by making a preselection based on the relative propagator
561weights, <code>true</code>. 
562 
563
564<a name="method21"></a>
565<p/><strong>int SigmaProcess::gmZmode() &nbsp;</strong> <br/>
566allows a possibility to override the global mode
567<code><?php $filepath = $_GET["filepath"];
568echo "<a href='ElectroweakProcesses.php?filepath=".$filepath."' target='page'>";?>WeakZ0:gmZmode</a></code>
569for a specific process. The global mode normally is used to switch off
570parts of the <i>gamma^*/Z^0</i> propagator for test purposes. The
571above local mode is useful for processes where a <i>Z^0</i> really is
572that and nothing more, such as <i>q qbar -> H^0 Z^0</i>. The default
573value -1 returned by <code>gmZmode()</code> ensures that the global
574mode is used, while 0 gives full <i>gamma^*/Z^0</i> interference,
5751 <i>gamma^*</i> only and 2 <i>Z^0</i> only.
576 
577
578<h3>Access to a process</h3> 
579
580Once you have implemented a class, it is straightforward to make use of
581it in a run. Assume you have written a new class <code>MySigma</code>,
582which inherits from <code>Sigma1Process</code>, <code>Sigma2Process</code>
583or <code>Sigma3Process</code>, which in their turn inherit from
584<code>SigmaProcess</code>. You then create an instance of this class
585and hand it in to a <code>pythia</code> object with
586<pre>
587      SigmaProcess* mySigma = new MySigma();
588      pythia.setSigmaPtr( mySigma);
589</pre>
590If you have several processes you can repeat the procedure any number
591of times. When <code>pythia.init(...)</code> is called these processes
592are initialized along with any internal processes you may have switched on,
593and treated in exactly the same manner. The  <code>pythia.next()</code>
594will therefore generate a mix of the different kinds of processes without
595distinction. See also the <?php $filepath = $_GET["filepath"];
596echo "<a href='ProgramFlow.php?filepath=".$filepath."' target='page'>";?>Program Flow</a>
597description.
598
599<p/>
600If the code should be of good quality and general usefulness, it would
601be simple to include it as a permanently available process in the
602standard program distribution. The final step of that integration ought to
603be left for the PYTHIA authors, but here is a description of what is
604required.
605 
606<p/>
607A flag has to be defined, that allows the process to be switched on;
608by default it should always be off. The name of the flag should be
609chosen of the type <code>model:process</code>. Here the
610<code>model</code> would be related to the general scenario considered,
611e.g. <code>Compositeness</code>, while <code>process</code> would
612specify instate and outstate, separated by a 2 (= to), e.g.
613<code>ug2u*g</code>.
614When several processes are implemented and "belong together" it is
615also useful to define a <code>model:all</code> switch that affects
616all the separate processes.
617
618<p/>
619The flags should normally be stored in the <code>ProcessSelection.xml</code>
620file or one of its daughters for a specific kind of processes. This is to
621make them easily found by users. You could create and use your own
622<code>.xml</code> file, so long as you then add that name to the
623list of files in the <code>Index.xml</code> file. (If not,
624the flags would never be created and the program would not work.) 
625
626<p/>
627In the <code>ProcessContainer.c</code> file, the
628<code>SetupContainers::init()</code> method needs to be expanded to
629create instances of the processes switched on. This code is fairly
630repetitive, and should be easy to copy and modify from the code
631already there. The basic structure is
632<br/>(i) check whether a process is requested by the user and, if so,
633<br/>(ii) create an instance of the matrix-element class,
634<br/>(iii)create a container for the matrix element and its associated
635phase-space handling, and
636<br>(iv) add the container to the existing process list. 
637
638<p/>
639Two minor variations are possible. One is that a set of related
640processes are lumped inside the the same initial check, i.e. are
641switched on all together. The second is that the matrix-element
642constructor may take arguments, as specified by you (see above).
643If so, the same basic matrix element may be recycled for a set of
644related processes, e.g. one for a composite <i>u</i> and one for
645a composite <i>d</i>. Obviously these variations may be combined.
646
647<input type="hidden" name="saved" value="1"/>
648
649<?php
650echo "<input type='hidden' name='filepath' value='".$_GET["filepath"]."'/>"?>
651
652<table width="100%"><tr><td align="right"><input type="submit" value="Save Settings" /></td></tr></table>
653</form>
654
655<?php
656
657if($_POST["saved"] == 1)
658{
659$filepath = $_POST["filepath"];
660$handle = fopen($filepath, 'a');
661
662if($_POST["1"] != "off")
663{
664$data = "SigmaProcess:cMassiveME = ".$_POST["1"]."\n";
665fwrite($handle,$data);
666}
667if($_POST["2"] != "on")
668{
669$data = "SigmaProcess:bMassiveME = ".$_POST["2"]."\n";
670fwrite($handle,$data);
671}
672if($_POST["3"] != "off")
673{
674$data = "SigmaProcess:muMassiveME = ".$_POST["3"]."\n";
675fwrite($handle,$data);
676}
677if($_POST["4"] != "on")
678{
679$data = "SigmaProcess:tauMassiveME = ".$_POST["4"]."\n";
680fwrite($handle,$data);
681}
682fclose($handle);
683}
684
685?>
686</body>
687</html>
688
689<!-- Copyright (C) 2012 Torbjorn Sjostrand -->
Note: See TracBrowser for help on using the repository browser.