CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/GeneratorInterface/ReggeGribovPartonMCInterface/interface/ReggeGribovPartonMCHadronizer.h

Go to the documentation of this file.
00001 #ifndef REGGEGRIBOVPARTONMCHADRONIZER_H
00002 #define REGGEGRIBOVPARTONMCHADRONIZER_H
00003 
00004 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00005 #include "GeneratorInterface/Core/interface/BaseHadronizer.h"
00006 #include "FWCore/ParameterSet/interface/FileInPath.h"
00007 
00008 #include "CLHEP/Random/RandomEngine.h"
00009 #include "CLHEP/Random/RandFlat.h"
00010 
00011 #include "boost/scoped_ptr.hpp"
00012 
00013 #include <map>
00014 #include <string>
00015 #include <vector>
00016 #include <math.h>
00017 
00018 boost::scoped_ptr<CLHEP::RandFlat> gFlatDistribution_; // yes, this must be global...
00019 
00020 namespace HepMC {
00021   class GenEvent;
00022   class GenParticle;
00023   class GenVertex;
00024 }
00025 
00026 extern "C"
00027 {
00028   //iout,ievent,noutpart,impactpar,outpart,outpx,outpy,outpz,oute,outm,outstat
00029   void crmc_f_(int&, int&, int&, double&, int&, double&, double&, double&,
00030                 double&, double&, int&);
00031 
00032   //iEvent,iSeed,pproj,ptarg,ipart,itarg,imodel,itab,iout,output,param
00033   void crmc_set_f_(int&, int&, double&, double&, int&, int&, int&, int&,
00034                    int&, const char*, const char*);
00035 
00036   //iEvent,iSeed,pproj,ptarg,ipart,itarg,imodel,itab,iout,output,param
00037   void crmc_init_f_();
00038 }
00039 
00040 #define nmxhep 99990
00041 
00042 extern "C"
00043 {
00044 /*  extern struct
00045   {
00046     int nevhep;
00047     int nhep;
00048 
00049     int isthep[nmxhep];
00050     int idhep[nmxhep];
00051     int jmohep[nmxhep][2];
00052     int jdahep[nmxhep][2];
00053     double phep[nmxhep][5]; 
00054     double vhep[nmxhep][5];
00055   } hepcom_; //epos.inc*/
00056   
00057   extern struct
00058   {
00059     float sigtot; // ........ total cross section
00060     float sigcut;
00061     float sigela;
00062     float sloela;
00063     float sigsd;
00064     float sigine;
00065     float sigdif;
00066     float sigineaa;
00067     float sigtotaa;
00068     float sigelaaa;
00069     float sigcutaa;
00070   } hadr5_; //epos.inc
00071 
00072   extern struct
00073   {
00074     float phievt; // ........ angle of impact parameter
00075     int   nevt;   // ........ error code. 1=valid event, 0=invalid event
00076     float bimevt; // ........ absolute value of impact parameter
00077     int   kolevt; // ........ number of collisions
00078     int   koievt; // ........ number of inelastic collisions
00079     float pmxevt; // ........ reference momentum
00080     float egyevt; // ........ pp cm energy (hadron) or string energy (lepton)
00081     int   npjevt; // ........ number of primary projectile participants
00082     int   ntgevt; // ........ number of primary target participants
00083     int   npnevt; // ........ number of primary projectile neutron spectators
00084     int   nppevt; // ........ number of primary projectile proton spectators
00085     int   ntnevt; // ........ number of primary target neutron spectators
00086     int   ntpevt; // ........ number of primary target proton spectators
00087     int   jpnevt; // ........ number of absolute projectile neutron spectators
00088     int   jppevt; // ........ number of absolute projectile proton spectators
00089     int   jtnevt; // ........ number of absolute target neutron spectators
00090     int   jtpevt; // ........ number of absolute target proton spectators
00091     float xbjevt; // ........ bjorken x for dis
00092     float qsqevt; // ........ q**2 for dis
00093     int   nglevt; // ........ number of collisions acc to  Glauber
00094     float zppevt; // ........ average Z-parton-proj
00095     float zptevt; // ........ average Z-parton-targ
00096     int   minfra; //
00097     int   maxfra; //
00098     int   kohevt; // ........ number of hard collisions
00099   } cevt_; //epos.inc
00100 
00101   extern struct
00102   {
00103     int   ng1evt; // ........ number of collisions acc to  Glauber
00104     int   ng2evt; // ........ number of Glauber participants with at least two IAs
00105     float rglevt; // ........
00106     float sglevt; // ........
00107     float eglevt; // ........
00108     float fglevt; // ........
00109     int   ikoevt; // ........ number of elementary parton-parton scatterings
00110     float typevt; // ........ type of event (1=Non Diff, 2=Double Diff, 3=Single Diff)
00111   } c2evt_; //epos.inc
00112 
00113   extern struct
00114   {
00115     float bmaxim;
00116     float bminim;
00117     float phimax;
00118     float phimin;
00119   } nucl2_; //epos.inc
00120 }
00121 
00122 
00123 extern "C"
00124 {
00125   extern struct
00126   {
00127     char fnch[500];
00128     char fnhi[500];
00129     char fndt[500];
00130     char fnii[500];
00131     char fnid[500];
00132     char fnie[500];
00133     char fnrj[500];
00134     char fnmt[500];
00135     char fngrv[500];
00136     char fncp[500];
00137     char fnnx[500];
00138     char fncs[500];
00139     char fndr[500];
00140     char fnhpf[500];
00141   } fname_; //epos.inc
00142 
00143   extern struct
00144   {
00145     int nfnch;
00146     int nfnhi;
00147     int nfndt;
00148     int nfnii;
00149     int nfnid;
00150     int nfnie;
00151     int nfnrj;
00152     int nfnmt;
00153     int nfngrv;
00154     int nfncp;
00155     int nfnnx;
00156     int nfncs;
00157     int nfndr;
00158     int nfnhpf;
00159   } nfname_; //epos.inc
00160 
00161   extern struct
00162   {
00163     char fndat[500];
00164     char fnncs[500];
00165     int ifdat;
00166     int ifncs;
00167   } qgsfname_; //epos-bas.f
00168 
00169   extern struct
00170   {
00171     int nfndat;
00172     int nfnncs;
00173   } qgsnfname_; //epos-bas.f
00174 
00175   extern struct
00176   {
00177     char fniidat[500];
00178     char fniincs[500];
00179     int ifiidat;
00180     int ifiincs;
00181   } qgsiifname_; //epos-bas.f
00182 
00183   extern struct
00184   {
00185     int nfniidat;
00186     int nfniincs;
00187   } qgsiinfname_; //epos-bas.f
00188 }
00189 
00190 namespace gen
00191 {
00192   extern "C" {
00193     float rangen_();
00194   }
00195 
00196   extern "C" {
00197     double drangen_(int*);
00198   }
00199 
00200 
00201   class ReggeGribovPartonMCHadronizer : public BaseHadronizer
00202   {
00203 
00204   public:
00205     ReggeGribovPartonMCHadronizer(const edm::ParameterSet &);
00206     virtual ~ReggeGribovPartonMCHadronizer();
00207 
00208     bool generatePartonsAndHadronize();
00209     bool hadronize();
00210     bool decay();
00211     bool residualDecay();
00212     bool readSettings( int ) { return true; }
00213     bool initializeForExternalPartons() { return true; }
00214     bool initializeForInternalPartons();
00215     bool declareStableParticles( const std::vector<int> );
00216     bool declareSpecialSettings( const std::vector<std::string> ) { return true; }
00217     bool initializeTablePaths();
00218 
00219     void finalizeEvent();
00220     void statistics();
00221     const char* classname() const;
00222 
00223   private:
00224     edm::ParameterSet pset_;
00225     double  m_BeamMomentum;
00226     double  m_TargetMomentum;
00227     int     m_BeamID;
00228     int     m_TargetID;
00229     int     m_HEModel;
00230     double  m_bMin;
00231     double  m_bMax;
00232     edm::FileInPath m_ParamFileName;
00233     bool    m_SkipNuclFrag;
00234     int     m_NEvent;
00235 
00236     int     m_NParticles;
00237     double  m_ImpactParameter;
00238     int     m_PartID[nmxhep];
00239     double  m_PartPx[nmxhep];
00240     double  m_PartPy[nmxhep];
00241     double  m_PartPz[nmxhep];
00242     double  m_PartEnergy[nmxhep];
00243     double  m_PartMass[nmxhep];
00244     int     m_PartStatus[nmxhep];
00245   };
00246 
00247 } /*end namespace*/
00248 
00249 #endif //ifndef REGGEGRIBOVPARTONMCHADRONIZER_H