16 #include "HepMC/GenEvent.h"
17 #include "HepMC/HeavyIon.h"
18 #include "HepMC/SimpleVector.h"
19 #include "CLHEP/Random/RandomEngine.h"
21 static const double pi = 3.14159265358979;
44 bmax_(pset.getParameter<double>(
"bMax")),
45 bmin_(pset.getParameter<double>(
"bMin")),
46 efrm_(pset.getParameter<double>(
"comEnergy")),
47 frame_(pset.getParameter<
string>(
"frame")),
48 proj_(pset.getParameter<
string>(
"proj")),
49 targ_(pset.getParameter<
string>(
"targ")),
50 iap_(pset.getParameter<int>(
"iap")),
51 izp_(pset.getParameter<int>(
"izp")),
52 iat_(pset.getParameter<int>(
"iat")),
53 izt_(pset.getParameter<int>(
"izt")),
54 amptmode_(pset.getParameter<int>(
"amptmode")),
55 ntmax_(pset.getParameter<int>(
"ntmax")),
56 dt_(pset.getParameter<double>(
"dt")),
57 stringFragA_(pset.getParameter<double>(
"stringFragA")),
58 stringFragB_(pset.getParameter<double>(
"stringFragB")),
59 popcornmode_(pset.getParameter<bool>(
"popcornmode")),
60 popcornpar_(pset.getParameter<double>(
"popcornpar")),
61 shadowingmode_(pset.getParameter<bool>(
"shadowingmode")),
62 quenchingmode_(pset.getParameter<bool>(
"quenchingmode")),
63 quenchingpar_(pset.getParameter<double>(
"quenchingpar")),
64 pthard_(pset.getParameter<double>(
"pthard")),
65 mu_(pset.getParameter<double>(
"mu")),
66 izpc_(pset.getParameter<int>(
"izpc")),
67 alpha_(pset.getParameter<double>(
"alpha")),
68 dpcoal_(pset.getParameter<double>(
"dpcoal")),
69 drcoal_(pset.getParameter<double>(
"drcoal")),
70 ks0decay_(pset.getParameter<bool>(
"ks0decay")),
71 phidecay_(pset.getParameter<bool>(
"phidecay")),
72 deuteronmode_(pset.getParameter<int>(
"deuteronmode")),
73 deuteronfactor_(pset.getParameter<int>(
"deuteronfactor")),
74 deuteronxsec_(pset.getParameter<int>(
"deuteronxsec")),
75 minijetpt_(pset.getParameter<double>(
"minijetpt")),
76 maxmiss_(pset.getParameter<int>(
"maxmiss")),
77 doInitialAndFinalRadiation_(pset.getParameter<int>(
"doInitialAndFinalRadiation")),
78 ktkick_(pset.getParameter<int>(
"ktkick")),
79 diquarkembedding_(pset.getParameter<int>(
"diquarkembedding")),
80 diquarkpx_(pset.getParameter<double>(
"diquarkpx")),
81 diquarkpy_(pset.getParameter<double>(
"diquarkpy")),
82 diquarkx_(pset.getParameter<double>(
"diquarkx")),
83 diquarky_(pset.getParameter<double>(
"diquarky")),
87 rotate_(pset.getParameter<bool>(
"rotateEventPlane")) {}
98 HepMC::HeavyIon* hi =
new HepMC::HeavyIon(
hmain1.jatt,
112 evt->set_heavy_ion(*hi);
128 float e =
sqrt(px * px + py * py + pz * pz + m * m);
136 p->suggest_barcode(barcode);
143 HepMC::GenVertex* vertex =
new HepMC::GenVertex(HepMC::FourVector(0, 0, 0, 0),
id);
168 HepMC::GenVertex* vertice;
171 vector<int> mother_ids;
172 vector<HepMC::GenVertex*> prods;
174 vertice =
new HepMC::GenVertex(HepMC::FourVector(0, 0, 0, 0), 0);
175 evt->add_vertex(vertice);
176 if (!evt->signal_process_vertex())
177 evt->set_signal_process_vertex(vertice);
179 const unsigned int knumpart =
hbt.nlast;
180 for (
unsigned int ipart = 0; ipart < knumpart; ipart++) {
182 particles.push_back(
build_ampt(ipart, ipart + 1));
184 mother_ids.push_back(mid);
185 LogDebug(
"DecayChain") <<
"Mother index : " << mid;
188 LogDebug(
"AMPT") <<
"Number of particles in vector " << particles.size();
190 for (
unsigned int ipart = 0; ipart < particles.size(); ipart++) {
193 int mid = mother_ids[ipart];
194 LogDebug(
"DecayChain") <<
"Particle " << ipart;
195 LogDebug(
"DecayChain") <<
"Mother's ID " << mid;
196 LogDebug(
"DecayChain") <<
"Particle's PDG ID " << part->pdg_id();
199 vertice->add_particle_out(part);
205 LogDebug(
"DecayChain") <<
"Mother's PDG ID " << mother->pdg_id();
207 HepMC::GenVertex* prod_vertex = mother->end_vertex();
209 prod_vertex = prods[ipart];
210 prod_vertex->add_particle_in(mother);
211 evt->add_vertex(prod_vertex);
212 prods[ipart] =
nullptr;
214 prod_vertex->add_particle_out(part);
219 for (
unsigned int i = 0;
i < prods.size();
i++) {
232 efrm, frame.c_str(), proj.c_str(), targ.c_str(), iap, izp, iat,
izt, frame.length(), proj.length(), targ.length());
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)
uint8_t *__restrict__ izt
static CLHEP::HepRandomEngine * amptRandomEngine
std::unique_ptr< HepMC::GenEvent > & event()
Log< level::Info, false > LogInfo
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)