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;
38 bmax_(pset.getParameter<double>(
"bMax")),
39 bmin_(pset.getParameter<double>(
"bMin")),
40 efrm_(pset.getParameter<double>(
"comEnergy")),
41 frame_(pset.getParameter<string>(
"frame")),
42 proj_(pset.getParameter<string>(
"proj")),
43 targ_(pset.getParameter<string>(
"targ")),
44 iap_(pset.getParameter<int>(
"iap")),
45 izp_(pset.getParameter<int>(
"izp")),
46 iat_(pset.getParameter<int>(
"iat")),
47 izt_(pset.getParameter<int>(
"izt")),
51 rotate_(pset.getParameter<bool>(
"rotateEventPlane"))
70 HepMC::HeavyIon* hi =
new HepMC::HeavyIon(
87 evt->set_heavy_ion(*hi);
115 p->suggest_barcode(barcode);
131 HepMC::GenVertex* vertex =
new HepMC::GenVertex(HepMC::FourVector(x,y,z,t),
id);
142 float f_bmin =
bmin_;
143 float f_bmax =
bmax_;
147 HepMC::GenEvent *
evt =
new HepMC::GenEvent();
162 HepMC::GenVertex* vertice;
164 vector<HepMC::GenParticle*> particles;
165 vector<int> mother_ids;
166 vector<HepMC::GenVertex*> prods;
168 vertice =
new HepMC::GenVertex(HepMC::FourVector(0,0,0,0),0);
169 evt->add_vertex(vertice);
170 if(!evt->signal_process_vertex()) evt->set_signal_process_vertex(vertice);
172 const unsigned int knumpart =
himain1.natt;
174 for (
unsigned int ipart = 0; ipart<knumpart; ipart++) {
176 int mid =
himain2.katt[2][ipart] - 1;
180 mother_ids.push_back(mid);
181 LogDebug(
"DecayChain")<<
"Mother index : "<<mid;
184 LogDebug(
"Hijing")<<
"Number of particles in vector "<<particles.size();
186 for (
unsigned int ipart = 0; ipart<particles.size(); ipart++) {
189 int mid = mother_ids[ipart];
190 LogDebug(
"DecayChain")<<
"Particle "<<ipart;
191 LogDebug(
"DecayChain")<<
"Mother's ID "<<mid;
192 LogDebug(
"DecayChain")<<
"Particle's PDG ID "<<part->pdg_id();
195 if(part->status()==1&&
sqrt(part->momentum().px()*part->momentum().px()+part->momentum().py()*part->momentum().py())==0)
199 vertice->add_particle_out(part);
205 LogDebug(
"DecayChain")<<
"Mother's PDG ID "<<mother->pdg_id();
206 HepMC::GenVertex* prod_vertex = mother->end_vertex();
208 prod_vertex = prods[ipart];
209 prod_vertex->add_particle_in(mother);
211 evt->add_vertex(prod_vertex);
215 prod_vertex->add_particle_out(part);
220 for (
unsigned int i = 0;
i<prods.size();
i++) {
221 if(prods[
i])
delete prods[
i];
233 HIJSET(ef,frame.data(),proj.data(),targ.data(),iap,izp,iat,izt,strlen(frame.data()),strlen(proj.data()),strlen(targ.data()));
243 std::string dumstr =
"";
294 return "gen::HijingHadronizer";
bool initializeForInternalPartons()
HepMC::GenParticle * build_hijing(int index, int barcode)
CLHEP::HepRandomEngine * hijRandomEngine
Sin< T >::type sin(const T &t)
bool call_pygive(const std::string &line)
std::auto_ptr< HepMC::GenEvent > & event()
void add_heavy_ion_rec(HepMC::GenEvent *evt)
bool declareStableParticles(const std::vector< int >)
HepMC::GenVertex * build_hijing_vertex(int i, int id)
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...
const char * classname() const
bool get_particles(HepMC::GenEvent *evt)
virtual ~HijingHadronizer()
bool generatePartonsAndHadronize()
bool call_hijset(double efrm, std::string frame, std::string proj, std::string targ, int iap, int izp, int iat, int izt)