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;
47 bmax_(pset.getParameter<double>(
"bMax")),
48 bmin_(pset.getParameter<double>(
"bMin")),
49 efrm_(pset.getParameter<double>(
"comEnergy")),
50 frame_(pset.getParameter<string>(
"frame")),
51 proj_(pset.getParameter<string>(
"proj")),
52 targ_(pset.getParameter<string>(
"targ")),
53 iap_(pset.getParameter<int>(
"iap")),
54 izp_(pset.getParameter<int>(
"izp")),
55 iat_(pset.getParameter<int>(
"iat")),
56 izt_(pset.getParameter<int>(
"izt")),
60 rotate_(pset.getParameter<bool>(
"rotateEventPlane"))
79 HepMC::HeavyIon* hi =
new HepMC::HeavyIon(
96 evt->set_heavy_ion(*hi);
119 p->suggest_barcode(barcode);
128 HepMC::GenVertex* vertex =
new HepMC::GenVertex(HepMC::FourVector(0,0,0,0),
id);
141 HepMC::GenEvent *
evt =
new HepMC::GenEvent();
157 HepMC::GenVertex* vertice;
159 vector<HepMC::GenParticle*> particles;
160 vector<int> mother_ids;
161 vector<HepMC::GenVertex*> prods;
163 vertice =
new HepMC::GenVertex(HepMC::FourVector(0,0,0,0),0);
164 evt->add_vertex(vertice);
165 if(!evt->signal_process_vertex()) evt->set_signal_process_vertex(vertice);
167 const unsigned int knumpart =
himain1.natt;
168 for (
unsigned int ipart = 0; ipart<knumpart; ipart++) {
170 int mid =
himain2.katt[2][ipart];
173 mother_ids.push_back(mid);
174 LogDebug(
"DecayChain")<<
"Mother index : "<<mid;
177 LogDebug(
"Hijing")<<
"Number of particles in vector "<<particles.size();
179 for (
unsigned int ipart = 0; ipart<particles.size(); ipart++) {
182 int mid = mother_ids[ipart];
183 LogDebug(
"DecayChain")<<
"Particle "<<ipart;
184 LogDebug(
"DecayChain")<<
"Mother's ID "<<mid;
185 LogDebug(
"DecayChain")<<
"Particle's PDG ID "<<part->pdg_id();
188 vertice->add_particle_out(part);
194 LogDebug(
"DecayChain")<<
"Mother's PDG ID "<<mother->pdg_id();
196 HepMC::GenVertex* prod_vertex = mother->end_vertex();
198 prod_vertex = prods[ipart];
199 prod_vertex->add_particle_in(mother);
200 evt->add_vertex(prod_vertex);
204 prod_vertex->add_particle_out(part);
209 for (
unsigned int i = 0;
i<prods.size();
i++) {
210 if(prods[
i])
delete prods[
i];
220 HIJSET(efrm,frame.data(),proj.data(),targ.data(),iap,izp,iat,izt,strlen(frame.data()),strlen(proj.data()),strlen(targ.data()));
230 std::string dumstr =
"";
281 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)