CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/GeneratorInterface/HijingInterface/interface/HijingPythiaWrapper.h

Go to the documentation of this file.
00001 #ifndef gen_HijingPythiaWrapper_h
00002 #define gen_HijingPythiaWrapper_h
00003 
00004 #include "HepMC/PythiaWrapper6_2.h"
00005 
00006  extern "C"
00007  {
00008     void   py1ent_(int& ip, int& kf, double& pe, double& the, double& phi);
00009     double pymass_(int& );
00010     void   pyexec_();
00011     int    pycomp_(int& );
00012     void   pyglfr_();
00013     void   pyglrhad_();
00014     void   pystlfr_();
00015     void   pystrhad_();
00016     void   pygive_(const char*, int );
00017     void   pydecy_( int& ip ) ;
00018     void   pyrobo_( int&, int&, double&, double&, double&, double&, double& );
00019     
00020     void   txgive_(const char*, int );
00021     void   txgive_init_(void);
00022     
00023     static bool call_pygive(const std::string &line)
00024     {
00025        int numWarn = pydat1.mstu[26];    // # warnings
00026        int numErr = pydat1.mstu[22];     // # errors
00027        
00028        pygive_(line.c_str(), line.length());
00029        
00030        return pydat1.mstu[26] == numWarn &&
00031           pydat1.mstu[22] == numErr;
00032     }
00033  }
00034  
00035 #define PYCOMP pycomp_
00036 extern "C" {
00037    int PYCOMP(int& length);
00038 }
00039 
00040 #define LUGIVE pygive_
00041 extern "C" {
00042    void LUGIVE(const char*,int length);
00043 }
00044 
00045 #include "CLHEP/Random/RandomEngine.h"
00046 extern CLHEP::HepRandomEngine* randomEngine;
00047 extern "C" {
00048    double pyr_(int* idummy);
00049 }
00050 
00051 CLHEP::HepRandomEngine* randomEngine;
00052 
00053 double pyr_(int *idummy)
00054 {
00055    // getInstance will throw if no one used enter/leave
00056    // or this is the wrong caller class, like e.g. Herwig6Instance
00057    return randomEngine->flat(); 
00058 }
00059 
00060 #endif