18 #include "HepMC/GenEvent.h"
19 #include "HepMC/HeavyIon.h"
20 #include "HepMC/SimpleVector.h"
22 #include "CLHEP/Random/RandomEngine.h"
24 static const double pi = 3.14159265358979;
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")),
71 rotate_(pset.getParameter<bool>(
"rotateEventPlane")) {
86 HepMC::HeavyIon* hi =
new HepMC::HeavyIon(
himain1.jatt,
102 evt->set_heavy_ion(*hi);
130 p->suggest_barcode(barcode);
145 HepMC::GenVertex* vertex =
new HepMC::GenVertex(HepMC::FourVector(x, y, z, t),
id);
156 float f_bmin =
bmin_;
157 float f_bmax =
bmax_;
175 HepMC::GenVertex* vertice;
178 vector<int> mother_ids;
179 vector<HepMC::GenVertex*> prods;
181 vertice =
new HepMC::GenVertex(HepMC::FourVector(0, 0, 0, 0), 0);
182 evt->add_vertex(vertice);
183 if (!evt->signal_process_vertex())
184 evt->set_signal_process_vertex(vertice);
186 const unsigned int knumpart =
himain1.natt;
188 for (
unsigned int ipart = 0; ipart < knumpart; ipart++) {
189 int mid =
himain2.katt[2][ipart] - 1;
193 mother_ids.push_back(mid);
194 LogDebug(
"DecayChain") <<
"Mother index : " << mid;
197 LogDebug(
"Hijing") <<
"Number of particles in vector " << particles.size();
199 for (
unsigned int ipart = 0; ipart < particles.size(); ipart++) {
202 int mid = mother_ids[ipart];
203 LogDebug(
"DecayChain") <<
"Particle " << ipart;
204 LogDebug(
"DecayChain") <<
"Mother's ID " << mid;
205 LogDebug(
"DecayChain") <<
"Particle's PDG ID " << part->pdg_id();
208 if (part->status() == 1 &&
209 sqrt(part->momentum().px() * part->momentum().px() + part->momentum().py() * part->momentum().py()) == 0)
213 vertice->add_particle_out(part);
219 LogDebug(
"DecayChain") <<
"Mother's PDG ID " << mother->pdg_id();
220 HepMC::GenVertex* prod_vertex = mother->end_vertex();
222 prod_vertex = prods[ipart];
223 prod_vertex->add_particle_in(mother);
225 evt->add_vertex(prod_vertex);
226 prods[ipart] =
nullptr;
228 prod_vertex->add_particle_out(part);
233 for (
unsigned int i = 0;
i < prods.size();
i++) {
247 ef, frame.c_str(), proj.c_str(), targ.c_str(), iap, izp, iat,
izt, frame.length(), proj.length(), targ.length());
bool initializeForInternalPartons()
HepMC::GenParticle * build_hijing(int index, int barcode)
Sin< T >::type sin(const T &t)
~HijingHadronizer() override
static const std::string kPythia6
void add_heavy_ion_rec(HepMC::GenEvent *evt)
float rlu_(unsigned int *iseed)
HepMC::GenVertex * build_hijing_vertex(int i, int id)
Cos< T >::type cos(const T &t)
static CLHEP::HepRandomEngine * hijRandomEngine
uint8_t *__restrict__ izt
std::unique_ptr< HepMC::GenEvent > & event()
Log< level::Info, false > LogInfo
const char * classname() const
bool get_particles(HepMC::GenEvent *evt)
float ran_(unsigned int *iseed)
void doSetRandomEngine(CLHEP::HepRandomEngine *v) override
bool generatePartonsAndHadronize()
bool call_hijset(double efrm, std::string frame, std::string proj, std::string targ, int iap, int izp, int iat, int izt)
bool declareStableParticles(const std::vector< int > &)