4 #include "boost/lexical_cast.hpp"
22 #include "HepMC/GenEvent.h"
23 #include "HepMC/HeavyIon.h"
24 #include "HepMC/SimpleVector.h"
25 #include "CLHEP/Random/RandomEngine.h"
27 static const double pi = 3.14159265358979;
39 if(0) idummy = idummy;
49 if(0) idummy = idummy;
58 bmax_(pset.getParameter<double>(
"bMax")),
59 bmin_(pset.getParameter<double>(
"bMin")),
60 efrm_(pset.getParameter<double>(
"comEnergy")),
61 frame_(pset.getParameter<
string>(
"frame")),
62 proj_(pset.getParameter<
string>(
"proj")),
63 targ_(pset.getParameter<
string>(
"targ")),
64 iap_(pset.getParameter<int>(
"iap")),
65 izp_(pset.getParameter<int>(
"izp")),
66 iat_(pset.getParameter<int>(
"iat")),
67 izt_(pset.getParameter<int>(
"izt")),
68 amptmode_(pset.getParameter<int>(
"amptmode")),
69 ntmax_(pset.getParameter<int>(
"ntmax")),
70 dt_(pset.getParameter<double>(
"dt")),
71 stringFragA_(pset.getParameter<double>(
"stringFragA")),
72 stringFragB_(pset.getParameter<double>(
"stringFragB")),
73 popcornmode_(pset.getParameter<bool>(
"popcornmode")),
74 popcornpar_(pset.getParameter<double>(
"popcornpar")),
75 shadowingmode_(pset.getParameter<bool>(
"shadowingmode")),
76 quenchingmode_(pset.getParameter<bool>(
"quenchingmode")),
77 quenchingpar_(pset.getParameter<double>(
"quenchingpar")),
78 pthard_(pset.getParameter<double>(
"pthard")),
79 mu_(pset.getParameter<double>(
"mu")),
80 izpc_(pset.getParameter<int>(
"izpc")),
81 alpha_(pset.getParameter<double>(
"alpha")),
82 dpcoal_(pset.getParameter<double>(
"dpcoal")),
83 drcoal_(pset.getParameter<double>(
"drcoal")),
84 ks0decay_(pset.getParameter<bool>(
"ks0decay")),
85 phidecay_(pset.getParameter<bool>(
"phidecay")),
86 deuteronmode_(pset.getParameter<int>(
"deuteronmode")),
87 deuteronfactor_(pset.getParameter<int>(
"deuteronfactor")),
88 deuteronxsec_(pset.getParameter<int>(
"deuteronxsec")),
89 minijetpt_(pset.getParameter<double>(
"minijetpt")),
90 maxmiss_(pset.getParameter<int>(
"maxmiss")),
91 doInitialAndFinalRadiation_(pset.getParameter<int>(
"doInitialAndFinalRadiation")),
92 ktkick_(pset.getParameter<int>(
"ktkick")),
93 diquarkembedding_(pset.getParameter<int>(
"diquarkembedding")),
94 diquarkpx_(pset.getParameter<double>(
"diquarkpx")),
95 diquarkpy_(pset.getParameter<double>(
"diquarkpy")),
96 diquarkx_(pset.getParameter<double>(
"diquarkx")),
97 diquarky_(pset.getParameter<double>(
"diquarky")),
101 rotate_(pset.getParameter<bool>(
"rotateEventPlane"))
118 HepMC::HeavyIon* hi =
new HepMC::HeavyIon(
133 evt->set_heavy_ion(*hi);
150 float e =
sqrt(px*px+py*py+pz*pz+m*m);
154 HepMC::FourVector(px,
162 p->suggest_barcode(barcode);
170 HepMC::GenVertex* vertex =
new HepMC::GenVertex(HepMC::FourVector(0,0,0,0),
id);
183 HepMC::GenEvent *
evt =
new HepMC::GenEvent();
197 HepMC::GenVertex* vertice;
199 vector<HepMC::GenParticle*> particles;
200 vector<int> mother_ids;
201 vector<HepMC::GenVertex*> prods;
203 vertice =
new HepMC::GenVertex(HepMC::FourVector(0,0,0,0),0);
204 evt->add_vertex(vertice);
205 if(!evt->signal_process_vertex()) evt->set_signal_process_vertex(vertice);
207 const unsigned int knumpart =
hbt.nlast;
208 for (
unsigned int ipart = 0; ipart<knumpart; ipart++) {
210 particles.push_back(
build_ampt(ipart,ipart+1));
212 mother_ids.push_back(mid);
213 LogDebug(
"DecayChain")<<
"Mother index : "<<mid;
216 LogDebug(
"AMPT")<<
"Number of particles in vector "<<particles.size();
218 for (
unsigned int ipart = 0; ipart<particles.size(); ipart++) {
221 int mid = mother_ids[ipart];
222 LogDebug(
"DecayChain")<<
"Particle "<<ipart;
223 LogDebug(
"DecayChain")<<
"Mother's ID "<<mid;
224 LogDebug(
"DecayChain")<<
"Particle's PDG ID "<<part->pdg_id();
227 vertice->add_particle_out(part);
233 LogDebug(
"DecayChain")<<
"Mother's PDG ID "<<mother->pdg_id();
235 HepMC::GenVertex* prod_vertex = mother->end_vertex();
237 prod_vertex = prods[ipart];
238 prod_vertex->add_particle_in(mother);
239 evt->add_vertex(prod_vertex);
243 prod_vertex->add_particle_out(part);
248 for (
unsigned int i = 0;
i<prods.size();
i++) {
249 if(prods[
i])
delete prods[
i];
259 AMPTSET(efrm,frame.data(),proj.data(),targ.data(),iap,izp,iat,izt,strlen(frame.data()),strlen(proj.data()),strlen(targ.data()));
353 return "gen::AMPTHadronizer";
bool initializeForInternalPartons()
virtual ~AMPTHadronizer()
CLHEP::HepRandomEngine * _amptRandomEngine
void add_heavy_ion_rec(HepMC::GenEvent *evt)
Sin< T >::type sin(const T &t)
bool generatePartonsAndHadronize()
std::auto_ptr< HepMC::GenEvent > & event()
bool declareStableParticles(const std::vector< int > &)
const char * classname() const
bool call_amptset(double efrm, std::string frame, std::string proj, std::string targ, int iap, int izp, int iat, int izt)
Cos< T >::type cos(const T &t)
virtual CLHEP::HepRandomEngine & getEngine() const =0
Use this to get the random number engine, this is the only function most users should call...
int doInitialAndFinalRadiation_
HepMC::GenParticle * build_ampt(int index, int barcode)
bool ampt_init(const edm::ParameterSet &pset)
HepMC::GenVertex * build_ampt_vertex(int i, int id)
bool get_particles(HepMC::GenEvent *evt)