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