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