4 #include "boost/lexical_cast.hpp" 20 #include "HepMC/GenEvent.h" 21 #include "HepMC/HeavyIon.h" 22 #include "HepMC/SimpleVector.h" 24 #include "CLHEP/Random/RandomEngine.h" 26 static const double pi = 3.14159265358979;
64 bmax_(pset.getParameter<double>(
"bMax")),
65 bmin_(pset.getParameter<double>(
"bMin")),
66 efrm_(pset.getParameter<double>(
"comEnergy")),
67 frame_(pset.getParameter<
string>(
"frame")),
68 proj_(pset.getParameter<
string>(
"proj")),
69 targ_(pset.getParameter<
string>(
"targ")),
70 iap_(pset.getParameter<
int>(
"iap")),
71 izp_(pset.getParameter<
int>(
"izp")),
72 iat_(pset.getParameter<
int>(
"iat")),
73 izt_(pset.getParameter<
int>(
"izt")),
77 rotate_(pset.getParameter<
bool>(
"rotateEventPlane"))
101 HepMC::HeavyIon*
hi =
new HepMC::HeavyIon(
118 evt->set_heavy_ion(*hi);
146 p->suggest_barcode(barcode);
162 HepMC::GenVertex* vertex =
new HepMC::GenVertex(HepMC::FourVector(x,y,z,t),
id);
173 float f_bmin =
bmin_;
174 float f_bmax =
bmax_;
178 HepMC::GenEvent *
evt =
new HepMC::GenEvent();
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 =
himain1.natt;
205 for (
unsigned int ipart = 0; ipart<knumpart; ipart++) {
207 int mid =
himain2.katt[2][ipart] - 1;
211 mother_ids.push_back(mid);
212 LogDebug(
"DecayChain")<<
"Mother index : "<<mid;
215 LogDebug(
"Hijing")<<
"Number of particles in vector "<<particles.size();
217 for (
unsigned int ipart = 0; ipart<particles.size(); ipart++) {
220 int mid = mother_ids[ipart];
221 LogDebug(
"DecayChain")<<
"Particle "<<ipart;
222 LogDebug(
"DecayChain")<<
"Mother's ID "<<mid;
223 LogDebug(
"DecayChain")<<
"Particle's PDG ID "<<part->pdg_id();
226 if(part->status()==1&&
sqrt(part->momentum().px()*part->momentum().px()+part->momentum().py()*part->momentum().py())==0)
230 vertice->add_particle_out(part);
236 LogDebug(
"DecayChain")<<
"Mother's PDG ID "<<mother->pdg_id();
237 HepMC::GenVertex* prod_vertex = mother->end_vertex();
239 prod_vertex = prods[ipart];
240 prod_vertex->add_particle_in(mother);
242 evt->add_vertex(prod_vertex);
246 prod_vertex->add_particle_out(part);
251 for (
unsigned int i = 0;
i<prods.size();
i++) {
252 if(prods[
i])
delete prods[
i];
264 HIJSET(ef,frame.data(),proj.data(),targ.data(),iap,izp,iat,izt,strlen(frame.data()),strlen(proj.data()),strlen(targ.data()));
323 return "gen::HijingHadronizer";
bool initializeForInternalPartons()
HepMC::GenParticle * build_hijing(int index, int barcode)
Sin< T >::type sin(const T &t)
std::auto_ptr< HepMC::GenEvent > & event()
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
const char * classname() const
bool get_particles(HepMC::GenEvent *evt)
float ran_(unsigned int *iseed)
virtual ~HijingHadronizer()
virtual 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 > &)