~ubuntu-branches/ubuntu/trusty/pythia8/trusty-proposed

« back to all changes in this revision

Viewing changes to htmldoc/HepMCInterface.html

  • Committer: Package Import Robot
  • Author(s): Lifeng Sun
  • Date: 2012-05-22 11:43:00 UTC
  • Revision ID: package-import@ubuntu.com-20120522114300-0jvsv2vl4o2bo435
Tags: upstream-8.1.65
ImportĀ upstreamĀ versionĀ 8.1.65

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html>
 
2
<head>
 
3
<title>HepMC Interface</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>HepMC Interface</h2>
 
10
 
 
11
An interface to the HepMC [<a href="Bibliography.html" target="page">Dob01</a>] standard event record 
 
12
format has been provided by M. Kirsanov. To use it, the relevant 
 
13
libraries need to be linked, as explained in the <code>README</code> 
 
14
file. Only version 2 of HepMC is supported. (Version 1 requires 
 
15
a different interface structure, which was only supported up until 
 
16
Pythia 8.107.) 
 
17
 
 
18
<p/>
 
19
The (simple) procedure to translate PYTHIA 8 events into HepMC ones 
 
20
is illustrated in the <code>main41.cc</code>, <code>main42.cc</code>
 
21
<code>main61.cc</code> and <code>main62.cc</code>   
 
22
main programs. At the core is a call to the
 
23
<pre>
 
24
HepMC::I_Pythia8::fill_next_event( pythia, hepmcevt, ievnum = -1, convertGluonTo0 = false ) 
 
25
</pre>
 
26
which takes a reference of the generator object and uses it, on the one
 
27
hand, to read out and covert the event record in <code>pythia.event</code> 
 
28
and, on the other hand, to extract and store parton-density (PDF) 
 
29
information for the hard subprocess from <code>pythia.info</code>. 
 
30
The optional last argument, if <code>true</code>, allows you to store 
 
31
gluons as "PDG" code 0 rather than the normal 21; this only applies to 
 
32
the PDF information, not the event record. 
 
33
 
 
34
<p/>
 
35
The earlier version of this routine,
 
36
<pre>
 
37
HepMC::I_Pythia8::fill_next_event( pythia.event, hepmcevt, ievnum = -1 ) 
 
38
</pre>
 
39
is retained (for now) for backwards compatibility. It takes a PYTHIA event 
 
40
as input and returns a HepMC one, but without storing the PDF information. 
 
41
The latter could then instead be stored by a separate call
 
42
<pre>
 
43
HepMC::I_Pythia8::pdf_put_info( hepmcevt, pythia, convertGluonTo0 = false ) 
 
44
</pre>
 
45
or not, as wished.
 
46
 
 
47
<p/>
 
48
The translation routine stores momenta, energies and masses in units 
 
49
of GeV, and distances and times in units of mm, with <i>c = 1</i>,
 
50
exactly as used in PYTHIA. This only works seamlessly for HepMC 2.04
 
51
or later, where the choice of units can (and should) be specified in 
 
52
the <code>HepMC::GenEvent</code> call. To work also with older HepMC
 
53
versions, where normally momenta are stored in MeV, the 
 
54
<code>HEPMC_HAS_UNITS</code> environment variable is tested. If not 
 
55
defined, i.e. if with an earlier HepMC version, conversion from 
 
56
GeV to MeV is done in <code>fill_next_event</code>.
 
57
 
 
58
<p/>
 
59
The status code is now based on the proposed standard for HepMC 2.05,
 
60
see the <a href="EventRecord.html" target="page">Event::statusHepMC(...)</a> 
 
61
conversion routine for details. The earlier behaviour, where all
 
62
final particles had status 1 and all initial or intermediate ones 
 
63
status 2, is available as a commented-out line in the   
 
64
<code>I_Pythia8::fill_next_event(...)</code> method, and so is simple
 
65
to recover.
 
66
 
 
67
<p/>
 
68
In HepMC 2.05 it also becomes possible to store the generated cross 
 
69
section and its error. The environment variable
 
70
<code>HEPMC_HAS_CROSS_SECTION</code> is used to check whether this
 
71
possibility exists and, if it does the current values from 
 
72
<code>pythia.info.sigmaGen()</code> and 
 
73
<code>pythia.info.sigmaErr()</code> are stored for each event,
 
74
multiplied by <i>10^9</i> to convert from mb to pb. Note that
 
75
PYTHIA improves it accuracy by Monte Carlo integration in the course
 
76
of the run, so the values associated with the last generated event
 
77
should be the most accurate ones. (If events also come with a dimensional 
 
78
weight, like in some Les Houches strategies, conversion from mb to fb 
 
79
for that weight must be set by hand, see the last method below.)
 
80
 
 
81
<h2>The public methods</h2>
 
82
 
 
83
Here comes a complete list of all public methods of the 
 
84
<code>I_Pythia8</code> class in the <code>HepMC</code> 
 
85
(<i>not</i> <code>Pythia8</code>!) namespace.
 
86
 
 
87
<a name="method1"></a>
 
88
<p/><strong>I_Pythia8::I_Pythia8() &nbsp;</strong> <br/>
 
89
  
 
90
<strong>virtual I_Pythia8::~I_Pythia8() &nbsp;</strong> <br/>
 
91
the constructor and destructor take no arguments.
 
92
  
 
93
 
 
94
<a name="method2"></a>
 
95
<p/><strong>bool I_Pythia8::fill_next_event( Pythia8::Pythia& pythia, GenEvent* evt, int ievnum = -1, bool convertGluonTo0 = false) &nbsp;</strong> <br/>
 
96
convert a <code>Pythia</code> event to a <code>HepMC</code> one.
 
97
Will return true if succeeded.
 
98
<br/><code>argument</code><strong> pythia </strong>  : 
 
99
the input <code>Pythia</code> generator object, from which both the 
 
100
event and the parton density information can be obtained.
 
101
   
 
102
<br/><code>argument</code><strong> evt </strong>  : 
 
103
the output <code>GenEvt</code> event, in its standard form.
 
104
   
 
105
<br/><code>argument</code><strong> iev </strong>  : 
 
106
set the event number of the current event. If negative then the 
 
107
internal event number is used, which is incremented by one for
 
108
each new event.
 
109
  
 
110
<br/><code>argument</code><strong> convertGluonTo0 </strong>  : 
 
111
the normal gluon identity code 21 is used also when parton density
 
112
information is stored, unless this optional argument is set true to
 
113
have gluons represented by a 0. This choice does not affect the 
 
114
normal event record, where a gluon is always 21. 
 
115
  
 
116
  
 
117
 
 
118
<a name="method3"></a>
 
119
<p/><strong>bool I_Pythia8::fill_next_event( Pythia8::Event& pyev, GenEvent* evt, int ievnum = -1 ) &nbsp;</strong> <br/>
 
120
convert a <code>Pythia</code> event to a <code>HepMC</code> one.
 
121
Will return true if succeeded. Do not store parton-density information.
 
122
<br/><code>argument</code><strong> pyev </strong>  : 
 
123
the input <code>Pythia</code> event, in its standard form.
 
124
   
 
125
<br/><code>argument</code><strong> evt </strong>  : 
 
126
the output <code>GenEvt</code> event, in its standard form.
 
127
   
 
128
<br/><code>argument</code><strong> iev </strong>  : 
 
129
set the event number of the current event. If negative then the 
 
130
internal event number is used, which is incremented by one for
 
131
each new event.
 
132
  
 
133
  
 
134
 
 
135
<a name="method4"></a>
 
136
<p/><strong>bool I_Pythia8::put_pdf_info( GenEvent* evt, Pythia8::Pythia& pythia, bool convertGluonTo0 = false ) &nbsp;</strong> <br/>
 
137
append parton-density information to an event already stored
 
138
by the previous method.
 
139
<br/><code>argument</code><strong> evt </strong>  : 
 
140
the output <code>GenEvt</code> event record, in its standard form.
 
141
   
 
142
<br/><code>argument</code><strong> pythia </strong>  : 
 
143
the input <code>Pythia</code> generator object, from which both the 
 
144
event and the parton density information can be obtained.
 
145
   
 
146
<br/><code>argument</code><strong> convertGluonTo0 </strong>  : 
 
147
the normal gluon identity code 21 is used also when parton density
 
148
information is stored, unless this optional argument is set true to
 
149
have gluons represented by a 0. 
 
150
  
 
151
  
 
152
 
 
153
<p/>
 
154
The following methods can be used to set, and in some cases interrogate,
 
155
the status of some switches that can be used to modify the behaviour
 
156
of the conversion routine. The <code>set</code> methods have the 
 
157
same default input values as the internal initialization ones, so
 
158
that a call without an argument (re)stores the default.
 
159
 
 
160
<a name="method5"></a>
 
161
<p/><strong>void I_Pythia8::set_trust_mothers_before_daughters( bool b = true ) &nbsp;</strong> <br/>
 
162
  
 
163
<strong>bool I_Pythia8::trust_mothers_before_daughters() &nbsp;</strong> <br/>
 
164
if there is a conflict in the history information, then trust the 
 
165
information on mothers above that on daughters. Currently this is
 
166
the only option implemented. 
 
167
  
 
168
 
 
169
<a name="method6"></a>
 
170
<p/><strong>void I_Pythia8::set_trust_both_mothers_and_daughters( bool b = false ) &nbsp;</strong> <br/>
 
171
  
 
172
<strong>bool I_Pythia8::trust_both_mothers_and_daughters() &nbsp;</strong> <br/>
 
173
currently dummy methods intended to resolve conflicts in the event
 
174
history.
 
175
  
 
176
 
 
177
<a name="method7"></a>
 
178
<p/><strong>void I_Pythia8::set_print_inconsistency_errors( bool b = true ) &nbsp;</strong> <br/>
 
179
  
 
180
<strong>bool I_Pythia8::print_inconsistency_errors() &nbsp;</strong> <br/>
 
181
print a warning line, on <code>cerr</code>, when inconsistent mother 
 
182
and daughter information is encountered.
 
183
  
 
184
 
 
185
<a name="method8"></a>
 
186
<p/><strong>void I_Pythia8::set_crash_on_problem( bool b = false ) &nbsp;</strong> <br/>
 
187
if problems are encountered then the run is interrupted by an
 
188
<code>exit(1)</code> command. Default is not to crash.
 
189
  
 
190
 
 
191
<a name="method9"></a>
 
192
<p/><strong>void I_Pythia8::set_freepartonwarnings( bool b = true ) &nbsp;</strong> <br/>
 
193
interrupt the run by an <code>exit(1)</code> command if unhadronized 
 
194
gluons or quarks are encountered in the event record, unless 
 
195
hadronization is switched off. Default is to crash.
 
196
  
 
197
 
 
198
<a name="method10"></a>
 
199
<p/><strong>void I_Pythia8::set_convert_to_mev( bool b = false ) &nbsp;</strong> <br/>
 
200
convert the normal GeV energies, momenta and masses to MeV.
 
201
  
 
202
 
 
203
</body>
 
204
</html>
 
205
 
 
206
<!-- Copyright (C) 2012 Torbjorn Sjostrand -->