Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:17:40

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)
0126     , fKF(kf)
0127     , fParent(parent)
0128     , fFirstChild(firstChild)
0129     , fLastChild(lastChild)
0130     , fPx(px)
0131     , fPy(py)
0132     , fPz(pz)
0133     , fEnergy(energy)
0134     , fMass(mass)
0135     , fVx(vx)
0136     , fVy(vy)
0137     , fVz(vz)
0138     , fTime(time)
0139     , fLifetime(lifetime)
0140   {
0141   }
0142 
0143   int fKS;          // status of particle       ( LUJETS K[1] )
0144   int fKF;          // KF flavour code          ( LUJETS K[2] )
0145   int fParent;      // parrent's id             ( LUJETS K[3] )
0146   int fFirstChild;  // id of first child        ( LUJETS K[4] )
0147   int fLastChild;   // id of last  child        ( LUJETS K[5] )
0148 
0149   float fPx;      // X momenta [GeV/c]        ( LUJETS P[1] )
0150   float fPy;      // Y momenta [GeV/c]        ( LUJETS P[2] )
0151   float fPz;      // Z momenta [GeV/c]        ( LUJETS P[3] )
0152   float fEnergy;  // Energy    [GeV]          ( LUJETS P[4] )
0153   float fMass;    // Mass      [Gev/c^2]      ( LUJETS P[5] )
0154 
0155   float fVx;        // X vertex  [mm]           ( LUJETS V[1] )
0156   float fVy;        // Y vertex  [mm]           ( LUJETS V[2] )
0157   float fVz;        // Z vertex  [mm]           ( LUJETS V[3] )
0158   float fTime;      // time of procuction [mm/c]( LUJETS V[4] )
0159   float fLifetime;  // proper lifetime [mm/c]   ( LUJETS V[5] )
0160 };
0161 
0162 typedef std::vector<Pythia6Particle*> ParticleVector;
0163 
0164 /// The C++ interface class to Pythia6
0165 ///
0166 /// According to TPythia6 class from Root:
0167 /// (The TPythia6 class is an interface class to F77 routines in Pythia6                //
0168 /// CERNLIB event generators, written by T.Sjostrand.)
0169 /// http://root.cern.ch/
0170 /// see http://root.cern.ch/root/License.html
0171 ///
0172 /// The complete Pythia6 documentation can be found at:
0173 /// http://home.thep.lu.se/~torbjorn/pythiaaux/recent.html
0174 ///
0175 
0176 class Pythia6
0177 {
0178  public:
0179   // ****** constructors and destructor
0180   Pythia6();
0181   virtual ~Pythia6();
0182   explicit Pythia6(const Pythia6&) = delete;
0183   Pythia6& operator=(const Pythia6&) = delete;
0184 
0185   static Pythia6* Instance();
0186 
0187   // ****** TPYTHIA routines
0188   //
0189   int Pycomp(int kf);
0190   void Py1ent(int line, int kf, double pe, double theta, double phi);
0191   ParticleVector* ImportParticles();
0192   int ImportParticles(ParticleVector* particles, const char* option = "");
0193 
0194   // ****** /PYDAT1/
0195   //
0196   void SetMSTJ(int i, int m) { fPydat1->MSTJ[i - 1] = m; }
0197 
0198   // ****** /PYDAT3/
0199   //
0200   int GetMDCY(int i, int j) { return fPydat3->MDCY[j - 1][i - 1]; }
0201   int GetKFDP(int i, int j) { return fPydat3->KFDP[j - 1][i - 1]; }
0202   void SetMDCY(int i, int j, int m) { fPydat3->MDCY[j - 1][i - 1] = m; }
0203   void SetMDME(int i, int j, int m) { fPydat3->MDME[j - 1][i - 1] = m; }
0204 
0205  private:
0206   static Pythia6* fgInstance;
0207 
0208   ParticleVector* fParticles;
0209   Pyjets_t* fPyjets;
0210   Pydat1_t* fPydat1;
0211   Pydat3_t* fPydat3;
0212 };
0213 
0214 #endif