CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HijingPythiaWrapper.h
Go to the documentation of this file.
1 #ifndef gen_HijingPythiaWrapper_h
2 #define gen_HijingPythiaWrapper_h
3 
5 #include "HepMC/PythiaWrapper6_4.h"
6 
7 #include "CLHEP/Random/RandomEngine.h"
8 
9  extern "C"
10  {
11  void py1ent_(int& ip, int& kf, double& pe, double& the, double& phi);
12  double pymass_(int& );
13  void pyexec_();
14  int pycomp_(int& );
15  void pyglfr_();
16  void pyglrhad_();
17  void pystlfr_();
18  void pystrhad_();
19  void pygive_(const char*, int );
20  void pydecy_( int& ip ) ;
21  void pyrobo_( int&, int&, double&, double&, double&, double&, double& );
22 
23  void txgive_(const char*, int );
24  void txgive_init_(void);
25 
26  static bool call_pygive(const std::string &line)
27  {
28  int numWarn = pydat1.mstu[26]; // # warnings
29  int numErr = pydat1.mstu[22]; // # errors
30 
31  pygive_(line.c_str(), line.length());
32 
33  return pydat1.mstu[26] == numWarn &&
34  pydat1.mstu[22] == numErr;
35  }
36  }
37 
38 #define PYCOMP pycomp_
39 extern "C" {
40  int PYCOMP(int& length);
41 }
42 
43 #define LUGIVE pygive_
44 extern "C" {
45  void LUGIVE(const char*,int length);
46 }
47 
48 /*
49 extern "C" {
50  double ran_(int*){
51  return gen::pyr_(0);
52  }
53 }
54 */
55 
56 float ranff_(unsigned int *iseed)
57 {
58  (*iseed) = (69069 * (*iseed) + 1) & 0xffffffffUL;
59  return (*iseed) / 4294967296.0;
60 }
61 
62 
63 CLHEP::HepRandomEngine* hijRandomEngine;
64 
65 extern "C"
66 {
67  float gen::hijran_(int *idummy)
68  {
69  return hijRandomEngine->flat();
70  }
71 }
72 
73 
74 
75 
76 extern "C" {
77  float ran_(unsigned int* iseed){
78  return hijRandomEngine->flat();
79  // return ranff_(iseed);
80  // return gen::pyr_(0);
81  }
82 }
83 
84 extern "C" {
85  float rlu_(unsigned int* iseed){
86  return hijRandomEngine->flat();
87  // return ranff_(iseed);
88  // return gen::pyr_(0);
89  }
90 }
91 
92 
93 
94 
95 
96 
97 /*
98 
99 #include "CLHEP/Random/RandomEngine.h"
100 extern CLHEP::HepRandomEngine* randomEngine;
101 extern "C" {
102  double pyr_(int* idummy);
103 }
104 
105 CLHEP::HepRandomEngine* randomEngine;
106 
107 double pyr_(int *idummy)
108 {
109  // getInstance will throw if no one used enter/leave
110  // or this is the wrong caller class, like e.g. Herwig6Instance
111  return randomEngine->flat();
112 }
113 
114 */
115 
116 #endif
#define pydat1
void pystlfr_()
void pystrhad_()
float ranff_(unsigned int *iseed)
void txgive_init_(void)
CLHEP::HepRandomEngine * hijRandomEngine
void pydecy_(int &ip)
static bool call_pygive(const std::string &line)
int pycomp_(int &)
#define PYCOMP
void pyglfr_()
void py1ent_(int &ip, int &kf, double &pe, double &the, double &phi)
void pyglrhad_()
void pygive_(const char *, int)
float ran_(unsigned int *iseed)
double pymass_(int &)
#define LUGIVE
float rlu_(unsigned int *iseed)
int iseed
Definition: AMPTWrapper.h:124
void pyexec_()
void txgive_(const char *, int)
void pyrobo_(int &, int &, double &, double &, double &, double &, double &)
float hijran_(int *)
Definition: DDAxes.h:10