CMS 3D CMS Logo

Hydjet2Hadronizer.cc
Go to the documentation of this file.
1 
7 #include <TLorentzVector.h>
8 #include <TMath.h>
9 #include <TVector3.h>
10 
12 #include <cmath>
13 #include <fstream>
14 #include <iostream>
15 
22 
25 
26 #include "HepMC/GenEvent.h"
27 #include "HepMC/HeavyIon.h"
28 #include "HepMC/IO_HEPEVT.h"
29 #include "HepMC/PythiaWrapper6_4.h"
30 #include "HepMC/SimpleVector.h"
31 
36 
37 CLHEP::HepRandomEngine *hjRandomEngine;
38 
39 using namespace edm;
40 using namespace std;
41 using namespace gen;
42 
43 int Hydjet2Hadronizer::convertStatusForComponents(int sta, int typ) {
44  if (sta == 1 && typ == 0)
45  return 6;
46  if (sta == 1 && typ == 1)
47  return 7;
48  if (sta == 2 && typ == 0)
49  return 16;
50  if (sta == 2 && typ == 1)
51  return 17;
52 
53  else
54  return sta;
55 }
56 
57 int Hydjet2Hadronizer::convertStatus(int st) {
58  if (!separateHydjetComponents_) {
59  if (st <= 0)
60  return 0;
61  if (st <= 10)
62  return 1;
63  if (st <= 20)
64  return 2;
65  if (st <= 30)
66  return 3;
67  }
68  return st;
69 }
70 
71 const std::vector<std::string> Hydjet2Hadronizer::theSharedResources = {edm::SharedResourceNames::kPythia6};
72 
73 //____________________________________________________________________________________________
74 Hydjet2Hadronizer::Hydjet2Hadronizer(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
76  rotate_(pset.getParameter<bool>("rotateEventPlane")),
77  evt(nullptr),
78  nsub_(0),
79  nhard_(0),
80  nsoft_(0),
81  phi0_(0.),
82  sinphi0_(0.),
83  cosphi0_(1.),
84  fVertex_(nullptr),
85  pythia6Service_(new Pythia6Service(pset))
86 
87 {
88  fParams.doPrintInfo = false;
89  fParams.allowEmptyEvent = false;
90  fParams.fNevnt = 0; //not used in CMSSW
91  fParams.femb = pset.getParameter<int>("embeddingMode"); //
92  fParams.fSqrtS = pset.getParameter<double>("fSqrtS"); // C.m.s. energy per nucleon pair
93  fParams.fAw = pset.getParameter<double>("fAw"); // Atomic weigth of nuclei, fAw
94  fParams.fIfb = pset.getParameter<int>(
95  "fIfb"); // Flag of type of centrality generation, fBfix (=0 is fixed by fBfix, >0 distributed [fBfmin, fBmax])
96  fParams.fBmin = pset.getParameter<double>("fBmin"); // Minimum impact parameter in units of nuclear radius, fBmin
97  fParams.fBmax = pset.getParameter<double>("fBmax"); // Maximum impact parameter in units of nuclear radius, fBmax
98  fParams.fBfix = pset.getParameter<double>("fBfix"); // Fixed impact parameter in units of nuclear radius, fBfix
99  fParams.fT = pset.getParameter<double>("fT"); // Temperature at chemical freeze-out, fT [GeV]
100  fParams.fMuB = pset.getParameter<double>("fMuB"); // Chemical baryon potential per unit charge, fMuB [GeV]
101  fParams.fMuS = pset.getParameter<double>("fMuS"); // Chemical strangeness potential per unit charge, fMuS [GeV]
102  fParams.fMuC = pset.getParameter<double>(
103  "fMuC"); // Chemical charm potential per unit charge, fMuC [GeV] (used if charm production is turned on)
104  fParams.fMuI3 = pset.getParameter<double>("fMuI3"); // Chemical isospin potential per unit charge, fMuI3 [GeV]
105  fParams.fThFO = pset.getParameter<double>("fThFO"); // Temperature at thermal freeze-out, fThFO [GeV]
106  fParams.fMu_th_pip =
107  pset.getParameter<double>("fMu_th_pip"); // Chemical potential of pi+ at thermal freeze-out, fMu_th_pip [GeV]
108  fParams.fTau = pset.getParameter<double>(
109  "fTau"); // Proper time proper at thermal freeze-out for central collisions, fTau [fm/c]
110  fParams.fSigmaTau = pset.getParameter<double>(
111  "fSigmaTau"); // Duration of emission at thermal freeze-out for central collisions, fSigmaTau [fm/c]
112  fParams.fR = pset.getParameter<double>(
113  "fR"); // Maximal transverse radius at thermal freeze-out for central collisions, fR [fm]
114  fParams.fYlmax =
115  pset.getParameter<double>("fYlmax"); // Maximal longitudinal flow rapidity at thermal freeze-out, fYlmax
116  fParams.fUmax = pset.getParameter<double>(
117  "fUmax"); // Maximal transverse flow rapidity at thermal freeze-out for central collisions, fUmax
118  fParams.frhou2 = pset.getParameter<double>("fRhou2"); //parameter to swich ON/OFF = 0) rhou2
119  fParams.frhou3 = pset.getParameter<double>("fRhou3"); //parameter to swich ON/OFF(0) rhou3
120  fParams.frhou4 = pset.getParameter<double>("fRhou4"); //parameter to swich ON/OFF(0) rhou4
121  fParams.fDelta =
122  pset.getParameter<double>("fDelta"); // Momentum azimuthal anizotropy parameter at thermal freeze-out, fDelta
123  fParams.fEpsilon =
124  pset.getParameter<double>("fEpsilon"); // Spatial azimuthal anisotropy parameter at thermal freeze-out, fEpsilon
125  fParams.fv2 = pset.getParameter<double>("fKeps2"); //parameter to swich ON/OFF(0) epsilon2 fluctuations
126  fParams.fv3 = pset.getParameter<double>("fKeps3"); //parameter to swich ON/OFF(0) epsilon3 fluctuations
127  fParams.fIfDeltaEpsilon = pset.getParameter<double>(
128  "fIfDeltaEpsilon"); // Flag to specify fDelta and fEpsilon values, fIfDeltaEpsilon (=0 user's ones, >=1 calculated)
129  fParams.fDecay =
130  pset.getParameter<int>("fDecay"); // Flag to switch on/off hadron decays, fDecay (=0 decays off, >=1 decays on)
131  fParams.fWeakDecay = pset.getParameter<double>(
132  "fWeakDecay"); // Low decay width threshold fWeakDecay[GeV]: width<fWeakDecay decay off, width>=fDecayWidth decay on; can be used to switch off weak decays
133  fParams.fEtaType = pset.getParameter<double>(
134  "fEtaType"); // Flag to choose longitudinal flow rapidity distribution, fEtaType (=0 uniform, >0 Gaussian with the dispersion Ylmax)
135  fParams.fTMuType = pset.getParameter<double>(
136  "fTMuType"); // Flag to use calculated T_ch, mu_B and mu_S as a function of fSqrtS, fTMuType (=0 user's ones, >0 calculated)
137  fParams.fCorrS = pset.getParameter<double>(
138  "fCorrS"); // Strangeness supression factor gamma_s with fCorrS value (0<fCorrS <=1, if fCorrS <= 0 then it is calculated)
139  fParams.fCharmProd = pset.getParameter<int>(
140  "fCharmProd"); // Flag to include thermal charm production, fCharmProd (=0 no charm production, >=1 charm production)
141  fParams.fCorrC = pset.getParameter<double>(
142  "fCorrC"); // Charmness enhancement factor gamma_c with fCorrC value (fCorrC >0, if fCorrC<0 then it is calculated)
143  fParams.fNhsel = pset.getParameter<int>(
144  "fNhsel"); //Flag to include jet (J)/jet quenching (JQ) and hydro (H) state production, fNhsel (0 H on & J off, 1 H/J on & JQ off, 2 H/J/HQ on, 3 J on & H/JQ off, 4 H off & J/JQ on)
145  fParams.fPyhist = pset.getParameter<int>(
146  "fPyhist"); // Flag to suppress the output of particle history from PYTHIA, fPyhist (=1 only final state particles; =0 full particle history from PYTHIA)
147  fParams.fIshad = pset.getParameter<int>(
148  "fIshad"); // Flag to switch on/off nuclear shadowing, fIshad (0 shadowing off, 1 shadowing on)
149  fParams.fPtmin =
150  pset.getParameter<double>("fPtmin"); // Minimal pt of parton-parton scattering in PYTHIA event, fPtmin [GeV/c]
151  fParams.fT0 = pset.getParameter<double>(
152  "fT0"); // Initial QGP temperature for central Pb+Pb collisions in mid-rapidity, fT0 [GeV]
153  fParams.fTau0 = pset.getParameter<double>("fTau0"); // Proper QGP formation time in fm/c, fTau0 (0.01<fTau0<10)
154  fParams.fNf = pset.getParameter<int>("fNf"); // Number of active quark flavours in QGP, fNf (0, 1, 2 or 3)
155  fParams.fIenglu = pset.getParameter<int>(
156  "fIenglu"); // Flag to fix type of partonic energy loss, fIenglu (0 radiative and collisional loss, 1 radiative loss only, 2 collisional loss only)
157  fParams.fIanglu = pset.getParameter<int>(
158  "fIanglu"); // Flag to fix type of angular distribution of in-medium emitted gluons, fIanglu (0 small-angular, 1 wide-angular, 2 collinear).
159 
160  edm::FileInPath f1("externals/hydjet2/particles.data");
161  strcpy(fParams.partDat, (f1.fullPath()).c_str());
162 
163  edm::FileInPath f2("externals/hydjet2/tabledecay.txt");
164  strcpy(fParams.tabDecay, (f2.fullPath()).c_str());
165 
166  fParams.fPythiaTune = false;
167 
168  if (pset.exists("signalVtx"))
169  signalVtx_ = pset.getUntrackedParameter<std::vector<double>>("signalVtx");
170 
171  if (signalVtx_.size() == 4) {
172  if (!fVertex_)
173  fVertex_ = new HepMC::FourVector();
174  LogDebug("EventSignalVertex") << "Setting event signal vertex "
175  << " x = " << signalVtx_.at(0) << " y = " << signalVtx_.at(1)
176  << " z= " << signalVtx_.at(2) << " t = " << signalVtx_.at(3) << endl;
177  fVertex_->set(signalVtx_.at(0), signalVtx_.at(1), signalVtx_.at(2), signalVtx_.at(3));
178  }
179 
180  // PYLIST Verbosity Level
181  // Valid PYLIST arguments are: 1, 2, 3, 5, 7, 11, 12, 13
182  pythiaPylistVerbosity_ = pset.getUntrackedParameter<int>("pythiaPylistVerbosity", 0);
183  LogDebug("PYLISTverbosity") << "Pythia PYLIST verbosity level = " << pythiaPylistVerbosity_;
184  //Max number of events printed on verbosity level
185  maxEventsToPrint_ = pset.getUntrackedParameter<int>("maxEventsToPrint", 0);
186  LogDebug("Events2Print") << "Number of events to be printed = " << maxEventsToPrint_;
187  if (fParams.femb == 1) {
188  fParams.fIfb = 0;
189  src_ = iC.consumes<CrossingFrame<edm::HepMCProduct>>(
190  pset.getUntrackedParameter<edm::InputTag>("backgroundLabel", edm::InputTag("mix", "generatorSmeared")));
191  }
192 
193  separateHydjetComponents_ = pset.getUntrackedParameter<bool>("separateHydjetComponents", false);
194 }
195 //__________________________________________________________________________________________
197  call_pystat(1);
198  delete pythia6Service_;
199 }
200 
201 //_____________________________________________________________________
202 void Hydjet2Hadronizer::doSetRandomEngine(CLHEP::HepRandomEngine *v) {
204  hjRandomEngine = v;
205 }
206 
207 //______________________________________________________________________________________________________
211 
212  fParams.fSeed = hjRandomEngine->CLHEP::HepRandomEngine::getSeed();
213  LogInfo("Hydjet2Hadronizer|GenSeed") << "Seed for random number generation: "
214  << hjRandomEngine->CLHEP::HepRandomEngine::getSeed();
215 
216  return kTRUE;
217 }
218 
219 //______________________________________________________________________________________________________
222 
223  // the input impact parameter (bxx_) is in [fm]; transform in [fm/RA] for hydjet usage
224  const double ra = nuclear_radius();
225  LogInfo("Hydjet2Hadronizer|RAScaling") << "Nuclear radius(RA) = " << ra;
226  fParams.fBmin /= ra;
227  fParams.fBmax /= ra;
228  fParams.fBfix /= ra;
229 
230  hj2 = new Hydjet2(fParams);
231 
232  return kTRUE;
233 }
234 
235 //__________________________________________________________________________________________
238 
239  // generate single event
240  if (fParams.femb == 1) {
241  const edm::Event &e = getEDMEvent();
242  HepMC::GenVertex *genvtx = nullptr;
243  const HepMC::GenEvent *inev = nullptr;
245  e.getByToken(src_, cf);
247  if (mix.size() < 1) {
248  throw cms::Exception("MatchVtx") << "Mixing has " << mix.size() << " sub-events, should have been at least 1"
249  << endl;
250  }
251  const HepMCProduct &bkg = mix.getObject(0);
252  if (!(bkg.isVtxGenApplied())) {
253  throw cms::Exception("MatchVtx") << "Input background does not have smeared vertex!" << endl;
254  } else {
255  inev = bkg.GetEvent();
256  }
257 
258  genvtx = inev->signal_process_vertex();
259 
260  if (!genvtx)
261  throw cms::Exception("MatchVtx") << "Input background does not have signal process vertex!" << endl;
262 
263  double aX, aY, aZ, aT;
264 
265  aX = genvtx->position().x();
266  aY = genvtx->position().y();
267  aZ = genvtx->position().z();
268  aT = genvtx->position().t();
269 
270  if (!fVertex_) {
271  fVertex_ = new HepMC::FourVector();
272  }
273  LogInfo("MatchVtx") << " setting vertex "
274  << " aX " << aX << " aY " << aY << " aZ " << aZ << " aT " << aT << endl;
275  fVertex_->set(aX, aY, aZ, aT);
276 
277  const HepMC::HeavyIon *hi = inev->heavy_ion();
278 
279  if (hi) {
280  fParams.fBfix = (hi->impact_parameter()) / nuclear_radius();
281  phi0_ = hi->event_plane_angle();
282  sinphi0_ = sin(phi0_);
283  cosphi0_ = cos(phi0_);
284  } else {
285  LogWarning("EventEmbedding") << "Background event does not have heavy ion record!";
286  }
287 
288  } else if (rotate_)
289  rotateEvtPlane();
290 
291  nsoft_ = 0;
292  nhard_ = 0;
293 
294  // generate one HYDJET event
295  int ntry = 0;
296 
297  while (nsoft_ == 0 && nhard_ == 0) {
298  if (ntry > 100) {
299  LogError("Hydjet2EmptyEvent") << "##### HYDJET2: No Particles generated, Number of tries =" << ntry;
300  // Throw an exception. Use the EventCorruption exception since it maps onto SkipEvent
301  // which is what we want to do here.
302  std::ostringstream sstr;
303  sstr << "Hydjet2HadronizerProducer: No particles generated after " << ntry << " tries.\n";
304  edm::Exception except(edm::errors::EventCorruption, sstr.str());
305  throw except;
306  } else {
307  hj2->GenerateEvent(fParams.fBfix);
308 
309  if (hj2->IsEmpty()) {
310  continue;
311  }
312 
313  nsoft_ = hj2->GetNhyd();
314  nsub_ = hj2->GetNjet();
315  nhard_ = hj2->GetNpyt();
316 
317  //100 trys
318  ++ntry;
319  }
320  }
321 
322  if (ev == 0) {
323  Sigin = hj2->GetSigin();
324  Sigjet = hj2->GetSigjet();
325  }
326  ev = true;
327 
328  if (fParams.fNhsel < 3)
329  nsub_++;
330 
331  // event information
332  std::unique_ptr<HepMC::GenEvent> evt = std::make_unique<HepMC::GenEvent>();
333  std::unique_ptr<edm::HepMCProduct> HepMCEvt = std::make_unique<edm::HepMCProduct>();
334 
335  if (nhard_ > 0 || nsoft_ > 0)
336  get_particles(evt.get());
337 
338  evt->set_signal_process_id(pypars.msti[0]); // type of the process
339  evt->set_event_scale(pypars.pari[16]); // Q^2
340  add_heavy_ion_rec(evt.get());
341 
342  if (fVertex_) {
343  // generate new vertex & apply the shift
344  // Copy the HepMC::GenEvent
345  HepMCEvt = std::make_unique<edm::HepMCProduct>(evt.get());
346  HepMCEvt->applyVtxGen(fVertex_);
347  evt = std::make_unique<HepMC::GenEvent>(*HepMCEvt->GetEvent());
348  }
349 
350  HepMC::HEPEVT_Wrapper::check_hepevt_consistency();
351  LogDebug("HEPEVT_info") << "Ev numb: " << HepMC::HEPEVT_Wrapper::event_number()
352  << " Entries number: " << HepMC::HEPEVT_Wrapper::number_entries() << " Max. entries "
353  << HepMC::HEPEVT_Wrapper::max_number_entries() << std::endl;
354 
355  event() = std::move(evt);
356  return kTRUE;
357 }
358 
359 //________________________________________________________________
360 bool Hydjet2Hadronizer::declareStableParticles(const std::vector<int> &_pdg) {
361  std::vector<int> pdg = _pdg;
362  for (size_t i = 0; i < pdg.size(); i++) {
363  int pyCode = pycomp_(pdg[i]);
364  std::ostringstream pyCard;
365  pyCard << "MDCY(" << pyCode << ",1)=0";
366  std::cout << pyCard.str() << std::endl;
367  call_pygive(pyCard.str());
368  }
369  return true;
370 }
371 //________________________________________________________________
372 bool Hydjet2Hadronizer::hadronize() { return false; }
373 bool Hydjet2Hadronizer::decay() { return true; }
374 bool Hydjet2Hadronizer::residualDecay() { return true; }
377 const char *Hydjet2Hadronizer::classname() const { return "gen::Hydjet2Hadronizer"; }
378 
379 //________________________________________________________________
381  const double pi = 3.14159265358979;
382  phi0_ = 2. * pi * gen::pyr_(nullptr) - pi;
383  sinphi0_ = sin(phi0_);
384  cosphi0_ = cos(phi0_);
385 }
386 
387 //_____________________________________________________________________
389  LogDebug("Hydjet2") << " Number of sub events " << nsub_;
390  LogDebug("Hydjet2") << " Number of hard events " << hj2->GetNjet();
391  LogDebug("Hydjet2") << " Number of hard particles " << nhard_;
392  LogDebug("Hydjet2") << " Number of soft particles " << nsoft_;
393  LogDebug("Hydjet2") << " nhard_ + nsoft_ = " << nhard_ + nsoft_ << " Ntot = " << hj2->GetNtot() << endl;
394 
395  int ihy = 0;
396  int isub_l = -1;
397  int stab = 0;
398 
399  vector<HepMC::GenParticle *> particle(hj2->GetNtot());
400  HepMC::GenVertex *sub_vertices = nullptr;
401 
402  while (ihy < hj2->GetNtot()) {
403  if ((hj2->GetiJet().at(ihy)) != isub_l) {
404  sub_vertices = new HepMC::GenVertex(HepMC::FourVector(0, 0, 0, 0), hj2->GetiJet().at(ihy));
405  evt->add_vertex(sub_vertices);
406  if (!evt->signal_process_vertex())
407  evt->set_signal_process_vertex(sub_vertices);
408  isub_l = hj2->GetiJet().at(ihy);
409  }
410 
411  if ((hj2->GetFinal().at(ihy)) == 1) //convertStatus(hj2->GetPythiaStatus().at(ihy)) == 1)
412  stab++;
413  LogDebug("Hydjet2_array") << ihy << " MULTin ev.:" << hj2->GetNtot() << " SubEv.#" << hj2->GetiJet().at(ihy)
414  << " Part #" << ihy + 1 << ", PDG: " << hj2->GetPdg().at(ihy) << " (st. "
415  << convertStatus(hj2->GetPythiaStatus().at(ihy))
416  << ") mother=" << hj2->GetMotherIndex().at(ihy) + 1 << ", childs ("
417  << hj2->GetFirstDaughterIndex().at(ihy) + 1 << "-"
418  << hj2->GetLastDaughterIndex().at(ihy) + 1 << "), vtx (" << hj2->GetX().at(ihy) << ","
419  << hj2->GetY().at(ihy) << "," << hj2->GetZ().at(ihy) << ") " << std::endl;
420 
421  if ((hj2->GetMotherIndex().at(ihy)) <= 0) {
422  particle.at(ihy) = build_hyjet2(ihy, ihy + 1);
423  if (!sub_vertices)
424  LogError("Hydjet2_array") << "##### HYDJET2: Vertex not initialized!";
425  else
426  sub_vertices->add_particle_out(particle.at(ihy));
427  LogDebug("Hydjet2_array") << " ---> " << ihy + 1 << std::endl;
428  } else {
429  particle.at(ihy) = build_hyjet2(ihy, ihy + 1);
430  int mid = hj2->GetMotherIndex().at(ihy);
431 
432  while (((mid + 1) < ihy) && (std::abs(hj2->GetPdg().at(mid)) < 100) &&
433  ((hj2->GetFirstDaughterIndex().at(mid + 1)) <= ihy)) {
434  mid++;
435  LogDebug("Hydjet2_array") << "======== MID changed to " << mid
436  << " ======== PDG(mid) = " << hj2->GetPdg().at(mid) << std::endl;
437  }
438 
439  if (std::abs(hj2->GetPdg().at(mid)) < 100) {
440  mid = hj2->GetMotherIndex().at(ihy);
441  LogDebug("Hydjet2_array") << "======== MID changed BACK to " << mid
442  << " ======== PDG(mid) = " << hj2->GetPdg().at(mid) << std::endl;
443  }
444 
445  HepMC::GenParticle *mother = particle.at(mid);
446  HepMC::GenVertex *prod_vertex = mother->end_vertex();
447 
448  if (!prod_vertex) {
449  prod_vertex = build_hyjet2_vertex(ihy, (hj2->GetiJet().at(ihy)));
450  prod_vertex->add_particle_in(mother);
451  LogDebug("Hydjet2_array") << " <--- " << mid + 1 << std::endl;
452  evt->add_vertex(prod_vertex);
453  }
454  prod_vertex->add_particle_out(particle.at(ihy));
455  LogDebug("Hydjet2_array") << " ---" << mid + 1 << "---> " << ihy + 1 << std::endl;
456  }
457  ihy++;
458  }
459 
460  LogDebug("Hydjet2_array") << " MULTin ev.:" << hj2->GetNtot() << ", last index: " << ihy - 1
461  << ", stable particles: " << stab << std::endl;
462  return kTRUE;
463 }
464 
465 //___________________________________________________________________
467  // Build particle object corresponding to index in hyjets (soft+hard)
468  double px0 = (hj2->GetPx()).at(index);
469  double py0 = (hj2->GetPy()).at(index);
470 
471  double px = px0 * cosphi0_ - py0 * sinphi0_;
472  double py = py0 * cosphi0_ + px0 * sinphi0_;
473 
475  new HepMC::GenParticle(HepMC::FourVector(px, // px
476  py, // py
477  (hj2->GetPz()).at(index), // pz
478  (hj2->GetE()).at(index)), // E
479  (hj2->GetPdg()).at(index), // id
481  (hj2->GetType()).at(index))) // status
482  );
483 
484  p->suggest_barcode(barcode);
485  return p;
486 }
487 
488 //___________________________________________________________________
489 HepMC::GenVertex *Hydjet2Hadronizer::build_hyjet2_vertex(int i, int id) {
490  // build verteces for the hyjets stored events
491  double x0 = (hj2->GetX()).at(i);
492  double y0 = (hj2->GetY()).at(i);
493  double x = x0 * cosphi0_ - y0 * sinphi0_;
494  double y = y0 * cosphi0_ + x0 * sinphi0_;
495  double z = (hj2->GetZ()).at(i);
496  double t = (hj2->GetT()).at(i);
497 
498  HepMC::GenVertex *vertex = new HepMC::GenVertex(HepMC::FourVector(x, y, z, t), id);
499 
500  return vertex;
501 }
502 
503 //_____________________________________________________________________
505  // heavy ion record in the final CMSSW Event
506  int nproj = static_cast<int>((hj2->GetNpart()) / 2);
507  int ntarg = static_cast<int>((hj2->GetNpart()) - nproj);
508 
509  HepMC::HeavyIon *hi = new HepMC::HeavyIon(nsub_, // Ncoll_hard/N of SubEvents
510  nproj, // Npart_proj
511  ntarg, // Npart_targ
512  hj2->GetNbcol(), // Ncoll
513  0, // spectator_neutrons
514  0, // spectator_protons
515  0, // N_Nwounded_collisions
516  0, // Nwounded_N_collisions
517  0, // Nwounded_Nwounded_collisions
518  hj2->GetBgen() * nuclear_radius(), // impact_parameter in [fm]
519  phi0_, // event_plane_angle
520  hj2->GetPsiv3(), // eccentricity <<<---- psi for v3!!!
521  Sigin // sigma_inel_NN
522  );
523 
524  evt->set_heavy_ion(*hi);
525  delete hi;
526 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
bool declareStableParticles(const std::vector< int > &)
edm::ParameterSet pset
unsigned int maxEventsToPrint_
InitialParamsHydjet_t fParams
bool isVtxGenApplied() const
Definition: HepMCProduct.h:39
void add_heavy_ion_rec(HepMC::GenEvent *evt)
double pyr_(int *idummy)
unsigned int pythiaPylistVerbosity_
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
bool exists(std::string const &parameterName) const
checks if a parameter exists
T const * product() const
Definition: Handle.h:70
bool call_pygive(const std::string &line)
HepMC::FourVector * fVertex_
std::vector< double > signalVtx_
Log< level::Error, false > LogError
double v[5][pyjets_maxn]
const Double_t pi
edm::EDGetTokenT< CrossingFrame< edm::HepMCProduct > > src_
const char * classname() const
T getUntrackedParameter(std::string const &, T const &) const
static const std::string kPythia6
HepMC::GenVertex * build_hyjet2_vertex(int i, int id)
double nuclear_radius() const
Pythia6Service * pythia6Service_
double p[5][pyjets_maxn]
edm::Event & getEDMEvent() const
CLHEP::HepRandomEngine * hjRandomEngine
Interface to the HYDJET++ (Hydjet2) generator (since core v. 2.4.3), produces HepMC events...
bool get_particles(HepMC::GenEvent *evt)
Definition: EPCuts.h:4
int convertStatusForComponents(int, int)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
void doSetRandomEngine(CLHEP::HepRandomEngine *v) override
std::unique_ptr< HepMC::GenEvent > & event()
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:37
Log< level::Info, false > LogInfo
int pycomp_(int &)
#define pypars
HepMC::GenParticle * build_hyjet2(int index, int barcode)
void setRandomEngine(CLHEP::HepRandomEngine *v)
HLT enums.
float x
Log< level::Warning, false > LogWarning
HepMC::GenEvent * evt
def move(src, dest)
Definition: eostools.py:511
#define LogDebug(id)