TPythia6.cxx

Go to the documentation of this file.
00001 // @(#)root/pythia6:$Id: TPythia6.cxx 35918 2010-09-30 14:33:27Z brun $
00002 // Author: Rene Brun   19/10/99
00003 
00004 ////////////////////////////////////////////////////////////////////////////////
00005 //                                                                            //
00006 // TPythia6                                                                   //
00007 //                                                                            //
00008 // TPythia is an interface class to F77 version of Pythia 6.2                 //
00009 // To use this class you must install a version of pythia6.                   //
00010 //   see the installation instructions at                                     //
00011 //       http://root.cern.ch/root/Install.html                                //
00012 //                                                                            // 
00013 // CERNLIB event generators, written by T.Sjostrand.                          //
00014 // For the details about these generators look at Pythia/Jetset manual:       //
00015 //                                                                            //
00016 //******************************************************************************
00017 //**                                                                          **
00018 //**                                                                          **
00019 //**  PPP  Y   Y TTTTT H   H III   A        JJJJ EEEE TTTTT  SSS  EEEE TTTTT  **
00020 //**  P  P  Y Y    T   H   H  I   A A          J E      T   S     E      T    **
00021 //**  PPP    Y     T   HHHHH  I  AAAAA         J EEE    T    SSS  EEE    T    **
00022 //**  P      Y     T   H   H  I  A   A      J  J E      T       S E      T    **
00023 //**  P      Y     T   H   H III A   A       JJ  EEEE   T    SSS  EEEE   T    **
00024 //**                                                                          **
00025 //**                                                                          **
00026 //**              *......*                  Welcome to the Lund Monte Carlo!  **
00027 //**         *:::!!:::::::::::*                                               **
00028 //**      *::::::!!::::::::::::::*            This is PYTHIA version 5.720    **
00029 //**    *::::::::!!::::::::::::::::*        Last date of change: 29 Nov 1995  **
00030 //**   *:::::::::!!:::::::::::::::::*                                         **
00031 //**   *:::::::::!!:::::::::::::::::*         This is JETSET version 7.408    **
00032 //**    *::::::::!!::::::::::::::::*!       Last date of change: 23 Aug 1995  **
00033 //**      *::::::!!::::::::::::::* !!                                         **
00034 //**      !! *:::!!:::::::::::*    !!                 Main author:            **
00035 //**      !!     !* -><- *         !!              Torbjorn Sjostrand         **
00036 //**      !!     !!                !!        Dept. of theoretical physics 2   **
00037 //**      !!     !!                !!              University of Lund         **
00038 //**      !!                       !!                Solvegatan 14A           **
00039 //**      !!        ep             !!             S-223 62 Lund, Sweden       **
00040 //**      !!                       !!          phone: +46 - 46 - 222 48 16    **
00041 //**      !!                 pp    !!          E-mail: torbjorn@thep.lu.se    **
00042 //**      !!   e+e-                !!                                         **
00043 //**      !!                       !!         Copyright Torbjorn Sjostrand    **
00044 //**      !!                                     and CERN, Geneva 1993        **
00045 //**                                                                          **
00046 //**                                                                          **
00047 //** The latest program versions and documentation is found on WWW address    **
00048 //** http://thep.lu.se/tf2/staff/torbjorn/Welcome.html                        **
00049 //**                                                                          **
00050 //** When you cite these programs, priority should always be given to the     **
00051 //** latest published description. Currently this is                          **
00052 //** T. Sjostrand, Computer Physics Commun. 82 (1994) 74.                     **
00053 //** The most recent long description (unpublished) is                        **
00054 //** T. Sjostrand, LU TP 95-20 and CERN-TH.7112/93 (revised August 1995).     **
00055 //** Also remember that the programs, to a large extent, represent original   **
00056 //** physics research. Other publications of special relevance to your        **
00057 //** studies may therefore deserve separate mention.                          **
00058 //**                                                                          **
00059 //**                                                                          **
00060 //******************************************************************************
00061 
00062 #include "TPythia6.h"
00063 
00064 #include "TClonesArray.h"
00065 #include "TMCParticle.h"
00066 #include "TParticle.h"
00067 
00068 TPythia6*  TPythia6::fgInstance = 0;
00069 
00070 
00071 #ifndef WIN32
00072 # define pydiff pydiff_
00073 # define pyevnt pyevnt_
00074 # define pyinit pyinit_
00075 # define pychge pychge_
00076 # define pycomp pycomp_
00077 # define pyedit pyedit_
00078 # define pyexec pyexec_
00079 # define pyhepc pyhepc_
00080 # define pygive pygive_
00081 # define pylist pylist_
00082 # define pymass pymass_
00083 # define pyname pyname_
00084 # define pyr    pyr_
00085 # define pyrget pyrget_
00086 # define pyrset pyrset_
00087 # define pystat pystat_
00088 # define pytest pytest_
00089 # define pytune pytune_
00090 # define pyupda pyupda_
00091 # define py1ent py1ent_
00092 # ifdef PYTHIA6_DOUBLE_UNDERSCORE
00093 #  define tpythia6_open_fortran_file tpythia6_open_fortran_file__
00094 #  define tpythia6_close_fortran_file tpythia6_close_fortran_file__
00095 #  define pythia6_common_address pythia6_common_address__
00096 # elif PYTHIA6_SINGLE_UNDERSCORE
00097 #  define tpythia6_open_fortran_file tpythia6_open_fortran_file_
00098 #  define tpythia6_close_fortran_file tpythia6_close_fortran_file_
00099 #  define pythia6_common_address pythia6_common_address
00100 # else
00101 #  define pythia6_common_address pythia6_common_address 
00102 #  define tpythia6_open_fortran_file tpythia6_open_fortran_file_
00103 #  define tpythia6_close_fortran_file tpythia6_close_fortran_file_
00104 # endif
00105 # define type_of_call
00106 #else
00107 # define pydiff PYDIFF
00108 # define pyevnt PYEVNT
00109 # define pyinit PYINIT
00110 # define pychge PYCHGE
00111 # define pycomp PYCOMP
00112 # define pyedit PYEDIT
00113 # define pyexec PYEXEC
00114 # define pygive PYGIVE
00115 # define pyhepc PYHEPC
00116 # define pylist PYLIST
00117 # define pymass PYMASS
00118 # define pyname PYNAME
00119 # define pyr    PYR
00120 # define pyrget PYRGET
00121 # define pyrset PYRSET
00122 # define pystat PYSTAT
00123 # define pytest PYTEST
00124 # define pytune PYTUNE
00125 # define pyupda PYUPDA
00126 # define py1ent PY1ENT
00127 # define tpythia6_open_fortran_file TPYTHIA6_OPEN_FORTRAN_FILE
00128 # define tpythia6_close_fortran_file TPYTHIA6_CLOSE_FORTRAN_FILE
00129 # define type_of_call _stdcall
00130 #endif
00131 
00132 
00133 extern "C" void type_of_call pyevnt();
00134 extern "C" void type_of_call pystat(int *key);
00135 extern "C" void type_of_call pylist(int *key);
00136 extern "C" void type_of_call pyedit(int *medit);
00137 extern "C" void type_of_call pydiff();
00138 extern "C" void type_of_call pyexec();
00139 extern "C" void type_of_call pygive(const char *param, Long_t lparam);
00140 extern "C" void type_of_call pyhepc(int *mconv);
00141 extern "C" void type_of_call pylist(int *flag);
00142 extern "C" int  type_of_call pychge(int *kf);
00143 extern "C" int  type_of_call pycomp(int *kf);
00144 extern "C" double  type_of_call pymass(int *kf);
00145 extern "C" void type_of_call pyname(int *kf, char *name, Long_t l_name);
00146 extern "C" int  type_of_call pyr(int *dummy);
00147 extern "C" int  type_of_call pyrget(int *lun, int *move);
00148 extern "C" int  type_of_call pyrset(int *lun, int *move);
00149 extern "C" int  type_of_call pytest(int *flag);
00150 extern "C" int  type_of_call pytune(int *itune);
00151 extern "C" int  type_of_call pyupda(int *mupda, int *lun);
00152 extern "C" void type_of_call py1ent(Int_t&, Int_t&, Double_t&, Double_t&, Double_t&);
00153 
00154 #ifndef WIN32
00155 extern "C" void type_of_call pyinit(char *frame, char *beam, char *target,
00156                                      double *win, Long_t l_frame, Long_t l_beam,
00157                                      Long_t l_target);
00158 #else
00159 extern "C" void type_of_call pyinit(char *frame,  Long_t l_frame,
00160                                     char *beam,   Long_t l_beam,
00161                                     char *target, Long_t l_target,
00162                                     double *win
00163                                     );
00164 #endif
00165 
00166 extern "C" {
00167    void*  pythia6_common_address(const char*);
00168    void   type_of_call tpythia6_open_fortran_file(int* lun, char* name, int);
00169    void   type_of_call tpythia6_close_fortran_file(int* lun);
00170 }
00171 
00172 ClassImp(TPythia6)
00173 
00174 //------------------------------------------------------------------------------
00175 TPythia6::TPythia6Cleaner::TPythia6Cleaner() {
00176    //utility class to manage the TPythia6 innstance
00177 }
00178 
00179 //------------------------------------------------------------------------------
00180 TPythia6::TPythia6Cleaner::~TPythia6Cleaner() {
00181    //delete the TPythia6 insntance
00182    if (TPythia6::fgInstance) {
00183       delete TPythia6::fgInstance;
00184       TPythia6::fgInstance = 0;
00185    }
00186 }
00187 
00188 //------------------------------------------------------------------------------
00189 //  constructor is not supposed to be called from the outside - only
00190 //  Initialize() method
00191 //------------------------------------------------------------------------------
00192 TPythia6::TPythia6() : TGenerator("TPythia6","TPythia6") {
00193    // TPythia6 constructor: creates a TClonesArray in which it will store all
00194    // particles. Note that there may be only one functional TPythia6 object
00195    // at a time, so it's not use to create more than one instance of it.
00196   
00197    // Protect against multiple objects.   All access should be via the
00198    // Instance member function. 
00199    if (fgInstance) 
00200       Fatal("TPythia6", "There's already an instance of TPythia6");
00201   
00202    delete fParticles; // was allocated as TObjArray in TGenerator
00203 
00204    fParticles = new TClonesArray("TMCParticle",50);
00205 
00206    // initialize common-blocks
00207    // the functions/subroutines referenced by TPythia6 can be found
00208    // at ftp://root.cern.ch/root/pythia6.tar.gz
00209   
00210    fPyjets = (Pyjets_t*) pythia6_common_address("PYJETS");
00211    fPydat1 = (Pydat1_t*) pythia6_common_address("PYDAT1");
00212    fPydat2 = (Pydat2_t*) pythia6_common_address("PYDAT2");
00213    fPydat3 = (Pydat3_t*) pythia6_common_address("PYDAT3");
00214    fPydat4 = (Pydat4_t*) pythia6_common_address("PYDAT4");
00215    fPydatr = (Pydatr_t*) pythia6_common_address("PYDATR");
00216    fPysubs = (Pysubs_t*) pythia6_common_address("PYSUBS");
00217    fPypars = (Pypars_t*) pythia6_common_address("PYPARS");
00218    fPyint1 = (Pyint1_t*) pythia6_common_address("PYINT1");
00219    fPyint2 = (Pyint2_t*) pythia6_common_address("PYINT2");
00220    fPyint3 = (Pyint3_t*) pythia6_common_address("PYINT3");
00221    fPyint4 = (Pyint4_t*) pythia6_common_address("PYINT4");
00222    fPyint5 = (Pyint5_t*) pythia6_common_address("PYINT5");
00223    fPyint6 = (Pyint6_t*) pythia6_common_address("PYINT6");
00224    fPyint7 = (Pyint7_t*) pythia6_common_address("PYINT7");
00225    fPyint8 = (Pyint8_t*) pythia6_common_address("PYINT8");
00226    fPyint9 = (Pyint9_t*) pythia6_common_address("PYINT9");
00227    fPymssm = (Pymssm_t*) pythia6_common_address("PYMSSM");
00228    fPyssmt = (Pyssmt_t*) pythia6_common_address("PYSSMT");
00229    fPyints = (Pyints_t*) pythia6_common_address("PYINTS");
00230    fPybins = (Pybins_t*) pythia6_common_address("PYBINS");
00231 }
00232 
00233 //------------------------------------------------------------------------------
00234 TPythia6::TPythia6(const TPythia6& p6) :
00235   TGenerator(p6),
00236   fPyjets(p6.fPyjets),
00237   fPydat1(p6.fPydat1),
00238   fPydat2(p6.fPydat2),
00239   fPydat3(p6.fPydat3),
00240   fPydat4(p6.fPydat4),
00241   fPydatr(p6.fPydatr),
00242   fPysubs(p6.fPysubs),
00243   fPypars(p6.fPypars),
00244   fPyint1(p6.fPyint1),
00245   fPyint2(p6.fPyint2),
00246   fPyint3(p6.fPyint3),
00247   fPyint4(p6.fPyint4),
00248   fPyint5(p6.fPyint5),
00249   fPyint6(p6.fPyint6),
00250   fPyint7(p6.fPyint7),
00251   fPyint8(p6.fPyint8),
00252   fPyint9(p6.fPyint9),
00253   fPymssm(p6.fPymssm),
00254   fPyssmt(p6.fPyssmt),
00255   fPyints(p6.fPyints),
00256   fPybins(p6.fPybins)
00257 { }
00258 
00259 //------------------------------------------------------------------------------
00260 TPythia6::~TPythia6()
00261 {
00262    // Destroys the object, deletes and disposes all TMCParticles currently on list.
00263 
00264    if (fParticles) {
00265       fParticles->Delete();
00266       delete fParticles;
00267       fParticles = 0;
00268    }
00269 }
00270 
00271 //------------------------------------------------------------------------------
00272 TPythia6* TPythia6::Instance() {
00273    // model of automatic memory cleanup suggested by Jim Kowalkovski:
00274    // destructor for local static variable `cleaner' is  always called in the end
00275    // of the job thus deleting the only TPythia6 instance
00276 
00277    static TPythia6::TPythia6Cleaner cleaner;
00278    return fgInstance ? fgInstance : (fgInstance=new TPythia6()) ;
00279 }
00280 
00281 
00282 
00283 
00284 
00285 //______________________________________________________________________________
00286 void TPythia6::GenerateEvent() {
00287    //  generate event and copy the information from /HEPEVT/ to fPrimaries
00288 
00289    pyevnt();
00290    ImportParticles();
00291 }
00292 
00293 //______________________________________________________________________________
00294 void TPythia6::OpenFortranFile(int lun, char* name) {
00295    //interface with fortran i/o
00296    tpythia6_open_fortran_file(&lun, name, strlen(name));
00297 }
00298 
00299 //______________________________________________________________________________
00300 void TPythia6::CloseFortranFile(int lun) {
00301    //interface with fortran i/o
00302    tpythia6_close_fortran_file(&lun);
00303 }
00304 
00305 
00306 //______________________________________________________________________________
00307 TObjArray *TPythia6::ImportParticles(Option_t *)
00308 {
00309    // Fills TObjArray fParticles list with particles from common LUJETS
00310    // Old contents of a list are cleared. This function should be called after
00311    // any change in common LUJETS, however GetParticles() method  calls it
00312    // automatically - user don't need to care about it. In case you make a call
00313    // to LuExec() you must call this method yourself to transfer new data from
00314    // common LUJETS to the fParticles list.
00315 
00316    fParticles->Clear();
00317    Int_t numpart   = fPyjets->N;
00318    TClonesArray &a = *((TClonesArray*)fParticles);
00319    for (Int_t i = 0; i<numpart; i++) {
00320       new(a[i]) TMCParticle(fPyjets->K[0][i] ,
00321                             fPyjets->K[1][i] ,
00322                             fPyjets->K[2][i] ,
00323                             fPyjets->K[3][i] ,
00324                             fPyjets->K[4][i] ,
00325                             fPyjets->P[0][i] ,
00326                             fPyjets->P[1][i] ,
00327                             fPyjets->P[2][i] ,
00328                             fPyjets->P[3][i] ,
00329                             fPyjets->P[4][i] ,
00330                             fPyjets->V[0][i] ,
00331                             fPyjets->V[1][i] ,
00332                             fPyjets->V[2][i] ,
00333                             fPyjets->V[3][i] ,
00334                             fPyjets->V[4][i]);
00335    }
00336    return fParticles;
00337 }
00338 
00339 //______________________________________________________________________________
00340 Int_t TPythia6::ImportParticles(TClonesArray *particles, Option_t *option)
00341 {
00342    //  Default primary creation method. It reads the /HEPEVT/ common block which
00343    //  has been filled by the GenerateEvent method. If the event generator does
00344    //  not use the HEPEVT common block, This routine has to be overloaded by
00345    //  the subclasses.
00346    //  The function loops on the generated particles and store them in
00347    //  the TClonesArray pointed by the argument particles.
00348    //  The default action is to store only the stable particles (ISTHEP = 1)
00349    //  This can be demanded explicitly by setting the option = "Final"
00350    //  If the option = "All", all the particles are stored.
00351    //
00352 
00353    if (particles == 0) return 0;
00354    TClonesArray &clonesParticles = *particles;
00355    clonesParticles.Clear();
00356    Int_t numpart = fPyjets->N;
00357    Int_t nparts=0;
00358    if (!strcmp(option,"") || !strcmp(option,"Final")) {
00359       for (Int_t i = 0; i<numpart; i++) {
00360 
00361       if (fPyjets->K[0][i] == 1) {
00362          //
00363          //  Use the common block values for the TParticle constructor
00364          //
00365          new(clonesParticles[nparts]) TParticle(
00366                             fPyjets->K[1][i] ,
00367                             fPyjets->K[0][i] ,
00368                             fPyjets->K[2][i] ,
00369                             -1,
00370                             fPyjets->K[3][i] ,
00371                             fPyjets->K[4][i] ,
00372                             fPyjets->P[0][i] ,
00373                             fPyjets->P[1][i] ,
00374                             fPyjets->P[2][i] ,
00375                             fPyjets->P[3][i] ,
00376                             fPyjets->V[0][i] ,
00377                             fPyjets->V[1][i] ,
00378                             fPyjets->V[2][i] ,
00379                             fPyjets->V[3][i]);
00380 
00381          //     if(gDebug) printf("%d %d %d! ",i,fPyjets->K[1][i],numpart);
00382          nparts++;
00383          }
00384       }
00385    } else if (!strcmp(option,"All")) {
00386       for (Int_t i = 0; i<numpart; i++) {
00387          new(clonesParticles[i]) TParticle(
00388                             fPyjets->K[1][i] ,
00389                             fPyjets->K[0][i] ,
00390                             fPyjets->K[2][i] ,
00391                             -1,
00392                             fPyjets->K[3][i] ,
00393                             fPyjets->K[4][i] ,
00394                             fPyjets->P[0][i] ,
00395                             fPyjets->P[1][i] ,
00396                             fPyjets->P[2][i] ,
00397                             fPyjets->P[3][i] ,
00398                             fPyjets->V[0][i] ,
00399                             fPyjets->V[1][i] ,
00400                             fPyjets->V[2][i] ,
00401                             fPyjets->V[3][i]);
00402       }
00403       nparts=numpart;
00404    }
00405 
00406    return nparts;
00407 }
00408 
00409 //______________________________________________________________________________
00410 void TPythia6::Initialize(const char *frame, const char *beam, const char *target, float win)
00411 {
00412    // Calls PyInit with the same parameters after performing some checking,
00413    // sets correct title. This method should preferably be called instead of PyInit.
00414    // PURPOSE: to initialize the generation procedure.
00415    // ARGUMENTS: See documentation for details.
00416    //    frame:  - specifies the frame of the experiment:
00417    //                "CMS","FIXT","USER","FOUR","FIVE","NONE"
00418    //    beam,
00419    //    target: - beam and target particles (with additionaly cahrges, tildes or "bar":
00420    //              e,nu_e,mu,nu_mu,tau,nu_tau,gamma,pi,n,p,Lambda,Sigma,Xi,Omega,
00421    //              pomeron,reggeon
00422    //    win:    - related to energy system:
00423    //              for frame=="CMS" - total energy of system
00424    //              for frame=="FIXT" - momentum of beam particle
00425    //              for frame=="USER" - dummy - see documentation.
00426 
00427    char  cframe[4];
00428    strlcpy(cframe,frame,4);
00429    char  cbeam[8];
00430    strlcpy(cbeam,beam,8);
00431    char  ctarget[8];
00432    strlcpy(ctarget,target,8);
00433 
00434    if ( (!strncmp(frame, "CMS"  ,3)) &&
00435         (!strncmp(frame, "FIXT" ,4)) &&
00436         (!strncmp(frame, "USER" ,4)) &&
00437         (!strncmp(frame, "FOUR" ,4)) &&
00438         (!strncmp(frame, "FIVE" ,4)) &&
00439         (!strncmp(frame, "NONE" ,4)) ) {
00440       printf("WARNING! In TPythia6:Initialize():\n");
00441       printf(" specified frame=%s is neither of CMS,FIXT,USER,FOUR,FIVE,NONE\n",frame);
00442       printf(" resetting to \"CMS\" .");
00443       snprintf(cframe,4,"CMS");
00444    }
00445 
00446    if ( (!strncmp(beam, "e"       ,1)) &&
00447         (!strncmp(beam, "nu_e"    ,4)) &&
00448         (!strncmp(beam, "mu"      ,2)) &&
00449         (!strncmp(beam, "nu_mu"   ,5)) &&
00450         (!strncmp(beam, "tau"     ,3)) &&
00451         (!strncmp(beam, "nu_tau"  ,6)) &&
00452         (!strncmp(beam, "gamma"   ,5)) &&
00453         (!strncmp(beam, "pi"      ,2)) &&
00454         (!strncmp(beam, "n"       ,1)) &&
00455         (!strncmp(beam, "p"       ,1)) &&
00456         (!strncmp(beam, "Lambda"  ,6)) &&
00457         (!strncmp(beam, "Sigma"   ,5)) &&
00458         (!strncmp(beam, "Xi"      ,2)) &&
00459         (!strncmp(beam, "Omega"   ,5)) &&
00460         (!strncmp(beam, "pomeron" ,7)) &&
00461         (!strncmp(beam, "reggeon" ,7)) ) {
00462       printf("WARNING! In TPythia6:Initialize():\n");
00463       printf(" specified beam=%s is unrecognized .\n",beam);
00464       printf(" resetting to \"p+\" .");
00465       snprintf(cbeam,8,"p+");
00466    }
00467 
00468    if ( (!strncmp(target, "e"       ,1)) &&
00469         (!strncmp(target, "nu_e"    ,4)) &&
00470         (!strncmp(target, "mu"      ,2)) &&
00471         (!strncmp(target, "nu_mu"   ,5)) &&
00472         (!strncmp(target, "tau"     ,3)) &&
00473         (!strncmp(target, "nu_tau"  ,6)) &&
00474         (!strncmp(target, "gamma"   ,5)) &&
00475         (!strncmp(target, "pi"      ,2)) &&
00476         (!strncmp(target, "n"       ,1)) &&
00477         (!strncmp(target, "p"       ,1)) &&
00478         (!strncmp(target, "Lambda"  ,6)) &&
00479         (!strncmp(target, "Sigma"   ,5)) &&
00480         (!strncmp(target, "Xi"      ,2)) &&
00481         (!strncmp(target, "Omega"   ,5)) &&
00482         (!strncmp(target, "pomeron" ,7)) &&
00483         (!strncmp(target, "reggeon" ,7)) ){
00484       printf("WARNING! In TPythia6:Initialize():\n");
00485       printf(" specified target=%s is unrecognized.\n",target);
00486       printf(" resetting to \"p+\" .");
00487       snprintf(ctarget,8,"p+");
00488    }
00489 
00490 
00491 
00492    Pyinit(cframe, cbeam ,ctarget, win);
00493 
00494    char atitle[32];
00495    snprintf(atitle,32," %s-%s at %g GeV",cbeam,ctarget,win);
00496    SetTitle(atitle);
00497 
00498 }
00499 
00500 
00501 void TPythia6::Pyinit(char* frame, char* beam, char* target, double win) 
00502 {
00503    // Calls Pyinit with the same parameters after performing some checking,
00504    // sets correct title. This method should preferably be called instead of PyInit.
00505    // PURPOSE: to initialize the generation procedure.
00506    // ARGUMENTS: See documentation for details.
00507    //    frame:  - specifies the frame of the experiment:
00508    //                "CMS","FIXT","USER","FOUR","FIVE","NONE"
00509    //    beam,
00510    //    target: - beam and target particles (with additionaly charges,
00511    //              tildes or "bar":
00512    //              e,nu_e,mu,nu_mu,tau,nu_tau,gamma,pi,n,p,Lambda,Sigma,Xi,Omega,
00513    //              pomeron,reggeon
00514    //    win:    - related to energy system:
00515    //              for frame=="CMS" - total energy of system
00516    //              for frame=="FIXT" - momentum of beam particle
00517    //              for frame=="USER" - dummy - see documentation.
00518 
00519    Double_t lwin = win;
00520    Long_t  s1    = strlen(frame);
00521    Long_t  s2    = strlen(beam);
00522    Long_t  s3    = strlen(target);
00523 #ifndef WIN32
00524    pyinit(frame,beam,target,&lwin,s1,s2,s3);
00525 #else
00526    pyinit(frame, s1, beam , s2, target, s3, &lwin);
00527 #endif
00528 }
00529 
00530 
00531 int TPythia6::Pycomp(int kf) {
00532    //interface with fortran routine pycomp
00533    return pycomp(&kf);
00534 }
00535 
00536 void TPythia6::Pyedit(int medit) {
00537    //interface with fortran routine pyedit
00538    pyedit(&medit);
00539    ImportParticles();
00540 }
00541 
00542 void TPythia6::Pydiff() {
00543    //interface with fortran routine pydiff
00544    pydiff();
00545 }
00546 
00547 void TPythia6::Pyevnt() {
00548    //interface with fortran routine pyevnt
00549    pyevnt();
00550 }
00551 
00552 void TPythia6::Pyexec() {
00553    //interface with fortran routine pyexec
00554    pyexec();
00555 }
00556 
00557 void TPythia6::Pygive(const char *param) {
00558    //interface with fortran routine pygive
00559    Long_t lparam = strlen(param);
00560    pygive(param,lparam);
00561 }
00562 
00563 void TPythia6::Pyhepc(int mconv) {
00564    //interface with fortran routine pyhepc
00565    pyhepc(&mconv);
00566 }
00567 
00568 void TPythia6::Pylist(int flag) {
00569    //interface with fortran routine pylist
00570    pylist(&flag);
00571 }
00572 
00573 void TPythia6::Pyname(int kf, char* name) {
00574    //Note that the array name must be dimensioned in the calling program
00575    //to at least name[16]
00576    
00577    pyname(&kf,name,15);
00578    // cut trailing blanks to get C string
00579    name[15] = 0;
00580    //for (int i=15; (i>=0) && (name[i] == ' '); i--) {
00581    //  name[i] = 0;
00582    // }
00583 }
00584 
00585 double TPythia6::Pyr(int idummy) {
00586    //interface with fortran routine pyr
00587    return pyr(&idummy);
00588 }
00589 
00590 void TPythia6::Pyrget(int lun, int move) {
00591    //interface with fortran routine pyrget
00592    pyrget(&lun,&move);
00593 }
00594 
00595 void TPythia6::Pyrset(int lun, int move) {
00596    //interface with fortran routine pyrset
00597    pyrset(&lun,&move);
00598 }
00599 
00600 void TPythia6::Pystat(int flag) {
00601    //interface with fortran routine pystat
00602    pystat(&flag);
00603 }
00604 
00605 void TPythia6::Pytest(int flag) {
00606    //interface with fortran routine pytest
00607    pytest(&flag);
00608 }
00609 
00610 void TPythia6::Pytune(int itune) {
00611    //interface with fortran routine pytune
00612    pytune(&itune);
00613 }
00614 
00615 void TPythia6::Pyupda(int mupda, int lun) {
00616    //interface with fortran routine pyupda
00617    pyupda(&mupda,&lun);
00618 }
00619 
00620 double TPythia6::Pymass(int kf) {
00621    //interface with fortran routine pymass
00622    return pymass(&kf);
00623 }
00624 
00625 int TPythia6::Pychge(int kf) {
00626    //interface with fortran routine pychge
00627    return pychge(&kf);
00628 }
00629 
00630 //______________________________________________________________________________
00631 void TPythia6::Py1ent(Int_t ip, Int_t kf, Double_t pe, Double_t theta, Double_t phi)
00632 {
00633    // Add one entry to the event record, i.e. either a parton or a
00634    // particle. 
00635    //
00636    //  IP:   normally line number for the parton/particle. There are two
00637    //        exceptions:
00638    // 
00639    //        If IP = 0: line number 1 is used and PYEXEC is called. 
00640    //        If IP < 0: line -IP is used, with status code K(-IP,2)=2
00641    //                   rather than 1; thus a parton system may be built
00642    //                   up by filling all but the last parton of the
00643    //                   system with IP < 0.   
00644    //  KF:   parton/particle flavour code (PDG code)
00645    //  PE:   parton/particle energy. If PE is smaller than the mass,
00646    //        the parton/particle is taken to be at rest.  
00647    //  THETA:
00648    //  PHI:  polar and azimuthal angle for the momentum vector of the
00649    //        parton/particle. 
00650    py1ent(ip, kf, pe, theta, phi);
00651 }
00652 
00653 
00654 //______________________________________________________________________________
00655 void TPythia6::SetupTest()
00656 {
00657    // Exemplary setup of Pythia parameters:
00658    // Switches on processes 102,123,124 (Higgs generation) and switches off
00659    // interactions, fragmentation, ISR, FSR...
00660 
00661    SetMSEL(0);            // full user controll;
00662 
00663    SetMSUB(102,1);        // g + g -> H0
00664    SetMSUB(123,1);        // f + f' -> f + f' + H0
00665    SetMSUB(124,1);        // f + f' -> f" + f"' + H0
00666 
00667 
00668    SetPMAS(6,1,175.0);   // mass of TOP
00669    SetPMAS(25,1,300);    // mass of Higgs
00670 
00671 
00672    SetCKIN(1,290.0);     // range of allowed mass
00673    SetCKIN(2,310.0);
00674 
00675    SetMSTP(61,  0);      // switch off ISR
00676    SetMSTP(71,  0);      // switch off FSR
00677    SetMSTP(81,  0);      // switch off multiple interactions
00678    SetMSTP(111, 0);      // switch off fragmentation/decay
00679 }

Generated on Tue Jul 5 14:45:16 2011 for ROOT_528-00b_version by  doxygen 1.5.1