Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:12:41

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // $Id: Pythia6.hh,v 1.1 2014/10/05 03:12:12 mccumber Exp $
0027 //
0028 /// \file eventgenerator/pythia/decayer6/include/Pythia6.hh
0029 /// \brief Definition of the Pythia6 class
0030 
0031 // 
0032 // ----------------------------------------------------------------------------
0033 
0034 // ******************************************************************************
0035 // ******************************************************************************
0036 // **                                                                          **
0037 // **                                                                          **
0038 // **              *......*                  Welcome to the Lund Monte Carlo!  **
0039 // **         *:::!!:::::::::::*                                               **
0040 // **      *::::::!!::::::::::::::*          PPP  Y   Y TTTTT H   H III   A    **
0041 // **    *::::::::!!::::::::::::::::*        P  P  Y Y    T   H   H  I   A A   **
0042 // **   *:::::::::!!:::::::::::::::::*       PPP    Y     T   HHHHH  I  AAAAA  **
0043 // **   *:::::::::!!:::::::::::::::::*       P      Y     T   H   H  I  A   A  **
0044 // **    *::::::::!!::::::::::::::::*!       P      Y     T   H   H III A   A  **
0045 // **      *::::::!!::::::::::::::* !!                                         **
0046 // **      !! *:::!!:::::::::::*    !!       This is PYTHIA version 6.418      **
0047 // **      !!     !* -><- *         !!       Last date of change:  9 Jun 2008  **
0048 // **      !!     !!                !!                                         **
0049 // **      !!     !!                !!       Now is  0 Jan 2000 at  0:00:00    **
0050 // **      !!                       !!                                         **
0051 // **      !!        lh             !!       Disclaimer: this program comes    **
0052 // **      !!                       !!       without any guarantees. Beware    **
0053 // **      !!                 hh    !!       of errors and use common sense    **
0054 // **      !!    ll                 !!       when interpreting results.        **
0055 // **      !!                       !!                                         **
0056 // **      !!                                Copyright T. Sjostrand (2008)     **
0057 // **                                                                          **
0058 // ** An archive of program versions and documentation is found on the web:    **
0059 // ** http://www.thep.lu.se/~torbjorn/Pythia.html                              **
0060 // **                                                                          **
0061 // ** When you cite this program, the official reference is to the 6.4 manual: **
0062 // ** T. Sjostrand, S. Mrenna and P. Skands, JHEP05 (2006) 026                 **
0063 // ** (LU TP 06-13, FERMILAB-PUB-06-052-CD-T) [hep-ph/0603175].                **
0064 // **                                                                          **
0065 // ** Also remember that the program, to a large extent, represents original   **
0066 // ** physics research. Other publications of special relevance to your        **
0067 // ** studies may therefore deserve separate mention.                          **
0068 // **                                                                          **
0069 // ** Main author: Torbjorn Sjostrand; Department of Theoretical Physics,      **
0070 // **   Lund University, Solvegatan 14A, S-223 62 Lund, Sweden;                **
0071 // **   phone: + 46 - 46 - 222 48 16; e-mail: torbjorn@thep.lu.se              **
0072 // ** Author: Stephen Mrenna; Computing Division, GDS Group,                   **
0073 // **   Fermi National Accelerator Laboratory, MS 234, Batavia, IL 60510, USA; **
0074 // **   phone: + 1 - 630 - 840 - 2556; e-mail: mrenna@fnal.gov                 **
0075 // ** Author: Peter Skands; Theoretical Physics Department,                    **
0076 // **   Fermi National Accelerator Laboratory, MS 106, Batavia, IL 60510, USA; **
0077 // **   and CERN/PH, CH-1211 Geneva, Switzerland;                              **
0078 // **   phone: + 41 - 22 - 767 24 59; e-mail: skands@fnal.gov                  **
0079 // **                                                                          **
0080 // **                                                                          **
0081 // ******************************************************************************
0082 
0083 #ifndef PYTHIA_Pythia6
0084 #define PYTHIA_Pythia6
0085 
0086 #include <vector>
0087 
0088 int const KNDCAY  =  8000; //should be 4000 for pythia61
0089 
0090 /// PYJETS common-block 
0091 struct Pyjets_t
0092 {
0093   int    N;
0094   int    NPAD;
0095   int    K[5][4000];
0096   double P[5][4000];
0097   double V[5][4000];
0098 };
0099 
0100 /// PYDAT1 common-block 
0101 struct Pydat1_t
0102 {
0103   int    MSTU[200];
0104   double PARU[200];
0105   int    MSTJ[200];
0106   double PARJ[200];
0107 };
0108 
0109 /// PYDAT3 common-block 
0110 struct Pydat3_t
0111 {
0112   int    MDCY[3][500];
0113   int    MDME[2][KNDCAY];
0114   double BRAT[KNDCAY];
0115   int    KFDP[5][KNDCAY];
0116 };
0117 
0118 /// Structure for Pythia6 particle properties
0119 struct Pythia6Particle  
0120 {
0121    Pythia6Particle(
0122      int ks, int kf, int parent, int firstChild, int lastChild,
0123      float px, float py, float pz, float energy, float mass,
0124      float vx, float vy, float vz, float time, float lifetime)
0125      : fKS(ks), fKF(kf), 
0126        fParent(parent), fFirstChild(firstChild), fLastChild(lastChild),
0127        fPx(px), fPy(py), fPz(pz), fEnergy(energy), fMass(mass),
0128        fVx(vx), fVy(vy), fVz(vz), fTime(time), fLifetime(lifetime) {}
0129 
0130    int    fKS;            // status of particle       ( LUJETS K[1] )
0131    int    fKF;            // KF flavour code          ( LUJETS K[2] )
0132    int    fParent;        // parrent's id             ( LUJETS K[3] )
0133    int    fFirstChild;    // id of first child        ( LUJETS K[4] )
0134    int    fLastChild;     // id of last  child        ( LUJETS K[5] )
0135 
0136    float  fPx;            // X momenta [GeV/c]        ( LUJETS P[1] )
0137    float  fPy;            // Y momenta [GeV/c]        ( LUJETS P[2] )
0138    float  fPz;            // Z momenta [GeV/c]        ( LUJETS P[3] )
0139    float  fEnergy;        // Energy    [GeV]          ( LUJETS P[4] )
0140    float  fMass;          // Mass      [Gev/c^2]      ( LUJETS P[5] )
0141 
0142    float  fVx;            // X vertex  [mm]           ( LUJETS V[1] )
0143    float  fVy;            // Y vertex  [mm]           ( LUJETS V[2] )
0144    float  fVz;            // Z vertex  [mm]           ( LUJETS V[3] )
0145    float  fTime;          // time of procuction [mm/c]( LUJETS V[4] )
0146    float  fLifetime;      // proper lifetime [mm/c]   ( LUJETS V[5] )
0147 };   
0148 
0149 typedef std::vector<Pythia6Particle*> ParticleVector;
0150 
0151 /// The C++ interface class to Pythia6 
0152 ///
0153 /// According to TPythia6 class from Root:
0154 /// (The TPythia6 class is an interface class to F77 routines in Pythia6                //
0155 /// CERNLIB event generators, written by T.Sjostrand.)                         
0156 /// http://root.cern.ch/
0157 /// see http://root.cern.ch/root/License.html
0158 ///
0159 /// The complete Pythia6 documentation can be found at:
0160 /// http://home.thep.lu.se/~torbjorn/pythiaaux/recent.html
0161 /// 
0162 
0163 class Pythia6
0164 {
0165   public:
0166 
0167    // ****** constructors and destructor
0168    Pythia6();
0169    virtual ~Pythia6();
0170 
0171    static Pythia6 *Instance();
0172 
0173    // ****** TPYTHIA routines
0174    //
0175    int   Pycomp(int kf);
0176    void  Py1ent(int line, int kf, double pe, double theta, double phi);
0177    ParticleVector*  ImportParticles();
0178    int   ImportParticles(ParticleVector* particles, const char* option="");
0179 
0180    // ****** /PYDAT1/
0181    //
0182    void  SetMSTJ(int i, int m   ) { fPydat1->MSTJ[i-1] = m; }
0183 
0184    // ****** /PYDAT3/
0185    //
0186    int   GetMDCY(int i, int j) { return fPydat3->MDCY[j-1][i-1]; }
0187    int   GetKFDP(int i, int j) { return fPydat3->KFDP[j-1][i-1]; }
0188    void  SetMDCY(int i, int j, int m) { fPydat3->MDCY[j-1][i-1] = m; }
0189    void  SetMDME(int i, int j, int m) { fPydat3->MDME[j-1][i-1] = m; }
0190    
0191   private:
0192    static  Pythia6* fgInstance;
0193 
0194    ParticleVector*  fParticles;
0195    Pyjets_t*        fPyjets;
0196    Pydat1_t*        fPydat1;
0197    Pydat3_t*        fPydat3;
0198 };
0199 
0200 #endif