CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
gen::HydjetHadronizer Class Reference

#include <HydjetHadronizer.h>

Inheritance diagram for gen::HydjetHadronizer:
gen::BaseHadronizer

Public Member Functions

const char * classname () const
 
bool decay ()
 
bool declareSpecialSettings (const std::vector< std::string > &)
 
bool declareStableParticles (const std::vector< int > &)
 
void finalizeEvent ()
 
bool generatePartonsAndHadronize ()
 
bool hadronize ()
 
 HydjetHadronizer (const edm::ParameterSet &, edm::ConsumesCollector &&)
 
bool initializeForExternalPartons ()
 
bool initializeForInternalPartons ()
 
bool readSettings (int)
 
bool residualDecay ()
 
void statistics ()
 
 ~HydjetHadronizer () override
 
- Public Member Functions inherited from gen::BaseHadronizer
 BaseHadronizer (edm::ParameterSet const &ps)
 
void cleanLHE ()
 
void generateLHE (edm::LuminosityBlock const &lumi, CLHEP::HepRandomEngine *rengine, unsigned int ncpu)
 
edm::EventgetEDMEvent () const
 
std::unique_ptr< HepMC::GenEventgetGenEvent ()
 
std::unique_ptr
< GenEventInfoProduct
getGenEventInfo ()
 
virtual std::unique_ptr
< GenLumiInfoHeader
getGenLumiInfoHeader () const
 
GenRunInfoProductgetGenRunInfo ()
 
std::unique_ptr< lhef::LHEEventgetLHEEvent ()
 
const std::shared_ptr
< lhef::LHERunInfo > & 
getLHERunInfo () const
 
const std::string & gridpackPath () const
 
int randomIndex () const
 
const std::string & randomInitConfigDescription () const
 
void randomizeIndex (edm::LuminosityBlock const &lumi, CLHEP::HepRandomEngine *rengine)
 
void resetEvent (std::unique_ptr< HepMC::GenEvent > event)
 
void resetEventInfo (std::unique_ptr< GenEventInfoProduct > eventInfo)
 
virtual bool select (HepMC::GenEvent *) const
 
void setEDMEvent (edm::Event &event)
 
void setLHEEvent (std::unique_ptr< lhef::LHEEvent > event)
 
void setLHERunInfo (std::unique_ptr< lhef::LHERunInfo > runInfo)
 
void setRandomEngine (CLHEP::HepRandomEngine *v)
 
std::vector< std::string > const & sharedResources () const
 
virtual ~BaseHadronizer () noexcept(false)
 

Private Member Functions

void add_heavy_ion_rec (HepMC::GenEvent *evt)
 
HepMC::GenParticle * build_hyjet (int index, int barcode)
 
HepMC::GenVertex * build_hyjet_vertex (int i, int id)
 
bool call_hyinit (double energy, double a, int ifb, double bmin, double bmax, double bfix, int nh)
 
void doSetRandomEngine (CLHEP::HepRandomEngine *v) override
 
std::vector< std::string > const & doSharedResources () const override
 
bool get_particles (HepMC::GenEvent *evt)
 
bool hydjet_init (const edm::ParameterSet &pset)
 
double nuclear_radius () const
 
void rotateEvtPlane ()
 

Private Attributes

double abeamtarget_
 beam/target atomic mass number More...
 
int angularspecselector_
 angular emitted gluon spectrum selection More...
 
double bfixed_
 fixed impact param (fm); valid only if cflag_=0 More...
 
double bmax_
 
double bmin_
 
int cflag_
 
double comenergy
 collision energy More...
 
double cosphi0_
 
bool docollisionalenloss_
 DEFAULT = true. More...
 
bool doradiativeenloss_
 DEFAULT = true. More...
 
bool embedding_
 Switch for embedding mode. More...
 
HepMC::GenEventevt
 
double fracsoftmult_
 
HepMC::FourVector * fVertex_
 Event signal vertex. More...
 
double hadfreeztemp_
 
std::string hymode_
 Hydjet running mode. More...
 
unsigned int maxEventsToPrint_
 Events to print if verbosity. More...
 
double maxlongy_
 
double maxtrany_
 
int nhard_
 multiplicity of PYTHIA(+PYQUEN)-induced particles in event More...
 
int nmultiplicity_
 
unsigned int nquarkflavor_
 
int nsoft_
 multiplicity of HYDRO-induced particles in event More...
 
int nsub_
 number of sub-events More...
 
double phi0_
 Event plane angle. More...
 
edm::ParameterSet pset_
 
Pythia6Servicepythia6Service_
 
unsigned int pythiaPylistVerbosity_
 pythia verbosity; def=1 More...
 
double qgpt0_
 
double qgptau0_
 
bool rotate_
 Switch to rotate event plane. More...
 
unsigned int shadowingswitch_
 
std::vector< double > signalVtx_
 Pset double vector to set event signal vertex. More...
 
double signn_
 
double sinphi0_
 
edm::EDGetTokenT
< CrossingFrame
< edm::HepMCProduct > > 
src_
 

Static Private Attributes

static const std::vector
< std::string > 
theSharedResources
 

Additional Inherited Members

- Protected Member Functions inherited from gen::BaseHadronizer
std::unique_ptr
< HepMC::GenEvent > & 
event ()
 
std::unique_ptr
< GenEventInfoProduct > & 
eventInfo ()
 
lhef::LHEEventlheEvent ()
 
lhef::LHERunInfolheRunInfo ()
 
GenRunInfoProductrunInfo ()
 
- Protected Attributes inherited from gen::BaseHadronizer
std::string lheFile_
 
int randomIndex_
 

Detailed Description

Definition at line 41 of file HydjetHadronizer.h.

Constructor & Destructor Documentation

HydjetHadronizer::HydjetHadronizer ( const edm::ParameterSet pset,
edm::ConsumesCollector &&  iC 
)

Definition at line 57 of file HydjetHadronizer.cc.

References cflag_, embedding_, edm::ParameterSet::exists(), fVertex_, edm::ParameterSet::getUntrackedParameter(), HYJVER, HLT_FULL_cff::InputTag, LogDebug, maxEventsToPrint_, pythiaPylistVerbosity_, signalVtx_, and src_.

58  : BaseHadronizer(pset),
59  evt(nullptr),
60  pset_(pset),
61  abeamtarget_(pset.getParameter<double>("aBeamTarget")),
62  angularspecselector_(pset.getParameter<int>("angularSpectrumSelector")),
63  bfixed_(pset.getParameter<double>("bFixed")),
64  bmax_(pset.getParameter<double>("bMax")),
65  bmin_(pset.getParameter<double>("bMin")),
66  cflag_(pset.getParameter<int>("cFlag")),
67  embedding_(pset.getParameter<bool>("embeddingMode")),
68  comenergy(pset.getParameter<double>("comEnergy")),
69  doradiativeenloss_(pset.getParameter<bool>("doRadiativeEnLoss")),
70  docollisionalenloss_(pset.getParameter<bool>("doCollisionalEnLoss")),
71  fracsoftmult_(pset.getParameter<double>("fracSoftMultiplicity")),
72  hadfreeztemp_(pset.getParameter<double>("hadronFreezoutTemperature")),
73  hymode_(pset.getParameter<string>("hydjetMode")),
74  maxEventsToPrint_(pset.getUntrackedParameter<int>("maxEventsToPrint", 1)),
75  maxlongy_(pset.getParameter<double>("maxLongitudinalRapidity")),
76  maxtrany_(pset.getParameter<double>("maxTransverseRapidity")),
77  nsub_(0),
78  nhard_(0),
79  nmultiplicity_(pset.getParameter<int>("nMultiplicity")),
80  nsoft_(0),
81  nquarkflavor_(pset.getParameter<int>("qgpNumQuarkFlavor")),
82  pythiaPylistVerbosity_(pset.getUntrackedParameter<int>("pythiaPylistVerbosity", 0)),
83  qgpt0_(pset.getParameter<double>("qgpInitialTemperature")),
84  qgptau0_(pset.getParameter<double>("qgpProperTimeFormation")),
85  phi0_(0.),
86  sinphi0_(0.),
87  cosphi0_(1.),
88  rotate_(pset.getParameter<bool>("rotateEventPlane")),
89  shadowingswitch_(pset.getParameter<int>("shadowingSwitch")),
90  signn_(pset.getParameter<double>("sigmaInelNN")),
91  fVertex_(nullptr),
92  pythia6Service_(new Pythia6Service(pset)) {
93  // Default constructor
94 
95  if (pset.exists("signalVtx"))
96  signalVtx_ = pset.getUntrackedParameter<std::vector<double> >("signalVtx");
97 
98  if (signalVtx_.size() == 4) {
99  if (!fVertex_)
100  fVertex_ = new HepMC::FourVector();
101  LogDebug("EventSignalVertex") << "Setting event signal vertex "
102  << " x = " << signalVtx_.at(0) << " y = " << signalVtx_.at(1)
103  << " z= " << signalVtx_.at(2) << " t = " << signalVtx_.at(3) << endl;
104  fVertex_->set(signalVtx_.at(0), signalVtx_.at(1), signalVtx_.at(2), signalVtx_.at(3));
105  }
106 
107  // PYLIST Verbosity Level
108  // Valid PYLIST arguments are: 1, 2, 3, 5, 7, 11, 12, 13
109  pythiaPylistVerbosity_ = pset.getUntrackedParameter<int>("pythiaPylistVerbosity", 0);
110  LogDebug("PYLISTverbosity") << "Pythia PYLIST verbosity level = " << pythiaPylistVerbosity_;
111 
112  //Max number of events printed on verbosity level
113  maxEventsToPrint_ = pset.getUntrackedParameter<int>("maxEventsToPrint", 0);
114  LogDebug("Events2Print") << "Number of events to be printed = " << maxEventsToPrint_;
115 
116  if (embedding_) {
117  cflag_ = 0;
119  pset.getUntrackedParameter<edm::InputTag>("backgroundLabel", edm::InputTag("mix", "generatorSmeared")));
120  }
121 
122  int cm = 1, va, vb, vc;
123  HYJVER(cm, va, vb, vc);
124  HepMC::HEPEVT_Wrapper::set_max_number_entries(4000);
125 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
double bfixed_
fixed impact param (fm); valid only if cflag_=0
T getUntrackedParameter(std::string const &, T const &) const
HepMC::GenEvent * evt
bool docollisionalenloss_
DEFAULT = true.
BaseHadronizer(edm::ParameterSet const &ps)
bool exists(std::string const &parameterName) const
checks if a parameter exists
#define HYJVER
Definition: HydjetWrapper.h:25
double comenergy
collision energy
bool embedding_
Switch for embedding mode.
std::string hymode_
Hydjet running mode.
int nsoft_
multiplicity of HYDRO-induced particles in event
unsigned int maxEventsToPrint_
Events to print if verbosity.
Pythia6Service * pythia6Service_
int nsub_
number of sub-events
std::vector< double > signalVtx_
Pset double vector to set event signal vertex.
int nhard_
multiplicity of PYTHIA(+PYQUEN)-induced particles in event
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
unsigned int pythiaPylistVerbosity_
pythia verbosity; def=1
double abeamtarget_
beam/target atomic mass number
edm::EDGetTokenT< CrossingFrame< edm::HepMCProduct > > src_
edm::ParameterSet pset_
unsigned int shadowingswitch_
bool doradiativeenloss_
DEFAULT = true.
int angularspecselector_
angular emitted gluon spectrum selection
bool rotate_
Switch to rotate event plane.
double phi0_
Event plane angle.
HepMC::FourVector * fVertex_
Event signal vertex.
#define LogDebug(id)
HydjetHadronizer::~HydjetHadronizer ( )
override

Definition at line 128 of file HydjetHadronizer.cc.

References pythia6Service_.

128  {
129  // destructor
130  call_pystat(1);
131  delete pythia6Service_;
132 }
Pythia6Service * pythia6Service_

Member Function Documentation

void HydjetHadronizer::add_heavy_ion_rec ( HepMC::GenEvent evt)
private

Definition at line 138 of file HydjetHadronizer.cc.

References hyfpar, hyjpar, npart, nsub_, nuclear_radius(), and phi0_.

Referenced by generatePartonsAndHadronize().

138  {
139  // heavy ion record in the final CMSSW Event
140  double npart = hyfpar.npart;
141  int nproj = static_cast<int>(npart / 2);
142  int ntarg = static_cast<int>(npart - nproj);
143 
144  HepMC::HeavyIon* hi = new HepMC::HeavyIon(nsub_, // Ncoll_hard/N of SubEvents
145  nproj, // Npart_proj
146  ntarg, // Npart_targ
147  static_cast<int>(hyfpar.nbcol), // Ncoll
148  0, // spectator_neutrons
149  0, // spectator_protons
150  0, // N_Nwounded_collisions
151  0, // Nwounded_N_collisions
152  0, // Nwounded_Nwounded_collisions
153  hyfpar.bgen * nuclear_radius(), // impact_parameter in [fm]
154  phi0_, // event_plane_angle
155  0, //hypsi3.psi3, // eccentricity
156  hyjpar.sigin // sigma_inel_NN
157  );
158 
159  evt->set_heavy_ion(*hi);
160  delete hi;
161 }
double npart
Definition: HydjetWrapper.h:46
#define hyfpar
Definition: HydjetWrapper.h:51
#define hyjpar
Definition: HydjetWrapper.h:93
int nsub_
number of sub-events
double nuclear_radius() const
double phi0_
Event plane angle.
HepMC::GenParticle * HydjetHadronizer::build_hyjet ( int  index,
int  barcode 
)
private

Definition at line 164 of file HydjetHadronizer.cc.

References cosphi0_, GenParticle::GenParticle, hyjets, gen::p, and sinphi0_.

Referenced by get_particles().

164  {
165  // Build particle object corresponding to index in hyjets (soft+hard)
166  double x0 = hyjets.phj[0][index];
167  double y0 = hyjets.phj[1][index];
168 
169  double x = x0 * cosphi0_ - y0 * sinphi0_;
170  double y = y0 * cosphi0_ + x0 * sinphi0_;
171 
172  HepMC::GenParticle* p = new HepMC::GenParticle(HepMC::FourVector(x, // px
173  y, // py
174  hyjets.phj[2][index], // pz
175  hyjets.phj[3][index]), // E
176  hyjets.khj[1][index], // id
177  convertStatus(hyjets.khj[0][index] // status
178  ));
179 
180  p->suggest_barcode(barcode);
181  return p;
182 }
double p[5][pyjets_maxn]
#define hyjets
Definition: HydjetWrapper.h:80
HepMC::GenVertex * HydjetHadronizer::build_hyjet_vertex ( int  i,
int  id 
)
private

Definition at line 185 of file HydjetHadronizer.cc.

References cosphi0_, hyjets, mps_fire::i, sinphi0_, and submitPVValidationJobs::t.

Referenced by get_particles().

185  {
186  // build verteces for the hyjets stored events
187  double x0 = hyjets.vhj[0][i];
188  double y0 = hyjets.vhj[1][i];
189  double x = x0 * cosphi0_ - y0 * sinphi0_;
190  double y = y0 * cosphi0_ + x0 * sinphi0_;
191  double z = hyjets.vhj[2][i];
192  double t = hyjets.vhj[4][i];
193 
194  HepMC::GenVertex* vertex = new HepMC::GenVertex(HepMC::FourVector(x, y, z, t), id);
195  return vertex;
196 }
#define hyjets
Definition: HydjetWrapper.h:80
bool HydjetHadronizer::call_hyinit ( double  energy,
double  a,
int  ifb,
double  bmin,
double  bmax,
double  bfix,
int  nh 
)
private

Definition at line 415 of file HydjetHadronizer.cc.

References HYINIT.

Referenced by initializeForInternalPartons().

415  {
416  // initialize hydjet
417 
418  pydatr.mrpy[2] = 1;
419  HYINIT(energy, a, ifb, bmin, bmax, bfix, nh);
420  return true;
421 }
#define HYINIT
Definition: HydjetWrapper.h:13
uint32_t nh
double a
Definition: hdecay.h:119
const char * HydjetHadronizer::classname ( ) const

Definition at line 556 of file HydjetHadronizer.cc.

556 { return "gen::HydjetHadronizer"; }
bool HydjetHadronizer::decay ( )

Definition at line 548 of file HydjetHadronizer.cc.

548 { return true; }
bool gen::HydjetHadronizer::declareSpecialSettings ( const std::vector< std::string > &  )
inline

Definition at line 54 of file HydjetHadronizer.h.

54 { return true; }
bool HydjetHadronizer::declareStableParticles ( const std::vector< int > &  _pdg)

Definition at line 525 of file HydjetHadronizer.cc.

References gen::call_pygive(), gather_cfg::cout, mps_fire::i, and gen::pycomp_().

525  {
526  std::vector<int> pdg = _pdg;
527  for (size_t i = 0; i < pdg.size(); i++) {
528  int pyCode = pycomp_(pdg[i]);
529  std::ostringstream pyCard;
530  pyCard << "MDCY(" << pyCode << ",1)=0";
531  std::cout << pyCard.str() << std::endl;
532  call_pygive(pyCard.str());
533  }
534  return true;
535 }
bool call_pygive(const std::string &line)
int pycomp_(int &)
tuple cout
Definition: gather_cfg.py:144
void HydjetHadronizer::doSetRandomEngine ( CLHEP::HepRandomEngine *  v)
overrideprivatevirtual

Reimplemented from gen::BaseHadronizer.

Definition at line 135 of file HydjetHadronizer.cc.

References pythia6Service_, and gen::Pythia6Service::setRandomEngine().

double v[5][pyjets_maxn]
Pythia6Service * pythia6Service_
void setRandomEngine(CLHEP::HepRandomEngine *v)
std::vector<std::string> const& gen::HydjetHadronizer::doSharedResources ( ) const
inlineoverrideprivatevirtual

Reimplemented from gen::BaseHadronizer.

Definition at line 62 of file HydjetHadronizer.h.

References theSharedResources.

62 { return theSharedResources; }
static const std::vector< std::string > theSharedResources
void HydjetHadronizer::finalizeEvent ( )

Definition at line 552 of file HydjetHadronizer.cc.

552 {}
bool HydjetHadronizer::generatePartonsAndHadronize ( )

Definition at line 200 of file HydjetHadronizer.cc.

References add_heavy_ion_rec(), bfixed_, funct::cos(), cosphi0_, alignCSCRings::e, embedding_, gen::BaseHadronizer::event(), edm::errors::EventCorruption, evt, Exception, fVertex_, get_particles(), edm::Event::getByToken(), gen::BaseHadronizer::getEDMEvent(), edm::HepMCProduct::GetEvent(), HYEVNT, hyflow, hyfpar, hyjpar, edm::HepMCProduct::isVtxGenApplied(), LogDebug, reco_application_tbsim_DetSim-Digi_cfg::mix, nhard_, nsoft_, nsub_, nuclear_radius(), phi0_, edm::Handle< T >::product(), pypars, pyqpar, pythia6Service_, rotate_, rotateEvtPlane(), funct::sin(), sinphi0_, and src_.

200  {
201  Pythia6Service::InstanceWrapper guard(pythia6Service_);
202 
203  // generate single event
204  if (embedding_) {
205  const edm::Event& e = getEDMEvent();
206  HepMC::GenVertex* genvtx = nullptr;
207  const HepMC::GenEvent* inev = nullptr;
209  e.getByToken(src_, cf);
211  if (mix.size() < 1) {
212  throw cms::Exception("MatchVtx") << "Mixing has " << mix.size() << " sub-events, should have been at least 1"
213  << endl;
214  }
215  const HepMCProduct& bkg = mix.getObject(0);
216  if (!(bkg.isVtxGenApplied())) {
217  throw cms::Exception("MatchVtx") << "Input background does not have smeared vertex!" << endl;
218  } else {
219  inev = bkg.GetEvent();
220  }
221 
222  genvtx = inev->signal_process_vertex();
223 
224  if (!genvtx)
225  throw cms::Exception("MatchVtx") << "Input background does not have signal process vertex!" << endl;
226 
227  double aX, aY, aZ, aT;
228 
229  aX = genvtx->position().x();
230  aY = genvtx->position().y();
231  aZ = genvtx->position().z();
232  aT = genvtx->position().t();
233 
234  if (!fVertex_) {
235  fVertex_ = new HepMC::FourVector();
236  }
237  LogInfo("MatchVtx") << " setting vertex "
238  << " aX " << aX << " aY " << aY << " aZ " << aZ << " aT " << aT << endl;
239  fVertex_->set(aX, aY, aZ, aT);
240 
241  const HepMC::HeavyIon* hi = inev->heavy_ion();
242 
243  if (hi) {
244  bfixed_ = (hi->impact_parameter()) / nuclear_radius();
245  phi0_ = hi->event_plane_angle();
246  sinphi0_ = sin(phi0_);
247  cosphi0_ = cos(phi0_);
248  } else {
249  LogWarning("EventEmbedding") << "Background event does not have heavy ion record!";
250  }
251 
252  } else if (rotate_)
253  rotateEvtPlane();
254 
255  nsoft_ = 0;
256  nhard_ = 0;
257 
258  edm::LogInfo("HYDJETmode") << "##### HYDJET nhsel = " << hyjpar.nhsel;
259  edm::LogInfo("HYDJETfpart") << "##### HYDJET fpart = " << hyflow.fpart;
260  edm::LogInfo("HYDJETtf") << "##### HYDJET hadron freez-out temp, Tf = " << hyflow.Tf;
261  edm::LogInfo("HYDJETinTemp") << "##### HYDJET: QGP init temperature, T0 =" << pyqpar.T0u;
262  edm::LogInfo("HYDJETinTau") << "##### HYDJET: QGP formation time,tau0 =" << pyqpar.tau0u;
263 
264  int ntry = 0;
265  while (nsoft_ == 0 && nhard_ == 0) {
266  if (ntry > 100) {
267  edm::LogError("HydjetEmptyEvent") << "##### HYDJET: No Particles generated, Number of tries =" << ntry;
268 
269  // Throw an exception. Use the EventCorruption exception since it maps onto SkipEvent
270  // which is what we want to do here.
271 
272  std::ostringstream sstr;
273  sstr << "HydjetHadronizerProducer: No particles generated after " << ntry << " tries.\n";
274  edm::Exception except(edm::errors::EventCorruption, sstr.str());
275  throw except;
276  } else {
277  HYEVNT(bfixed_);
278  nsoft_ = hyfpar.nhyd;
279  nsub_ = hyjpar.njet;
280  nhard_ = hyfpar.npyt;
281  ++ntry;
282  }
283  }
284 
285  if (hyjpar.nhsel < 3)
286  nsub_++;
287 
288  // event information
290 
291  if (nhard_ > 0 || nsoft_ > 0)
292  get_particles(evt);
293 
294  evt->set_signal_process_id(pypars.msti[0]); // type of the process
295  evt->set_event_scale(pypars.pari[16]); // Q^2
296  add_heavy_ion_rec(evt);
297 
298  if (fVertex_) {
299  // generate new vertex & apply the shift
300 
301  // Copy the HepMC::GenEvent
302  std::unique_ptr<edm::HepMCProduct> HepMCEvt(new edm::HepMCProduct(evt));
303 
304  HepMCEvt->applyVtxGen(fVertex_);
305  evt = new HepMC::GenEvent((*HepMCEvt->GetEvent()));
306  }
307 
308  HepMC::HEPEVT_Wrapper::check_hepevt_consistency();
309  LogDebug("HEPEVT_info") << "Ev numb: " << HepMC::HEPEVT_Wrapper::event_number()
310  << " Entries number: " << HepMC::HEPEVT_Wrapper::number_entries() << " Max. entries "
311  << HepMC::HEPEVT_Wrapper::max_number_entries() << std::endl;
312 
313  event().reset(evt);
314  return true;
315 }
#define HYEVNT
Definition: HydjetWrapper.h:20
double bfixed_
fixed impact param (fm); valid only if cflag_=0
HepMC::GenEvent * evt
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
void add_heavy_ion_rec(HepMC::GenEvent *evt)
Log< level::Error, false > LogError
#define hyfpar
Definition: HydjetWrapper.h:51
bool embedding_
Switch for embedding mode.
int nsoft_
multiplicity of HYDRO-induced particles in event
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
std::unique_ptr< HepMC::GenEvent > & event()
Pythia6Service * pythia6Service_
#define hyjpar
Definition: HydjetWrapper.h:93
int nsub_
number of sub-events
Log< level::Info, false > LogInfo
int nhard_
multiplicity of PYTHIA(+PYQUEN)-induced particles in event
#define pypars
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:37
T const * product() const
Definition: Handle.h:70
bool isVtxGenApplied() const
Definition: HepMCProduct.h:39
double nuclear_radius() const
#define pyqpar
#define hyflow
Definition: HydjetWrapper.h:40
edm::EDGetTokenT< CrossingFrame< edm::HepMCProduct > > src_
Log< level::Warning, false > LogWarning
bool rotate_
Switch to rotate event plane.
double phi0_
Event plane angle.
HepMC::FourVector * fVertex_
Event signal vertex.
bool get_particles(HepMC::GenEvent *evt)
edm::Event & getEDMEvent() const
#define LogDebug(id)
bool HydjetHadronizer::get_particles ( HepMC::GenEvent evt)
private

Definition at line 318 of file HydjetHadronizer.cc.

References build_hyjet(), build_hyjet_vertex(), GenParticle::GenParticle, hyjets, hyjpar, if(), LogDebug, nhard_, nsoft_, and nsub_.

Referenced by generatePartonsAndHadronize().

318  {
319  // Hard particles. The first nhard_ lines from hyjets array.
320  // Pythia/Pyquen sub-events (sub-collisions) for a given event
321  // Return T/F if success/failure
322  // Create particles from lujet entries, assign them into vertices and
323  // put the vertices in the GenEvent, for each SubEvent
324  // The SubEvent information is kept by storing indeces of main vertices
325  // of subevents as a vector in GenHIEvent.
326 
327  LogDebug("SubEvent") << " Number of sub events " << nsub_;
328  LogDebug("Hydjet") << " Number of hard events " << hyjpar.njet;
329  LogDebug("Hydjet") << " Number of hard particles " << nhard_;
330  LogDebug("Hydjet") << " Number of soft particles " << nsoft_;
331  LogDebug("Hydjet") << " nhard_ + nsoft_ = " << nhard_ + nsoft_ << " hyjets.nhj = " << hyjets.nhj << endl;
332 
333  int ihy = 0;
334  int isub = -1;
335  int isub_l = -1;
336  int stab = 0;
337 
338  vector<HepMC::GenParticle*> primary_particle(hyjets.nhj);
339  vector<HepMC::GenParticle*> particle(hyjets.nhj);
340 
341  HepMC::GenVertex* sub_vertices = new HepMC::GenVertex(HepMC::FourVector(0, 0, 0, 0), 0); // just initialization
342 
343  // contain the last index in for each subevent
344  vector<int> index(nsub_);
345 
346  while (ihy < hyjets.nhj) {
347  isub = std::floor((hyjets.khj[2][ihy] / 50000));
348  int hjoffset = isub * 50000;
349 
350  if (isub != isub_l) {
351  sub_vertices = new HepMC::GenVertex(HepMC::FourVector(0, 0, 0, 0), isub);
352  evt->add_vertex(sub_vertices);
353  if (!evt->signal_process_vertex())
354  evt->set_signal_process_vertex(sub_vertices);
355  index[isub] = ihy - 1;
356  isub_l = isub;
357  }
358 
359  if (convertStatus(hyjets.khj[0][ihy]) == 1)
360  stab++;
361  LogDebug("Hydjet_array") << ihy << " MULTin ev.:" << hyjets.nhj << " SubEv.#" << isub << " Part #" << ihy + 1
362  << ", PDG: " << hyjets.khj[1][ihy] << " (st. " << convertStatus(hyjets.khj[0][ihy])
363  << ") mother=" << hyjets.khj[2][ihy] - (isub * 50000) + index[isub] + 1 << " ("
364  << hyjets.khj[2][ihy] << "), childs ("
365  << hyjets.khj[3][ihy] - (isub * 50000) + index[isub] + 1 << "-"
366  << hyjets.khj[4][ihy] - (isub * 50000) + index[isub] + 1 << "), vtx ("
367  << hyjets.vhj[0][ihy] << "," << hyjets.vhj[1][ihy] << "," << hyjets.vhj[2][ihy] << ") "
368  << std::endl;
369 
370  if (hyjets.khj[2][ihy] == 0) {
371  primary_particle[ihy] = build_hyjet(ihy, ihy + 1);
372  sub_vertices->add_particle_out(primary_particle[ihy]);
373  LogDebug("Hydjet_array") << " ---> " << ihy + 1 << std::endl;
374  } else {
375  particle[ihy] = build_hyjet(ihy, ihy + 1);
376  int mid = hyjets.khj[2][ihy] - hjoffset + index[isub];
377  int mid_t = mid;
378  while ((mid < ihy) && (hyjets.khj[1][mid] < 100) && (hyjets.khj[3][mid + 1] - hjoffset + index[isub] == ihy))
379  mid++;
380  if (hyjets.khj[1][mid] < 100)
381  mid = mid_t;
382 
383  HepMC::GenParticle* mother = primary_particle.at(mid);
384  HepMC::GenVertex* prods = build_hyjet_vertex(ihy, isub);
385 
386  if (!mother) {
387  mother = particle[mid];
388  primary_particle[mid] = mother;
389  }
390 
391  HepMC::GenVertex* prod_vertex = mother->end_vertex();
392  if (!prod_vertex) {
393  prod_vertex = prods;
394  prod_vertex->add_particle_in(mother);
395  LogDebug("Hydjet_array") << " <--- " << mid + 1 << std::endl;
396  evt->add_vertex(prod_vertex);
397  prods = nullptr;
398  }
399 
400  prod_vertex->add_particle_out(particle[ihy]);
401  LogDebug("Hydjet_array") << " ---" << mid + 1 << "---> " << ihy + 1 << std::endl;
402 
403  if (prods)
404  delete prods;
405  }
406  ihy++;
407  }
408  LogDebug("Hydjet_array") << " MULTin ev.:" << hyjets.nhj << ", last index: " << ihy - 1
409  << ", Sub events: " << isub + 1 << ", stable particles: " << stab << std::endl;
410 
411  return true;
412 }
int nsoft_
multiplicity of HYDRO-induced particles in event
if(conf_.getParameter< bool >("UseStripCablingDB"))
HepMC::GenParticle * build_hyjet(int index, int barcode)
#define hyjpar
Definition: HydjetWrapper.h:93
int nsub_
number of sub-events
int nhard_
multiplicity of PYTHIA(+PYQUEN)-induced particles in event
HepMC::GenVertex * build_hyjet_vertex(int i, int id)
#define hyjets
Definition: HydjetWrapper.h:80
#define LogDebug(id)
bool HydjetHadronizer::hadronize ( )

Definition at line 546 of file HydjetHadronizer.cc.

546 { return false; }
bool HydjetHadronizer::hydjet_init ( const edm::ParameterSet pset)
private

Definition at line 424 of file HydjetHadronizer.cc.

References angularspecselector_, docollisionalenloss_, doradiativeenloss_, fracsoftmult_, hadfreeztemp_, hyflow, hyjpar, hymode_, maxlongy_, maxtrany_, nquarkflavor_, pyqpar, qgpt0_, qgptau0_, shadowingswitch_, and signn_.

Referenced by initializeForInternalPartons().

424  {
425  // set hydjet options
426 
427  // hydjet running mode mode
428  // kHydroOnly --- nhsel=0 jet production off (pure HYDRO event), nhsel=0
429  // kHydroJets --- nhsle=1 jet production on, jet quenching off (HYDRO+njet*PYTHIA events)
430  // kHydroQJet --- nhsel=2 jet production & jet quenching on (HYDRO+njet*PYQUEN events)
431  // kJetsOnly --- nhsel=3 jet production on, jet quenching off, HYDRO off (njet*PYTHIA events)
432  // kQJetsOnly --- nhsel=4 jet production & jet quenching on, HYDRO off (njet*PYQUEN events)
433 
434  if (hymode_ == "kHydroOnly")
435  hyjpar.nhsel = 0;
436  else if (hymode_ == "kHydroJets")
437  hyjpar.nhsel = 1;
438  else if (hymode_ == "kHydroQJets")
439  hyjpar.nhsel = 2;
440  else if (hymode_ == "kJetsOnly")
441  hyjpar.nhsel = 3;
442  else if (hymode_ == "kQJetsOnly")
443  hyjpar.nhsel = 4;
444  else
445  hyjpar.nhsel = 2;
446 
447  // fraction of soft hydro induced multiplicity
448  hyflow.fpart = fracsoftmult_;
449 
450  // hadron freez-out temperature
451  hyflow.Tf = hadfreeztemp_;
452 
453  // maximum longitudinal collective rapidity
454  hyflow.ylfl = maxlongy_;
455 
456  // maximum transverse collective rapidity
457  hyflow.ytfl = maxtrany_;
458 
459  // shadowing on=1, off=0
460  hyjpar.ishad = shadowingswitch_;
461 
462  // set inelastic nucleon-nucleon cross section
463  hyjpar.sigin = signn_;
464 
465  // angular emitted gluon spectrum selection
466  pyqpar.ianglu = angularspecselector_;
467 
468  // number of active quark flavors in qgp
469  pyqpar.nfu = nquarkflavor_;
470 
471  // initial temperature of QGP
472  pyqpar.T0u = qgpt0_;
473 
474  // proper time of QGP formation
475  pyqpar.tau0u = qgptau0_;
476 
477  // type of medium induced partonic energy loss
479  edm::LogInfo("HydjetEnLoss") << "##### Radiative AND Collisional partonic energy loss ON ####";
480  pyqpar.ienglu = 0;
481  } else if (doradiativeenloss_) {
482  edm::LogInfo("HydjetenLoss") << "##### Only RADIATIVE partonic energy loss ON ####";
483  pyqpar.ienglu = 1;
484  } else if (docollisionalenloss_) {
485  edm::LogInfo("HydjetEnLoss") << "##### Only COLLISIONAL partonic energy loss ON ####";
486  pyqpar.ienglu = 2;
487  } else {
488  edm::LogInfo("HydjetEnLoss") << "##### Radiative AND Collisional partonic energy loss ON ####";
489  pyqpar.ienglu = 0;
490  }
491  return true;
492 }
bool docollisionalenloss_
DEFAULT = true.
std::string hymode_
Hydjet running mode.
#define hyjpar
Definition: HydjetWrapper.h:93
Log< level::Info, false > LogInfo
#define pyqpar
#define hyflow
Definition: HydjetWrapper.h:40
unsigned int shadowingswitch_
bool doradiativeenloss_
DEFAULT = true.
int angularspecselector_
angular emitted gluon spectrum selection
bool gen::HydjetHadronizer::initializeForExternalPartons ( )
bool HydjetHadronizer::initializeForInternalPartons ( )

Definition at line 505 of file HydjetHadronizer.cc.

References abeamtarget_, bfixed_, bmax_, bmin_, call_hyinit(), cflag_, comenergy, hydjet_init(), nmultiplicity_, nuclear_radius(), pset_, and pythia6Service_.

505  {
506  Pythia6Service::InstanceWrapper guard(pythia6Service_);
507  // pythia6Service_->setGeneralParams();
508 
509  // the input impact parameter (bxx_) is in [fm]; transform in [fm/RA] for hydjet usage
510  const float ra = nuclear_radius();
511  LogInfo("RAScaling") << "Nuclear radius(RA) = " << ra;
512  bmin_ /= ra;
513  bmax_ /= ra;
514  bfixed_ /= ra;
515 
516  // hydjet running options
518  // initialize hydjet
519  LogInfo("HYDJETinAction") << "##### Calling HYINIT(" << comenergy << "," << abeamtarget_ << "," << cflag_ << ","
520  << bmin_ << "," << bmax_ << "," << bfixed_ << "," << nmultiplicity_ << ") ####";
522  return true;
523 }
double bfixed_
fixed impact param (fm); valid only if cflag_=0
bool hydjet_init(const edm::ParameterSet &pset)
double comenergy
collision energy
Pythia6Service * pythia6Service_
Log< level::Info, false > LogInfo
double nuclear_radius() const
bool call_hyinit(double energy, double a, int ifb, double bmin, double bmax, double bfix, int nh)
double abeamtarget_
beam/target atomic mass number
edm::ParameterSet pset_
double HydjetHadronizer::nuclear_radius ( ) const
inlineprivate

Return the nuclear radius derived from the beam/target atomic mass number.

Definition at line 140 of file HydjetHadronizer.h.

References abeamtarget_, and funct::pow().

Referenced by add_heavy_ion_rec(), generatePartonsAndHadronize(), and initializeForInternalPartons().

140 { return 1.15 * pow((double)abeamtarget_, 1. / 3.); }
double abeamtarget_
beam/target atomic mass number
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
bool HydjetHadronizer::readSettings ( int  )

Definition at line 496 of file HydjetHadronizer.cc.

References pythia6Service_, and gen::Pythia6Service::setGeneralParams().

496  {
497  Pythia6Service::InstanceWrapper guard(pythia6Service_);
499 
500  return true;
501 }
Pythia6Service * pythia6Service_
bool HydjetHadronizer::residualDecay ( )

Definition at line 550 of file HydjetHadronizer.cc.

550 { return true; }
void HydjetHadronizer::rotateEvtPlane ( )
private

Definition at line 538 of file HydjetHadronizer.cc.

References funct::cos(), cosphi0_, phi0_, pi, gen::pyr_(), funct::sin(), and sinphi0_.

Referenced by generatePartonsAndHadronize().

538  {
539  const double pi = 3.14159265358979;
540  phi0_ = 2. * pi * gen::pyr_(nullptr) - pi;
541  sinphi0_ = sin(phi0_);
542  cosphi0_ = cos(phi0_);
543 }
double pyr_(int *idummy)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
const Double_t pi
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double phi0_
Event plane angle.
void HydjetHadronizer::statistics ( )

Definition at line 554 of file HydjetHadronizer.cc.

554 {}

Member Data Documentation

double gen::HydjetHadronizer::abeamtarget_
private

beam/target atomic mass number

Definition at line 77 of file HydjetHadronizer.h.

Referenced by initializeForInternalPartons(), and nuclear_radius().

int gen::HydjetHadronizer::angularspecselector_
private

angular emitted gluon spectrum selection

Definition at line 78 of file HydjetHadronizer.h.

Referenced by hydjet_init().

double gen::HydjetHadronizer::bfixed_
private

fixed impact param (fm); valid only if cflag_=0

Definition at line 79 of file HydjetHadronizer.h.

Referenced by generatePartonsAndHadronize(), and initializeForInternalPartons().

double gen::HydjetHadronizer::bmax_
private

max impact param; units of nucl radius

Definition at line 80 of file HydjetHadronizer.h.

Referenced by initializeForInternalPartons().

double gen::HydjetHadronizer::bmin_
private

min impact param; units of nucl radius

Definition at line 82 of file HydjetHadronizer.h.

Referenced by initializeForInternalPartons().

int gen::HydjetHadronizer::cflag_
private

centrality flag = 0 fixed impact param, <> 0 between bmin and bmax

Definition at line 84 of file HydjetHadronizer.h.

Referenced by HydjetHadronizer(), and initializeForInternalPartons().

double gen::HydjetHadronizer::comenergy
private

collision energy

Definition at line 88 of file HydjetHadronizer.h.

Referenced by initializeForInternalPartons().

double gen::HydjetHadronizer::cosphi0_
private
bool gen::HydjetHadronizer::docollisionalenloss_
private

DEFAULT = true.

Definition at line 90 of file HydjetHadronizer.h.

Referenced by hydjet_init().

bool gen::HydjetHadronizer::doradiativeenloss_
private

DEFAULT = true.

Definition at line 89 of file HydjetHadronizer.h.

Referenced by hydjet_init().

bool gen::HydjetHadronizer::embedding_
private

Switch for embedding mode.

Definition at line 87 of file HydjetHadronizer.h.

Referenced by generatePartonsAndHadronize(), and HydjetHadronizer().

HepMC::GenEvent* gen::HydjetHadronizer::evt
private

Definition at line 75 of file HydjetHadronizer.h.

Referenced by generatePartonsAndHadronize().

double gen::HydjetHadronizer::fracsoftmult_
private

fraction of soft hydro induced hadronic multiplicity proportional to no of nucleon participants (1-fracsoftmult_)— fraction of soft multiplicity proportional to the numebr of nucleon-nucleon binary collisions DEFAULT=1., allowed range [0.01,1]

Definition at line 91 of file HydjetHadronizer.h.

Referenced by hydjet_init().

HepMC::FourVector* gen::HydjetHadronizer::fVertex_
private

Event signal vertex.

Definition at line 129 of file HydjetHadronizer.h.

Referenced by generatePartonsAndHadronize(), and HydjetHadronizer().

double gen::HydjetHadronizer::hadfreeztemp_
private

hadron freez-out temperature DEFAULT=0.14MeV, allowed ranges [0.08,0.2]MeV

Definition at line 97 of file HydjetHadronizer.h.

Referenced by hydjet_init().

std::string gen::HydjetHadronizer::hymode_
private

Hydjet running mode.

Definition at line 99 of file HydjetHadronizer.h.

Referenced by hydjet_init().

unsigned int gen::HydjetHadronizer::maxEventsToPrint_
private

Events to print if verbosity.

Definition at line 100 of file HydjetHadronizer.h.

Referenced by HydjetHadronizer().

double gen::HydjetHadronizer::maxlongy_
private

max longitudinal collective rapidity: controls width of eta-spectra DEFAULT=4, allowed range [0.01,7.0]

Definition at line 101 of file HydjetHadronizer.h.

Referenced by hydjet_init().

double gen::HydjetHadronizer::maxtrany_
private

max transverse collective rapidity: controls slope of low-pt spectra DEFAULT=1.5, allowed range [0.01,3.0]

Definition at line 104 of file HydjetHadronizer.h.

Referenced by hydjet_init().

int gen::HydjetHadronizer::nhard_
private

multiplicity of PYTHIA(+PYQUEN)-induced particles in event

Definition at line 108 of file HydjetHadronizer.h.

Referenced by generatePartonsAndHadronize(), and get_particles().

int gen::HydjetHadronizer::nmultiplicity_
private

mean soft multiplicity in central PbPb automatically calculated for other centralitie and beams

Definition at line 109 of file HydjetHadronizer.h.

Referenced by initializeForInternalPartons().

unsigned int gen::HydjetHadronizer::nquarkflavor_
private

number of active quark flavors in qgp DEFAULT=0; allowed values: 0,1,2,3.

Definition at line 112 of file HydjetHadronizer.h.

Referenced by hydjet_init().

int gen::HydjetHadronizer::nsoft_
private

multiplicity of HYDRO-induced particles in event

Definition at line 111 of file HydjetHadronizer.h.

Referenced by generatePartonsAndHadronize(), and get_particles().

int gen::HydjetHadronizer::nsub_
private

number of sub-events

Definition at line 107 of file HydjetHadronizer.h.

Referenced by add_heavy_ion_rec(), generatePartonsAndHadronize(), and get_particles().

double gen::HydjetHadronizer::phi0_
private

Event plane angle.

Definition at line 120 of file HydjetHadronizer.h.

Referenced by add_heavy_ion_rec(), generatePartonsAndHadronize(), and rotateEvtPlane().

edm::ParameterSet gen::HydjetHadronizer::pset_
private

Definition at line 76 of file HydjetHadronizer.h.

Referenced by initializeForInternalPartons().

Pythia6Service* gen::HydjetHadronizer::pythia6Service_
private
unsigned int gen::HydjetHadronizer::pythiaPylistVerbosity_
private

pythia verbosity; def=1

Definition at line 114 of file HydjetHadronizer.h.

Referenced by HydjetHadronizer().

double gen::HydjetHadronizer::qgpt0_
private

initial temperature of QGP DEFAULT = 1GeV; allowed range [0.2,2.0]GeV;

Definition at line 115 of file HydjetHadronizer.h.

Referenced by hydjet_init().

double gen::HydjetHadronizer::qgptau0_
private

proper time of QGP formation DEFAULT = 0.1 fm/c; allowed range [0.01,10.0]fm/

Definition at line 117 of file HydjetHadronizer.h.

Referenced by hydjet_init().

bool gen::HydjetHadronizer::rotate_
private

Switch to rotate event plane.

Definition at line 123 of file HydjetHadronizer.h.

Referenced by generatePartonsAndHadronize().

unsigned int gen::HydjetHadronizer::shadowingswitch_
private

shadowing switcher 1-ON, 0-OFF

Definition at line 125 of file HydjetHadronizer.h.

Referenced by hydjet_init().

std::vector<double> gen::HydjetHadronizer::signalVtx_
private

Pset double vector to set event signal vertex.

Definition at line 130 of file HydjetHadronizer.h.

Referenced by HydjetHadronizer().

double gen::HydjetHadronizer::signn_
private

inelastic nucleon nucleon cross section [mb] DEFAULT= 58 mb

Definition at line 127 of file HydjetHadronizer.h.

Referenced by hydjet_init().

double gen::HydjetHadronizer::sinphi0_
private
edm::EDGetTokenT<CrossingFrame<edm::HepMCProduct> > gen::HydjetHadronizer::src_
private

Definition at line 133 of file HydjetHadronizer.h.

Referenced by generatePartonsAndHadronize(), and HydjetHadronizer().

const std::vector< std::string > HydjetHadronizer::theSharedResources
staticprivate