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;
35 if(
false) idummy = idummy;
45 if(
false) idummy = idummy;
54 bmax_(pset.getParameter<double>(
"bMax")),
55 bmin_(pset.getParameter<double>(
"bMin")),
56 efrm_(pset.getParameter<double>(
"comEnergy")),
57 frame_(pset.getParameter<
string>(
"frame")),
58 proj_(pset.getParameter<
string>(
"proj")),
59 targ_(pset.getParameter<
string>(
"targ")),
60 iap_(pset.getParameter<
int>(
"iap")),
61 izp_(pset.getParameter<
int>(
"izp")),
62 iat_(pset.getParameter<
int>(
"iat")),
63 izt_(pset.getParameter<
int>(
"izt")),
64 amptmode_(pset.getParameter<
int>(
"amptmode")),
65 ntmax_(pset.getParameter<
int>(
"ntmax")),
66 dt_(pset.getParameter<double>(
"dt")),
67 stringFragA_(pset.getParameter<double>(
"stringFragA")),
68 stringFragB_(pset.getParameter<double>(
"stringFragB")),
69 popcornmode_(pset.getParameter<
bool>(
"popcornmode")),
70 popcornpar_(pset.getParameter<double>(
"popcornpar")),
71 shadowingmode_(pset.getParameter<
bool>(
"shadowingmode")),
72 quenchingmode_(pset.getParameter<
bool>(
"quenchingmode")),
73 quenchingpar_(pset.getParameter<double>(
"quenchingpar")),
74 pthard_(pset.getParameter<double>(
"pthard")),
75 mu_(pset.getParameter<double>(
"mu")),
76 izpc_(pset.getParameter<
int>(
"izpc")),
77 alpha_(pset.getParameter<double>(
"alpha")),
78 dpcoal_(pset.getParameter<double>(
"dpcoal")),
79 drcoal_(pset.getParameter<double>(
"drcoal")),
80 ks0decay_(pset.getParameter<
bool>(
"ks0decay")),
81 phidecay_(pset.getParameter<
bool>(
"phidecay")),
82 deuteronmode_(pset.getParameter<
int>(
"deuteronmode")),
83 deuteronfactor_(pset.getParameter<
int>(
"deuteronfactor")),
84 deuteronxsec_(pset.getParameter<
int>(
"deuteronxsec")),
85 minijetpt_(pset.getParameter<double>(
"minijetpt")),
86 maxmiss_(pset.getParameter<
int>(
"maxmiss")),
87 doInitialAndFinalRadiation_(pset.getParameter<
int>(
"doInitialAndFinalRadiation")),
88 ktkick_(pset.getParameter<
int>(
"ktkick")),
89 diquarkembedding_(pset.getParameter<
int>(
"diquarkembedding")),
90 diquarkpx_(pset.getParameter<double>(
"diquarkpx")),
91 diquarkpy_(pset.getParameter<double>(
"diquarkpy")),
92 diquarkx_(pset.getParameter<double>(
"diquarkx")),
93 diquarky_(pset.getParameter<double>(
"diquarky")),
97 rotate_(pset.getParameter<
bool>(
"rotateEventPlane"))
116 HepMC::HeavyIon*
hi =
new HepMC::HeavyIon(
131 evt->set_heavy_ion(*hi);
148 float e =
sqrt(px*px+py*py+pz*pz+m*m);
152 HepMC::FourVector(px,
160 p->suggest_barcode(barcode);
168 HepMC::GenVertex* vertex =
new HepMC::GenVertex(HepMC::FourVector(0,0,0,0),
id);
181 HepMC::GenEvent *
evt =
new HepMC::GenEvent();
195 HepMC::GenVertex* vertice;
198 vector<int> mother_ids;
199 vector<HepMC::GenVertex*> prods;
201 vertice =
new HepMC::GenVertex(HepMC::FourVector(0,0,0,0),0);
202 evt->add_vertex(vertice);
203 if(!evt->signal_process_vertex()) evt->set_signal_process_vertex(vertice);
205 const unsigned int knumpart =
hbt.nlast;
206 for (
unsigned int ipart = 0; ipart<knumpart; ipart++) {
208 particles.push_back(
build_ampt(ipart,ipart+1));
210 mother_ids.push_back(mid);
211 LogDebug(
"DecayChain")<<
"Mother index : "<<mid;
214 LogDebug(
"AMPT")<<
"Number of particles in vector "<<particles.size();
216 for (
unsigned int ipart = 0; ipart<particles.size(); ipart++) {
219 int mid = mother_ids[ipart];
220 LogDebug(
"DecayChain")<<
"Particle "<<ipart;
221 LogDebug(
"DecayChain")<<
"Mother's ID "<<mid;
222 LogDebug(
"DecayChain")<<
"Particle's PDG ID "<<part->pdg_id();
225 vertice->add_particle_out(part);
231 LogDebug(
"DecayChain")<<
"Mother's PDG ID "<<mother->pdg_id();
233 HepMC::GenVertex* prod_vertex = mother->end_vertex();
235 prod_vertex = prods[ipart];
236 prod_vertex->add_particle_in(mother);
237 evt->add_vertex(prod_vertex);
238 prods[ipart]=
nullptr;
241 prod_vertex->add_particle_out(part);
246 for (
unsigned int i = 0;
i<prods.size();
i++) {
247 if(prods[
i])
delete prods[
i];
257 AMPTSET(efrm,frame.data(),proj.data(),targ.data(),iap,izp,iat,izt,strlen(frame.data()),strlen(proj.data()),strlen(targ.data()));
351 return "gen::AMPTHadronizer";
bool initializeForInternalPartons()
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)
~AMPTHadronizer() override
Cos< T >::type cos(const T &t)
static CLHEP::HepRandomEngine * amptRandomEngine
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)