source: HiSusy/trunk/Pythia8/pythia8170/phpdoc/UserHooks.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: 48.8 KB
Line 
1<html>
2<head>
3<title>User Hooks</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='UserHooks.php'>
29
30<h2>User Hooks</h2>
31
32Sometimes it may be convenient to step in during the generation
33process: to modify the built-in cross sections, to veto undesirable
34events or simply to collect statistics at various stages of the
35evolution. There is a base class <code>UserHooks</code> that gives
36you this access at a few selected places. This class in itself does
37nothing; the idea is that you should write your own derived class
38for your task. One simple derived class (<code>SuppressSmallPT</code>)
39comes with the program, mainly as illustration, and the
40<code>main10.cc</code> program provides a complete (toy) example how
41a derived class could be set up and used.
42
43<p/>
44There are six sets of routines, that give you different kinds of
45freedom. They are, in no particular order:
46<br/>(i) Ones that give you access to the event record in between
47the process-level and parton-level steps, or in between the
48parton-level and hadron-level ones. You can study the event record
49and decide whether to veto this event.
50<br/>(ii) Ones that allow you to set a scale at which the combined
51parton-level MPI+ISR+FSR downwards evolution in <i>pT</i> is
52temporarily interrupted, so the event can be studied and either
53vetoed or allowed to continue the evolution.
54<br/>(iii) Ones that allow you to to study the event after the first
55few ISR/FSR emissions, or first few MPI, so the event can be vetoed
56or allowed to continue the evolution.
57<br/>(iv) Ones that allow you to study the latest initial- or
58final-state emission and veto that emission, without vetoing the
59event as a whole.
60<br/>(v) Ones that give you access to the properties of the trial
61hard process, so that you can modify the internal Pythia cross section,
62alternatively the phase space sampling, by your own correction factors.
63<br/>(vi) Ones that allow you to reject the decay sequence of resonances
64at the process level.
65<br/>(vii) Ones that let you set the scale of shower evolution,
66specifically for matching in resonance decays.
67<br/>They are described further in the following numbered subsections.
68
69<p/> 
70All the possibilities above can be combined freely and also be combined
71with the standard flags. An event would then survive only if it survived
72each of the possible veto methods. There are no hidden interdependencies
73in this game, but of course some combinations may not be particularly
74meaningful. For instance, if you set <code>PartonLevel:all = off</code>
75then the <code>doVetoPT(...)</code> and <code>doVetoPartonLevel(...)</code>
76locations in the code are not even reached, so they would never be called.
77
78<p/> 
79The effect of the vetoes of types (i), (ii) and (iii) can be studied
80in the output of the
81<code><?php $filepath = $_GET["filepath"];
82echo "<a href='EventStatistics.php?filepath=".$filepath."' target='page'>";?>Pythia::statistics()</a></code>
83method. The "Selected" column represents the number of events that were
84found acceptable by the internal Pythia machinery, whereas the "Accepted"
85one are the events that also survived the user cuts. The cross section
86is based on the latter number, and so is reduced by the amount associated
87by the vetoed events. Also type (v) modifies the cross section, while
88types (iv), (vi) and (vii) do not.
89
90<p/>
91A warning. When you program your own derived class, do remember that you
92must exactly match the arguments of the base-class methods you overload.
93If not, your methods will be considered as completely new ones, and
94compile without any warnings, but not be used inside <code>Pythia</code>.
95So, at the debug stage, do insert some suitable print statements to check
96that the new methods are called (and do what they should).
97
98<h3>The basic components</h3>
99
100For a derived <code>UserHooks</code> class to be called during the
101execution, a pointer to an object of this class should be handed in
102with the
103<br/><code><?php $filepath = $_GET["filepath"];
104echo "<a href='ProgramFlow.php?filepath=".$filepath."' target='page'>";?>
105Pythia::setUserHooksPtr( UserHooks*)</a></code>
106<br/>method. The first step therefore is to construct your own derived
107class, of course. This must contain a constructor and a destructor. The
108<code>initPtr</code> method comes "for free", and is set up without
109any intervention from you.
110
111<a name="method1"></a>
112<p/><strong>UserHooks::UserHooks() &nbsp;</strong> <br/>
113 
114<strong>virtual UserHooks::~UserHooks() &nbsp;</strong> <br/>
115The constructor and destructor do not need to do anything.
116 
117
118<a name="method2"></a>
119<p/><strong>void UserHooks::initPtr( Info* infoPtr, Settings* settingsPtr, ParticleData* particleDataPtr, Rndm* rndmPtr, BeamParticle* beamAPtr, BeamParticle* beamBPtr, BeamParticle* beamPomAPtr, BeamParticle* beamPomBPtr, CoupSM* coupSMPtr, PartonSystems* partonSystemsPtr, SigmaTotal* sigmaTotPtr) &nbsp;</strong> <br/>
120this (non-virtual) method is automatically called during the
121initialization stage to set several useful pointers, and to set up
122the <code>workEvent</code> below. The corresponding objects can
123later be used to extract some useful information.
124<br/><?php $filepath = $_GET["filepath"];
125echo "<a href='EventInformation.php?filepath=".$filepath."' target='page'>";?>Info</a>:
126general event and run information, including some loop counters.
127<br/><?php $filepath = $_GET["filepath"];
128echo "<a href='SettingsScheme.php?filepath=".$filepath."' target='page'>";?>Settings</a>:
129the settings used to determine the character of the run.
130<br/><?php $filepath = $_GET["filepath"];
131echo "<a href='ParticleDataScheme.php?filepath=".$filepath."' target='page'>";?>ParticleData</a>:
132the particle data used in the event record
133(including <code>workEvent</code> below).
134<br/><?php $filepath = $_GET["filepath"];
135echo "<a href='RandomNumbers.php?filepath=".$filepath."' target='page'>";?>Rndm</a>: the random number
136generator, that you could also use in your code.
137<br/><?php $filepath = $_GET["filepath"];
138echo "<a href='BeamRemnants.php?filepath=".$filepath."' target='page'>";?>BeamParticle</a>:
139the <code>beamAPtr</code> and <code>beamBPtr</code> beam particles
140contain info on partons extracted from the two incoming beams,
141on the PDFs used, and more. In cases when diffraction is simulated,
142also special Pomeron beams <code>beamPomAPtr</code> and
143<code>beamPomBPtr</code> are introduced, for the Pomerons residing
144inside the respective proton.
145<br/><?php $filepath = $_GET["filepath"];
146echo "<a href='StandardModelParameters.php?filepath=".$filepath."' target='page'>";?>CoupSM</a>:
147Standard Model couplings.
148<br/><?php $filepath = $_GET["filepath"];
149echo "<a href='AdvancedUsage.php?filepath=".$filepath."' target='page'>";?>PartonSystems</a>:
150the list of partons that belong to each individual subcollision system.   
151<br/><?php $filepath = $_GET["filepath"];
152echo "<a href='TotalCrossSections.php?filepath=".$filepath."' target='page'>";?>SigmaTotal</a>:
153total/elastic/diffractive cross section parametrizations.
154 
155
156<p/> 
157Next you overload the desired methods listed in the sections below.
158These often come in pairs or triplets, where the first must return
159true for the last method to be called. This latter method typically
160hands you a reference to the event record, which you then can use to
161decide whether or not to veto. Often the event record can be quite
162lengthy and difficult to overview. The following methods and data member
163can then come in handy.
164
165<a name="method3"></a>
166<p/><strong>void UserHooks::omitResonanceDecays(const Event& process, bool finalOnly = false) &nbsp;</strong> <br/>
167is a protected method that you can make use of in your own methods to
168extract a simplified list of the hard process, where all resonance decay
169chains are omitted. Intended for the <code>can/doVetoProcessLevel</code>
170routines. Note that the normal process-level generation does include
171resonance decays. That is, if a top quark is produced in the hard process,
172then also decays such as <i>t -> b W+, W+ -> u dbar</i> will be generated
173and stored in <code>process</code>. The <code>omitResonanceDecays</code>
174routine will take the input <code>process</code> and copy it to
175<code>workEvent</code> (see below), minus the resonance decay chains.
176All particles produced in the hard process, such as the top, will be
177considered final-state ones, with positive status and no daughters,
178just as it is before resonances are allowed to decay.
179<br/>(In the <code>PartonLevel</code> routines, these decay chains will
180initially not be copied from <code>process</code> to <code>event</code>.
181Instead the combined MPI, ISR and FSR evolution is done with the top
182above as final particle. Only afterwards will the resonance decay chains
183be copied over, with kinematics changes reflecting those of the top, and
184showers in the decays carried out.)
185<br/>For the default <code>finalOnly = false</code> the beam particles
186and incoming partons are retained, so the event looks like a normal
187event record up to the point of resonance decays, with a normal history
188setup.
189<br/>With <code>finalOnly = true</code> only the final-state partons
190are retained in the list. It therefore becomes similar in functionality
191to the <code>subEvent</code> method below, with the difference that
192<code>subEvent</code> counts the decay products of the resonances
193as the final state, whereas here the resonances themselves are the
194final state. Since the history has been removed in this option,
195<code>mother1()</code> and <code>mother2()</code> return 0, while
196<code>daughter1()</code> and <code>daughter2()</code> both return the
197index of the same parton in the original event record.
198 
199
200<a name="method4"></a>
201<p/><strong>void UserHooks::subEvent(const Event& event, bool isHardest = true) &nbsp;</strong> <br/>
202is a protected method that you can make use of in your own methods to
203extract a brief list of the current partons of interest, with all
204irrelevant ones omitted. It is primarily intended to track the evolution
205at the parton level, notably the shower evolution of the hardest
206(i.e. first) interaction.
207<br/>For the default <code>isHardest = true</code> only the outgoing partons
208from the hardest interaction (including the partons added to it by ISR and
209FSR) are extracted, as relevant e.g. for <code>doVetoPT( iPos, event)</code>
210with <code>iPos = 0 - 4</code>. With <code>isHardest = false</code> instead
211the outgoing partons of the latest "subprocess" are extracted, as relevant
212when <code>iPos = 5</code>, where it corresponds to the outgoing partons
213in the currently considered decay.
214<br/>The method also works at the process level, but there simply extracts
215all final-state partons in the event, and thus offers no extra functionality.
216<br/>The result is stored in <code>workEvent</code> below. Since the
217history has been removed, <code>mother1()</code> and <code>mother2()</code>
218return 0, while <code>daughter1()</code> and <code>daughter2()</code> both
219return the index of the same parton in the original event record
220(<code>event</code>; possibly <code>process</code>), so that you can
221trace the full history, if of interest.
222 
223
224<a name="method5"></a>
225<p/><strong>Event UserHooks::workEvent &nbsp;</strong> <br/>
226This protected class member contains the outcome of the above
227<code>omitResonanceDecays(...)</code> and
228<code>subEvent(...)</code> methods. Alternatively you can use it for
229whatever temporary purposes you wish. You are free to use standard
230operations, e.g. to boost the event to its rest frame before analysis,
231or remove particles that should not be analyzed. 
232The <code>workEvent</code> can also be sent on to a
233<?php $filepath = $_GET["filepath"];
234echo "<a href='EventAnalysis.php?filepath=".$filepath."' target='page'>";?>jet clustering algorithm</a>.
235
236<h3>(i) Interrupt between the main generation levels</h3>
237
238<a name="method6"></a>
239<p/><strong>virtual bool UserHooks::initAfterBeams() &nbsp;</strong> <br/>
240This routine is called by Pythia::init(), after the beams have been
241set up, but before any other initialisation. Therefore, at this stage,
242it is still possible to modifiy settings (apart from
243<code>Beams:*</code>) and particle data. This is mainly intended
244to be used in conjunction with Les Houches Event files, where
245headers are read in during beam initialisation, see the header
246functions in the <?php $filepath = $_GET["filepath"];
247echo "<a href='EventInformation.php?filepath=".$filepath."' target='page'>";?>Info</a> class.
248In the base class this method returns true. By returning false,
249PYTHIA initialisation will be aborted.
250 
251
252<a name="method7"></a>
253<p/><strong>virtual bool UserHooks::canVetoProcessLevel() &nbsp;</strong> <br/>
254In the base class this method returns false. If you redefine it
255to return true then the method <code>doVetoProcessLevel(...)</code>
256will be called immediately after a hard process (and associated
257resonance decays) has been selected and stored in the
258<code><?php $filepath = $_GET["filepath"];
259echo "<a href='EventRecord.php?filepath=".$filepath."' target='page'>";?>process</a></code> event record.
260<br/>At this stage, the <code>process</code> record typically contains
261the two beams in slots 1 and 2, the two incoming partons to the hard
262process in slots 3 and 4, the N (usually 1, 2 or 3) primary produced
263particles in slots 5 through 4 + N, and thereafter recursively the
264resonance decay chains, if any. Use the method
265<code>omitResonanceDecays(...)</code> if you want to skip these
266decay chains. There are exceptions to this structure,
267for <?php $filepath = $_GET["filepath"];
268echo "<a href='QCDProcesses.php?filepath=".$filepath."' target='page'>";?>soft QCD processes</a> (where
269the partonic process may not yet have been selected at this stage),
270and when <?php $filepath = $_GET["filepath"];
271echo "<a href='ASecondHardProcess.php?filepath=".$filepath."' target='page'>";?>a second hard process</a> has
272been requested (where two hard processes are bookkept). In general
273it is useful to begin the development work by listing a few
274<code>process</code> records, to clarify what the structure is for
275the cases of interest.
276 
277
278<a name="method8"></a>
279<p/><strong>virtual bool UserHooks::doVetoProcessLevel(Event& process) &nbsp;</strong> <br/>
280can optionally be called, as described above. You can study the
281<code>process</code> event record of the hard process.
282Based on that you can decide whether to veto the event, true, or let
283it continue to evolve, false. If you veto, then this event is not
284counted among the accepted ones, and does not contribute to the estimated
285cross section. The <code>Pytha::next()</code> method will begin a
286completely new event, so the vetoed event will not appear in the
287output of <code>Pythia::next()</code>.
288<br/><b>Warning:</b> Normally you should not modify the <code>process</code>
289event record. However, for some matrix-element-matching procedures it may
290become unavoidable. If so, be very careful, since there are many pitfalls.
291Only to give one example: if you modify the incoming partons then also
292the information stored in the beam particles may need to be modified.
293<br/><b>Note:</b> the above veto is different from setting the flag
294<code><?php $filepath = $_GET["filepath"];
295echo "<a href='MasterSwitches.php?filepath=".$filepath."' target='page'>";?>PartonLevel:all = off</a></code>.
296Also in the latter case the event generation will stop after the process
297level, but an event generated up to this point is considered perfectly
298acceptable. It can be studied and it contributes to the cross section.
299That is, <code>PartonLevel:all = off</code> is intended for simple studies
300of hard processes, where one can save a lot of time by not generating
301the rest of the story. By contrast, the <code>doVetoProcessLevel()</code>
302method allows you to throw away uninteresting events at an early stage
303to save time, but those events that do survive the veto are allowed to
304develop into complete final states (unless flags have been set otherwise).
305 
306
307<a name="method9"></a>
308<p/><strong>virtual bool UserHooks::canVetoPartonLevel() &nbsp;</strong> <br/>
309In the base class this method returns false. If you redefine it
310to return true then the method <code>doVetoPartonLevel(...)</code>
311will be called immediately after the parton level has been generated
312and stored in the <code><?php $filepath = $_GET["filepath"];
313echo "<a href='EventRecord.php?filepath=".$filepath."' target='page'>";?>event</a></code>
314event record. Thus showers, multiparton interactions and beam remnants
315have been set up, but hadronization and decays have not yet been
316performed. This is already a fairly complete event, possibly with quite
317a complex parton-level history. Therefore it is usually only meaningful
318to study the hardest interaction, e.g. using <code>subEvent(...)</code>
319introduced above, or fairly generic properties, such as the parton-level
320jet structure.
321 
322
323<a name="method10"></a>
324<p/><strong>virtual bool UserHooks::doVetoPartonLevel(const Event& event) &nbsp;</strong> <br/>
325can optionally be called, as described above. You can study, but not
326modify, the <code>event</code> event record of the partonic process.
327Based on that you can decide whether to veto the event, true, or let
328it continue to evolve, false. If you veto, then this event is not
329counted among the accepted ones, and does not contribute to the estimated
330cross section. The <code>Pytha::next()</code> method will begin a
331completely new event, so the vetoed event will not appear in the
332output of <code>Pythia::next()</code>.
333<br/><b>Note:</b> the above veto is different from setting the flag
334<code><?php $filepath = $_GET["filepath"];
335echo "<a href='MasterSwitches.php?filepath=".$filepath."' target='page'>";?>HadronLevel:all = off</a></code>.
336Also in the latter case the event generation will stop after the parton
337level, but an event generated up to this point is considered perfectly
338acceptable. It can be studied and it contributes to the cross section.
339That is, <code>HadronLevel:all = off</code> is intended for simple
340studies of complete partonic states, where one can save time by not
341generating the complete hadronic final state. By contrast, the
342<code>doVetoPartonLevel()</code> method allows you to throw away
343uninteresting events to save time that way, but those events that
344do survive the veto are allowed to develop into complete final states
345(unless flags have been set otherwise).
346 
347
348<a name="method11"></a>
349<p/><strong>virtual bool UserHooks::canVetoPartonLevelEarly() &nbsp;</strong> <br/>
350is very similar to <code>canVetoPartonLevel()</code> above, except
351that the chance to veto appears somewhat earlier in the generation
352chain, after showers and multiparton interactions, but before the
353beam remnants and resonance decays have been added. It is therefore
354somewhat more convenient for many matrix element strategies, where
355the primordial <i>kT</i> added along with the beam remnants should
356not be included.
357 
358
359<a name="method12"></a>
360<p/><strong>virtual bool UserHooks::doVetoPartonLevelEarly(const Event& event) &nbsp;</strong> <br/>
361is very similar to <code>doVetoPartonLevel(...)</code> above, but
362the veto can be done earier, as described for
363<code>canVetoPartonLevelEarly()</code>.
364
365<h3>(ii) Interrupt during the parton-level evolution, at a
366<i>pT</i> scale</h3>
367
368During the parton-level evolution, multiparton interactions (MPI),
369initial-state radiation (ISR) and final-state radiation (FSR)
370are normally evolved downwards in
371one interleaved evolution sequence of decreasing <i>pT</i> values.
372For some applications, e.g  matrix-element-matching approaches, it
373may be convenient to stop the evolution temporarily when the "hard"
374emissions have been considered, but before continuing with the more
375time-consuming soft activity. Based on these hard partons one can make
376a decision whether the event at all falls in the intended event class,
377e.g. has the "right" number of parton-level jets. If yes then, as for
378the methods above, the evolution will continue all the way up to a
379complete event. Also as above, if no, then the event will not be
380considered in the final cross section.
381
382<p/>
383Recall that the new or modified partons resulting from a MPI, ISR or FSR
384step are always appended to the end of the then-current event record.
385Previously existing partons are not touched, except for the
386<?php $filepath = $_GET["filepath"];
387echo "<a href='ParticleProperties.php?filepath=".$filepath."' target='page'>";?>status, mother and daughter</a>
388values, which are updated to reflect the modified history. It is
389therefore straightforward to find the partons associated with the most
390recent occurence.
391<br/>An MPI results in four new partons being appended, two incoming
392and two outgoing ones.
393<br/>An ISR results in the whole affected system being copied down,
394with one of the two incoming partons being replaced by a new one, and
395one more outgoing parton.
396<br/>An FSR results in three new partons, two that come from the
397branching and one that takes the recoil.
398<br/>The story becomes more messy when rescattering is allowed as part
399of the MPI machinery. Then there will not only be a new system, as
400outlined above, but additionally some existing systems will undergo
401cascade effects, and be copied down with changed kinematics.
402
403<p/>
404In this subsection we outline the possibility to interrupt at a given
405<i>pT</i> scale, in the next to interrupt after a given number of
406emissions.
407
408<a name="method13"></a>
409<p/><strong>virtual bool UserHooks::canVetoPT() &nbsp;</strong> <br/>
410In the base class this method returns false. If you redefine it
411to return true then the method <code>doVetoPT(...)</code> will
412interrupt the downward evolution at <code>scaleVetoPT()</code>.
413
414<a name="method14"></a>
415<p/><strong>virtual double UserHooks::scaleVetoPT() &nbsp;</strong> <br/>
416In the base class this method returns 0. You should redefine it
417to return the <i>pT</i> scale at which you want to study the event.
418 
419
420<a name="method15"></a>
421<p/><strong>virtual bool UserHooks::doVetoPT(int iPos, const Event& event) &nbsp;</strong> <br/>
422can optionally be called, as described above. You can study, but not
423modify, the <code>event</code> event record of the partonic process.
424Based on that you can decide whether to veto the event, true, or let
425it continue to evolve, false. If you veto, then this event is not
426counted among the accepted ones, and does not contribute to the estimated
427cross section. The <code>Pytha::next()</code> method will begin a
428completely new event, so the vetoed event will not appear in the
429output of <code>Pythia::next()</code>.
430<br/><code>argument</code><strong> iPos </strong>  :  is the position/status when the routine is
431called, information that can help you decide your course of action:
432<br/><code>argumentoption </code><strong> 0</strong> :  when no MPI, ISR or FSR occured above the veto scale;
433 
434<br/><code>argumentoption </code><strong> 1</strong> :  when inside the interleaved MPI + ISR + FSR evolution,
435after an MPI process; 
436 
437<br/><code>argumentoption </code><strong> 2</strong> :  when inside the interleaved MPI + ISR + FSR evolution,
438after an ISR emission;
439 
440<br/><code>argumentoption </code><strong> 3</strong> :  when inside the interleaved MPI + ISR + FSR evolution,
441after an FSR emission;
442 
443<br/><code>argumentoption </code><strong> 4</strong> :  for the optional case where FSR is deferred from the
444interleaved evolution and only considered separately afterward (then
445alternative 3 would never occur);
446 
447<br/><code>argumentoption </code><strong> 5</strong> :  is for subsequent resonance decays, and is called once
448for each decaying resonance in a chain such as <i>t -> b W, W -> u dbar</i>.
449 
450 
451<br/><code>argument</code><strong> event </strong>  :  the event record contains a list of all partons
452generated so far, also including intermediate ones not part of the
453"current final state", and also those from further multiparton interactions.
454This may not be desirable for comparisons with matrix-element calculations.
455You may want to make use of the <code>subEvent(...)</code> method below to
456obtain a simplified event record <code>workEvent</code>.
457 
458 
459
460<h3>(iii) Interrupt during the parton-level evolution, after a step</h3>
461
462These options are closely related to the ones above in section (ii), so
463we do not repeat the introduction, nor the possibilities to study the
464event record, also by using <code>subEvent(...)</code> and
465<code>workEvent</code>. 
466What is different is that the methods in this section give access to the
467event as it looks like after each of the first few steps in the downwards
468evolution, irrespectively of the <i>pT</i> scales of these branchings.
469Furthermore, it is here assumed that the focus normally is on the hardest
470subprocess, so that ISR/FSR emissions associated with additional MPI's
471are not considered. For MPI studies, however, a separate simpler
472alternative is offered to consider the event after a given number
473of interactions. 
474
475<a name="method16"></a>
476<p/><strong>virtual bool UserHooks::canVetoStep() &nbsp;</strong> <br/>
477In the base class this method returns false. If you redefine it
478to return true then the method <code>doVetoStep(...)</code> will
479interrupt the downward ISR and FSR evolution the first
480<code>numberVetoStep()</code> times.
481
482<a name="method17"></a>
483<p/><strong>virtual int UserHooks::numberVetoStep() &nbsp;</strong> <br/>
484Returns the number of steps <i>n</i> each of ISR and FSR, for the
485hardest interaction, that you want to be able to study. That is,
486the method will be called after the first <i>n</i> ISR emissions,
487irrespective of the number of FSR ones at the time, and after the
488first <i>n</i> FSR emissions, irespective of the number of ISR ones.
489The number of steps defaults to the first one only, but you are free
490to pick another value. Note that double diffraction is handled as two
491separate Pomeron-proton collisions, and thus has two sequences of
492emissions.
493 
494
495<a name="method18"></a>
496<p/><strong>virtual bool UserHooks::doVetoStep(int iPos, int nISR, int nFSR, const Event& event) &nbsp;</strong> <br/>
497can optionally be called, as described above. You can study, but not
498modify, the <code>event</code> event record of the partonic process.
499Based on that you can decide whether to veto the event, true, or let
500it continue to evolve, false. If you veto, then this event is not
501counted among the accepted ones, and does not contribute to the estimated
502cross section. The <code>Pytha::next()</code> method will begin a
503completely new event, so the vetoed event will not appear in the
504output of <code>Pythia::next()</code>.
505<br/><code>argument</code><strong> iPos </strong>  :  is the position/status when the routine is
506called, information that can help you decide your course of action.
507Agrees with options 2 - 5 of the <code>doVetoPT(...)</code> routine
508above, while options 0 and 1 are not relevant here.
509 
510<br/><code>argument</code><strong> nISR </strong>  :  is the number of ISR emissions in the hardest
511process so far. For resonance decays, <code>iPos = 5</code>, it is 0.
512 
513<br/><code>argument</code><strong> nFSR </strong>  :  is the number of FSR emissions in the hardest
514process so far. For resonance decays, <code>iPos = 5</code>, it is the
515number of emissions in the currently studied system.
516 
517<br/><code>argument</code><strong> event </strong>  :  the event record contains a list of all partons
518generated so far, also including intermediate ones not part of the
519"current final state", and also those from further multiparton interactions.
520This may not be desirable for comparisons with matrix-element calculations.
521You may want to make use of the <code>subEvent(...)</code> method above to
522obtain a simplified event record.
523 
524 
525
526<a name="method19"></a>
527<p/><strong>virtual bool UserHooks::canVetoMPIStep() &nbsp;</strong> <br/>
528In the base class this method returns false. If you redefine it
529to return true then the method <code>doVetoMPIStep(...)</code> will
530interrupt the downward MPI evolution the first
531<code>numberVetoMPIStep()</code> times.
532
533<a name="method20"></a>
534<p/><strong>virtual int UserHooks::numberVetoMPIStep() &nbsp;</strong> <br/>
535Returns the number of steps in the MPI evolution that you want to be
536able to study, right after each new step has been taken and the
537subcollision has been added to the event record. The number of steps
538defaults to the first one only, but you are free to pick another value.
539Note that the hardest interaction of an events counts as the first
540multiparton interaction. For most hard processes it thus at the first
541step offers nothing not available with the <code>VetoProcessLevel</code>
542functionality above. For the minimum-bias and diffractive systems the
543hardest interaction is not selected at the process level, however, so
544there a check after the first multiparton interaction offers new
545functionality. Note that double diffraction is handled as two separate
546Pomeron-proton collisions, and thus has two sequences of interactions.
547Also, if you have set up a second hard process then a check is made
548after these first two, and the first interaction coming from the MPI
549machinery would have sequence number 3.
550 
551
552<a name="method21"></a>
553<p/><strong>virtual bool UserHooks::doVetoMPIStep(int nMPI,const Event& event) &nbsp;</strong> <br/>
554can optionally be called, as described above. You can study, but not
555modify, the <code>event</code> event record of the partonic process.
556Based on that you can decide whether to veto the event, true, or let
557it continue to evolve, false. If you veto, then this event is not
558counted among the accepted ones, and does not contribute to the estimated
559cross section. The <code>Pytha::next()</code> method will begin a
560completely new event, so the vetoed event will not appear in the
561output of <code>Pythia::next()</code>.
562<br/><code>argument</code><strong> nMPI </strong>  :  is the number of MPI subprocesses has occured
563so far.
564 
565<br/><code>argument</code><strong> event </strong>  :  the event record contains a list of all partons
566generated so far, also including intermediate ones not part of the
567"current final state", e.g. leftovers from the ISR and FSR evolution
568of previously generated systems. The most recently added one has not
569had time to radiate, of course.
570 
571 
572
573<h3>(iv) Veto emissions</h3>
574
575The methods in this group are intended to allow the veto of an emission
576in ISR, FSR or MPI, without affecting the evolution in any other way.
577If an emission is vetoed, the event record is "rolled back" to the
578way it was before the emission occured, and the evolution in <i>pT</i>
579is continued downwards from the rejected value. The decision can be
580based on full knowledge of the kinematics of the shower branching or MPI.
581
582<p/>
583To identify where shower emissions originated, the ISR/FSR veto
584routines are passed the system from which the radiation occured, according
585to the Parton Systems class (see <?php $filepath = $_GET["filepath"];
586echo "<a href='AdvancedUsage.php?filepath=".$filepath."' target='page'>";?>Advanced
587Usage</a>). Note, however, that inside the veto routines only the event
588record has been updated; all other information, including the Parton
589Systems, reflects the event before the shower branching or MPI has
590taken place.
591
592<a name="method22"></a>
593<p/><strong>virtual bool UserHooks::canVetoISREmission() &nbsp;</strong> <br/>
594In the base class this method returns false. If you redefine it
595to return true then the method <code>doVetoISREmission(...)</code>
596will interrupt the initial-state shower immediately after each
597emission and allow that emission to be vetoed.
598
599<a name="method23"></a>
600<p/><strong>virtual bool UserHooks::doVetoISREmission( int sizeOld, const Event& event, int iSys) &nbsp;</strong> <br/>
601can optionally be called, as described above. You can study, but not
602modify, the <code>event</code> event record of the partonic process.
603Based on that you can decide whether to veto the emission, true, or
604not, false. If you veto, then the latest emission is removed from
605the event record. In either case the evolution of the shower will
606continue from the point where it was left off.
607<br/><code>argument</code><strong> sizeOld </strong>  :  is the size of the event record before the
608latest emission was added to it. It will also become the new size if
609the emission is vetoed.
610 
611<br/><code>argument</code><strong> event </strong>  :  the event record contains a list of all partons
612generated so far. Of special interest are the ones associated with the
613most recent emission, which are stored in entries from <code>sizeOld</code>
614through <code>event.size() - 1</code> inclusive. If you veto the emission
615these entries will be removed, and the history info in the remaining
616partons will be restored to a state as if the emission had never occured.
617 
618<br/><code>argument</code><strong> iSys </strong>  :  the system where the radiation occurs, according
619to Parton Systems.
620 
621 
622
623<a name="method24"></a>
624<p/><strong>virtual bool UserHooks::canVetoFSREmission() &nbsp;</strong> <br/>
625In the base class this method returns false. If you redefine it
626to return true then the method <code>doVetoFSREmission(...)</code>
627will interrupt the final-state shower immediately after each
628emission and allow that emission to be vetoed.
629
630<a name="method25"></a>
631<p/><strong>virtual bool UserHooks::doVetoFSREmission( int sizeOld, const Event& event, int iSys, bool inResonance = false) &nbsp;</strong> <br/>
632can optionally be called, as described above. You can study, but not
633modify, the <code>event</code> event record of the partonic process.
634Based on that you can decide whether to veto the emission, true, or
635not, false. If you veto, then the latest emission is removed from
636the event record. In either case the evolution of the shower will
637continue from the point where it was left off.
638<br/><code>argument</code><strong> sizeOld </strong>  :  is the size of the event record before the
639latest emission was added to it. It will also become the new size if
640the emission is vetoed.
641 
642<br/><code>argument</code><strong> event </strong>  :  the event record contains a list of all partons
643generated so far. Of special interest are the ones associated with the
644most recent emission, which are stored in entries from <code>sizeOld</code>
645through <code>event.size() - 1</code> inclusive. If you veto the emission
646these entries will be removed, and the history info in the remaining
647partons will be restored to a state as if the emission had never occured.
648 
649<br/><code>argument</code><strong> iSys </strong>  :  the system where the radiation occurs, according
650to Parton Systems.
651 
652<br/><code>argument</code><strong> inResonance </strong>  :  <code>true</code> if the emission takes
653place in a resonance decay, subsequent to the hard process.
654 
655 
656
657<a name="method26"></a>
658<p/><strong>virtual bool UserHooks::canVetoMPIEmission() &nbsp;</strong> <br/>
659In the base class this method returns false. If you redefine it
660to return true then the method <code>doVetoMPIEmission(...)</code>
661will interrupt the MPI machinery immediately after each multiparton
662interaction and allow it to be vetoed.
663
664<a name="method27"></a>
665<p/><strong>virtual bool UserHooks::doVetoMPIEmission( int sizeOld, const Event& event) &nbsp;</strong> <br/>
666can optionally be called, as described above. You can study, but not
667modify, the <code>event</code> event record of the partonic process.
668Based on that you can decide whether to veto the MPI, true, or
669not, false. If you veto, then the latest MPI is removed from
670the event record. In either case the interleaved evolution will
671continue from the point where it was left off.
672<br/><code>argument</code><strong> sizeOld </strong>  :  is the size of the event record before the
673latest MPI was added to it. It will also become the new size if
674the MPI is vetoed.
675 
676<br/><code>argument</code><strong> event </strong>  :  the event record contains a list of all partons
677generated so far. Of special interest are the ones associated with the
678most recent MPI, which are stored in entries from <code>sizeOld</code>
679through <code>event.size() - 1</code> inclusive. If you veto the MPI
680these entries will be removed.
681 
682 
683
684<h3>(v) Modify cross-sections or phase space samling</h3>
685
686This section addresses two related but different topics. In both
687cases the sampling of events in phase space is modified, so that
688some regions are more populated while others are depleted.
689In the first case, this is assumed to be because the physical
690cross section should be modified relative to the built-in Pythia
691form. Therefore not only the relative population of phase space
692is changed, but also the integrated cross section of the process.
693In the second case the repopulation is only to be viewed as a
694technical trick to sample some phase-space regions better, so as
695to reduce the statistical error. There each event instead obtains
696a compensating weight, the inverse of the differential cross section
697reweighting factor, in such a way thet the integrated cross section
698is unchanged. Below these two cases are considered separately, 
699but note that they share many points.
700
701<a name="method28"></a>
702<p/><strong>virtual bool UserHooks::canModifySigma() &nbsp;</strong> <br/>
703In the base class this method returns false. If you redefine it
704to return true then the method <code>multiplySigmaBy(...)</code> will
705allow you to modify the cross section weight assigned to the current
706event.
707 
708
709<a name="method29"></a>
710<p/><strong>virtual double UserHooks::multiplySigmaBy(const SigmaProcess* sigmaProcessPtr, const PhaseSpace* phaseSpacePtr, bool inEvent) &nbsp;</strong> <br/>
711when called this method should provide the factor by which you want to
712see the cross section weight of the current event modified. If you
713return unity then the normal cross section is obtained. Note that, unlike
714the methods above, these modifications do not lead to a difference between
715the number of "selected" events and the number of "accepted" ones,
716since the modifications occur already before the "selected" level.
717The integrated cross section of a process is modified, of course.
718Note that the cross section is only modifiable for normal hard processes.
719It does not affect the cross section in further multiparton interactions,
720nor in elastic/diffractive/minimum-bias events.
721<br/><code>argument</code><strong> sigmaProcessPtr, phaseSpacePtr </strong>  : :
722what makes this routine somewhat tricky to write is that the
723hard-process event has not yet been constructed, so one is restricted
724to use the information available in the phase-space and cross-section
725objects currently being accessed. Which of their  methods are applicable
726depends on the process, in particular the number of final-state particles.
727The <code>multiplySigmaBy</code> code in <code>UserHooks.cc</code>
728contains explicit instructions about which methods provide meaningful
729information, and so offers a convenient starting point.
730 
731<br/><code>argument</code><strong> inEvent </strong>  : : this flag is true when the method is
732called from within the event-generation machinery and false
733when it is called at the initialization stage of the run, when the
734cross section is explored to find a maximum for later Monte Carlo usage.
735Cross-section modifications should be independent of this flag,
736for consistency, but if <code> multiplySigmaBy(...)</code> is used to
737collect statistics on the original kinematics distributions before cuts,
738then it is important to be able to exclude the initialization stage
739from comparisons.
740 
741 
742
743<p/>
744One derived class is supplied as an example how this facility can be used
745to reweight cross sections in the same spirit as is done with QCD cross
746sections for the minimum-bias/underlying-event description:
747
748<p/><code>class&nbsp; </code><strong> SuppressSmallPT : public UserHooks &nbsp;</strong> <br/>
749suppress small-<i>pT</i> production for <i>2 -> 2</i> processes
750only, while leaving other processes unaffected. The basic suppression
751factor is <i>pT^4 / ((k*pT0)^2 + pT^2)^2</i>, where <i>pT</i>
752refers to the current hard subprocess and <i>pT0</i> is the same
753energy-dependent dampening scale as used for
754<?php $filepath = $_GET["filepath"];
755echo "<a href='MultipartonInteractions.php?filepath=".$filepath."' target='page'>";?>multiparton interactions</a>.
756This class contains <code>canModifySigma()</code> and
757<code>multiplySigmaBy()</code> methods that overload the base class ones.
758
759<a name="method30"></a>
760<p/><strong>SuppressSmallPT::SuppressSmallPT( double pT0timesMPI = 1., int numberAlphaS = 0, bool useSameAlphaSasMPI = true) &nbsp;</strong> <br/>
761 The optional arguments of the constructor provides further variability.
762<br/><code>argument</code><strong> pT0timesMPI </strong>  : 
763corresponds to the additional factor <i>k</i> in the above formula.
764It is by default equal to 1 but can be used to explore deviations from
765the expected value.
766 
767<br/><code>argument</code><strong> numberAlphaS </strong>  :   
768if this number <i>n</i> is bigger than the default 0, the
769corresponding number of <i>alpha_strong</i> factors is also
770reweighted from the normal renormalization scale to a modified one,
771i.e. a further suppression factor
772<i>( alpha_s((k*pT0)^2 + Q^2_ren) / alpha_s(Q^2_ren) )^n</i>
773is introduced.
774 
775<br/><code>argument</code><strong> useSameAlphaSasMPI </strong>  : 
776regulates which kind of new <i>alpha_strong</i> value is evaluated
777for the numerator in the above expression. It is by default the same
778as set for multiparton interactions (i.e. same starting value at
779<i>M_Z</i> and same order of running), but if <code>false</code>
780instead the one for hard subprocesses. The denominator
781<i>alpha_s(Q^2_ren)</i> is always the value used for the "original",
782unweighted cross section.
783 
784 
785
786<p/>
787The second main case of the current section involves three methods,
788as follows.
789
790<a name="method31"></a>
791<p/><strong>virtual bool UserHooks::canBiasSelection() &nbsp;</strong> <br/>
792In the base class this method returns false. If you redefine it
793to return true then the method <code>biasSelectionBy(...)</code> will
794allow you to modify the phase space sampling, with a compensating
795event weight, such that the cross section is unchanged. You cannot
796combine this kind of reweighting with the selection of
797<?php $filepath = $_GET["filepath"];
798echo "<a href='ASecondHardProcess.php?filepath=".$filepath."' target='page'>";?>a second hard process</a>.
799 
800
801<a name="method32"></a>
802<p/><strong>virtual double UserHooks::biasSelectionBy(const SigmaProcess* sigmaProcessPtr, const PhaseSpace* phaseSpacePtr, bool inEvent) &nbsp;</strong> <br/>
803when called this method should provide the factor by which you want to
804see the phase space sampling of the current event modified. Events are
805assigned a weight being the inverse of this, such that the integrated
806cross section of a process is unchanged. Note that the selection
807is only modifiable for normal hard processes. It does not affect the
808selection in further multiparton interactions, nor in
809elastic/diffractive/minimum-bias events.
810<br/><code>argument</code><strong> sigmaProcessPtr, phaseSpacePtr </strong>  : :
811what makes this routine somewhat tricky to write is that the
812hard-process event has not yet been constructed, so one is restricted
813to use the information available in the phase-space and cross-section
814objects currently being accessed. Which of their  methods are applicable
815depends on the process, in particular the number of final-state particles.
816The <code>biasSelectionBy</code> code in <code>UserHooks.cc</code>
817contains explicit instructions about which methods provide meaningful
818information, and so offers a convenient starting point.
819 
820<br/><code>argument</code><strong> inEvent </strong>  : : this flag is true when the method is
821called from within the event-generation machinery and false
822when it is called at the initialization stage of the run, when the
823cross section is explored to find a maximum for later Monte Carlo usage.
824Cross-section modifications should be independent of this flag,
825for consistency, but if <code>biasSelectionBy(...)</code> is used to
826collect statistics on the original kinematics distributions before cuts,
827then it is important to be able to exclude the initialization stage
828from comparisons.
829 
830 
831
832<a name="method33"></a>
833<p/><strong>virtual double UserHooks::biasedSelectionWeight() &nbsp;</strong> <br/>
834Returns the weight you should assign to the event, to use e.g. when
835you histogram results. It is the exact inverse of the weight you
836used to modify the phase-space sampling, a weight that must be stored
837in the <code>selBias</code> member variable, such that this routine
838can return <code>1/selBias</code>. The weight is also returned by the
839<code>Info::weight()</code> method, which may be more convenient to use.
840 
841
842<h3>(vi) Reject the decay sequence of resonances</h3>
843
844Resonance decays are performed already at the process level, as
845an integrated second step of the hard process itself. One reason is
846that the matrix element of many processes encode nontrivial decay
847angular distributions. Another is to have equivalence with Les Houches
848input, where resonance decays typically are provided from the onset.
849The methods in this section allow you to veto that decay sequence and
850try a new one. Unlike the veto of the whole process-level step,
851in point (i), the first step of the hard process is retained, i.e.
852where the resonances are produced. For this reason the cross section
853is not affected here but, depending on context, you may want to introduce
854your own counters to check how often a new set of decay modes and
855kinematics is selected, and correct accordingly.
856
857<p/>The main method below is applied after all decays. For the production
858of a <i>t tbar</i> pair this typically means after four decays,
859namely those of the <i>t</i>, the <i>tbar</i>, the <i>W+</i>
860and the <i>W-</i>. If Les Houches events are processed, the rollback
861is to the level of the originally read events. For top, that might mean
862either to the tops, or to the <i>W</i> bosons, or no rollback at all,
863depending on how the process generation was set up.
864
865<a name="method34"></a>
866<p/><strong>virtual bool UserHooks::canVetoResonanceDecays() &nbsp;</strong> <br/>
867In the base class this method returns false. If you redefine it
868to return true then the method <code>doVetoResonanceDecays(...)</code>
869will be called immediately after the resonance decays have been
870selected and stored in the <code>process</code> event record,
871as described above for <code>canVetoProcessLevel()</code>.
872 
873
874<a name="method35"></a>
875<p/><strong>virtual bool UserHooks::doVetoResonanceDecays(Event& process) &nbsp;</strong> <br/>
876can optionally be called, as described above. You can study the
877<code>process</code> event record of the hard process.
878Based on that you can decide whether to reject the sequence of
879resonance decays that was not already fixed by the production step
880of the hard process (which can vary depending on how a process has
881been set up, see above). If you veto, then a new resonance decay
882sequence is selected, but the production step remains unchanged.
883The cross section remains unaffected by this veto, for better or worse.
884<br/><b>Warning:</b> Normally you should not modify the <code>process</code>
885event record. However, as an extreme measure, parts or the complete decay
886chain could be overwritten. If so, be very careful. 
887 
888 
889<h3>(vii) Modify scale in shower evolution</h3>
890
891The choice of maximum shower scale in resonance decays is normally not a
892big issue, since the shower here is expected to cover the full phase
893space. In some special cases a matching scheme is intended, where hard
894radiation is covered by matrix elements, and only softer by showers. The
895below two methods support such an approach. Note that the two methods
896are not used in the <code>TimeShower</code> class itself, but when
897showers are called from the <code>PartonLevel</code> generation. Thus
898user calls directly to <code>TimeShower</code> are not affected.
899
900<a name="method36"></a>
901<p/><strong>virtual bool UserHooks::canSetResonanceScale() &nbsp;</strong> <br/>
902In the base class this method returns false. If you redefine it
903to return true then the method <code>scaleResonance(...)</code>
904will set the initial scale of downwards shower evolution.
905
906<a name="method37"></a>
907<p/><strong>virtual double UserHooks::scaleResonance( int iRes, const Event& event) &nbsp;</strong> <br/>
908can optionally be called, as described above. You should return the maximum
909scale, in GeV, from which the shower evolution will begin. The base class
910method returns 0, i.e. gives no shower evolution at all.
911You can study, but not modify, the <code>event</code> event record
912of the partonic process to check which resonance is decaying, and into what.
913<br/><code>argument</code><strong> iRes </strong>  :  is the location in the event record of the
914resonance that decayed to the particles that now will shower.
915 
916<br/><code>argument</code><strong> event </strong>  :  the event record contains a list of all partons
917generated so far, specifically the decaying resonance and its immediate
918decay products.
919 
920 
921
922</body>
923</html>
924
925<!-- Copyright (C) 2012 Torbjorn Sjostrand -->
Note: See TracBrowser for help on using the repository browser.