]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PYTHIA8/pythia8145/xmldoc/EventAnalysis.xml
Use Output directive instead of the old OutputFile and OUtputArchive. Save fileinfo...
[u/mrichter/AliRoot.git] / PYTHIA8 / pythia8145 / xmldoc / EventAnalysis.xml
CommitLineData
9419eeef 1<chapter name="Event Analysis">
2
3<h2>Event Analysis</h2>
4
5<h3>Introduction</h3>
6
7The routines in this section are intended to be used to analyze
8event properties. As such they are not part of the main event
9generation chain, but can be used in comparisons between Monte
10Carlo events and real data. They are rather free-standing, but
11assume that input is provided in the PYTHIA 8
12<code>Event</code> format, and use a few basic facilities such
13as four-vectors.
14
15<p/>
16In addition to the methods presented here, there is also the
17possibility to make use of <aloc href="JetFinders">external
18jet finders </aloc>.
19
20<h3>Sphericity</h3>
21
22The standard sphericity tensor is
23<eq>
24 S^{ab} = (sum_i p_i^a p_i^b) / (sum_i p_i^2)
25</eq>
26where the <ei>sum i</ei> runs over the particles in the event,
27<ei>a, b = x, y, z,</ei> and <ei>p</ei> without such an index is
28the absolute size of the three-momentum . This tensor can be
29diagonalized to find eigenvalues and eigenvectors.
30
31<p/>
32The above tensor can be generalized by introducing a power
33<ei>r</ei>, such that
34<eq>
35 S^{ab} = (sum_i p_i^a p_i^b p_i^{r-2}) / (sum_i p_i^r)
36</eq>
37In particular, <ei>r = 1</ei> gives a linear dependence on momenta
38and thus a collinear safe definition, unlike sphericity.
39
40<p/>
41To do sphericity analyses you have to set up a <code>Sphericity</code>
42instance, and then feed in events to it, one at a time. The results
43for the latest event are available as output from a few methods.
44
45<method name="Sphericity::Sphericity(double power = 2., int select = 2)">
46create a sphericity analysis object, where
47<argument name="power" default="2.">
48is the power <ei>r</ei> defined above, i.e.
49<argoption value="2.">gives Spericity, and</argoption>
50<argoption value="1.">gives the linear form.</argoption>
51</argument>
52<argument name="select" default="2">
53tells which particles are analyzed,
54<argoption value="1">all final-state particles,</argoption>
55<argoption value="2">all observable final-state particles,
56i.e. excluding neutrinos and other particles without strong or
57electromagnetic interactions (the <code>isVisible()</code>
58particle method), and
59</argoption>
60<argoption value="3">only charged final-state particles.</argoption>
61</argument>
62</method>
63
64<method name="bool Sphericity::analyze( const Event& event,
65ostream& os = cout)">
66perform a sphericity analysis, where
67<argument name="event">is an object of the <code>Event</code> class,
68most likely the <code>pythia.event</code> one.
69</argument>
70<argument name="os" default="cout"> is the output stream for
71error messages. (The method does not rely on the <code>Info</code>
72mchinery for error messages.)
73</argument>
74<br/>If the routine returns <code>false</code> the
75analysis failed, e.g. if too few particles are present to analyze.
76</method>
77
78<p/>
79After the analysis has been performed, a few methods are available
80to return the result of the analysis of the latest event:
81
82<method name="double Sphericity::sphericity()">
83gives the sphericity (or equivalent if <ei>r</ei> is not 2),
84</method>
85
86<method name="double Sphericity::aplanarity()">
87gives the aplanarity (with the same comment),
88</method>
89
90<method name="double Sphericity::eigenValue(int i)">
91gives one of the three eigenvalues for <ei>i</ei> = 1, 2 or 3, in
92descending order,
93</method>
94
95<method name="Vec4 Sphericity::eventAxis(i)">
96gives the matching normalized eigenvector, as a <code>Vec4</code>
97with vanishing time/energy component.
98</method>
99
100<method name="void Sphericity::list(ostream& os = cout)">
101provides a listing of the above information.
102</method>
103
104<p/>
105There is also one method that returns information accumulated for all
106the events analyzed so far.
107
108<method name="int Sphericity::nError()">
109tells the number of times <code>analyze(...)</code> failed to analyze
110events, i.e. returned <code>false</code>.
111</method>
112
113<h3>Thrust</h3>
114
115Thrust is obtained by varying the thrust axis so that the longitudinal
116momentum component projected onto it is maximized, and thrust itself is
117then defined as the sum of absolute longitudinal momenta divided by
118the sum of absolute momenta. The major axis is found correspondingly
119in the plane transverse to thrust, and the minor one is then defined
120to be transverse to both. Oblateness is the difference between the major
121and the minor values.
122
123<p/>
124The calculation of thrust is more computer-time-intensive than e.g.
125linear sphericity, introduced above, and has no specific advantages except
126historical precedent. In the PYTHIA 6 implementation the search was
127speeded up at the price of then not being guaranteed to hit the absolute
128maximum. The current implementation studies all possibilities, but at
129the price of being slower, with time consumption for an event with
130<ei>n</ei> particles growing like <ei>n^3</ei>.
131
132<p/>
133To do thrust analyses you have to set up a <code>Thrust</code>
134instance, and then feed in events to it, one at a time. The results
135for the latest event are available as output from a few methods.
136
137<method name="Thrust::Thrust(int select = 2)">
138create a thrust analysis object, where
139<argument name="select" default="2">
140tells which particles are analyzed,
141<argoption value="1">all final-state particles,</argoption>
142<argoption value="2">all observable final-state particles,
143i.e. excluding neutrinos and other particles without strong or
144electromagnetic interactions (the <code>isVisible()</code>
145particle method), and
146</argoption>
147<argoption value="3">only charged final-state particles.</argoption>
148</argument>
149</method>
150
151<method name="bool Thrust::analyze( const Event& event,
152ostream& os = cout)">
153perform a thrust analysis, where
154<argument name="event">is an object of the <code>Event</code> class,
155most likely the <code>pythia.event</code> one.
156</argument>
157<argument name="os" default="cout"> is the output stream for
158error messages. (The method does not rely on the <code>Info</code>
159mchinery for error messages.)
160</argument>
161<br/>If the routine returns <code>false</code> the
162analysis failed, e.g. if too few particles are present to analyze.
163</method>
164
165<p/>
166After the analysis has been performed, a few methods are available
167to return the result of the analysis of the latest event:
168
169<method name="double Thrust::thrust()">
170</method>
171<methodmore name="double Thrust::tMajor()">
172</methodmore>
173<methodmore name="double Thrust::tMinor()">
174</methodmore>
175<methodmore name="double Thrust::oblateness()">
176gives the thrust, major, minor and oblateness values, respectively,
177</methodmore>
178
179<method name="Vec4 Thrust::eventAxis(int i)">
180gives the matching normalized event-axis vectors, for <ei>i</ei> = 1, 2 or 3
181corresponding to thrust, major or minor, as a <code>Vec4</code> with
182vanishing time/energy component.
183</method>
184
185<method name="void Thrust::list(ostream& os = cout)">
186provides a listing of the above information.
187</method>
188
189<p/>
190There is also one method that returns information accumulated for all
191the events analyzed so far.
192
193<method name="int Thrust::nError()">
194tells the number of times <code>analyze(...)</code> failed to analyze
195events, i.e. returned <code>false</code>.
196</method>
197
198<h3>ClusterJet</h3>
199
200<code>ClusterJet</code> (a.k.a. <code>LUCLUS</code> and
201<code>PYCLUS</code>) is a clustering algorithm of the type used for
202analyses of <ei>e^+e^-</ei> events, see the PYTHIA 6 manual. All
203visible particles in the events are clustered into jets. A few options
204are available for some well-known distance measures. Cutoff
205distances can either be given in terms of a scaled quadratic quantity
206like <ei>y = pT^2/E^2</ei> or an unscaled linear one like <ei>pT</ei>.
207
208<p/>
209To do jet finding analyses you have to set up a <code>ClusterJet</code>
210instance, and then feed in events to it, one at a time. The results
211for the latest event are available as output from a few methods.
212
213<method name="ClusterJet::ClusterJet(string measure = &quot;Lund&quot;,
214int select = 2, int massSet = 2, bool precluster = false,
215bool reassign = false)">
216create a <code>ClusterJet</code> instance, where
217<argument name="measure" default="&quot;Lund&quot;">distance measure,
218to be provided as a character string (actually, only the first character
219is necessary)
220<argoption value="&quot;Lund&quot;">the Lund <ei>pT</ei> distance,
221</argoption>
222<argoption value="&quot;JADE&quot;">the JADE mass distance, and
223</argoption>
224<argoption value="&quot;Durham&quot;">the Durham <ei>kT</ei> measure.
225</argoption>
226</argument>
227<argument name="select" default="2">
228tells which particles are analyzed,
229<argoption value="1">all final-state particles,</argoption>
230<argoption value="2">all observable final-state particles,
231i.e. excluding neutrinos and other particles without strong or
232electromagnetic interactions (the <code>isVisible()</code> particle
233method), and
234</argoption>
235<argoption value="3">only charged final-state particles.</argoption>
236</argument>
237<argument name="massSet" default="2">masses assumed for the particles
238used in the analysis
239<argoption value="0">all massless,</argoption>
240<argoption value="1">photons are massless while all others are
241assigned the <ei>pi+-</ei> mass, and
242</argoption>
243<argoption value="2">all given their correct masses.</argoption>
244</argument>
245<argument name="precluster" default="false">
246perform or not a early preclustering step, where nearby particles
247are lumped together so as to speed up the subsequent normal clustering.
248</argument>
249<argument name="reassign" default="false">
250reassign all particles to the nearest jet each time after two jets
251have been joined.
252</argument>
253</method>
254
255<method name="ClusterJet::analyze( const Event& event, double yScale,
256double pTscale, int nJetMin = 1, int nJetMax = 0, ostream& os = cout)">
257performs a jet finding analysis, where
258<argument name="event">is an object of the <code>Event</code> class,
259most likely the <code>pythia.event</code> one.
260</argument>
261<argument name="yScale">
262is the cutoff joining scale, below which jets are joined. Is given
263in quadratic dimensionless quantities. Either <code>yScale</code>
264or <code>pTscale</code> must be set nonvanishing, and the larger of
265the two dictates the actual value.
266</argument>
267<argument name="pTscale">
268is the cutoff joining scale, below which jets are joined. Is given
269in linear quantities, such as <ei>pT</ei> or <ei>m</ei> depending on
270the measure used, but always in units of GeV. Either <code>yScale</code>
271or <code>pTscale</code> must be set nonvanishing, and the larger of
272the two dictates the actual value.
273</argument>
274<argument name="nJetMin" default="1">
275the minimum number of jets to be reconstructed. If used, it can override
276the <code>yScale</code> and <code>pTscale</code> values.
277</argument>
278<argument name="nJetMax" default="0">
279the maximum number of jets to be reconstructed. Is not used if below
280<code>nJetMin</code>. If used, it can override the <code>yScale</code>
281and <code>pTscale</code> values. Thus e.g.
282<code>nJetMin = nJetMax = 3</code> can be used to reconstruct exactly
2833 jets.
284</argument>
285<argument name="os" default="cout"> is the output stream for
286error messages. (The method does not rely on the <code>Info</code>
287mchinery for error messages.)
288</argument>
289<br/>If the routine returns <code>false</code> the analysis failed,
290e.g. because the number of particles was smaller than the minimum number
291of jets requested.
292</method>
293
294<p/>
295After the analysis has been performed, a few <code>ClusterJet</code>
296class methods are available to return the result of the analysis:
297
298<method name="int ClusterJet::size()">
299gives the number of jets found, with jets numbered 0 through
300<code>size() - 1</code>,
301</method>
302
303<method name="Vec4 ClusterJet::p(int i)">
304gives a <code>Vec4</code> corresponding to the four-momentum defined by
305the sum of all the contributing particles to the <ei>i</ei>'th jet,
306</method>
307
308<method name="int ClusterJet::jetAssignment(int i)">
309gives the index of the jet that the particle <ei>i</ei> of the event
310record belongs to,
311</method>
312
313<method name="void ClusterJet::list(ostream& os = cout)">
314provides a listing of the reconstructed jets.
315</method>
316
317<method name="int ClusterJet::distanceSize()">
318the number of most recent clustering scales that have been stored
319for readout with the next method. Normally this would be five,
320but less if fewer clustering steps occured.
321</method>
322
323<method name="double ClusterJet::distance(int i)">
324clustering scales, with <code>distance(0)</code> being the most
325recent one, i.e. normally the highest, up to <code>distance(4)</code>
326being the fifth most recent. That is, with <ei>n</ei> being the final
327number of jets, <code>ClusterJet::size()</code>, the scales at which
328<ei>n+1</ei> jets become <ei>n</ei>, <ei>n+2</ei> become <ei>n+1</ei>,
329and so on till <ei>n+5</ei> become <ei>n+4</ei>. Nonexisting clustering
330scales are returned as zero. The physical interpretation of a scale is
331as provided by the respective distance measure (Lund, JADE, Durham).
332</method>
333
334<p/>
335There is also one method that returns information accumulated for all
336the events analyzed so far.
337
338<method name="int ClusterJet::nError()">
339tells the number of times <code>analyze(...)</code> failed to analyze
340events, i.e. returned <code>false</code>.
341</method>
342
343<h3>CellJet</h3>
344
345<code>CellJet</code> (a.k.a. <code>PYCELL</code>) is a simple cone jet
346finder in the UA1 spirit, see the PYTHIA 6 manual. It works in an
347<ei>(eta, phi, eT)</ei> space, where <ei>eta</ei> is pseudorapidity,
348<ei>phi</ei> azimuthal angle and <ei>eT</ei> transverse energy.
349It will draw cones in <ei>R = sqrt(Delta-eta^2 + Delta-phi^2)</ei>
350around seed cells. If the total <ei>eT</ei> inside the cone exceeds
351the threshold, a jet is formed, and the cells are removed from further
352analysis. There are no split or merge procedures, so later-found jets
353may be missing some of the edge regions already used up by previous
354ones. Not all particles in the event are assigned to jets; leftovers
355may be viewed as belonging to beam remnants or the underlying event.
356It is not used by any experimental collaboration, but is closely
357related to the more recent and better theoretically motivated
358anti-<ei>kT</ei> algorithm <ref>Cac08</ref>.
359
360<p/>
361To do jet finding analyses you have to set up a <code>CellJet</code>
362instance, and then feed in events to it, one at a time. Especially note
363that, if you want to use the options where energies are smeared in
364order so emulate detector imperfections, you must hand in an external
365random number generator, preferably the one residing in the
366<code>Pythia</code> class. The results for the latest event are
367available as output from a few methods.
368
369<method name="CellJet::CellJet(double etaMax = 5., int nEta = 50,
370int nPhi = 32, int select = 2, int smear = 0, double resolution = 0.5,
371double upperCut = 2., double threshold = 0., Rndm* rndmPtr = 0)">
372create a <code>CellJet</code> instance, where
373<argument name="etaMax" default="5.">
374the maximum +-pseudorapidity that the detector is assumed to cover.
375</argument>
376<argument name="nEta" default="50">
377the number of equal-sized bins that the <ei>+-etaMax</ei> range
378is assumed to be divided into.
379</argument>
380<argument name="nPhi" default="32">
381the number of equal-sized bins that the <ei>phi</ei> range
382<ei>+-pi</ei> is assumed to be divided into.
383</argument>
384<argument name="select" default="2">
385tells which particles are analyzed,
386<argoption value="1">all final-state particles,</argoption>
387<argoption value="2">all observable final-state particles,
388i.e. excluding neutrinos and other particles without strong or
389electromagnetic interactions (the <code>isVisible()</code> particle
390method),
391and</argoption>
392<argoption value="3">only charged final-state particles.</argoption>
393</argument>
394<argument name="smear" default="0">
395strategy to smear the actual <ei>eT</ei> bin by bin,
396<argoption value="0">no smearing,</argoption>
397<argoption value="1">smear the <ei>eT</ei> according to a Gaussian
398with width <ei>resolution * sqrt(eT)</ei>, with the Gaussian truncated
399at 0 and <ei>upperCut * eT</ei>,</argoption>
400<argoption value="2">smear the <ei>e = eT * cosh(eta)</ei> according
401to a Gaussian with width <ei>resolution * sqrt(e)</ei>, with the
402Gaussian truncated at 0 and <ei>upperCut * e</ei>.</argoption>
403</argument>
404<argument name="resolution" default="0.5">
405see above.
406</argument>
407<argument name="upperCut" default="2.">
408see above.
409</argument>
410<argument name="threshold" default="0 GeV">
411completely neglect all bins with an <ei>eT &lt; threshold</ei>.
412</argument>
413<argument name="rndmPtr" default="0">
414the random-number generator used to select the smearing described
415above. Must be handed in for smearing to be possible. If your
416<code>Pythia</code> class instance is named <code>pythia</code>,
417then <code>&pythia.rndm</code> would be the logical choice.
418</argument>
419</class>
420
421<method name="bool CellJet::analyze( const Event& event,
422double eTjetMin = 20., double coneRadius = 0.7, double eTseed = 1.5,
423ostream& os = cout)">
424performs a jet finding analysis, where
425<argument name="event">is an object of the <code>Event</code> class,
426most likely the <code>pythia.event</code> one.
427</argument>
428<argument name="eTjetMin" default="20. GeV">
429is the minimum transverse energy inside a cone for this to be
430accepted as a jet.
431</argument>
432<argument name="coneRadius" default="0.7">
433 is the size of the cone in <ei>(eta, phi)</ei> space drawn around
434the geometric center of the jet.
435</argument>
436<argument name="eTseed" default="1.5 GeV">
437the mimimum <ei>eT</ei> in a cell for this to be acceptable as
438the trial center of a jet.
439</argument>
440<argument name="os" default="cout"> is the output stream for
441error messages. (The method does not rely on the <code>Info</code>
442mchinery for error messages.)
443</argument>
444<br/>If the routine returns <code>false</code> the analysis failed,
445but currently this is not foreseen ever to happen.
446</method>
447
448<p/>
449After the analysis has been performed, a few <code>CellJet</code>
450class methods are available to return the result of the analysis:
451
452<method name="int CellJet::size()">
453gives the number of jets found, with jets numbered 0 through
454<code>size() - 1</code>,
455</method>
456
457<method name="double CellJet::eT(i)">
458gives the <ei>eT</ei> of the <ei>i</ei>'th jet, where jets have been
459ordered with decreasing <ei>eT</ei> values,
460</method>
461
462<method name="double CellJet::etaCenter(int i)">
463</method>
464<methodmore name="double CellJet::phiCenter(int i)">
465gives the <ei>eta</ei> and <ei>phi</ei> coordinates of the geometrical
466center of the <ei>i</ei>'th jet,
467</methodmore>
468
469<method name="double CellJet::etaWeighted(int i)">
470</method>
471<methodmore name="double CellJet::phiWeighted(int i)">
472gives the <ei>eta</ei> and <ei>phi</ei> coordinates of the
473<ei>eT</ei>-weighted center of the <ei>i</ei>'th jet,
474</methodmore>
475
476<method name="int CellJet::multiplicity(int i)">
477gives the number of particles clustered into the <ei>i</ei>'th jet,
478</method>
479
480<method name="Vec4 CellJet::pMassless(int i)">
481gives a <code>Vec4</code> corresponding to the four-momentum defined
482by the <ei>eT</ei> and the weighted center of the <ei>i</ei>'th jet,
483</method>
484
485<method name="Vec4 CellJet::pMassive(int i)">
486gives a <code>Vec4</code> corresponding to the four-momentum defined by
487the sum of all the contributing cells to the <ei>i</ei>'th jet, where
488each cell contributes a four-momentum as if all the <ei>eT</ei> is
489deposited in the center of the cell,
490</method>
491
492<method name="double CellJet::m(int i)">
493gives the invariant mass of the <ei>i</ei>'th jet, defined by the
494<code>pMassive</code> above,
495</method>
496
497<method name="void CellJet::list()">
498provides a listing of the above information (except <code>pMassless</code>,
499for reasons of space).
500</method>
501
502<p/>
503There is also one method that returns information accumulated for all
504the events analyzed so far.
505<method name="int CellJet::nError()">
506tells the number of times <code>analyze(...)</code> failed to analyze
507events, i.e. returned <code>false</code>.
508</method>
509
510</chapter>
511
512<!-- Copyright (C) 2010 Torbjorn Sjostrand -->