diff --git a/GeneratorParam/TPythia6.h b/GeneratorParam/TPythia6.h new file mode 100644 index 0000000..93d9c16 --- /dev/null +++ b/GeneratorParam/TPythia6.h @@ -0,0 +1,330 @@ +// @(#)root/pythia6:$Id$ +// Author: Rene Brun 19/10/99 + +/************************************************************************* + * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * + * All rights reserved. * + * * + * For the licensing terms see $ROOTSYS/LICENSE. * + * For the list of contributors see $ROOTSYS/README/CREDITS. * + *************************************************************************/ + +#ifndef PYTHIA_TPythia6 +#define PYTHIA_TPythia6 + +//////////////////////////////////////////////////////////////////////////////// +// // +// TPythia6 // +// // +// TPythia is an interface class to F77 version of Pythia 6.2 // +// CERNLIB event generators, written by T.Sjostrand. // +// For the details about these generators look at Pythia/Jetset manual: // +// // +// ****************************************************************************** +// ****************************************************************************** +// ** ** +// ** ** +// ** *......* Welcome to the Lund Monte Carlo! ** +// ** *:::!!:::::::::::* ** +// ** *::::::!!::::::::::::::* PPP Y Y TTTTT H H III A ** +// ** *::::::::!!::::::::::::::::* P P Y Y T H H I A A ** +// ** *:::::::::!!:::::::::::::::::* PPP Y T HHHHH I AAAAA ** +// ** *:::::::::!!:::::::::::::::::* P Y T H H I A A ** +// ** *::::::::!!::::::::::::::::*! P Y T H H III A A ** +// ** *::::::!!::::::::::::::* !! ** +// ** !! *:::!!:::::::::::* !! This is PYTHIA version 6.205 ** +// ** !! !* -><- * !! Last date of change: 1 Mar 2002 ** +// ** !! !! !! ** +// ** !! !! !! Now is 0 Jan 2000 at 0:00:00 ** +// ** !! !! ** +// ** !! lh !! Disclaimer: this program comes ** +// ** !! !! without any guarantees. Beware ** +// ** !! hh !! of errors and use common sense ** +// ** !! ll !! when interpreting results. ** +// ** !! !! ** +// ** !! Copyright T. Sjostrand (2001) ** +// ** ** +// ** An archive of program versions and documentation is found on the web: ** +// ** http://www.thep.lu.se/~torbjorn/Pythia.html ** +// ** ** +// ** When you cite this program, currently the official reference is ** +// ** T. Sjostrand, P. Eden, C. Friberg, L. Lonnblad, G. Miu, S. Mrenna and ** +// ** E. Norrbin, Computer Physics Commun. 135 (2001) 238. ** +// ** The large manual is ** +// ** T. Sjostrand, L. Lonnblad and S. Mrenna, LU TP 01-21 [hep-ph/0108264]. ** +// ** Also remember that the program, to a large extent, represents original ** +// ** physics research. Other publications of special relevance to your ** +// ** studies may therefore deserve separate mention. ** +// ** ** +// ** Main author: Torbjorn Sjostrand; Department of Theoretical Physics 2, ** +// ** Lund University, Solvegatan 14A, S-223 62 Lund, Sweden; ** +// ** phone: + 46 - 46 - 222 48 16; e-mail: torbjorn@thep.lu.se ** +// ** Author: Leif Lonnblad; Department of Theoretical Physics 2, ** +// ** Lund University, Solvegatan 14A, S-223 62 Lund, Sweden; ** +// ** phone: + 46 - 46 - 222 77 80; e-mail: leif@thep.lu.se ** +// ** Author: Stephen Mrenna; Computing Division, Simulations Group, ** +// ** Fermi National Accelerator Laboratory, MS 234, Batavia, IL 60510, USA; ** +// ** phone: + 1 - 630 - 840 - 2556; e-mail: mrenna@fnal.gov ** +// ** Author: Peter Skands; Department of Theoretical Physics 2, ** +// ** Lund University, Solvegatan 14A, S-223 62 Lund, Sweden; ** +// ** phone: + 46 - 46 - 222 31 92; e-mail: zeiler@thep.lu.se ** +// ** ** +// ** ** +// ****************************************************************************** +//#ifdef __GNUG__ +//#pragma interface +//#endif + +#include "TPythia6Calls.h" + +#include "TGenerator.h" + +#include "TObjArray.h" + +class TPythia6 : public TGenerator { + +protected: + static TPythia6* fgInstance; + // PYTHIA6 common-blocks + Pyjets_t* fPyjets; + Pydat1_t* fPydat1; + Pydat2_t* fPydat2; + Pydat3_t* fPydat3; + Pydat4_t* fPydat4; + Pydatr_t* fPydatr; + Pysubs_t* fPysubs; + Pypars_t* fPypars; + Pyint1_t* fPyint1; + Pyint2_t* fPyint2; + Pyint3_t* fPyint3; + Pyint4_t* fPyint4; + Pyint5_t* fPyint5; + Pyint6_t* fPyint6; + Pyint7_t* fPyint7; + Pyint8_t* fPyint8; + Pyint9_t* fPyint9; + Pymssm_t* fPymssm; + Pyssmt_t* fPyssmt; + Pyints_t* fPyints; + Pybins_t* fPybins; + // ****** cleanup stuff (thanks Jim K.) + class TPythia6Cleaner { + public: + TPythia6Cleaner(); + ~TPythia6Cleaner(); + }; + friend class TPythia6Cleaner; + + TPythia6(const TPythia6&); // Cannot be copied + TPythia6& operator=(const TPythia6&); // Cannot be copied + +public: + // ****** constructors and destructor + TPythia6(); + ~TPythia6() override; + + static TPythia6 *Instance(); + + // ****** accessors + // FORTRAN indexing in accessing the arrays, + // indices start from 1 !!!!! + + // ****** access to PYTHIA6 common-blocks + + // ****** /PYJETS/ + + Pyjets_t* GetPyjets () { return fPyjets; } + int GetN () { return fPyjets->N; } + int GetNPAD () { return fPyjets->NPAD; } + int GetK(int ip, int i) { return fPyjets->K[i-1][ip-1]; } + double GetP(int ip, int i) { return fPyjets->P[i-1][ip-1]; } + double GetV(int ip, int i) { return fPyjets->V[i-1][ip-1]; } + + void SetN (int n) { fPyjets->N = n; } + void SetNPAD (int n) { fPyjets->NPAD = n; } + void SetK(int ip, int i, int k) { fPyjets->K[i-1][ip-1] = k; } + void SetP(int ip, int i, double p) { fPyjets->P[i-1][ip-1] = p; } + void SetV(int ip, int i, double v) { fPyjets->V[i-1][ip-1] = v; } + + // ****** /PYDAT1/ + + Pydat1_t* GetPydat1 () { return fPydat1; } + int GetMSTU(int i) { return fPydat1->MSTU[i-1]; } + double GetPARU(int i) { return fPydat1->PARU[i-1]; } + int GetMSTJ(int i) { return fPydat1->MSTJ[i-1]; } + double GetPARJ(int i) { return fPydat1->PARJ[i-1]; } + + void SetMSTU(int i, int m ) { fPydat1->MSTU[i-1] = m; } + void SetPARU(int i, double p) { fPydat1->PARU[i-1] = p; } + void SetMSTJ(int i, int m ) { fPydat1->MSTJ[i-1] = m; } + void SetPARJ(int i, double p) { fPydat1->PARJ[i-1] = p; } + + // ****** /PYDAT2/ + + Pydat2_t* GetPydat2 () { return fPydat2; } + int GetKCHG(int ip, int i) { return fPydat2->KCHG[i-1][ip-1]; } + double GetPMAS(int ip, int i) { return fPydat2->PMAS[i-1][ip-1]; } + double GetPARF (int i) { return fPydat2->PARF[i-1]; } + double GetVCKM(int i, int j) { return fPydat2->VCKM[j-1][i-1]; } + + void SetKCHG(int ip, int i, int k ) { fPydat2->KCHG[i-1][ip-1] = k; } + void SetPMAS(int ip, int i, double m) { fPydat2->PMAS[i-1][ip-1] = m; } + void SetPARF (int i, double p) { fPydat2->PARF[i-1] = p; } + void SetVCKM (int i, int j, double v) { fPydat2->VCKM[j-1][i-1] = v; } + + // ****** /PYDAT3/ + + Pydat3_t* GetPydat3() { return fPydat3; } + int GetMDCY(int i, int j) { return fPydat3->MDCY[j-1][i-1]; } + int GetMDME(int i, int j) { return fPydat3->MDME[j-1][i-1]; } + double GetBRAT (int i) { return fPydat3->BRAT[i-1]; } + int GetKFDP(int i, int j) { return fPydat3->KFDP[j-1][i-1]; } + + void SetMDCY(int i, int j, int m) { fPydat3->MDCY[j-1][i-1] = m; } + void SetMDME(int i, int j, int m) { fPydat3->MDME[j-1][i-1] = m; } + void SetBRAT(int i, double b) { fPydat3->BRAT[i-1] = b; } + void SetKFDP(int i, int j, int k) { fPydat3->KFDP[j-1][i-1] = k; } + + // ****** /PYDAT4/ + + Pydat4_t* GetPydat4() { return fPydat4; } + + // ****** /PYDATR/ - random number generator info + + Pydatr_t* GetPydatr () { return fPydatr; } + int GetMRPY(int i) { return fPydatr->MRPY[i-1]; } + double GetRRPY(int i) { return fPydatr->RRPY[i-1]; } + + void SetMRPY(int i, int m) { fPydatr->MRPY[i-1] = m; } + void SetRRPY(int i, double r) { fPydatr->RRPY[i-1] = r; } + + // ****** /PYSUBS/ + + Pysubs_t* GetPysubs () { return fPysubs; } + int GetMSEL () { return fPysubs->MSEL; } + int GetMSELPD () { return fPysubs->MSELPD; } + int GetMSUB (int i) { return fPysubs->MSUB[i-1]; } + double GetCKIN (int i) { return fPysubs->CKIN[i-1]; } + Int_t GetKFIN(int i, int j) {return fPysubs->KFIN[j+40][i-1]; } + + void SetMSEL (int m) { fPysubs->MSEL = m; } + void SetMSELPD (int m) { fPysubs->MSELPD = m; } + void SetMSUB (int i, int m) { fPysubs->MSUB[i-1] = m; } + void SetCKIN (int i, double c) { fPysubs->CKIN[i-1] = c; } + void SetKFIN(int i, int j, Int_t kfin=1) { fPysubs->KFIN[j+40][i-1] = kfin; } + + // ****** /PYPARS/ + + Pypars_t* GetPypars() { return fPypars; } + int GetMSTP(int i) { return fPypars->MSTP[i-1]; } + double GetPARP(int i) { return fPypars->PARP[i-1]; } + int GetMSTI(int i) { return fPypars->MSTI[i-1]; } + double GetPARI(int i) { return fPypars->PARI[i-1]; } + + void SetMSTP (int i, int m) { fPypars->MSTP[i-1] = m; } + void SetPARP (int i, double p) { fPypars->PARP[i-1] = p; } + void SetMSTI (int i, int m) { fPypars->MSTI[i-1] = m; } + void SetPARI (int i, double p) { fPypars->PARI[i-1] = p; } + + // ****** /PYINT1/ + + Pyint1_t* GetPyint1() { return fPyint1; } + int GetMINT(int i) { return fPyint1->MINT[i-1]; } + double GetVINT(int i) { return fPyint1->VINT[i-1]; } + + void SetMINT(int i, int m ) { fPyint1->MINT[i-1] = m; } + void SetVINT(int i, double v) { fPyint1->VINT[i-1] = v; } + + // ****** /PYINT2/ and /PYINT3/ + + Pyint2_t* GetPyint2() { return fPyint2; } + Pyint3_t* GetPyint3() { return fPyint3; } + + // ****** /PYINT4/ + + Pyint4_t* GetPyint4() { return fPyint4; } + int GetMWID (int i) { return fPyint4->MWID[i-1]; } + double GetWIDS(int i,int j) { return fPyint4->WIDS[j-1][i-1]; } + + void SetMWID(int i, int m) { fPyint4->MWID[i-1] = m; } + void SetWIDS(int i, int j, double w) { fPyint4->WIDS[j-1][i-1] = w; } + + // ****** / PYINT5/ + + Pyint5_t* GetPyint5() { return fPyint5; } + int GetNGENPD() { return fPyint5->NGENPD; } + void SetNGENPD(int n) { fPyint5->NGENPD = n; } + + // ****** /PYINT6/ + + Pyint6_t* GetPyint6 () { return fPyint6; } + char* GetPROC(int i) { fPyint6->PROC[i][27]=0; return fPyint6->PROC[i]; } + + Pyint7_t* GetPyint7() { return fPyint7; } + Pyint8_t* GetPyint8() { return fPyint8; } + Pyint9_t* GetPyint9() { return fPyint9; } + + // ****** /PYMSSM/ - indexing in FORTRAN starts + // from 0! + + Pymssm_t* GetPymssm() { return fPymssm; } + int GetIMSS(int i) { return fPymssm->IMSS[i]; } + double GetRMSS(int i) { return fPymssm->RMSS[i]; } + + void SetIMSS(int i, int m) { fPymssm->IMSS[i] = m; } + void SetRMSS(int i, double r) { fPymssm->RMSS[i] = r; } + + // ****** /PYSSMT/ + + Pyssmt_t* GetPyssmt() { return fPyssmt; } + double GetZMIX(int i, int j) { return fPyssmt->ZMIX[j-1][i-1]; } + double GetUMIX(int i, int j) { return fPyssmt->UMIX[j-1][i-1]; } + double GetVMIX(int i, int j) { return fPyssmt->VMIX[j-1][i-1]; } + double GetSMZ (int i) { return fPyssmt->SMZ[i-1]; } + double GetSMW (int i) { return fPyssmt->SMW[i-1]; } + + void SetZMIX(int i, int j, double z) { fPyssmt->ZMIX[j-1][i-1] = z; } + void SetUMIX(int i, int j, double u) { fPyssmt->UMIX[j-1][i-1] = u; } + void SetSMZ (int i, double s) { fPyssmt->SMZ[i-1] = s; } + void SetSMW (int i, double s) { fPyssmt->SMW[i-1] = s; } + + Pyints_t* GetPyints() { return fPyints; } + Pybins_t* GetPybins() { return fPybins; } + + // ****** TPYTHIA routines + + void GenerateEvent() override; + + void Initialize(const char *frame, const char *beam, const char *target, float win); + + Int_t ImportParticles(TClonesArray *particles, Option_t *option="") override; + TObjArray *ImportParticles(Option_t *option="") override; + + void OpenFortranFile(int lun, char* name); + void CloseFortranFile(int lun); + int Pychge(int kf); + int Pycomp(int kf); + void Pydiff(); + void Pyedit(int medit); + void Pyevnt(); + void Py1ent(Int_t line, Int_t kf, Double_t pe, Double_t theta, Double_t phi); + void Pyexec(); + void Pyhepc(int mconv); + void Pygive(const char *param); + void Pyinit(char* frame, char* beam, char* target, double wint); + void Pylist(int flag); + double Pymass(int kf); + void Pyname(int kf, char* name); + double Pyr(int idummy); + void Pyrget(int lun, int move); + void Pyrset(int lun, int move); + void Pystat(int flag); + void Pytest(int flag); + void Pytune(int itune); + void Pyupda(int mupda, int lun); + void SetupTest(); + + ClassDefOverride(TPythia6,0) //Interface to Pythia6.1 Event Generator +}; + +#endif diff --git a/GeneratorParam/TPythia6Calls.h b/GeneratorParam/TPythia6Calls.h new file mode 100644 index 0000000..90d15e6 --- /dev/null +++ b/GeneratorParam/TPythia6Calls.h @@ -0,0 +1,210 @@ +/* @(#)root/pythia6:$Id$ */ + +/************************************************************************* + * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * + * All rights reserved. * + * * + * For the licensing terms see $ROOTSYS/LICENSE. * + * For the list of contributors see $ROOTSYS/README/CREDITS. * + *************************************************************************/ +#ifndef ROOT_TPythia6Calls +#define ROOT_TPythia6Calls +// +// converted with i2h by P.Murat +// +//------------------------------------------------------------------------------ +//...This file contains a complete listing of all PYTHIA +//...commonblocks, and additionally some recommended other +//...declarations. You may copy this to the top of your +//...mina program and then eliminate unnecessary parts. +// Jun 19 1998 P.Murat(CDF): add implicit for integers +//----------------------------------------------------------------- +//...All real arithmetic in double precision. +// IMPLICIT DOUBLE PRECISION(A-H, O-Z) +// implicit integer (i-n) +//...Three Pythia functions return integers, so need declaring. +//...Parameter statement to help give large particle numbers +//...(left- and righthanded SUSY, excited fermions). +//...Commonblocks. +//...The event record. +//...Parameters. +//...Particle properties + some flavour parameters. +//...Decay information. +//...Particle names +//...Random number generator information. +//...Selection of hard scattering subprocesses. +//...Parameters. +//...Internal variables. +//...Process information. +//...Parton distributions and cross sections. +//...Resonance width and secondary decay treatment. +//...Generation and cross section statistics. +//...Process names. +//...Total cross sections. +//...Photon parton distributions: total and valence only. +//...Setting up user-defined processes. +//...Supersymmetry parameters. +//...Supersymmetry mixing matrices. +//...Parameters for Gauss integration of supersymmetric widths. +//...Histogram information. +//------------------------------------------------------------------------------ + +int const KSUSY1 = 1000000; +int const KSUSY2 = 2000000; +int const KEXCIT = 4000000; +int const KNDCAY = 8000; //should be 4000 for pythia61 + +/// Pythia6 common block Pyjets +struct Pyjets_t { + int N; + int NPAD; + int K[5][4000]; + double P[5][4000]; + double V[5][4000]; +}; + +/// Pythia6 common block Pydat1 +struct Pydat1_t { + int MSTU[200]; + double PARU[200]; + int MSTJ[200]; + double PARJ[200]; +}; + +/// Pythia6 common block Pydat2 +struct Pydat2_t { + int KCHG[4][500]; + double PMAS[4][500]; + double PARF[2000]; + double VCKM[4][4]; +}; + +/// Pythia6 common block Pydat3 +struct Pydat3_t { + int MDCY[3][500]; + int MDME[2][KNDCAY]; + double BRAT[KNDCAY]; + int KFDP[5][KNDCAY]; +}; + +/// Pythia6 common block Pydat4 +struct Pydat4_t { + char CHAF[2][500][16]; // here I needed manual intervention +}; + +/// Pythia6 common block Pydatr +struct Pydatr_t { + int MRPY[6]; + double RRPY[100]; +}; + +/// Pythia6 common block Pysubs +struct Pysubs_t { + int MSEL; + int MSELPD; + int MSUB[500]; + int KFIN[81][2]; // + double CKIN[200]; +}; + +/// Pythia6 common block Pypars +struct Pypars_t { + int MSTP[200]; + double PARP[200]; + int MSTI[200]; + double PARI[200]; +}; + +/// Pythia6 common block Pyint1 +struct Pyint1_t { + int MINT[400]; + double VINT[400]; +}; + +/// Pythia6 common block Pyint2 +struct Pyint2_t { + int ISET[500]; + int KFPR[2][500]; + double COEF[20][500]; + int ICOL[2][4][40]; +}; + +/// Pythia6 common block Pyint3 +struct Pyint3_t { + double XSFX[81][2]; // + int ISIG[3][1000]; + double SIGH[1000]; +}; + +/// Pythia6 common block Pyint4 +struct Pyint4_t { + int MWID[500]; + double WIDS[5][500]; +}; + +/// Pythia6 common block Pyint5 +struct Pyint5_t { + int NGENPD; + int NGEN[3][501]; + double XSEC[3][501]; +}; + +/// Pythia6 common block Pyint6 +struct Pyint6_t { + char PROC[501][28]; +}; + +/// Pythia6 common block Pyint7 +struct Pyint7_t { + double SIGT[6][7][7]; +}; + +/// Pythia6 common block Pyint8 +struct Pyint8_t { + double XPVMD[13]; + double XPANL[13]; + double XPANH[13]; + double XPBEH[13]; + double XPDIR[13]; +}; + +/// Pythia6 common block Pyint9 +struct Pyint9_t { + double VXPVMD[13]; + double VXPANL[13]; + double VXPANH[13]; + double VXPDGM[13]; +}; + +/// Pythia6 common block Pymssm +struct Pymssm_t { + int IMSS[100]; + double RMSS[100]; +}; + +/// Pythia6 common block Pyssmt +struct Pyssmt_t { + double ZMIX[4][4]; + double UMIX[2][2]; + double VMIX[2][2]; + double SMZ[4]; + double SMW[2]; + double SFMIX[4][16]; + double ZMIXI[4][4]; + double UMIXI[2][2]; + double VMIXI[2][2]; +}; + +/// Pythia6 common block Pyints +struct Pyints_t { + double XXM[20]; +}; + +/// Pythia6 common block Pybins +struct Pybins_t { + int IHIST[4]; + int INDX[1000]; + double BIN[20000]; +}; + +#endif diff --git a/GeneratorParam/TPythia6Decayer.h b/GeneratorParam/TPythia6Decayer.h new file mode 100644 index 0000000..0c283eb --- /dev/null +++ b/GeneratorParam/TPythia6Decayer.h @@ -0,0 +1,102 @@ +// @(#)root/pythia6:$Id$ +// Author: Christian Holm Christensen 22/04/06 + +/************************************************************************* + * Copyright (C) 1995-2006, Rene Brun and Fons Rademakers. * + * All rights reserved. * + * * + * For the licensing terms see $ROOTSYS/LICENSE. * + * For the list of contributors see $ROOTSYS/README/CREDITS. * + *************************************************************************/ + +#ifndef ROOT_TPythia6Decayer +#define ROOT_TPythia6Decayer + +/////////////////////////////////////////////////////////////////////////////// +// // +// TPythia6Decayer // +// // +// This implements the TVirtualMCDecayer interface. The TPythia6 // +// singleton object is used to decay particles. Note, that since this // +// class modifies common blocks (global variables) it is defined as a // +// singleton. // +// // +/////////////////////////////////////////////////////////////////////////////// + +#include "TVirtualMCDecayer.h" +#include "TString.h" +#include "TArrayF.h" + + +class TPythia6Decayer : public TVirtualMCDecayer { + +public: + // enum of decay mode types + enum EDecayType { + kSemiElectronic, + kDiElectron, + kSemiMuonic, + kDiMuon, + kBJpsiDiMuon, + kBJpsiDiElectron, + kBPsiPrimeDiMuon, + kBPsiPrimeDiElectron, + kPiToMu, + kKaToMu, + kNoDecay, + kHadronicD, + kOmega, + kPhiKK, + kAll, + kNoDecayHeavy, + kHardMuons, + kBJpsi, + kWToMuon, + kWToCharm, + kWToCharmToMuon, + kZDiMuon, + kMaxDecay + }; + +protected: + TString fDecayTableFile; // File to read decay table from + EDecayType fDecay; // Forced decay mode + TArrayF fBraPart; //! Branching ratios + + static TPythia6Decayer *fgInstance; + + // Extra functions + void ForceHadronicD(); + void ForceOmega(); + Int_t CountProducts(Int_t channel, Int_t particle); + +public: + TPythia6Decayer(); + ~TPythia6Decayer() override { } + void Init() override; + void Decay(Int_t idpart, TLorentzVector* p) override; + Int_t ImportParticles(TClonesArray *particles) override; + void SetForceDecay(Int_t type) override; + void ForceDecay() override; + void ForceParticleDecay(Int_t particle, Int_t* products, + Int_t* mult, Int_t npart); + void ForceParticleDecay(Int_t particle, Int_t product, Int_t mult); + Float_t GetPartialBranchingRatio(Int_t ipart) override; + Float_t GetLifetime(Int_t kf) override; + void ReadDecayTable() override; + // Extension member functions + virtual void SetDecayTableFile(const char* name); + virtual void WriteDecayTable(); + virtual void SetForceDecay(EDecayType type) { fDecay = type; } + + static TPythia6Decayer *Instance(); + + ClassDefOverride(TPythia6Decayer,1) // Particle Decayer Base Class +}; + +inline void TPythia6Decayer::SetDecayTableFile(const char *name) +{ + fDecayTableFile = name; +} + +#endif