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_
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
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_
105 # define type_of_call
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
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
160 char *beam,
Long_t l_beam,
161 char *target,
Long_t l_target,
177 TPythia6::TPythia6Cleaner::TPythia6Cleaner() {
184 if (TPythia6::fgInstance) {
186 TPythia6::fgInstance = 0;
202 Fatal(
"TPythia6",
"There's already an instance of TPythia6");
324 for (
Int_t i = 0; i<numpart; i++) {
358 if (particles == 0)
return 0;
360 clonesParticles.
Clear();
363 if (!strcmp(option,
"") || !strcmp(option,
"Final")) {
364 for (
Int_t i = 0; i<numpart; i++) {
390 }
else if (!strcmp(option,
"All")) {
391 for (
Int_t i = 0; i<numpart; i++) {
433 strlcpy(cframe,frame,4);
435 strlcpy(cbeam,beam,10);
437 strlcpy(ctarget,target,10);
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");
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+");
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+");
501 Pyinit(cframe, cbeam ,ctarget, win);
504 snprintf(atitle,32,
" %s-%s at %g GeV",cbeam,ctarget,win);
528 Long_t s1 = strlen(frame);
530 Long_t s3 = strlen(target);
532 pyinit(frame,beam,target,&lwin,s1,s2,s3);
534 pyinit(frame, s1, beam , s2, target, s3, &lwin);
567 Long_t lparam = strlen(param);
659 py1ent(ip, kf, pe, theta, phi);
void Pygive(const char *param)
void SetCKIN(int i, double c)
#define pythia6_common_address
void Pyrset(int lun, int move)
void SetMSUB(int i, int m)
virtual void Clear(Option_t *option="")
Remove all objects from the array.
virtual void Delete(Option_t *option="")
Remove all objects from the array AND delete all heap based objects.
void SetupTest()
Exemplary setup of Pythia parameters: Switches on processes 102,123,124 (Higgs generation) and switch...
void GenerateEvent()
generate event and copy the information from /HEPEVT/ to fPrimaries
#define tpythia6_close_fortran_file
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
friend class TClonesArray
void Pyinit(char *frame, char *beam, char *target, double wint)
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...
void SetMSTP(int i, int m)
void CloseFortranFile(int lun)
interface with fortran i/o
static TPythia6 * fgInstance
void SetPMAS(int ip, int i, double m)
virtual void Clear(Option_t *option="")
Clear the clones array.
void OpenFortranFile(int lun, char *name)
interface with fortran i/o
virtual ~TPythia6()
Destroys the object, deletes and disposes all TMCParticles currently on list.
~TPythia6Cleaner()
delete the TPythia6 insntance
TObjArray * fParticles
display neutrons if true
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
static RooMathCoreReg dummy
TPythia6()
TPythia6 constructor: creates a TClonesArray in which it will store all particles.
An array of clone (identical) objects.
void Pyname(int kf, char *name)
static TPythia6 * Instance()
model of automatic memory cleanup suggested by Jim Kowalkovski: destructor for local static variable ...
ClassImp(TPythia6) TPythia6
utility class to manage the TPythia6 innstance
Int_t ImportParticles(TClonesArray *particles, Option_t *option="")
Default primary creation method.
virtual void SetTitle(const char *title="")
Change (i.e. set) the title of the TNamed.
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.
#define tpythia6_open_fortran_file
void Pyrget(int lun, int move)
void Pyupda(int mupda, int lun)