16 #include "boost/lexical_cast.hpp" 31 #include "HepMC/PythiaWrapper6_4.h" 32 #include "HepMC/GenEvent.h" 33 #include "HepMC/HeavyIon.h" 34 #include "HepMC/SimpleVector.h" 63 abeamtarget_(pset.getParameter<double>(
"aBeamTarget")),
64 angularspecselector_(pset.getParameter<
int>(
"angularSpectrumSelector")),
65 bfixed_(pset.getParameter<double>(
"bFixed")),
66 bmax_(pset.getParameter<double>(
"bMax")),
67 bmin_(pset.getParameter<double>(
"bMin")),
68 cflag_(pset.getParameter<
int>(
"cFlag")),
69 embedding_(pset.getParameter<
bool>(
"embeddingMode")),
70 comenergy(pset.getParameter<double>(
"comEnergy")),
71 doradiativeenloss_(pset.getParameter<
bool>(
"doRadiativeEnLoss")),
72 docollisionalenloss_(pset.getParameter<
bool>(
"doCollisionalEnLoss")),
73 fracsoftmult_(pset.getParameter<double>(
"fracSoftMultiplicity")),
74 hadfreeztemp_(pset.getParameter<double>(
"hadronFreezoutTemperature")),
75 hymode_(pset.getParameter<
string>(
"hydjetMode")),
76 maxEventsToPrint_(pset.getUntrackedParameter<
int>(
"maxEventsToPrint", 1)),
77 maxlongy_(pset.getParameter<double>(
"maxLongitudinalRapidity")),
78 maxtrany_(pset.getParameter<double>(
"maxTransverseRapidity")),
81 nmultiplicity_(pset.getParameter<
int>(
"nMultiplicity")),
83 nquarkflavor_(pset.getParameter<
int>(
"qgpNumQuarkFlavor")),
84 pythiaPylistVerbosity_(pset.getUntrackedParameter<
int>(
"pythiaPylistVerbosity", 0)),
85 qgpt0_(pset.getParameter<double>(
"qgpInitialTemperature")),
86 qgptau0_(pset.getParameter<double>(
"qgpProperTimeFormation")),
90 rotate_(pset.getParameter<
bool>(
"rotateEventPlane")),
91 shadowingswitch_(pset.getParameter<
int>(
"shadowingSwitch")),
92 signn_(pset.getParameter<double>(
"sigmaInelNN")),
132 int nproj =
static_cast<int>(npart / 2);
133 int ntarg =
static_cast<int>(npart - nproj);
135 HepMC::HeavyIon*
hi =
new HepMC::HeavyIon(
139 static_cast<int>(
hyfpar.nbcol),
151 evt->set_heavy_ion(*hi);
176 p->suggest_barcode(barcode);
192 HepMC::GenVertex* vertex =
new HepMC::GenVertex(HepMC::FourVector(x,y,z,t),
id);
209 const HepMC::HeavyIon*
hi = inev->heavy_ion();
211 bfixed_ = hi->impact_parameter();
212 phi0_ = hi->event_plane_angle();
216 LogWarning(
"EventEmbedding")<<
"Background event does not have heavy ion record!";
226 edm::LogInfo(
"HYDJETinTemp") <<
"##### HYDJET: QGP init temperature, T0 ="<<
pyqpar.T0u;
227 edm::LogInfo(
"HYDJETinTau") <<
"##### HYDJET: QGP formation time,tau0 ="<<
pyqpar.tau0u;
233 edm::LogError(
"HydjetEmptyEvent") <<
"##### HYDJET: No Particles generated, Number of tries ="<<ntry;
238 std::ostringstream sstr;
239 sstr <<
"HydjetHadronizerProducer: No particles generated after " << ntry <<
" tries.\n";
258 evt->set_signal_process_id(
pypars.msti[0]);
259 evt->set_event_scale(
pypars.pari[16]);
283 vector<HepMC::GenVertex*> sub_vertices(
nsub_);
286 for(
int isub=0;isub<
nsub_;isub++){
287 LogDebug(
"SubEvent") <<
"Sub Event ID : "<<isub;
289 int sub_up = (isub+1)*50000;
291 vector<int> mother_ids;
292 vector<HepMC::GenVertex*> prods;
294 sub_vertices[isub] =
new HepMC::GenVertex(HepMC::FourVector(0,0,0,0),isub);
295 evt->add_vertex(sub_vertices[isub]);
296 if(!evt->signal_process_vertex()) evt->set_signal_process_vertex(sub_vertices[isub]);
301 mother_ids.push_back(
hyjets.khj[2][ihy]);
310 LogDebug(
"Hydjet")<<
"Number of particles in vector "<<particles.size();
312 for (
unsigned int i = 0;
i<particles.size();
i++) {
317 int mid = mother_ids[
i]-isub*50000-1;
319 LogDebug(
"DecayChain")<<
"Mother's ID "<<mid;
320 LogDebug(
"DecayChain")<<
"Particle's PDG ID "<<part->pdg_id();
323 sub_vertices[isub]->add_particle_out(part);
329 LogDebug(
"DecayChain")<<
"Mother's PDG ID "<<mother->pdg_id();
331 HepMC::GenVertex* prod_vertex = mother->end_vertex();
333 prod_vertex = prods[
i];
334 prod_vertex->add_particle_in(mother);
335 evt->add_vertex(prod_vertex);
338 prod_vertex->add_particle_out(part);
342 for (
unsigned int i = 0;
i<prods.size();
i++) {
343 if(prods[
i])
delete prods[
i];
352 double bmax,
double bfix,
int nh)
357 HYINIT(energy,a,ifb,bmin,bmax,bfix,nh);
413 edm::LogInfo(
"HydjetEnLoss") <<
"##### Radiative AND Collisional partonic energy loss ON ####";
416 edm::LogInfo(
"HydjetenLoss") <<
"##### Only RADIATIVE partonic energy loss ON ####";
419 edm::LogInfo(
"HydjetEnLoss") <<
"##### Only COLLISIONAL partonic energy loss ON ####";
422 edm::LogInfo(
"HydjetEnLoss") <<
"##### Radiative AND Collisional partonic energy loss ON ####";
448 LogInfo(
"RAScaling")<<
"Nuclear radius(RA) = "<<ra;
464 std::vector<int> pdg = _pdg;
465 for (
size_t i=0;
i < pdg.size();
i++ ) {
467 std::ostringstream pyCard ;
468 pyCard <<
"MDCY(" << pyCode <<
",1)=0";
478 const double pi = 3.14159265358979;
511 return "gen::HydjetHadronizer";
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
virtual void doSetRandomEngine(CLHEP::HepRandomEngine *v) override
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
static const std::string kPythia6
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_
static const std::string kFortranInstance
double fracsoftmult_
DEFAULT = true.
HepMC::GenVertex * build_hyjet_vertex(int i, int id)
const HepMC::GenEvent * GetEvent() const
double nuclear_radius() const
bool call_hyinit(double energy, double a, int ifb, double bmin, double bmax, double bfix, int nh)
unsigned int pythiaPylistVerbosity_
void setRandomEngine(CLHEP::HepRandomEngine *v)
bool initializeForInternalPartons()
unsigned int shadowingswitch_
unsigned int nquarkflavor_
def convertStatus(status)
bool declareStableParticles(const std::vector< int > &)
bool get_particles(HepMC::GenEvent *evt)
edm::Event & getEDMEvent() const