11 #include "boost/lexical_cast.hpp"
27 #include "HepMC/PythiaWrapper6_4.h"
28 #include "HepMC/GenEvent.h"
29 #include "HepMC/HeavyIon.h"
30 #include "HepMC/SimpleVector.h"
57 abeamtarget_(pset.getParameter<double>(
"aBeamTarget")),
58 bfixed_(pset.getParameter<double>(
"bFixed")),
59 bmax_(pset.getParameter<double>(
"bMax")),
60 bmin_(pset.getParameter<double>(
"bMin")),
61 cflag_(pset.getParameter<int>(
"cFlag")),
62 embedding_(pset.getParameter<bool>(
"embeddingMode")),
63 comenergy(pset.getParameter<double>(
"comEnergy")),
64 doradiativeenloss_(pset.getParameter<bool>(
"doRadiativeEnLoss")),
65 docollisionalenloss_(pset.getParameter<bool>(
"doCollisionalEnLoss")),
66 fracsoftmult_(pset.getParameter<double>(
"fracSoftMultiplicity")),
67 hadfreeztemp_(pset.getParameter<double>(
"hadronFreezoutTemperature")),
68 hymode_(pset.getParameter<
string>(
"hydjetMode")),
69 maxEventsToPrint_(pset.getUntrackedParameter<int>(
"maxEventsToPrint", 1)),
70 maxlongy_(pset.getParameter<double>(
"maxLongitudinalRapidity")),
71 maxtrany_(pset.getParameter<double>(
"maxTransverseRapidity")),
74 nmultiplicity_(pset.getParameter<int>(
"nMultiplicity")),
76 nquarkflavor_(pset.getParameter<int>(
"qgpNumQuarkFlavor")),
77 pythiaPylistVerbosity_(pset.getUntrackedParameter<int>(
"pythiaPylistVerbosity", 0)),
78 qgpt0_(pset.getParameter<double>(
"qgpInitialTemperature")),
79 qgptau0_(pset.getParameter<double>(
"qgpProperTimeFormation")),
83 rotate_(pset.getParameter<bool>(
"rotateEventPlane")),
84 shadowingswitch_(pset.getParameter<int>(
"shadowingSwitch")),
85 signn_(pset.getParameter<double>(
"sigmaInelNN")),
118 int nproj =
static_cast<int>(npart / 2);
119 int ntarg =
static_cast<int>(npart - nproj);
121 HepMC::HeavyIon* hi =
new HepMC::HeavyIon(
125 static_cast<int>(
hyfpar.nbcol),
137 evt->set_heavy_ion(*hi);
162 p->suggest_barcode(barcode);
178 HepMC::GenVertex* vertex =
new HepMC::GenVertex(HepMC::FourVector(x,y,z,t),
id);
194 const HepMC::GenEvent * inev = input->GetEvent();
195 const HepMC::HeavyIon* hi = inev->heavy_ion();
197 bfixed_ = hi->impact_parameter();
198 phi0_ = hi->event_plane_angle();
202 LogWarning(
"EventEmbedding")<<
"Background event does not have heavy ion record!";
212 edm::LogInfo(
"HYDJETinTemp") <<
"##### HYDJET: QGP init temperature, T0 ="<<
pyqpar.T0u;
213 edm::LogInfo(
"HYDJETinTau") <<
"##### HYDJET: QGP formation time,tau0 ="<<
pyqpar.tau0u;
219 edm::LogError(
"HydjetEmptyEvent") <<
"##### HYDJET: No Particles generated, Number of tries ="<<ntry;
224 std::ostringstream sstr;
225 sstr <<
"HydjetHadronizerProducer: No particles generated after " << ntry <<
" tries.\n";
240 HepMC::GenEvent *
evt =
new HepMC::GenEvent();
244 evt->set_signal_process_id(
pypars.msti[0]);
245 evt->set_event_scale(
pypars.pari[16]);
269 vector<HepMC::GenVertex*> sub_vertices(
nsub_);
272 for(
int isub=0;isub<
nsub_;isub++){
273 LogDebug(
"SubEvent") <<
"Sub Event ID : "<<isub;
275 int sub_up = (isub+1)*50000;
276 vector<HepMC::GenParticle*> particles;
277 vector<int> mother_ids;
278 vector<HepMC::GenVertex*> prods;
280 sub_vertices[isub] =
new HepMC::GenVertex(HepMC::FourVector(0,0,0,0),isub);
281 evt->add_vertex(sub_vertices[isub]);
282 if(!evt->signal_process_vertex()) evt->set_signal_process_vertex(sub_vertices[isub]);
287 mother_ids.push_back(
hyjets.khj[2][ihy]);
296 LogDebug(
"Hydjet")<<
"Number of particles in vector "<<particles.size();
298 for (
unsigned int i = 0;
i<particles.size();
i++) {
303 int mid = mother_ids[
i]-isub*50000-1;
305 LogDebug(
"DecayChain")<<
"Mother's ID "<<mid;
306 LogDebug(
"DecayChain")<<
"Particle's PDG ID "<<part->pdg_id();
309 sub_vertices[isub]->add_particle_out(part);
315 LogDebug(
"DecayChain")<<
"Mother's PDG ID "<<mother->pdg_id();
317 HepMC::GenVertex* prod_vertex = mother->end_vertex();
319 prod_vertex = prods[
i];
320 prod_vertex->add_particle_in(mother);
321 evt->add_vertex(prod_vertex);
324 prod_vertex->add_particle_out(part);
328 for (
unsigned int i = 0;
i<prods.size();
i++) {
329 if(prods[
i])
delete prods[
i];
338 double bmax,
double bfix,
int nh)
343 HYINIT(energy,a,ifb,bmin,bmax,bfix,nh);
396 edm::LogInfo(
"HydjetEnLoss") <<
"##### Radiative AND Collisional partonic energy loss ON ####";
399 edm::LogInfo(
"HydjetenLoss") <<
"##### Only RADIATIVE partonic energy loss ON ####";
402 edm::LogInfo(
"HydjetEnLoss") <<
"##### Only COLLISIONAL partonic energy loss ON ####";
405 edm::LogInfo(
"HydjetEnLoss") <<
"##### Radiative AND Collisional partonic energy loss ON ####";
431 LogInfo(
"RAScaling")<<
"Nuclear radius(RA) = "<<ra;
447 std::vector<int> pdg = _pdg;
448 for (
size_t i=0;
i < pdg.size();
i++ ) {
450 std::ostringstream pyCard ;
451 pyCard <<
"MDCY(" << pyCode <<
",1)=0";
461 const double pi = 3.14159265358979;
494 return "gen::HydjetHadronizer";
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
bool docollisionalenloss_
DEFAULT = true.
bool hydjet_init(const edm::ParameterSet &pset)
Sin< T >::type sin(const T &t)
bool call_pygive(const std::string &line)
void add_heavy_ion_rec(HepMC::GenEvent *evt)
std::auto_ptr< HepMC::GenEvent > & event()
static std::string const input
bool generatePartonsAndHadronize()
Cos< T >::type cos(const T &t)
const char * classname() const
virtual ~HydjetHadronizer()
unsigned int maxEventsToPrint_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
HepMC::GenParticle * build_hyjet(int index, int barcode)
Pythia6Service * pythia6Service_
double fracsoftmult_
DEFAULT = true.
HepMC::GenVertex * build_hyjet_vertex(int i, int id)
double nuclear_radius() const
bool call_hyinit(double energy, double a, int ifb, double bmin, double bmax, double bfix, int nh)
unsigned int pythiaPylistVerbosity_
bool initializeForInternalPartons()
unsigned int shadowingswitch_
unsigned int nquarkflavor_
bool declareStableParticles(const std::vector< int > &)
bool get_particles(HepMC::GenEvent *evt)
edm::Event & getEDMEvent() const