]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PYTHIA8/pythia8170/phpdoc/HepMCInterface.php
Update to pythi8.170
[u/mrichter/AliRoot.git] / PYTHIA8 / pythia8170 / phpdoc / HepMCInterface.php
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 <script language=javascript type=text/javascript>
10 function stopRKey(evt) {
11 var evt = (evt) ? evt : ((event) ? event : null);
12 var node = (evt.target) ? evt.target :((evt.srcElement) ? evt.srcElement : null);
13 if ((evt.keyCode == 13) && (node.type=="text"))
14 {return false;}
15 }
16
17 document.onkeypress = stopRKey;
18 </script>
19 <?php
20 if($_POST['saved'] == 1) {
21 if($_POST['filepath'] != "files/") {
22 echo "<font color='red'>SETTINGS SAVED TO FILE</font><br/><br/>"; }
23 else {
24 echo "<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='HepMCInterface.php'>
29
30 <h2>HepMC Interface</h2>
31
32 An interface to the HepMC [<a href="Bibliography.php" target="page">Dob01</a>] standard event record 
33 format has been provided by M. Kirsanov. To use it, the relevant 
34 libraries need to be linked, as explained in the <code>README</code> 
35 file. Only version 2 of HepMC is supported. (Version 1 requires 
36 a different interface structure, which was only supported up until 
37 Pythia 8.107.) 
38
39 <p/>
40 The (simple) procedure to translate PYTHIA 8 events into HepMC ones 
41 is illustrated in the <code>main41.cc</code>, <code>main42.cc</code>
42 <code>main61.cc</code> and <code>main62.cc</code>   
43 main programs. At the core is a call to the
44 <pre>
45 HepMC::I_Pythia8::fill_next_event( pythia, hepmcevt, ievnum = -1, convertGluonTo0 = false ) 
46 </pre>
47 which takes a reference of the generator object and uses it, on the one
48 hand, to read out and covert the event record in <code>pythia.event</code> 
49 and, on the other hand, to extract and store parton-density (PDF) 
50 information for the hard subprocess from <code>pythia.info</code>. 
51 The optional last argument, if <code>true</code>, allows you to store 
52 gluons as "PDG" code 0 rather than the normal 21; this only applies to 
53 the PDF information, not the event record. 
54
55 <p/>
56 The earlier version of this routine,
57 <pre>
58 HepMC::I_Pythia8::fill_next_event( pythia.event, hepmcevt, ievnum = -1 ) 
59 </pre>
60 is retained (for now) for backwards compatibility. It takes a PYTHIA event 
61 as input and returns a HepMC one, but without storing the PDF information. 
62 The latter could then instead be stored by a separate call
63 <pre>
64 HepMC::I_Pythia8::pdf_put_info( hepmcevt, pythia, convertGluonTo0 = false ) 
65 </pre>
66 or not, as wished.
67
68 <p/>
69 While PYTHIA stores momenta in units of GeV, with <i>c = 1</i>, 
70 the HepMC standard originally did not specify which units to use, 
71 unfortunately. Later versions allow units to be specified either as
72 MeV or as GeV. The dividing line goes with the introduction of the
73 <code>HEPMC_HAS_UNITS</code> environment variable in HepMC 2.04.
74 When PYTHIA is linked to older versions, which do not have this
75 environment variable, the default behaviour of 
76 <code>fill_next_event</code> is to convert momenta to MeV. 
77 To store momenta in GeV instead, you must call 
78 <pre>
79 HepMC::I_Pythia8::set_convert_to_mev( false ) 
80 </pre>
81 beforehand. When linked to newer HepMC versions, PYTHIA will adapt
82 to the unit specified for the HepMC event record. A default unit
83 is chosen when HepMC is built, but this choice can be overridden
84 in the constructor of a <code>HepMC::GenEvent</code>, to be either
85 GeV or MeV. The <code>main41.cc</code> code illustrates these 
86 possibilities. 
87
88 <p/>
89 Also for length units there could exist ambiguities, but the mm
90 choice of PYTHIA seems to be shared by most other programs. 
91 When linked to older HepMC versions there is never a conversion, 
92 while for newer versions the PYTHIA interface will convert to the 
93 units set for the HepMC event record, as for momenta.
94
95 <p/>
96 By agreement with the LHC experimental community, support for the
97 older behaviour will be dropped for all versions released after 
98 the end of 2012.
99
100 <p/>
101 The status code is now based on the new standard for HepMC 2.05,
102 see the <?php $filepath = $_GET["filepath"];
103 echo "<a href='EventRecord.php?filepath=".$filepath."' target='page'>";?>Event::statusHepMC(...)</a> 
104 conversion routine for details. The earlier behaviour, where all
105 final particles had status 1 and all initial or intermediate ones 
106 status 2, is available as a commented-out line in the   
107 <code>I_Pythia8::fill_next_event(...)</code> method, and so is simple
108 to recover.
109
110 <p/>
111 In HepMC 2.05 it also becomes possible to store the generated cross 
112 section and its error. The environment variable
113 <code>HEPMC_HAS_CROSS_SECTION</code> is used to check whether this
114 possibility exists and, if it does the current values from 
115 <code>pythia.info.sigmaGen()</code> and 
116 <code>pythia.info.sigmaErr()</code> are stored for each event,
117 multiplied by <i>10^9</i> to convert from mb to pb. Note that
118 PYTHIA improves its accuracy by Monte Carlo integration in the course
119 of the run, so the values associated with the last generated event
120 should be the most accurate ones. (If events also come with a dimensional 
121 weight, like in some Les Houches strategies, conversion from mb to fb 
122 for that weight must be set by hand, see the last method below.)
123
124 <h2>The public methods</h2>
125
126 Here comes a complete list of all public methods of the 
127 <code>I_Pythia8</code> class in the <code>HepMC</code> 
128 (<i>not</i> <code>Pythia8</code>!) namespace.
129
130 <a name="method1"></a>
131 <p/><strong>I_Pythia8::I_Pythia8() &nbsp;</strong> <br/>
132   
133 <strong>virtual I_Pythia8::~I_Pythia8() &nbsp;</strong> <br/>
134 the constructor and destructor take no arguments.
135   
136
137 <a name="method2"></a>
138 <p/><strong>bool I_Pythia8::fill_next_event( Pythia8::Pythia& pythia, GenEvent* evt, int ievnum = -1, bool convertGluonTo0 = false) &nbsp;</strong> <br/>
139 convert a <code>Pythia</code> event to a <code>HepMC</code> one.
140 Will return true if succeeded.
141 <br/><code>argument</code><strong> pythia </strong>  : 
142 the input <code>Pythia</code> generator object, from which both the 
143 event and the parton density information can be obtained.
144    
145 <br/><code>argument</code><strong> evt </strong>  : 
146 the output <code>GenEvt</code> event, in its standard form.
147    
148 <br/><code>argument</code><strong> iev </strong>  : 
149 set the event number of the current event. If negative then the 
150 internal event number is used, which is incremented by one for
151 each new event.
152   
153 <br/><code>argument</code><strong> convertGluonTo0 </strong>  : 
154 the normal gluon identity code 21 is used also when parton density
155 information is stored, unless this optional argument is set true to
156 have gluons represented by a 0. This choice does not affect the 
157 normal event record, where a gluon is always 21. 
158   
159   
160
161 <a name="method3"></a>
162 <p/><strong>bool I_Pythia8::fill_next_event( Pythia8::Event& pyev, GenEvent* evt, int ievnum = -1 ) &nbsp;</strong> <br/>
163 convert a <code>Pythia</code> event to a <code>HepMC</code> one.
164 Will return true if succeeded. Do not store parton-density information.
165 <br/><code>argument</code><strong> pyev </strong>  : 
166 the input <code>Pythia</code> event, in its standard form.
167    
168 <br/><code>argument</code><strong> evt </strong>  : 
169 the output <code>GenEvt</code> event, in its standard form.
170    
171 <br/><code>argument</code><strong> iev </strong>  : 
172 set the event number of the current event. If negative then the 
173 internal event number is used, which is incremented by one for
174 each new event.
175   
176   
177
178 <a name="method4"></a>
179 <p/><strong>bool I_Pythia8::put_pdf_info( GenEvent* evt, Pythia8::Pythia& pythia, bool convertGluonTo0 = false ) &nbsp;</strong> <br/>
180 append parton-density information to an event already stored
181 by the previous method.
182 <br/><code>argument</code><strong> evt </strong>  : 
183 the output <code>GenEvt</code> event record, in its standard form.
184    
185 <br/><code>argument</code><strong> pythia </strong>  : 
186 the input <code>Pythia</code> generator object, from which both the 
187 event and the parton density information can be obtained.
188    
189 <br/><code>argument</code><strong> convertGluonTo0 </strong>  : 
190 the normal gluon identity code 21 is used also when parton density
191 information is stored, unless this optional argument is set true to
192 have gluons represented by a 0. 
193   
194   
195
196 <p/>
197 The following methods can be used to set, and in some cases interrogate,
198 the status of some switches that can be used to modify the behaviour
199 of the conversion routine. The <code>set</code> methods have the 
200 same default input values as the internal initialization ones, so
201 that a call without an argument (re)stores the default.
202
203 <a name="method5"></a>
204 <p/><strong>void I_Pythia8::set_trust_mothers_before_daughters( bool b = true ) &nbsp;</strong> <br/>
205   
206 <strong>bool I_Pythia8::trust_mothers_before_daughters() &nbsp;</strong> <br/>
207 if there is a conflict in the history information, then trust the 
208 information on mothers above that on daughters. Currently this is
209 the only option implemented. 
210   
211
212 <a name="method6"></a>
213 <p/><strong>void I_Pythia8::set_trust_both_mothers_and_daughters( bool b = false ) &nbsp;</strong> <br/>
214   
215 <strong>bool I_Pythia8::trust_both_mothers_and_daughters() &nbsp;</strong> <br/>
216 currently dummy methods intended to resolve conflicts in the event
217 history.
218   
219
220 <a name="method7"></a>
221 <p/><strong>void I_Pythia8::set_print_inconsistency_errors( bool b = true ) &nbsp;</strong> <br/>
222   
223 <strong>bool I_Pythia8::print_inconsistency_errors() &nbsp;</strong> <br/>
224 print a warning line, on <code>cerr</code>, when inconsistent mother 
225 and daughter information is encountered.
226   
227
228 <a name="method8"></a>
229 <p/><strong>void I_Pythia8::set_crash_on_problem( bool b = false ) &nbsp;</strong> <br/>
230 if problems are encountered then the run is interrupted by an
231 <code>exit(1)</code> command. Default is not to crash.
232   
233
234 <a name="method9"></a>
235 <p/><strong>void I_Pythia8::set_freepartonwarnings( bool b = true ) &nbsp;</strong> <br/>
236 interrupt the run by an <code>exit(1)</code> command if unhadronized 
237 gluons or quarks are encountered in the event record, unless 
238 hadronization is switched off. Default is to crash.
239   
240
241 <a name="method10"></a>
242 <p/><strong>void I_Pythia8::set_convert_to_mev( bool b = false ) &nbsp;</strong> <br/>
243 convert the normal GeV energies, momenta and masses to MeV.
244   
245
246 </body>
247 </html>
248
249 <!-- Copyright (C) 2012 Torbjorn Sjostrand -->