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;
48 if(0) idummy = idummy;
57 bmax_(pset.getParameter<double>(
"bMax")),
58 bmin_(pset.getParameter<double>(
"bMin")),
59 efrm_(pset.getParameter<double>(
"comEnergy")),
60 frame_(pset.getParameter<string>(
"frame")),
61 proj_(pset.getParameter<string>(
"proj")),
62 targ_(pset.getParameter<string>(
"targ")),
63 iap_(pset.getParameter<int>(
"iap")),
64 izp_(pset.getParameter<int>(
"izp")),
65 iat_(pset.getParameter<int>(
"iat")),
66 izt_(pset.getParameter<int>(
"izt")),
67 amptmode_(pset.getParameter<int>(
"amptmode")),
68 ntmax_(pset.getParameter<int>(
"ntmax")),
69 dt_(pset.getParameter<double>(
"dt")),
70 stringFragA_(pset.getParameter<double>(
"stringFragA")),
71 stringFragB_(pset.getParameter<double>(
"stringFragB")),
72 popcornmode_(pset.getParameter<bool>(
"popcornmode")),
73 popcornpar_(pset.getParameter<double>(
"popcornpar")),
74 shadowingmode_(pset.getParameter<bool>(
"shadowingmode")),
75 quenchingmode_(pset.getParameter<bool>(
"quenchingmode")),
76 quenchingpar_(pset.getParameter<double>(
"quenchingpar")),
77 pthard_(pset.getParameter<double>(
"pthard")),
78 mu_(pset.getParameter<double>(
"mu")),
79 izpc_(pset.getParameter<int>(
"izpc")),
80 alpha_(pset.getParameter<double>(
"alpha")),
81 dpcoal_(pset.getParameter<double>(
"dpcoal")),
82 drcoal_(pset.getParameter<double>(
"drcoal")),
83 ks0decay_(pset.getParameter<bool>(
"ks0decay")),
84 phidecay_(pset.getParameter<bool>(
"phidecay")),
85 deuteronmode_(pset.getParameter<int>(
"deuteronmode")),
86 deuteronfactor_(pset.getParameter<int>(
"deuteronfactor")),
87 deuteronxsec_(pset.getParameter<int>(
"deuteronxsec")),
88 minijetpt_(pset.getParameter<double>(
"minijetpt")),
89 maxmiss_(pset.getParameter<int>(
"maxmiss")),
90 doInitialAndFinalRadiation_(pset.getParameter<int>(
"doInitialAndFinalRadiation")),
91 ktkick_(pset.getParameter<int>(
"ktkick")),
92 diquarkembedding_(pset.getParameter<int>(
"diquarkembedding")),
93 diquarkpx_(pset.getParameter<double>(
"diquarkpx")),
94 diquarkpy_(pset.getParameter<double>(
"diquarkpy")),
95 diquarkx_(pset.getParameter<double>(
"diquarkx")),
96 diquarky_(pset.getParameter<double>(
"diquarky")),
100 rotate_(pset.getParameter<bool>(
"rotateEventPlane"))
117 HepMC::HeavyIon* hi =
new HepMC::HeavyIon(
132 evt->set_heavy_ion(*hi);
149 float e =
sqrt(px*px+py*py+pz*pz+m*m);
153 HepMC::FourVector(px,
161 p->suggest_barcode(barcode);
169 HepMC::GenVertex* vertex =
new HepMC::GenVertex(HepMC::FourVector(0,0,0,0),
id);
182 HepMC::GenEvent *
evt =
new HepMC::GenEvent();
196 HepMC::GenVertex* vertice;
198 vector<HepMC::GenParticle*> particles;
199 vector<int> mother_ids;
200 vector<HepMC::GenVertex*> prods;
202 vertice =
new HepMC::GenVertex(HepMC::FourVector(0,0,0,0),0);
203 evt->add_vertex(vertice);
204 if(!evt->signal_process_vertex()) evt->set_signal_process_vertex(vertice);
206 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;
219 for (
unsigned int ipart = 0; ipart<particles.size(); ipart++) {
222 int mid = mother_ids[ipart];
223 LogDebug(
"DecayChain")<<
"Particle "<<ipart;
224 LogDebug(
"DecayChain")<<
"Mother's ID "<<mid;
225 LogDebug(
"DecayChain")<<
"Particle's PDG ID "<<part->pdg_id();
228 vertice->add_particle_out(part);
234 LogDebug(
"DecayChain")<<
"Mother's PDG ID "<<mother->pdg_id();
236 HepMC::GenVertex* prod_vertex = mother->end_vertex();
238 prod_vertex = prods[ipart];
239 prod_vertex->add_particle_in(mother);
240 evt->add_vertex(prod_vertex);
244 prod_vertex->add_particle_out(part);
249 for (
unsigned int i = 0;
i<prods.size();
i++) {
250 if(prods[
i])
delete prods[
i];
260 AMPTSET(efrm,frame.data(),proj.data(),targ.data(),iap,izp,iat,izt,strlen(frame.data()),strlen(proj.data()),strlen(targ.data()));
352 return "gen::AMPTHadronizer";
bool declareStableParticles(const std::vector< int >)
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()
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)