|
| 1 | +// @(#)root/pythia6:$Id$ |
| 2 | +// Author: Rene Brun 19/10/99 |
| 3 | + |
| 4 | +/************************************************************************* |
| 5 | + * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * |
| 6 | + * All rights reserved. * |
| 7 | + * * |
| 8 | + * For the licensing terms see $ROOTSYS/LICENSE. * |
| 9 | + * For the list of contributors see $ROOTSYS/README/CREDITS. * |
| 10 | + *************************************************************************/ |
| 11 | + |
| 12 | +#ifndef PYTHIA_TPythia6 |
| 13 | +#define PYTHIA_TPythia6 |
| 14 | + |
| 15 | +//////////////////////////////////////////////////////////////////////////////// |
| 16 | +// // |
| 17 | +// TPythia6 // |
| 18 | +// // |
| 19 | +// TPythia is an interface class to F77 version of Pythia 6.2 // |
| 20 | +// CERNLIB event generators, written by T.Sjostrand. // |
| 21 | +// For the details about these generators look at Pythia/Jetset manual: // |
| 22 | +// // |
| 23 | +// ****************************************************************************** |
| 24 | +// ****************************************************************************** |
| 25 | +// ** ** |
| 26 | +// ** ** |
| 27 | +// ** *......* Welcome to the Lund Monte Carlo! ** |
| 28 | +// ** *:::!!:::::::::::* ** |
| 29 | +// ** *::::::!!::::::::::::::* PPP Y Y TTTTT H H III A ** |
| 30 | +// ** *::::::::!!::::::::::::::::* P P Y Y T H H I A A ** |
| 31 | +// ** *:::::::::!!:::::::::::::::::* PPP Y T HHHHH I AAAAA ** |
| 32 | +// ** *:::::::::!!:::::::::::::::::* P Y T H H I A A ** |
| 33 | +// ** *::::::::!!::::::::::::::::*! P Y T H H III A A ** |
| 34 | +// ** *::::::!!::::::::::::::* !! ** |
| 35 | +// ** !! *:::!!:::::::::::* !! This is PYTHIA version 6.205 ** |
| 36 | +// ** !! !* -><- * !! Last date of change: 1 Mar 2002 ** |
| 37 | +// ** !! !! !! ** |
| 38 | +// ** !! !! !! Now is 0 Jan 2000 at 0:00:00 ** |
| 39 | +// ** !! !! ** |
| 40 | +// ** !! lh !! Disclaimer: this program comes ** |
| 41 | +// ** !! !! without any guarantees. Beware ** |
| 42 | +// ** !! hh !! of errors and use common sense ** |
| 43 | +// ** !! ll !! when interpreting results. ** |
| 44 | +// ** !! !! ** |
| 45 | +// ** !! Copyright T. Sjostrand (2001) ** |
| 46 | +// ** ** |
| 47 | +// ** An archive of program versions and documentation is found on the web: ** |
| 48 | +// ** http://www.thep.lu.se/~torbjorn/Pythia.html ** |
| 49 | +// ** ** |
| 50 | +// ** When you cite this program, currently the official reference is ** |
| 51 | +// ** T. Sjostrand, P. Eden, C. Friberg, L. Lonnblad, G. Miu, S. Mrenna and ** |
| 52 | +// ** E. Norrbin, Computer Physics Commun. 135 (2001) 238. ** |
| 53 | +// ** The large manual is ** |
| 54 | +// ** T. Sjostrand, L. Lonnblad and S. Mrenna, LU TP 01-21 [hep-ph/0108264]. ** |
| 55 | +// ** Also remember that the program, to a large extent, represents original ** |
| 56 | +// ** physics research. Other publications of special relevance to your ** |
| 57 | +// ** studies may therefore deserve separate mention. ** |
| 58 | +// ** ** |
| 59 | +// ** Main author: Torbjorn Sjostrand; Department of Theoretical Physics 2, ** |
| 60 | +// ** Lund University, Solvegatan 14A, S-223 62 Lund, Sweden; ** |
| 61 | +// ** phone: + 46 - 46 - 222 48 16; e-mail: [email protected] ** |
| 62 | +// ** Author: Leif Lonnblad; Department of Theoretical Physics 2, ** |
| 63 | +// ** Lund University, Solvegatan 14A, S-223 62 Lund, Sweden; ** |
| 64 | +// ** phone: + 46 - 46 - 222 77 80; e-mail: [email protected] ** |
| 65 | +// ** Author: Stephen Mrenna; Computing Division, Simulations Group, ** |
| 66 | +// ** Fermi National Accelerator Laboratory, MS 234, Batavia, IL 60510, USA; ** |
| 67 | +// ** phone: + 1 - 630 - 840 - 2556; e-mail: [email protected] ** |
| 68 | +// ** Author: Peter Skands; Department of Theoretical Physics 2, ** |
| 69 | +// ** Lund University, Solvegatan 14A, S-223 62 Lund, Sweden; ** |
| 70 | +// ** phone: + 46 - 46 - 222 31 92; e-mail: [email protected] ** |
| 71 | +// ** ** |
| 72 | +// ** ** |
| 73 | +// ****************************************************************************** |
| 74 | +//#ifdef __GNUG__ |
| 75 | +//#pragma interface |
| 76 | +//#endif |
| 77 | + |
| 78 | +#include "TPythia6Calls.h" |
| 79 | + |
| 80 | +#include "TGenerator.h" |
| 81 | + |
| 82 | +#include "TObjArray.h" |
| 83 | + |
| 84 | +class TPythia6 : public TGenerator { |
| 85 | + |
| 86 | +protected: |
| 87 | + static TPythia6* fgInstance; |
| 88 | + // PYTHIA6 common-blocks |
| 89 | + Pyjets_t* fPyjets; |
| 90 | + Pydat1_t* fPydat1; |
| 91 | + Pydat2_t* fPydat2; |
| 92 | + Pydat3_t* fPydat3; |
| 93 | + Pydat4_t* fPydat4; |
| 94 | + Pydatr_t* fPydatr; |
| 95 | + Pysubs_t* fPysubs; |
| 96 | + Pypars_t* fPypars; |
| 97 | + Pyint1_t* fPyint1; |
| 98 | + Pyint2_t* fPyint2; |
| 99 | + Pyint3_t* fPyint3; |
| 100 | + Pyint4_t* fPyint4; |
| 101 | + Pyint5_t* fPyint5; |
| 102 | + Pyint6_t* fPyint6; |
| 103 | + Pyint7_t* fPyint7; |
| 104 | + Pyint8_t* fPyint8; |
| 105 | + Pyint9_t* fPyint9; |
| 106 | + Pymssm_t* fPymssm; |
| 107 | + Pyssmt_t* fPyssmt; |
| 108 | + Pyints_t* fPyints; |
| 109 | + Pybins_t* fPybins; |
| 110 | + // ****** cleanup stuff (thanks Jim K.) |
| 111 | + class TPythia6Cleaner { |
| 112 | + public: |
| 113 | + TPythia6Cleaner(); |
| 114 | + ~TPythia6Cleaner(); |
| 115 | + }; |
| 116 | + friend class TPythia6Cleaner; |
| 117 | + |
| 118 | + TPythia6(const TPythia6&); // Cannot be copied |
| 119 | + TPythia6& operator=(const TPythia6&); // Cannot be copied |
| 120 | + |
| 121 | +public: |
| 122 | + // ****** constructors and destructor |
| 123 | + TPythia6(); |
| 124 | + ~TPythia6() override; |
| 125 | + |
| 126 | + static TPythia6 *Instance(); |
| 127 | + |
| 128 | + // ****** accessors |
| 129 | + // FORTRAN indexing in accessing the arrays, |
| 130 | + // indices start from 1 !!!!! |
| 131 | + |
| 132 | + // ****** access to PYTHIA6 common-blocks |
| 133 | + |
| 134 | + // ****** /PYJETS/ |
| 135 | + |
| 136 | + Pyjets_t* GetPyjets () { return fPyjets; } |
| 137 | + int GetN () { return fPyjets->N; } |
| 138 | + int GetNPAD () { return fPyjets->NPAD; } |
| 139 | + int GetK(int ip, int i) { return fPyjets->K[i-1][ip-1]; } |
| 140 | + double GetP(int ip, int i) { return fPyjets->P[i-1][ip-1]; } |
| 141 | + double GetV(int ip, int i) { return fPyjets->V[i-1][ip-1]; } |
| 142 | + |
| 143 | + void SetN (int n) { fPyjets->N = n; } |
| 144 | + void SetNPAD (int n) { fPyjets->NPAD = n; } |
| 145 | + void SetK(int ip, int i, int k) { fPyjets->K[i-1][ip-1] = k; } |
| 146 | + void SetP(int ip, int i, double p) { fPyjets->P[i-1][ip-1] = p; } |
| 147 | + void SetV(int ip, int i, double v) { fPyjets->V[i-1][ip-1] = v; } |
| 148 | + |
| 149 | + // ****** /PYDAT1/ |
| 150 | + |
| 151 | + Pydat1_t* GetPydat1 () { return fPydat1; } |
| 152 | + int GetMSTU(int i) { return fPydat1->MSTU[i-1]; } |
| 153 | + double GetPARU(int i) { return fPydat1->PARU[i-1]; } |
| 154 | + int GetMSTJ(int i) { return fPydat1->MSTJ[i-1]; } |
| 155 | + double GetPARJ(int i) { return fPydat1->PARJ[i-1]; } |
| 156 | + |
| 157 | + void SetMSTU(int i, int m ) { fPydat1->MSTU[i-1] = m; } |
| 158 | + void SetPARU(int i, double p) { fPydat1->PARU[i-1] = p; } |
| 159 | + void SetMSTJ(int i, int m ) { fPydat1->MSTJ[i-1] = m; } |
| 160 | + void SetPARJ(int i, double p) { fPydat1->PARJ[i-1] = p; } |
| 161 | + |
| 162 | + // ****** /PYDAT2/ |
| 163 | + |
| 164 | + Pydat2_t* GetPydat2 () { return fPydat2; } |
| 165 | + int GetKCHG(int ip, int i) { return fPydat2->KCHG[i-1][ip-1]; } |
| 166 | + double GetPMAS(int ip, int i) { return fPydat2->PMAS[i-1][ip-1]; } |
| 167 | + double GetPARF (int i) { return fPydat2->PARF[i-1]; } |
| 168 | + double GetVCKM(int i, int j) { return fPydat2->VCKM[j-1][i-1]; } |
| 169 | + |
| 170 | + void SetKCHG(int ip, int i, int k ) { fPydat2->KCHG[i-1][ip-1] = k; } |
| 171 | + void SetPMAS(int ip, int i, double m) { fPydat2->PMAS[i-1][ip-1] = m; } |
| 172 | + void SetPARF (int i, double p) { fPydat2->PARF[i-1] = p; } |
| 173 | + void SetVCKM (int i, int j, double v) { fPydat2->VCKM[j-1][i-1] = v; } |
| 174 | + |
| 175 | + // ****** /PYDAT3/ |
| 176 | + |
| 177 | + Pydat3_t* GetPydat3() { return fPydat3; } |
| 178 | + int GetMDCY(int i, int j) { return fPydat3->MDCY[j-1][i-1]; } |
| 179 | + int GetMDME(int i, int j) { return fPydat3->MDME[j-1][i-1]; } |
| 180 | + double GetBRAT (int i) { return fPydat3->BRAT[i-1]; } |
| 181 | + int GetKFDP(int i, int j) { return fPydat3->KFDP[j-1][i-1]; } |
| 182 | + |
| 183 | + void SetMDCY(int i, int j, int m) { fPydat3->MDCY[j-1][i-1] = m; } |
| 184 | + void SetMDME(int i, int j, int m) { fPydat3->MDME[j-1][i-1] = m; } |
| 185 | + void SetBRAT(int i, double b) { fPydat3->BRAT[i-1] = b; } |
| 186 | + void SetKFDP(int i, int j, int k) { fPydat3->KFDP[j-1][i-1] = k; } |
| 187 | + |
| 188 | + // ****** /PYDAT4/ |
| 189 | + |
| 190 | + Pydat4_t* GetPydat4() { return fPydat4; } |
| 191 | + |
| 192 | + // ****** /PYDATR/ - random number generator info |
| 193 | + |
| 194 | + Pydatr_t* GetPydatr () { return fPydatr; } |
| 195 | + int GetMRPY(int i) { return fPydatr->MRPY[i-1]; } |
| 196 | + double GetRRPY(int i) { return fPydatr->RRPY[i-1]; } |
| 197 | + |
| 198 | + void SetMRPY(int i, int m) { fPydatr->MRPY[i-1] = m; } |
| 199 | + void SetRRPY(int i, double r) { fPydatr->RRPY[i-1] = r; } |
| 200 | + |
| 201 | + // ****** /PYSUBS/ |
| 202 | + |
| 203 | + Pysubs_t* GetPysubs () { return fPysubs; } |
| 204 | + int GetMSEL () { return fPysubs->MSEL; } |
| 205 | + int GetMSELPD () { return fPysubs->MSELPD; } |
| 206 | + int GetMSUB (int i) { return fPysubs->MSUB[i-1]; } |
| 207 | + double GetCKIN (int i) { return fPysubs->CKIN[i-1]; } |
| 208 | + Int_t GetKFIN(int i, int j) {return fPysubs->KFIN[j+40][i-1]; } |
| 209 | + |
| 210 | + void SetMSEL (int m) { fPysubs->MSEL = m; } |
| 211 | + void SetMSELPD (int m) { fPysubs->MSELPD = m; } |
| 212 | + void SetMSUB (int i, int m) { fPysubs->MSUB[i-1] = m; } |
| 213 | + void SetCKIN (int i, double c) { fPysubs->CKIN[i-1] = c; } |
| 214 | + void SetKFIN(int i, int j, Int_t kfin=1) { fPysubs->KFIN[j+40][i-1] = kfin; } |
| 215 | + |
| 216 | + // ****** /PYPARS/ |
| 217 | + |
| 218 | + Pypars_t* GetPypars() { return fPypars; } |
| 219 | + int GetMSTP(int i) { return fPypars->MSTP[i-1]; } |
| 220 | + double GetPARP(int i) { return fPypars->PARP[i-1]; } |
| 221 | + int GetMSTI(int i) { return fPypars->MSTI[i-1]; } |
| 222 | + double GetPARI(int i) { return fPypars->PARI[i-1]; } |
| 223 | + |
| 224 | + void SetMSTP (int i, int m) { fPypars->MSTP[i-1] = m; } |
| 225 | + void SetPARP (int i, double p) { fPypars->PARP[i-1] = p; } |
| 226 | + void SetMSTI (int i, int m) { fPypars->MSTI[i-1] = m; } |
| 227 | + void SetPARI (int i, double p) { fPypars->PARI[i-1] = p; } |
| 228 | + |
| 229 | + // ****** /PYINT1/ |
| 230 | + |
| 231 | + Pyint1_t* GetPyint1() { return fPyint1; } |
| 232 | + int GetMINT(int i) { return fPyint1->MINT[i-1]; } |
| 233 | + double GetVINT(int i) { return fPyint1->VINT[i-1]; } |
| 234 | + |
| 235 | + void SetMINT(int i, int m ) { fPyint1->MINT[i-1] = m; } |
| 236 | + void SetVINT(int i, double v) { fPyint1->VINT[i-1] = v; } |
| 237 | + |
| 238 | + // ****** /PYINT2/ and /PYINT3/ |
| 239 | + |
| 240 | + Pyint2_t* GetPyint2() { return fPyint2; } |
| 241 | + Pyint3_t* GetPyint3() { return fPyint3; } |
| 242 | + |
| 243 | + // ****** /PYINT4/ |
| 244 | + |
| 245 | + Pyint4_t* GetPyint4() { return fPyint4; } |
| 246 | + int GetMWID (int i) { return fPyint4->MWID[i-1]; } |
| 247 | + double GetWIDS(int i,int j) { return fPyint4->WIDS[j-1][i-1]; } |
| 248 | + |
| 249 | + void SetMWID(int i, int m) { fPyint4->MWID[i-1] = m; } |
| 250 | + void SetWIDS(int i, int j, double w) { fPyint4->WIDS[j-1][i-1] = w; } |
| 251 | + |
| 252 | + // ****** / PYINT5/ |
| 253 | + |
| 254 | + Pyint5_t* GetPyint5() { return fPyint5; } |
| 255 | + int GetNGENPD() { return fPyint5->NGENPD; } |
| 256 | + void SetNGENPD(int n) { fPyint5->NGENPD = n; } |
| 257 | + |
| 258 | + // ****** /PYINT6/ |
| 259 | + |
| 260 | + Pyint6_t* GetPyint6 () { return fPyint6; } |
| 261 | + char* GetPROC(int i) { fPyint6->PROC[i][27]=0; return fPyint6->PROC[i]; } |
| 262 | + |
| 263 | + Pyint7_t* GetPyint7() { return fPyint7; } |
| 264 | + Pyint8_t* GetPyint8() { return fPyint8; } |
| 265 | + Pyint9_t* GetPyint9() { return fPyint9; } |
| 266 | + |
| 267 | + // ****** /PYMSSM/ - indexing in FORTRAN starts |
| 268 | + // from 0! |
| 269 | + |
| 270 | + Pymssm_t* GetPymssm() { return fPymssm; } |
| 271 | + int GetIMSS(int i) { return fPymssm->IMSS[i]; } |
| 272 | + double GetRMSS(int i) { return fPymssm->RMSS[i]; } |
| 273 | + |
| 274 | + void SetIMSS(int i, int m) { fPymssm->IMSS[i] = m; } |
| 275 | + void SetRMSS(int i, double r) { fPymssm->RMSS[i] = r; } |
| 276 | + |
| 277 | + // ****** /PYSSMT/ |
| 278 | + |
| 279 | + Pyssmt_t* GetPyssmt() { return fPyssmt; } |
| 280 | + double GetZMIX(int i, int j) { return fPyssmt->ZMIX[j-1][i-1]; } |
| 281 | + double GetUMIX(int i, int j) { return fPyssmt->UMIX[j-1][i-1]; } |
| 282 | + double GetVMIX(int i, int j) { return fPyssmt->VMIX[j-1][i-1]; } |
| 283 | + double GetSMZ (int i) { return fPyssmt->SMZ[i-1]; } |
| 284 | + double GetSMW (int i) { return fPyssmt->SMW[i-1]; } |
| 285 | + |
| 286 | + void SetZMIX(int i, int j, double z) { fPyssmt->ZMIX[j-1][i-1] = z; } |
| 287 | + void SetUMIX(int i, int j, double u) { fPyssmt->UMIX[j-1][i-1] = u; } |
| 288 | + void SetSMZ (int i, double s) { fPyssmt->SMZ[i-1] = s; } |
| 289 | + void SetSMW (int i, double s) { fPyssmt->SMW[i-1] = s; } |
| 290 | + |
| 291 | + Pyints_t* GetPyints() { return fPyints; } |
| 292 | + Pybins_t* GetPybins() { return fPybins; } |
| 293 | + |
| 294 | + // ****** TPYTHIA routines |
| 295 | + |
| 296 | + void GenerateEvent() override; |
| 297 | + |
| 298 | + void Initialize(const char *frame, const char *beam, const char *target, float win); |
| 299 | + |
| 300 | + Int_t ImportParticles(TClonesArray *particles, Option_t *option="") override; |
| 301 | + TObjArray *ImportParticles(Option_t *option="") override; |
| 302 | + |
| 303 | + void OpenFortranFile(int lun, char* name); |
| 304 | + void CloseFortranFile(int lun); |
| 305 | + int Pychge(int kf); |
| 306 | + int Pycomp(int kf); |
| 307 | + void Pydiff(); |
| 308 | + void Pyedit(int medit); |
| 309 | + void Pyevnt(); |
| 310 | + void Py1ent(Int_t line, Int_t kf, Double_t pe, Double_t theta, Double_t phi); |
| 311 | + void Pyexec(); |
| 312 | + void Pyhepc(int mconv); |
| 313 | + void Pygive(const char *param); |
| 314 | + void Pyinit(char* frame, char* beam, char* target, double wint); |
| 315 | + void Pylist(int flag); |
| 316 | + double Pymass(int kf); |
| 317 | + void Pyname(int kf, char* name); |
| 318 | + double Pyr(int idummy); |
| 319 | + void Pyrget(int lun, int move); |
| 320 | + void Pyrset(int lun, int move); |
| 321 | + void Pystat(int flag); |
| 322 | + void Pytest(int flag); |
| 323 | + void Pytune(int itune); |
| 324 | + void Pyupda(int mupda, int lun); |
| 325 | + void SetupTest(); |
| 326 | + |
| 327 | + ClassDefOverride(TPythia6,0) //Interface to Pythia6.1 Event Generator |
| 328 | +}; |
| 329 | + |
| 330 | +#endif |
0 commit comments