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