10 #include "CLHEP/Random/RandomEngine.h"
11 #include "CLHEP/Random/RandFlat.h"
13 #include <HepMC/GenCrossSection.h>
14 #include <HepMC/GenEvent.h>
15 #include <HepMC/GenVertex.h>
16 #include <HepMC/GenParticle.h>
17 #include <HepMC/HeavyIon.h>
18 #include <HepMC/PdfInfo.h>
19 #include <HepMC/Units.h>
62 ReggeGribovPartonMCHadronizer::ReggeGribovPartonMCHadronizer(
const ParameterSet &pset) :
65 m_BeamMomentum(pset.getParameter<double>(
"beammomentum")),
66 m_TargetMomentum(pset.getParameter<double>(
"targetmomentum")),
67 m_BeamID(pset.getParameter<int>(
"beamid")),
68 m_TargetID(pset.getParameter<int>(
"targetid")),
69 m_HEModel(pset.getParameter<int>(
"model")),
70 m_bMin(pset.getParameter<double>(
"bmin")),
71 m_bMax(pset.getParameter<double>(
"bmax")),
72 m_ParamFileName(pset.getUntrackedParameter<
string>(
"paramFileName")),
73 m_SkipNuclFrag(pset.getParameter<bool>(
"skipNuclFrag")),
82 <<
"ReggeGribovPartonMCHadronizer requires the RandomNumberGeneratorService\n"
83 "which is not present in the configuration file. You must add the service\n"
84 "in the configuration file or remove the modules that require it.";
93 char dummyName[] =
"dummy";
124 LogDebug(
"ReggeGribovPartonMCInterface") <<
"event generated" << endl;
129 conv.set_trust_beam_particles(
false);
133 HepMC::GenEvent* evt =
conv.read_next_event();
137 switch (
int(
c2evt_.typevt))
140 case 1: sig_id = 101;
break;
141 case -1: sig_id = 101;
break;
142 case 2: sig_id = 105;
break;
143 case -2: sig_id = 105;
break;
144 case 3: sig_id = 102;
break;
145 case -3: sig_id = 102;
break;
146 case 4: sig_id = 103;
break;
147 case -4: sig_id = 104;
break;
148 default:
LogDebug(
"ReggeGribovPartonMCInterface") <<
"Signal ID not recognised for setting HEPEVT" << endl;
150 evt->set_signal_process_id(sig_id);
152 #ifdef HEPMC_HAS_CROSS_SECTION
154 HepMC::GenCrossSection theCrossSection;
155 theCrossSection.set_cross_section(
double(
hadr5_.sigineaa)*1e9);
156 evt->set_cross_section(theCrossSection);
161 HepMC::HeavyIon ion(
cevt_.kohevt,
174 evt->set_heavy_ion(ion);
211 return "gen::ReggeGribovPartonMCHadronizer";
227 string path_fnii(
FileInPath(
"GeneratorInterface/ReggeGribovPartonMCInterface/data/epos.initl").fullPath());
228 string path_fnie(
FileInPath(
"GeneratorInterface/ReggeGribovPartonMCInterface/data/epos.iniev").fullPath());
229 string path_fnrj(
FileInPath(
"GeneratorInterface/ReggeGribovPartonMCInterface/data/epos.inirj").fullPath());
230 string path_fncs(
FileInPath(
"GeneratorInterface/ReggeGribovPartonMCInterface/data/epos.inics").fullPath());
232 if (path_fnii.length() >= 500)
LogError(
"ReggeGribovPartonMCInterface") <<
"table path too long" << endl;
233 else nfname_.nfnii = path_fnii.length();
234 if (path_fnie.length() >= 500)
LogError(
"ReggeGribovPartonMCInterface") <<
"table path too long" << endl;
235 else nfname_.nfnie = path_fnie.length();
236 if (path_fnrj.length() >= 500)
LogError(
"ReggeGribovPartonMCInterface") <<
"table path too long" << endl;
237 else nfname_.nfnrj = path_fnrj.length();
238 if (path_fncs.length() >= 500)
LogError(
"ReggeGribovPartonMCInterface") <<
"table path too long" << endl;
239 else nfname_.nfncs = path_fncs.length();
241 strcpy(
fname_.fnii, path_fnii.c_str());
242 strcpy(
fname_.fnie, path_fnie.c_str());
243 strcpy(
fname_.fnrj, path_fnrj.c_str());
244 strcpy(
fname_.fncs, path_fncs.c_str());
247 string path_fndat(
FileInPath(
"GeneratorInterface/ReggeGribovPartonMCInterface/data/qgsjet.dat").fullPath());
248 string path_fnncs(
FileInPath(
"GeneratorInterface/ReggeGribovPartonMCInterface/data/qgsjet.ncs").fullPath());
250 if (path_fndat.length() >= 500)
LogError(
"ReggeGribovPartonMCInterface") <<
"table path too long" << endl;
252 if (path_fnncs.length() >= 500)
LogError(
"ReggeGribovPartonMCInterface") <<
"table path too long" << endl;
255 strcpy(
qgsfname_.fndat, path_fndat.c_str());
256 strcpy(
qgsfname_.fnncs, path_fnncs.c_str());
262 string path_fniidat(
FileInPath(
"GeneratorInterface/ReggeGribovPartonMCInterface/data/qgsdat-II-04.lzma").fullPath());
263 string path_fniincs(
FileInPath(
"GeneratorInterface/ReggeGribovPartonMCInterface/data/sectnu-II-04").fullPath());
265 if (path_fniidat.length() >= 500)
LogError(
"ReggeGribovPartonMCInterface") <<
"table path too long" << endl;
267 if (path_fniincs.length() >= 500)
LogError(
"ReggeGribovPartonMCInterface") <<
"table path too long" << endl;
const char * classname() const
edm::FileInPath m_ParamFileName
virtual ~ReggeGribovPartonMCHadronizer()
static HepMC::IO_HEPEVT conv
double m_PartMass[nmxhep]
void crmc_f_(int &, int &, int &, double &, int &, double &, double &, double &, double &, double &, int &)
std::auto_ptr< HepMC::GenEvent > & event()
boost::scoped_ptr< CLHEP::RandFlat > gFlatDistribution_
virtual CLHEP::HepRandomEngine & getEngine() const =0
Use this to get the random number engine, this is the only function most users should call...
bool initializeForInternalPartons()
bool generatePartonsAndHadronize()
double m_PartEnergy[nmxhep]
std::string fullPath() const
void crmc_set_f_(int &, int &, double &, double &, int &, int &, int &, int &, int &, const char *, const char *)
bool initializeTablePaths()
bool declareStableParticles(const std::vector< int >)