ROOT  6.06/09
Reference Guide
TPythia6.cxx
Go to the documentation of this file.
1 // @(#)root/pythia6:$Id$
2 // Author: Rene Brun 19/10/99
3 
4 ////////////////////////////////////////////////////////////////////////////////
5 // //
6 // TPythia6 //
7 // //
8 // TPythia is an interface class to F77 version of Pythia 6.2 //
9 // To use this class you must install a version of pythia6. //
10 // see the installation instructions at //
11 // http://root.cern.ch/root/Install.html //
12 // //
13 // CERNLIB event generators, written by T.Sjostrand. //
14 // For the details about these generators look at Pythia/Jetset manual: //
15 // //
16 //******************************************************************************
17 //** **
18 //** **
19 //** PPP Y Y TTTTT H H III A JJJJ EEEE TTTTT SSS EEEE TTTTT **
20 //** P P Y Y T H H I A A J E T S E T **
21 //** PPP Y T HHHHH I AAAAA J EEE T SSS EEE T **
22 //** P Y T H H I A A J J E T S E T **
23 //** P Y T H H III A A JJ EEEE T SSS EEEE T **
24 //** **
25 //** **
26 //** *......* Welcome to the Lund Monte Carlo! **
27 //** *:::!!:::::::::::* **
28 //** *::::::!!::::::::::::::* This is PYTHIA version 5.720 **
29 //** *::::::::!!::::::::::::::::* Last date of change: 29 Nov 1995 **
30 //** *:::::::::!!:::::::::::::::::* **
31 //** *:::::::::!!:::::::::::::::::* This is JETSET version 7.408 **
32 //** *::::::::!!::::::::::::::::*! Last date of change: 23 Aug 1995 **
33 //** *::::::!!::::::::::::::* !! **
34 //** !! *:::!!:::::::::::* !! Main author: **
35 //** !! !* -><- * !! Torbjorn Sjostrand **
36 //** !! !! !! Dept. of theoretical physics 2 **
37 //** !! !! !! University of Lund **
38 //** !! !! Solvegatan 14A **
39 //** !! ep !! S-223 62 Lund, Sweden **
40 //** !! !! phone: +46 - 46 - 222 48 16 **
41 //** !! pp !! E-mail: torbjorn@thep.lu.se **
42 //** !! e+e- !! **
43 //** !! !! Copyright Torbjorn Sjostrand **
44 //** !! and CERN, Geneva 1993 **
45 //** **
46 //** **
47 //** The latest program versions and documentation is found on WWW address **
48 //** http://thep.lu.se/tf2/staff/torbjorn/Welcome.html **
49 //** **
50 //** When you cite these programs, priority should always be given to the **
51 //** latest published description. Currently this is **
52 //** T. Sjostrand, Computer Physics Commun. 82 (1994) 74. **
53 //** The most recent long description (unpublished) is **
54 //** T. Sjostrand, LU TP 95-20 and CERN-TH.7112/93 (revised August 1995). **
55 //** Also remember that the programs, to a large extent, represent original **
56 //** physics research. Other publications of special relevance to your **
57 //** studies may therefore deserve separate mention. **
58 //** **
59 //** **
60 //******************************************************************************
61 
62 #include "TPythia6.h"
63 
64 #include "TClonesArray.h"
65 #include "TMCParticle.h"
66 #include "TParticle.h"
67 
68 TPythia6* TPythia6::fgInstance = 0;
69 
70 
71 #ifndef WIN32
72 # define pydiff pydiff_
73 # define pyevnt pyevnt_
74 # define pyinit pyinit_
75 # define pychge pychge_
76 # define pycomp pycomp_
77 # define pyedit pyedit_
78 # define pyexec pyexec_
79 # define pyhepc pyhepc_
80 # define pygive pygive_
81 # define pylist pylist_
82 # define pymass pymass_
83 # define pyname pyname_
84 # define pyr pyr_
85 # define pyrget pyrget_
86 # define pyrset pyrset_
87 # define pystat pystat_
88 # define pytest pytest_
89 # define pytune pytune_
90 # define pyupda pyupda_
91 # define py1ent py1ent_
92 # ifdef PYTHIA6_DOUBLE_UNDERSCORE
93 # define tpythia6_open_fortran_file tpythia6_open_fortran_file__
94 # define tpythia6_close_fortran_file tpythia6_close_fortran_file__
95 # define pythia6_common_address pythia6_common_address__
96 # elif PYTHIA6_SINGLE_UNDERSCORE
97 # define tpythia6_open_fortran_file tpythia6_open_fortran_file_
98 # define tpythia6_close_fortran_file tpythia6_close_fortran_file_
99 # define pythia6_common_address pythia6_common_address
100 # else
101 # define pythia6_common_address pythia6_common_address
102 # define tpythia6_open_fortran_file tpythia6_open_fortran_file_
103 # define tpythia6_close_fortran_file tpythia6_close_fortran_file_
104 # endif
105 # define type_of_call
106 #else
107 # define pydiff PYDIFF
108 # define pyevnt PYEVNT
109 # define pyinit PYINIT
110 # define pychge PYCHGE
111 # define pycomp PYCOMP
112 # define pyedit PYEDIT
113 # define pyexec PYEXEC
114 # define pygive PYGIVE
115 # define pyhepc PYHEPC
116 # define pylist PYLIST
117 # define pymass PYMASS
118 # define pyname PYNAME
119 # define pyr PYR
120 # define pyrget PYRGET
121 # define pyrset PYRSET
122 # define pystat PYSTAT
123 # define pytest PYTEST
124 # define pytune PYTUNE
125 # define pyupda PYUPDA
126 # define py1ent PY1ENT
127 # define tpythia6_open_fortran_file TPYTHIA6_OPEN_FORTRAN_FILE
128 # define tpythia6_close_fortran_file TPYTHIA6_CLOSE_FORTRAN_FILE
129 # define type_of_call _stdcall
130 #endif
131 
132 
133 extern "C" void type_of_call pyevnt();
134 extern "C" void type_of_call pystat(int *key);
135 extern "C" void type_of_call pylist(int *key);
136 extern "C" void type_of_call pyedit(int *medit);
137 extern "C" void type_of_call pydiff();
138 extern "C" void type_of_call pyexec();
139 extern "C" void type_of_call pygive(const char *param, Long_t lparam);
140 extern "C" void type_of_call pyhepc(int *mconv);
141 extern "C" void type_of_call pylist(int *flag);
142 extern "C" int type_of_call pychge(int *kf);
143 extern "C" int type_of_call pycomp(int *kf);
144 extern "C" double type_of_call pymass(int *kf);
145 extern "C" void type_of_call pyname(int *kf, char *name, Long_t l_name);
146 extern "C" int type_of_call pyr(int *dummy);
147 extern "C" int type_of_call pyrget(int *lun, int *move);
148 extern "C" int type_of_call pyrset(int *lun, int *move);
149 extern "C" int type_of_call pytest(int *flag);
150 extern "C" int type_of_call pytune(int *itune);
151 extern "C" int type_of_call pyupda(int *mupda, int *lun);
152 extern "C" void type_of_call py1ent(Int_t&, Int_t&, Double_t&, Double_t&, Double_t&);
153 
154 #ifndef WIN32
155 extern "C" void type_of_call pyinit(char *frame, char *beam, char *target,
156  double *win, Long_t l_frame, Long_t l_beam,
157  Long_t l_target);
158 #else
159 extern "C" void type_of_call pyinit(char *frame, Long_t l_frame,
160  char *beam, Long_t l_beam,
161  char *target, Long_t l_target,
162  double *win
163  );
164 #endif
165 
166 extern "C" {
167  void* pythia6_common_address(const char*);
168  void type_of_call tpythia6_open_fortran_file(int* lun, char* name, int);
170 }
171 
173 
174 ////////////////////////////////////////////////////////////////////////////////
175 ///utility class to manage the TPythia6 innstance
176 
177 TPythia6::TPythia6Cleaner::TPythia6Cleaner() {
178 }
179 
180 ////////////////////////////////////////////////////////////////////////////////
181 ///delete the TPythia6 insntance
182 
184  if (TPythia6::fgInstance) {
185  delete TPythia6::fgInstance;
186  TPythia6::fgInstance = 0;
187  }
188 }
189 
190 //------------------------------------------------------------------------------
191 // constructor is not supposed to be called from the outside - only
192 // Initialize() method
193 ////////////////////////////////////////////////////////////////////////////////
194 /// TPythia6 constructor: creates a TClonesArray in which it will store all
195 /// particles. Note that there may be only one functional TPythia6 object
196 /// at a time, so it's not use to create more than one instance of it.
197 
198 TPythia6::TPythia6() : TGenerator("TPythia6","TPythia6") {
199  // Protect against multiple objects. All access should be via the
200  // Instance member function.
201  if (fgInstance)
202  Fatal("TPythia6", "There's already an instance of TPythia6");
203 
204  delete fParticles; // was allocated as TObjArray in TGenerator
205 
206  fParticles = new TClonesArray("TMCParticle",50);
207 
208  // initialize common-blocks
209  // the functions/subroutines referenced by TPythia6 can be found
210  // at ftp://root.cern.ch/root/pythia6.tar.gz
211 
212  fPyjets = (Pyjets_t*) pythia6_common_address("PYJETS");
213  fPydat1 = (Pydat1_t*) pythia6_common_address("PYDAT1");
214  fPydat2 = (Pydat2_t*) pythia6_common_address("PYDAT2");
215  fPydat3 = (Pydat3_t*) pythia6_common_address("PYDAT3");
216  fPydat4 = (Pydat4_t*) pythia6_common_address("PYDAT4");
217  fPydatr = (Pydatr_t*) pythia6_common_address("PYDATR");
218  fPysubs = (Pysubs_t*) pythia6_common_address("PYSUBS");
219  fPypars = (Pypars_t*) pythia6_common_address("PYPARS");
220  fPyint1 = (Pyint1_t*) pythia6_common_address("PYINT1");
221  fPyint2 = (Pyint2_t*) pythia6_common_address("PYINT2");
222  fPyint3 = (Pyint3_t*) pythia6_common_address("PYINT3");
223  fPyint4 = (Pyint4_t*) pythia6_common_address("PYINT4");
224  fPyint5 = (Pyint5_t*) pythia6_common_address("PYINT5");
225  fPyint6 = (Pyint6_t*) pythia6_common_address("PYINT6");
226  fPyint7 = (Pyint7_t*) pythia6_common_address("PYINT7");
227  fPyint8 = (Pyint8_t*) pythia6_common_address("PYINT8");
228  fPyint9 = (Pyint9_t*) pythia6_common_address("PYINT9");
229  fPymssm = (Pymssm_t*) pythia6_common_address("PYMSSM");
230  fPyssmt = (Pyssmt_t*) pythia6_common_address("PYSSMT");
231  fPyints = (Pyints_t*) pythia6_common_address("PYINTS");
232  fPybins = (Pybins_t*) pythia6_common_address("PYBINS");
233 }
234 
235 ////////////////////////////////////////////////////////////////////////////////
236 
238  TGenerator(p6),
239  fPyjets(p6.fPyjets),
240  fPydat1(p6.fPydat1),
241  fPydat2(p6.fPydat2),
242  fPydat3(p6.fPydat3),
243  fPydat4(p6.fPydat4),
244  fPydatr(p6.fPydatr),
245  fPysubs(p6.fPysubs),
246  fPypars(p6.fPypars),
247  fPyint1(p6.fPyint1),
248  fPyint2(p6.fPyint2),
249  fPyint3(p6.fPyint3),
250  fPyint4(p6.fPyint4),
251  fPyint5(p6.fPyint5),
252  fPyint6(p6.fPyint6),
253  fPyint7(p6.fPyint7),
254  fPyint8(p6.fPyint8),
255  fPyint9(p6.fPyint9),
256  fPymssm(p6.fPymssm),
257  fPyssmt(p6.fPyssmt),
258  fPyints(p6.fPyints),
259  fPybins(p6.fPybins)
260 { }
261 
262 ////////////////////////////////////////////////////////////////////////////////
263 /// Destroys the object, deletes and disposes all TMCParticles currently on list.
264 
266 {
267  if (fParticles) {
268  fParticles->Delete();
269  delete fParticles;
270  fParticles = 0;
271  }
272 }
273 
274 ////////////////////////////////////////////////////////////////////////////////
275 /// model of automatic memory cleanup suggested by Jim Kowalkovski:
276 /// destructor for local static variable `cleaner' is always called in the end
277 /// of the job thus deleting the only TPythia6 instance
278 
280  static TPythia6::TPythia6Cleaner cleaner;
281  return fgInstance ? fgInstance : (fgInstance=new TPythia6()) ;
282 }
283 
284 
285 
286 
287 
288 ////////////////////////////////////////////////////////////////////////////////
289 /// generate event and copy the information from /HEPEVT/ to fPrimaries
290 
292  pyevnt();
293  ImportParticles();
294 }
295 
296 ////////////////////////////////////////////////////////////////////////////////
297 ///interface with fortran i/o
298 
299 void TPythia6::OpenFortranFile(int lun, char* name) {
300  tpythia6_open_fortran_file(&lun, name, strlen(name));
301 }
302 
303 ////////////////////////////////////////////////////////////////////////////////
304 ///interface with fortran i/o
305 
308 }
309 
310 
311 ////////////////////////////////////////////////////////////////////////////////
312 /// Fills TObjArray fParticles list with particles from common LUJETS
313 /// Old contents of a list are cleared. This function should be called after
314 /// any change in common LUJETS, however GetParticles() method calls it
315 /// automatically - user don't need to care about it. In case you make a call
316 /// to LuExec() you must call this method yourself to transfer new data from
317 /// common LUJETS to the fParticles list.
318 
320 {
321  fParticles->Clear();
322  Int_t numpart = fPyjets->N;
324  for (Int_t i = 0; i<numpart; i++) {
325  new(a[i]) TMCParticle(fPyjets->K[0][i] ,
326  fPyjets->K[1][i] ,
327  fPyjets->K[2][i] ,
328  fPyjets->K[3][i] ,
329  fPyjets->K[4][i] ,
330  fPyjets->P[0][i] ,
331  fPyjets->P[1][i] ,
332  fPyjets->P[2][i] ,
333  fPyjets->P[3][i] ,
334  fPyjets->P[4][i] ,
335  fPyjets->V[0][i] ,
336  fPyjets->V[1][i] ,
337  fPyjets->V[2][i] ,
338  fPyjets->V[3][i] ,
339  fPyjets->V[4][i]);
340  }
341  return fParticles;
342 }
343 
344 ////////////////////////////////////////////////////////////////////////////////
345 /// Default primary creation method. It reads the /HEPEVT/ common block which
346 /// has been filled by the GenerateEvent method. If the event generator does
347 /// not use the HEPEVT common block, This routine has to be overloaded by
348 /// the subclasses.
349 /// The function loops on the generated particles and store them in
350 /// the TClonesArray pointed by the argument particles.
351 /// The default action is to store only the stable particles (ISTHEP = 1)
352 /// This can be demanded explicitly by setting the option = "Final"
353 /// If the option = "All", all the particles are stored.
354 ///
355 
357 {
358  if (particles == 0) return 0;
359  TClonesArray &clonesParticles = *particles;
360  clonesParticles.Clear();
361  Int_t numpart = fPyjets->N;
362  Int_t nparts=0;
363  if (!strcmp(option,"") || !strcmp(option,"Final")) {
364  for (Int_t i = 0; i<numpart; i++) {
365 
366  if (fPyjets->K[0][i] == 1) {
367  //
368  // Use the common block values for the TParticle constructor
369  //
370  new(clonesParticles[nparts]) TParticle(
371  fPyjets->K[1][i] ,
372  fPyjets->K[0][i] ,
373  fPyjets->K[2][i] ,
374  -1,
375  fPyjets->K[3][i] ,
376  fPyjets->K[4][i] ,
377  fPyjets->P[0][i] ,
378  fPyjets->P[1][i] ,
379  fPyjets->P[2][i] ,
380  fPyjets->P[3][i] ,
381  fPyjets->V[0][i] ,
382  fPyjets->V[1][i] ,
383  fPyjets->V[2][i] ,
384  fPyjets->V[3][i]);
385 
386  // if(gDebug) printf("%d %d %d! ",i,fPyjets->K[1][i],numpart);
387  nparts++;
388  }
389  }
390  } else if (!strcmp(option,"All")) {
391  for (Int_t i = 0; i<numpart; i++) {
392  new(clonesParticles[i]) TParticle(
393  fPyjets->K[1][i] ,
394  fPyjets->K[0][i] ,
395  fPyjets->K[2][i] ,
396  -1,
397  fPyjets->K[3][i] ,
398  fPyjets->K[4][i] ,
399  fPyjets->P[0][i] ,
400  fPyjets->P[1][i] ,
401  fPyjets->P[2][i] ,
402  fPyjets->P[3][i] ,
403  fPyjets->V[0][i] ,
404  fPyjets->V[1][i] ,
405  fPyjets->V[2][i] ,
406  fPyjets->V[3][i]);
407  }
408  nparts=numpart;
409  }
410 
411  return nparts;
412 }
413 
414 ////////////////////////////////////////////////////////////////////////////////
415 /// Calls PyInit with the same parameters after performing some checking,
416 /// sets correct title. This method should preferably be called instead of PyInit.
417 /// PURPOSE: to initialize the generation procedure.
418 /// ARGUMENTS: See documentation for details.
419 /// frame: - specifies the frame of the experiment:
420 /// "CMS","FIXT","USER","FOUR","FIVE","NONE"
421 /// beam,
422 /// target: - beam and target particles (with additionaly charges, tildes or "bar":
423 /// e,nu_e,mu,nu_mu,tau,nu_tau,gamma,pi,n,p,Lambda,Sigma,Xi,Omega,
424 /// pomeron,reggeon
425 /// win: - related to energy system:
426 /// for frame=="CMS" - total energy of system
427 /// for frame=="FIXT" - momentum of beam particle
428 /// for frame=="USER" - dummy - see documentation.
429 
430 void TPythia6::Initialize(const char *frame, const char *beam, const char *target, float win)
431 {
432  char cframe[4];
433  strlcpy(cframe,frame,4);
434  char cbeam[10];
435  strlcpy(cbeam,beam,10);
436  char ctarget[10];
437  strlcpy(ctarget,target,10);
438 
439  // For frames "3MOM", "4MOM" and "5MOM" see p. 181-182 of the version 6 manual,
440  // http://home.thep.lu.se/~torbjorn/pythia/lutp0613man2.pdf
441  // their usage may depend on the version of Pythia6 used
442  if ( (!strncmp(frame, "CMS" ,3)) &&
443  (!strncmp(frame, "FIXT" ,4)) &&
444  (!strncmp(frame, "USER" ,4)) &&
445  (!strncmp(frame, "FOUR" ,4)) &&
446  (!strncmp(frame, "FIVE" ,4)) &&
447  (!strncmp(frame, "3MOM" ,4)) &&
448  (!strncmp(frame, "4MOM" ,4)) &&
449  (!strncmp(frame, "5MOM" ,4)) &&
450  (!strncmp(frame, "NONE" ,4)) ) {
451  printf("WARNING! In TPythia6:Initialize():\n");
452  printf(" specified frame=%s is neither of CMS,FIXT,USER,FOUR,FIVE,NONE,3MOM,4MOM,5MOM\n",frame);
453  printf(" resetting to \"CMS\" .");
454  snprintf(cframe,4,"CMS");
455  }
456 
457  if ( (!strncmp(beam, "e" ,1)) &&
458  (!strncmp(beam, "nu_e" ,4)) &&
459  (!strncmp(beam, "mu" ,2)) &&
460  (!strncmp(beam, "nu_mu" ,5)) &&
461  (!strncmp(beam, "tau" ,3)) &&
462  (!strncmp(beam, "nu_tau" ,6)) &&
463  (!strncmp(beam, "gamma" ,5)) &&
464  (!strncmp(beam, "pi" ,2)) &&
465  (!strncmp(beam, "n" ,1)) &&
466  (!strncmp(beam, "p" ,1)) &&
467  (!strncmp(beam, "Lambda" ,6)) &&
468  (!strncmp(beam, "Sigma" ,5)) &&
469  (!strncmp(beam, "Xi" ,2)) &&
470  (!strncmp(beam, "Omega" ,5)) &&
471  (!strncmp(beam, "pomeron" ,7)) &&
472  (!strncmp(beam, "reggeon" ,7)) ) {
473  printf("WARNING! In TPythia6:Initialize():\n");
474  printf(" specified beam=%s is unrecognized .\n",beam);
475  printf(" resetting to \"p+\" .");
476  snprintf(cbeam,8,"p+");
477  }
478 
479  if ( (!strncmp(target, "e" ,1)) &&
480  (!strncmp(target, "nu_e" ,4)) &&
481  (!strncmp(target, "mu" ,2)) &&
482  (!strncmp(target, "nu_mu" ,5)) &&
483  (!strncmp(target, "tau" ,3)) &&
484  (!strncmp(target, "nu_tau" ,6)) &&
485  (!strncmp(target, "gamma" ,5)) &&
486  (!strncmp(target, "pi" ,2)) &&
487  (!strncmp(target, "n" ,1)) &&
488  (!strncmp(target, "p" ,1)) &&
489  (!strncmp(target, "Lambda" ,6)) &&
490  (!strncmp(target, "Sigma" ,5)) &&
491  (!strncmp(target, "Xi" ,2)) &&
492  (!strncmp(target, "Omega" ,5)) &&
493  (!strncmp(target, "pomeron" ,7)) &&
494  (!strncmp(target, "reggeon" ,7)) ){
495  printf("WARNING! In TPythia6:Initialize():\n");
496  printf(" specified target=%s is unrecognized.\n",target);
497  printf(" resetting to \"p+\" .");
498  snprintf(ctarget,8,"p+");
499  }
500 
501  Pyinit(cframe, cbeam ,ctarget, win);
502 
503  char atitle[32];
504  snprintf(atitle,32," %s-%s at %g GeV",cbeam,ctarget,win);
505  SetTitle(atitle);
506 }
507 
508 
509 void TPythia6::Pyinit(char* frame, char* beam, char* target, double win)
510 {
511  // Calls Pyinit with the same parameters after performing some checking,
512  // sets correct title. This method should preferably be called instead of PyInit.
513  // PURPOSE: to initialize the generation procedure.
514  // ARGUMENTS: See documentation for details.
515  // frame: - specifies the frame of the experiment:
516  // "CMS","FIXT","USER","FOUR","FIVE","NONE"
517  // beam,
518  // target: - beam and target particles (with additionaly charges,
519  // tildes or "bar":
520  // e,nu_e,mu,nu_mu,tau,nu_tau,gamma,pi,n,p,Lambda,Sigma,Xi,Omega,
521  // pomeron,reggeon
522  // win: - related to energy system:
523  // for frame=="CMS" - total energy of system
524  // for frame=="FIXT" - momentum of beam particle
525  // for frame=="USER" - dummy - see documentation.
526 
527  Double_t lwin = win;
528  Long_t s1 = strlen(frame);
529  Long_t s2 = strlen(beam);
530  Long_t s3 = strlen(target);
531 #ifndef WIN32
532  pyinit(frame,beam,target,&lwin,s1,s2,s3);
533 #else
534  pyinit(frame, s1, beam , s2, target, s3, &lwin);
535 #endif
536 }
537 
538 
539 int TPythia6::Pycomp(int kf) {
540  //interface with fortran routine pycomp
541  return pycomp(&kf);
542 }
543 
544 void TPythia6::Pyedit(int medit) {
545  //interface with fortran routine pyedit
546  pyedit(&medit);
547  ImportParticles();
548 }
549 
551  //interface with fortran routine pydiff
552  pydiff();
553 }
554 
556  //interface with fortran routine pyevnt
557  pyevnt();
558 }
559 
561  //interface with fortran routine pyexec
562  pyexec();
563 }
564 
565 void TPythia6::Pygive(const char *param) {
566  //interface with fortran routine pygive
567  Long_t lparam = strlen(param);
568  pygive(param,lparam);
569 }
570 
571 void TPythia6::Pyhepc(int mconv) {
572  //interface with fortran routine pyhepc
573  pyhepc(&mconv);
574 }
575 
576 void TPythia6::Pylist(int flag) {
577  //interface with fortran routine pylist
578  pylist(&flag);
579 }
580 
581 void TPythia6::Pyname(int kf, char* name) {
582  //Note that the array name must be dimensioned in the calling program
583  //to at least name[16]
584 
585  pyname(&kf,name,15);
586  // cut trailing blanks to get C string
587  name[15] = 0;
588  //for (int i=15; (i>=0) && (name[i] == ' '); i--) {
589  // name[i] = 0;
590  // }
591 }
592 
593 double TPythia6::Pyr(int idummy) {
594  //interface with fortran routine pyr
595  return pyr(&idummy);
596 }
597 
598 void TPythia6::Pyrget(int lun, int move) {
599  //interface with fortran routine pyrget
600  pyrget(&lun,&move);
601 }
602 
603 void TPythia6::Pyrset(int lun, int move) {
604  //interface with fortran routine pyrset
605  pyrset(&lun,&move);
606 }
607 
608 void TPythia6::Pystat(int flag) {
609  //interface with fortran routine pystat
610  pystat(&flag);
611 }
612 
613 void TPythia6::Pytest(int flag) {
614  //interface with fortran routine pytest
615  pytest(&flag);
616 }
617 
618 void TPythia6::Pytune(int itune) {
619  //interface with fortran routine pytune
620  pytune(&itune);
621 }
622 
623 void TPythia6::Pyupda(int mupda, int lun) {
624  //interface with fortran routine pyupda
625  pyupda(&mupda,&lun);
626 }
627 
628 double TPythia6::Pymass(int kf) {
629  //interface with fortran routine pymass
630  return pymass(&kf);
631 }
632 
633 int TPythia6::Pychge(int kf) {
634  //interface with fortran routine pychge
635  return pychge(&kf);
636 }
637 
638 ////////////////////////////////////////////////////////////////////////////////
639 /// Add one entry to the event record, i.e. either a parton or a
640 /// particle.
641 ///
642 /// IP: normally line number for the parton/particle. There are two
643 /// exceptions:
644 ///
645 /// If IP = 0: line number 1 is used and PYEXEC is called.
646 /// If IP < 0: line -IP is used, with status code K(-IP,2)=2
647 /// rather than 1; thus a parton system may be built
648 /// up by filling all but the last parton of the
649 /// system with IP < 0.
650 /// KF: parton/particle flavour code (PDG code)
651 /// PE: parton/particle energy. If PE is smaller than the mass,
652 /// the parton/particle is taken to be at rest.
653 /// THETA:
654 /// PHI: polar and azimuthal angle for the momentum vector of the
655 /// parton/particle.
656 
657 void TPythia6::Py1ent(Int_t ip, Int_t kf, Double_t pe, Double_t theta, Double_t phi)
658 {
659  py1ent(ip, kf, pe, theta, phi);
660 }
661 
662 
663 ////////////////////////////////////////////////////////////////////////////////
664 /// Exemplary setup of Pythia parameters:
665 /// Switches on processes 102,123,124 (Higgs generation) and switches off
666 /// interactions, fragmentation, ISR, FSR...
667 
669 {
670  SetMSEL(0); // full user controll;
671 
672  SetMSUB(102,1); // g + g -> H0
673  SetMSUB(123,1); // f + f' -> f + f' + H0
674  SetMSUB(124,1); // f + f' -> f" + f"' + H0
675 
676 
677  SetPMAS(6,1,175.0); // mass of TOP
678  SetPMAS(25,1,300); // mass of Higgs
679 
680 
681  SetCKIN(1,290.0); // range of allowed mass
682  SetCKIN(2,310.0);
683 
684  SetMSTP(61, 0); // switch off ISR
685  SetMSTP(71, 0); // switch off FSR
686  SetMSTP(81, 0); // switch off multiple interactions
687  SetMSTP(111, 0); // switch off fragmentation/decay
688 }
void Pygive(const char *param)
Definition: TPythia6.cxx:565
void SetCKIN(int i, double c)
Definition: TPythia6.h:219
Pyint6_t * fPyint6
Definition: TPythia6.h:108
#define pythia6_common_address
Definition: TPythia6.cxx:101
An array of TObjects.
Definition: TObjArray.h:39
#define pychge
Definition: TPythia6.cxx:75
#define pytest
Definition: TPythia6.cxx:88
void Pyrset(int lun, int move)
Definition: TPythia6.cxx:603
void SetMSUB(int i, int m)
Definition: TPythia6.h:218
void Pylist(int flag)
Definition: TPythia6.cxx:576
virtual void Clear(Option_t *option="")
Remove all objects from the array.
Definition: TObjArray.cxx:297
const char Option_t
Definition: RtypesCore.h:62
#define pyexec
Definition: TPythia6.cxx:78
virtual void Delete(Option_t *option="")
Remove all objects from the array AND delete all heap based objects.
Definition: TObjArray.cxx:328
Pyint4_t * fPyint4
Definition: TPythia6.h:106
Pydat2_t * fPydat2
Definition: TPythia6.h:97
Pybins_t * fPybins
Definition: TPythia6.h:115
Pydatr_t * fPydatr
Definition: TPythia6.h:100
Pyint1_t * fPyint1
Definition: TPythia6.h:103
int Int_t
Definition: RtypesCore.h:41
void SetupTest()
Exemplary setup of Pythia parameters: Switches on processes 102,123,124 (Higgs generation) and switch...
Definition: TPythia6.cxx:668
void GenerateEvent()
generate event and copy the information from /HEPEVT/ to fPrimaries
Definition: TPythia6.cxx:291
TArc * a
Definition: textangle.C:12
#define tpythia6_close_fortran_file
Definition: TPythia6.cxx:103
void Pystat(int flag)
Definition: TPythia6.cxx:608
Pyjets_t * fPyjets
Definition: TPythia6.h:95
double Pymass(int kf)
Definition: TPythia6.cxx:628
void Pytune(int itune)
Definition: TPythia6.cxx:618
Pyint5_t * fPyint5
Definition: TPythia6.h:107
int K[5][4000]
Definition: TPythia6Calls.h:61
#define type_of_call
Definition: TPythia6.cxx:105
double Pyr(int idummy)
Definition: TPythia6.cxx:593
Pyssmt_t * fPyssmt
Definition: TPythia6.h:113
#define pyhepc
Definition: TPythia6.cxx:79
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
Definition: TObject.cxx:946
Pysubs_t * fPysubs
Definition: TPythia6.h:101
#define pyedit
Definition: TPythia6.cxx:77
friend class TClonesArray
Definition: TObject.h:214
void Pyinit(char *frame, char *beam, char *target, double wint)
Definition: TPythia6.cxx:509
void Initialize(const char *frame, const char *beam, const char *target, float win)
Calls PyInit with the same parameters after performing some checking, sets correct title...
Definition: TPythia6.cxx:430
#define pymass
Definition: TPythia6.cxx:82
void SetMSTP(int i, int m)
Definition: TPythia6.h:230
Pyint3_t * fPyint3
Definition: TPythia6.h:105
void CloseFortranFile(int lun)
interface with fortran i/o
Definition: TPythia6.cxx:306
static TPythia6 * fgInstance
Definition: TPythia6.h:93
Pypars_t * fPypars
Definition: TPythia6.h:102
void SetPMAS(int ip, int i, double m)
Definition: TPythia6.h:177
Pydat1_t * fPydat1
Definition: TPythia6.h:96
virtual void Clear(Option_t *option="")
Clear the clones array.
Pydat3_t * fPydat3
Definition: TPythia6.h:98
#define pydiff
Definition: TPythia6.cxx:72
#define pygive
Definition: TPythia6.cxx:80
int Pychge(int kf)
Definition: TPythia6.cxx:633
void OpenFortranFile(int lun, char *name)
interface with fortran i/o
Definition: TPythia6.cxx:299
void Pyevnt()
Definition: TPythia6.cxx:555
#define pylist
Definition: TPythia6.cxx:81
#define pycomp
Definition: TPythia6.cxx:76
int Pycomp(int kf)
Definition: TPythia6.cxx:539
void Pyhepc(int mconv)
Definition: TPythia6.cxx:571
Pydat4_t * fPydat4
Definition: TPythia6.h:99
virtual ~TPythia6()
Destroys the object, deletes and disposes all TMCParticles currently on list.
Definition: TPythia6.cxx:265
#define pyname
Definition: TPythia6.cxx:83
#define pyrset
Definition: TPythia6.cxx:86
double V[5][4000]
Definition: TPythia6Calls.h:63
Pyint7_t * fPyint7
Definition: TPythia6.h:109
long Long_t
Definition: RtypesCore.h:50
double P[5][4000]
Definition: TPythia6Calls.h:62
double Double_t
Definition: RtypesCore.h:55
~TPythia6Cleaner()
delete the TPythia6 insntance
Definition: TPythia6.cxx:183
TObjArray * fParticles
display neutrons if true
Definition: TGenerator.h:151
Pyint8_t * fPyint8
Definition: TPythia6.h:110
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
static RooMathCoreReg dummy
Pyint2_t * fPyint2
Definition: TPythia6.h:104
void Pytest(int flag)
Definition: TPythia6.cxx:613
Pyint9_t * fPyint9
Definition: TPythia6.h:111
Pymssm_t * fPymssm
Definition: TPythia6.h:112
#define name(a, b)
Definition: linkTestLib0.cpp:5
void Pydiff()
Definition: TPythia6.cxx:550
TPythia6()
TPythia6 constructor: creates a TClonesArray in which it will store all particles.
Definition: TPythia6.cxx:198
void Pyedit(int medit)
Definition: TPythia6.cxx:544
An array of clone (identical) objects.
Definition: TClonesArray.h:32
void Pyname(int kf, char *name)
Definition: TPythia6.cxx:581
static TPythia6 * Instance()
model of automatic memory cleanup suggested by Jim Kowalkovski: destructor for local static variable ...
Definition: TPythia6.cxx:279
ClassImp(TPythia6) TPythia6
utility class to manage the TPythia6 innstance
Definition: TPythia6.cxx:172
void Pyexec()
Definition: TPythia6.cxx:560
#define pyinit
Definition: TPythia6.cxx:74
#define pyupda
Definition: TPythia6.cxx:90
#define pystat
Definition: TPythia6.cxx:87
void SetMSEL(int m)
Definition: TPythia6.h:216
#define pytune
Definition: TPythia6.cxx:89
#define pyr
Definition: TPythia6.cxx:84
#define pyrget
Definition: TPythia6.cxx:85
Int_t ImportParticles(TClonesArray *particles, Option_t *option="")
Default primary creation method.
Definition: TPythia6.cxx:356
virtual void SetTitle(const char *title="")
Change (i.e. set) the title of the TNamed.
Definition: TNamed.cxx:152
void Py1ent(Int_t line, Int_t kf, Double_t pe, Double_t theta, Double_t phi)
Add one entry to the event record, i.e.
Definition: TPythia6.cxx:657
#define pyevnt
Definition: TPythia6.cxx:73
#define tpythia6_open_fortran_file
Definition: TPythia6.cxx:102
#define py1ent
Definition: TPythia6.cxx:91
Pyints_t * fPyints
Definition: TPythia6.h:114
void Pyrget(int lun, int move)
Definition: TPythia6.cxx:598
void Pyupda(int mupda, int lun)
Definition: TPythia6.cxx:623