CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/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 extern "C"
00041 {
00042   extern struct
00043   {
00044     float sigtot; // ........ total cross section
00045     float sigcut;
00046     float sigela;
00047     float sloela;
00048     float sigsd;
00049     float sigine;
00050     float sigdif;
00051     float sigineaa;
00052     float sigtotaa;
00053     float sigelaaa;
00054     float sigcutaa;
00055   } hadr5_; //crmc-aaa.f
00056 
00057   extern struct
00058   {
00059     float phievt; // ........ angle of impact parameter
00060     int   nevt;   // ........ error code. 1=valid event, 0=invalid event
00061     float bimevt; // ........ absolute value of impact parameter
00062     int   kolevt; // ........ number of collisions
00063     int   koievt; // ........ number of inelastic collisions
00064     float pmxevt; // ........ reference momentum
00065     float egyevt; // ........ pp cm energy (hadron) or string energy (lepton)
00066     int   npjevt; // ........ number of primary projectile participants
00067     int   ntgevt; // ........ number of primary target participants
00068     int   npnevt; // ........ number of primary projectile neutron spectators
00069     int   nppevt; // ........ number of primary projectile proton spectators
00070     int   ntnevt; // ........ number of primary target neutron spectators
00071     int   ntpevt; // ........ number of primary target proton spectators
00072     int   jpnevt; // ........ number of absolute projectile neutron spectators
00073     int   jppevt; // ........ number of absolute projectile proton spectators
00074     int   jtnevt; // ........ number of absolute target neutron spectators
00075     int   jtpevt; // ........ number of absolute target proton spectators
00076     float xbjevt; // ........ bjorken x for dis
00077     float qsqevt; // ........ q**2 for dis
00078     int   nglevt; // ........ number of collisions acc to  Glauber
00079     float zppevt; // ........ average Z-parton-proj
00080     float zptevt; // ........ average Z-parton-targ
00081     int   minfra; //
00082     int   maxfra; //
00083   } cevt_; //epos.inc
00084 
00085   extern struct
00086   {
00087     int   ng1evt; // ........ number of collisions acc to  Glauber
00088     int   ng2evt; // ........ number of Glauber participants with at least two IAs
00089     float rglevt; // ........
00090     float sglevt; // ........
00091     float eglevt; // ........
00092     float fglevt; // ........
00093     int   ikoevt; // ........ number of elementary parton-parton scatterings
00094     float typevt; // ........ type of event (1=Non Diff, 2=Double Diff, 3=Single Diff)
00095   } c2evt_; //epos.inc
00096 
00097   extern struct
00098   {
00099     float bmaxim;
00100     float bminim;
00101     float phimax;
00102     float phimin;
00103   } nucl2_; //epos.inc
00104 }
00105 
00106 
00107 extern "C"
00108 {
00109   extern struct
00110   {
00111     char fnch[500];
00112     char fnhi[500];
00113     char fndt[500];
00114     char fnii[500];
00115     char fnid[500];
00116     char fnie[500];
00117     char fnrj[500];
00118     char fnmt[500];
00119     char fngrv[500];
00120     char fncp[500];
00121     char fnnx[500];
00122     char fncs[500];
00123     char fndr[500];
00124     char fnhpf[500];
00125   } fname_; //epos.inc
00126 
00127   extern struct
00128   {
00129     int nfnch;
00130     int nfnhi;
00131     int nfndt;
00132     int nfnii;
00133     int nfnid;
00134     int nfnie;
00135     int nfnrj;
00136     int nfnmt;
00137     int nfngrv;
00138     int nfncp;
00139     int nfnnx;
00140     int nfncs;
00141     int nfndr;
00142     int nfnhpf;
00143   } nfname_; //epos.inc
00144 
00145   extern struct
00146   {
00147     char fndat[500];
00148     char fnncs[500];
00149     int ifdat;
00150     int ifncs;
00151   } qgsfname_; //epos-bas.f
00152 
00153   extern struct
00154   {
00155     int nfndat;
00156     int nfnncs;
00157   } qgsnfname_; //epos-bas.f
00158 
00159   extern struct
00160   {
00161     char fniidat[500];
00162     char fniincs[500];
00163     int ifiidat;
00164     int ifiincs;
00165   } qgsiifname_; //epos-bas.f
00166 
00167   extern struct
00168   {
00169     int nfniidat;
00170     int nfniincs;
00171   } qgsiinfname_; //epos-bas.f
00172 }
00173 
00174 namespace gen
00175 {
00176   extern "C" {
00177     float rangen_();
00178   }
00179 
00180   extern "C" {
00181     double drangen_(int*);
00182   }
00183 
00184 
00185   class ReggeGribovPartonMCHadronizer : public BaseHadronizer
00186   {
00187 
00188   public:
00189     ReggeGribovPartonMCHadronizer(const edm::ParameterSet &);
00190     virtual ~ReggeGribovPartonMCHadronizer();
00191 
00192     bool generatePartonsAndHadronize();
00193     bool hadronize();
00194     bool decay();
00195     bool residualDecay();
00196     bool readSettings( int ) { return true; }
00197     bool initializeForExternalPartons() { return true; }
00198     bool initializeForInternalPartons();
00199     bool declareStableParticles( const std::vector<int> );
00200     bool declareSpecialSettings( const std::vector<std::string> ) { return true; }
00201     bool initializeTablePaths();
00202 
00203     void finalizeEvent();
00204     void statistics();
00205     const char* classname() const;
00206 
00207   private:
00208     edm::ParameterSet pset_;
00209     double  m_BeamMomentum;
00210     double  m_TargetMomentum;
00211     int     m_BeamID;
00212     int     m_TargetID;
00213     int     m_HEModel;
00214     double  m_bMin;
00215     double  m_bMax;
00216     edm::FileInPath m_ParamFileName;
00217     int     m_NEvent;
00218 
00219     int     m_NParticles;
00220     double  m_ImpactParameter;
00221     int     m_PartID[99990];
00222     double  m_PartPx[99990];
00223     double  m_PartPy[99990];
00224     double  m_PartPz[99990];
00225     double  m_PartEnergy[99990];
00226     double  m_PartMass[99990];
00227     int     m_PartStatus[99990];
00228   };
00229 
00230 } /*end namespace*/
00231 
00232 #endif //ifndef REGGEGRIBOVPARTONMCHADRONIZER_H