4 #include "boost/lexical_cast.hpp" 18 #include "HepMC/GenEvent.h" 19 #include "HepMC/HeavyIon.h" 20 #include "HepMC/SimpleVector.h" 21 #include "CLHEP/Random/RandomEngine.h" 23 static const double pi = 3.14159265358979;
52 bmax_(pset.getParameter<double>(
"bMax")),
53 bmin_(pset.getParameter<double>(
"bMin")),
54 efrm_(pset.getParameter<double>(
"comEnergy")),
55 frame_(pset.getParameter<
string>(
"frame")),
56 proj_(pset.getParameter<
string>(
"proj")),
57 targ_(pset.getParameter<
string>(
"targ")),
58 iap_(pset.getParameter<
int>(
"iap")),
59 izp_(pset.getParameter<
int>(
"izp")),
60 iat_(pset.getParameter<
int>(
"iat")),
61 izt_(pset.getParameter<
int>(
"izt")),
62 amptmode_(pset.getParameter<
int>(
"amptmode")),
63 ntmax_(pset.getParameter<
int>(
"ntmax")),
64 dt_(pset.getParameter<double>(
"dt")),
65 stringFragA_(pset.getParameter<double>(
"stringFragA")),
66 stringFragB_(pset.getParameter<double>(
"stringFragB")),
67 popcornmode_(pset.getParameter<
bool>(
"popcornmode")),
68 popcornpar_(pset.getParameter<double>(
"popcornpar")),
69 shadowingmode_(pset.getParameter<
bool>(
"shadowingmode")),
70 quenchingmode_(pset.getParameter<
bool>(
"quenchingmode")),
71 quenchingpar_(pset.getParameter<double>(
"quenchingpar")),
72 pthard_(pset.getParameter<double>(
"pthard")),
73 mu_(pset.getParameter<double>(
"mu")),
74 izpc_(pset.getParameter<
int>(
"izpc")),
75 alpha_(pset.getParameter<double>(
"alpha")),
76 dpcoal_(pset.getParameter<double>(
"dpcoal")),
77 drcoal_(pset.getParameter<double>(
"drcoal")),
78 ks0decay_(pset.getParameter<
bool>(
"ks0decay")),
79 phidecay_(pset.getParameter<
bool>(
"phidecay")),
80 deuteronmode_(pset.getParameter<
int>(
"deuteronmode")),
81 deuteronfactor_(pset.getParameter<
int>(
"deuteronfactor")),
82 deuteronxsec_(pset.getParameter<
int>(
"deuteronxsec")),
83 minijetpt_(pset.getParameter<double>(
"minijetpt")),
84 maxmiss_(pset.getParameter<
int>(
"maxmiss")),
85 doInitialAndFinalRadiation_(pset.getParameter<
int>(
"doInitialAndFinalRadiation")),
86 ktkick_(pset.getParameter<
int>(
"ktkick")),
87 diquarkembedding_(pset.getParameter<
int>(
"diquarkembedding")),
88 diquarkpx_(pset.getParameter<double>(
"diquarkpx")),
89 diquarkpy_(pset.getParameter<double>(
"diquarkpy")),
90 diquarkx_(pset.getParameter<double>(
"diquarkx")),
91 diquarky_(pset.getParameter<double>(
"diquarky")),
95 rotate_(pset.getParameter<
bool>(
"rotateEventPlane"))
114 HepMC::HeavyIon*
hi =
new HepMC::HeavyIon(
129 evt->set_heavy_ion(*hi);
146 float e =
sqrt(px*px+py*py+pz*pz+m*m);
150 HepMC::FourVector(px,
158 p->suggest_barcode(barcode);
166 HepMC::GenVertex* vertex =
new HepMC::GenVertex(HepMC::FourVector(0,0,0,0),
id);
193 HepMC::GenVertex* vertice;
196 vector<int> mother_ids;
197 vector<HepMC::GenVertex*> prods;
199 vertice =
new HepMC::GenVertex(HepMC::FourVector(0,0,0,0),0);
200 evt->add_vertex(vertice);
201 if(!evt->signal_process_vertex()) evt->set_signal_process_vertex(vertice);
203 const unsigned int knumpart =
hbt.nlast;
204 for (
unsigned int ipart = 0; ipart<knumpart; ipart++) {
206 particles.push_back(
build_ampt(ipart,ipart+1));
208 mother_ids.push_back(mid);
209 LogDebug(
"DecayChain")<<
"Mother index : "<<mid;
212 LogDebug(
"AMPT")<<
"Number of particles in vector "<<particles.size();
214 for (
unsigned int ipart = 0; ipart<particles.size(); ipart++) {
217 int mid = mother_ids[ipart];
218 LogDebug(
"DecayChain")<<
"Particle "<<ipart;
219 LogDebug(
"DecayChain")<<
"Mother's ID "<<mid;
220 LogDebug(
"DecayChain")<<
"Particle's PDG ID "<<part->pdg_id();
223 vertice->add_particle_out(part);
229 LogDebug(
"DecayChain")<<
"Mother's PDG ID "<<mother->pdg_id();
231 HepMC::GenVertex* prod_vertex = mother->end_vertex();
233 prod_vertex = prods[ipart];
234 prod_vertex->add_particle_in(mother);
235 evt->add_vertex(prod_vertex);
236 prods[ipart]=
nullptr;
239 prod_vertex->add_particle_out(part);
244 for (
unsigned int i = 0;
i<prods.size();
i++) {
245 if(prods[
i])
delete prods[
i];
255 AMPTSET(efrm,frame.data(),proj.data(),targ.data(),iap,izp,iat,izt,strlen(frame.data()),strlen(proj.data()),strlen(targ.data()));
349 return "gen::AMPTHadronizer";
bool initializeForInternalPartons()
void add_heavy_ion_rec(HepMC::GenEvent *evt)
Sin< T >::type sin(const T &t)
bool generatePartonsAndHadronize()
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)
~AMPTHadronizer() override
Cos< T >::type cos(const T &t)
static CLHEP::HepRandomEngine * amptRandomEngine
std::unique_ptr< HepMC::GenEvent > & event()
int doInitialAndFinalRadiation_
void doSetRandomEngine(CLHEP::HepRandomEngine *v) override
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)