CMS 3D CMS Logo

Pythia8Hadronizer.cc
Go to the documentation of this file.
1 #include <iostream>
2 #include <memory>
3 
4 #include <cstdint>
5 #include <memory>
6 #include <sstream>
7 #include <string>
8 #include <vector>
9 
10 #include "HepMC/GenEvent.h"
11 #include "HepMC/GenParticle.h"
12 
13 #include "Pythia8/Pythia.h"
14 #include "Pythia8Plugins/HepMC2.h"
15 
16 using namespace Pythia8;
17 
19 
20 #include "ReweightUserHooks.h"
22 #include "TopRecoilHook.h"
23 
24 // PS matchning prototype
25 //
27 #include "Pythia8Plugins/JetMatching.h"
28 #include "Pythia8Plugins/aMCatNLOHooks.h"
29 
30 // Emission Veto Hooks
31 //
32 #include "Pythia8Plugins/PowhegHooks.h"
34 
35 // Resonance scale hook
38 
39 //biased tau decayer
41 
42 //decay filter hook
44 
45 //decay filter hook
47 
48 // EvtGen plugin
49 //
50 #include "Pythia8Plugins/EvtGen.h"
51 
57 
60 
65 
67 
68 #include "HepPID/ParticleIDTranslations.hh"
69 
72 
73 namespace CLHEP {
74  class HepRandomEngine;
75 }
76 
77 using namespace gen;
78 
79 //Insert class for use w/ PDFPtr for proton-photon flux
80 //parameters hardcoded according to main70.cc in PYTHIA8 v3.10
81 class Nucleus2gamma2 : public Pythia8::PDF {
82 private:
83  double radius;
84  int z;
85 
86 public:
87  // Constructor.
88  Nucleus2gamma2(int idBeamIn, double R = -1.0, int Z = -1) : Pythia8::PDF(idBeamIn), radius(R), z(Z) {}
89 
90  void xfUpdate(int, double x, double) override {
91  if (z == -1) {
92  // lead
93  if (idBeam == 1000822080)
94  z = 82;
95  }
96  if (radius == -1) {
97  // lead
98  if (idBeam == 1000822080)
99  radius = 6.636;
100  }
101 
102  if (z < 0 || radius < 0)
103  throw edm::Exception(edm::errors::Configuration, "Pythia8Interface")
104  << " Invalid photon flux input parameters: beam ID= " << idBeam << " , radius= " << radius << " , z= " << z
105  << "\n";
106 
107  // Minimum impact parameter (~2*radius) [fm].
108  double bmin = 2 * radius;
109 
110  // Per-nucleon mass for lead.
111  double m2 = pow2(0.9314);
112  double alphaEM = 0.007297353080;
113  double hbarc = 0.197;
114  double xi = x * sqrt(m2) * bmin / hbarc;
115  double bK0 = besselK0(xi);
116  double bK1 = besselK1(xi);
117  double intB = xi * bK1 * bK0 - 0.5 * pow2(xi) * (pow2(bK1) - pow2(bK0));
118  xgamma = 2. * alphaEM * pow2(z) / M_PI * intB;
119  }
120 };
121 
123 public:
125  ~Pythia8Hadronizer() override;
126 
127  bool initializeForInternalPartons() override;
128  bool initializeForExternalPartons();
129 
130  bool generatePartonsAndHadronize() override;
131  bool hadronize();
132 
133  virtual bool residualDecay();
134 
135  void finalizeEvent() override;
136 
137  void statistics() override;
138 
139  const char *classname() const override { return "Pythia8Hadronizer"; }
140 
141  std::unique_ptr<GenLumiInfoHeader> getGenLumiInfoHeader() const override;
142 
143 private:
144  void doSetRandomEngine(CLHEP::HepRandomEngine *v) override { p8SetRandomEngine(v); }
145  std::vector<std::string> const &doSharedResources() const override { return p8SharedResources; }
146 
148  double comEnergy;
149 
151  std::shared_ptr<LHAupLesHouches> lhaUP;
152 
153  enum { PP, PPbar, ElectronPositron };
154  int fInitialState; // pp, ppbar, or e-e+
155 
156  double fBeam1PZ;
157  double fBeam2PZ;
158 
159  //PDFPtr for the photonFlux
160  //Following main70.cc example in PYTHIA8 v3.10
162 
163  //helper class to allow multiple user hooks simultaneously
164  std::shared_ptr<UserHooksVector> fUserHooksVector;
166 
167  // Reweight user hooks
168  //
169  std::shared_ptr<UserHooks> fReweightUserHook;
170  std::shared_ptr<UserHooks> fReweightEmpUserHook;
171  std::shared_ptr<UserHooks> fReweightRapUserHook;
172  std::shared_ptr<UserHooks> fReweightPtHatRapUserHook;
173 
174  // PS matching prototype
175  //
176  std::shared_ptr<JetMatchingHook> fJetMatchingHook;
177  std::shared_ptr<Pythia8::JetMatchingMadgraph> fJetMatchingPy8InternalHook;
178  std::shared_ptr<Pythia8::amcnlo_unitarised_interface> fMergingHook;
179 
180  // Emission Veto Hooks
181  //
182  std::shared_ptr<PowhegHooks> fEmissionVetoHook;
183  std::shared_ptr<EmissionVetoHook1> fEmissionVetoHook1;
184 
185  // Resonance scale hook
186  std::shared_ptr<PowhegResHook> fPowhegResHook;
187  std::shared_ptr<PowhegHooksBB4L> fPowhegHooksBB4L;
188 
189  // biased tau decayer
190  std::shared_ptr<BiasedTauDecayer> fBiasedTauDecayer;
191 
192  //resonance decay filter hook
193  std::shared_ptr<ResonanceDecayFilterHook> fResonanceDecayFilterHook;
194 
195  //PT filter hook
196  std::shared_ptr<PTFilterHook> fPTFilterHook;
197 
198  //Generic customized hooks vector
199  std::shared_ptr<UserHooksVector> fCustomHooksVector;
200 
201  //RecoilToTop userhook
202  std::shared_ptr<TopRecoilHook> fTopRecoilHook;
203 
214 
215  static const std::vector<std::string> p8SharedResources;
216 
217  vector<float> DJR;
218  int nME;
220 
221  int nISRveto;
222  int nFSRveto;
223 };
224 
226 
229  comEnergy(params.getParameter<double>("comEnergy")),
230  LHEInputFileName(params.getUntrackedParameter<std::string>("LHEInputFileName", "")),
231  fInitialState(PP),
232  UserHooksSet(false),
233  nME(-1),
234  nMEFiltered(-1),
235  nISRveto(0),
236  nFSRveto(0) {
237  ivhepmc = 2;
238  // J.Y.: the following 3 parameters are hacked "for a reason"
239  //
240  if (params.exists("PPbarInitialState")) {
241  if (fInitialState == PP) {
243  edm::LogImportant("GeneratorInterface|Pythia8Interface")
244  << "Pythia8 will be initialized for PROTON-ANTIPROTON INITIAL STATE. "
245  << "This is a user-request change from the DEFAULT PROTON-PROTON initial state.";
246  } else {
247  // probably need to throw on attempt to override ?
248  }
249  } else if (params.exists("ElectronPositronInitialState")) {
250  if (fInitialState == PP) {
252  edm::LogInfo("GeneratorInterface|Pythia8Interface")
253  << "Pythia8 will be initialized for ELECTRON-POSITRON INITIAL STATE. "
254  << "This is a user-request change from the DEFAULT PROTON-PROTON initial state.";
255  } else {
256  // probably need to throw on attempt to override ?
257  }
258  } else if (params.exists("ElectronProtonInitialState") || params.exists("PositronProtonInitialState")) {
259  // throw on unknown initial state !
260  throw edm::Exception(edm::errors::Configuration, "Pythia8Interface")
261  << " UNKNOWN INITIAL STATE. \n The allowed initial states are: PP, PPbar, ElectronPositron \n";
262  }
263 
264  // avoid filling weights twice (from v8.30x)
265  toHepMC.set_store_weights(false);
266 
267  if (params.exists("PhotonFlux")) {
268  photonFluxParams = params.getParameter<edm::ParameterSet>("PhotonFlux");
269  }
270 
271  // Reweight user hook
272  //
273  if (params.exists("reweightGen")) {
274  edm::LogInfo("Pythia8Interface") << "Start setup for reweightGen";
275  edm::ParameterSet rgParams = params.getParameter<edm::ParameterSet>("reweightGen");
276  fReweightUserHook.reset(
277  new PtHatReweightUserHook(rgParams.getParameter<double>("pTRef"), rgParams.getParameter<double>("power")));
278  edm::LogInfo("Pythia8Interface") << "End setup for reweightGen";
279  }
280  if (params.exists("reweightGenEmp")) {
281  edm::LogInfo("Pythia8Interface") << "Start setup for reweightGenEmp";
282  edm::ParameterSet rgeParams = params.getParameter<edm::ParameterSet>("reweightGenEmp");
283 
284  std::string tuneName = "";
285  if (rgeParams.exists("tune"))
286  tuneName = rgeParams.getParameter<std::string>("tune");
287  fReweightEmpUserHook.reset(new PtHatEmpReweightUserHook(tuneName));
288  edm::LogInfo("Pythia8Interface") << "End setup for reweightGenEmp";
289  }
290  if (params.exists("reweightGenRap")) {
291  edm::LogInfo("Pythia8Interface") << "Start setup for reweightGenRap";
292  edm::ParameterSet rgrParams = params.getParameter<edm::ParameterSet>("reweightGenRap");
293  fReweightRapUserHook.reset(new RapReweightUserHook(rgrParams.getParameter<std::string>("yLabSigmaFunc"),
294  rgrParams.getParameter<double>("yLabPower"),
295  rgrParams.getParameter<std::string>("yCMSigmaFunc"),
296  rgrParams.getParameter<double>("yCMPower"),
297  rgrParams.getParameter<double>("pTHatMin"),
298  rgrParams.getParameter<double>("pTHatMax")));
299  edm::LogInfo("Pythia8Interface") << "End setup for reweightGenRap";
300  }
301  if (params.exists("reweightGenPtHatRap")) {
302  edm::LogInfo("Pythia8Interface") << "Start setup for reweightGenPtHatRap";
303  edm::ParameterSet rgrParams = params.getParameter<edm::ParameterSet>("reweightGenPtHatRap");
304  fReweightPtHatRapUserHook.reset(new PtHatRapReweightUserHook(rgrParams.getParameter<std::string>("yLabSigmaFunc"),
305  rgrParams.getParameter<double>("yLabPower"),
306  rgrParams.getParameter<std::string>("yCMSigmaFunc"),
307  rgrParams.getParameter<double>("yCMPower"),
308  rgrParams.getParameter<double>("pTHatMin"),
309  rgrParams.getParameter<double>("pTHatMax")));
310  edm::LogInfo("Pythia8Interface") << "End setup for reweightGenPtHatRap";
311  }
312 
313  if (params.exists("useUserHook"))
314  throw edm::Exception(edm::errors::Configuration, "Pythia8Interface")
315  << " Obsolete parameter: useUserHook \n Please use the actual one instead \n";
316 
317  // PS matching prototype
318  //
319  if (params.exists("jetMatching")) {
320  edm::ParameterSet jmParams = params.getUntrackedParameter<edm::ParameterSet>("jetMatching");
321  std::string scheme = jmParams.getParameter<std::string>("scheme");
322  if (scheme == "Madgraph" || scheme == "MadgraphFastJet") {
323  fJetMatchingHook.reset(new JetMatchingHook(jmParams, &fMasterGen->info));
324  }
325  }
326 
327  // Pythia8Interface emission veto
328  //
329  if (params.exists("emissionVeto1")) {
330  EV1_nFinal = -1;
331  if (params.exists("EV1_nFinal"))
332  EV1_nFinal = params.getParameter<int>("EV1_nFinal");
333  EV1_vetoOn = true;
334  if (params.exists("EV1_vetoOn"))
335  EV1_vetoOn = params.getParameter<bool>("EV1_vetoOn");
336  EV1_maxVetoCount = 10;
337  if (params.exists("EV1_maxVetoCount"))
338  EV1_maxVetoCount = params.getParameter<int>("EV1_maxVetoCount");
339  EV1_pThardMode = 1;
340  if (params.exists("EV1_pThardMode"))
341  EV1_pThardMode = params.getParameter<int>("EV1_pThardMode");
342  EV1_pTempMode = 0;
343  if (params.exists("EV1_pTempMode"))
344  EV1_pTempMode = params.getParameter<int>("EV1_pTempMode");
345  if (EV1_pTempMode > 2 || EV1_pTempMode < 0)
346  throw edm::Exception(edm::errors::Configuration, "Pythia8Interface") << " Wrong value for EV1_pTempMode code\n";
347  EV1_emittedMode = 0;
348  if (params.exists("EV1_emittedMode"))
349  EV1_emittedMode = params.getParameter<int>("EV1_emittedMode");
350  EV1_pTdefMode = 1;
351  if (params.exists("EV1_pTdefMode"))
352  EV1_pTdefMode = params.getParameter<int>("EV1_pTdefMode");
353  EV1_MPIvetoOn = false;
354  if (params.exists("EV1_MPIvetoOn"))
355  EV1_MPIvetoOn = params.getParameter<bool>("EV1_MPIvetoOn");
356  EV1_QEDvetoMode = 0;
357  if (params.exists("EV1_QEDvetoMode"))
358  EV1_QEDvetoMode = params.getParameter<int>("EV1_QEDvetoMode");
359  EV1_nFinalMode = 0;
360  if (params.exists("EV1_nFinalMode"))
361  EV1_nFinalMode = params.getParameter<int>("EV1_nFinalMode");
363  EV1_vetoOn,
372  0));
373  }
374 
375  if (params.exists("UserCustomization")) {
376  fCustomHooksVector = std::make_shared<UserHooksVector>();
377  const std::vector<edm::ParameterSet> userParams =
378  params.getParameter<std::vector<edm::ParameterSet>>("UserCustomization");
379  for (const auto &pluginParams : userParams) {
380  (fCustomHooksVector->hooks)
381  .push_back(
382  CustomHookFactory::get()->create(pluginParams.getParameter<std::string>("pluginName"), pluginParams));
383  }
384  }
385 
386  if (params.exists("VinciaPlugin")) {
387  throw edm::Exception(edm::errors::Configuration, "Pythia8Interface")
388  << " Obsolete parameter: VinciaPlugin \n Please use the parameter PartonShowers:model instead \n";
389  }
390  if (params.exists("DirePlugin")) {
391  throw edm::Exception(edm::errors::Configuration, "Pythia8Interface")
392  << " Obsolete parameter: DirePlugin \n Please use the parameter PartonShowers:model instead \n";
393  }
394 }
395 
397 
399  bool status = false, status1 = false;
400 
401  if (lheFile_.empty()) {
402  if (fInitialState == PP) // default
403  {
404  fMasterGen->settings.mode("Beams:idA", 2212);
405  fMasterGen->settings.mode("Beams:idB", 2212);
406  } else if (fInitialState == PPbar) {
407  fMasterGen->settings.mode("Beams:idA", 2212);
408  fMasterGen->settings.mode("Beams:idB", -2212);
409  } else if (fInitialState == ElectronPositron) {
410  fMasterGen->settings.mode("Beams:idA", 11);
411  fMasterGen->settings.mode("Beams:idB", -11);
412  } else {
413  // throw on unknown initial state !
414  throw edm::Exception(edm::errors::Configuration, "Pythia8Interface")
415  << " UNKNOWN INITIAL STATE. \n The allowed initial states are: PP, PPbar, ElectronPositron \n";
416  }
417  fMasterGen->settings.parm("Beams:eCM", comEnergy);
418  } else {
419  fMasterGen->settings.mode("Beams:frameType", 4);
420  fMasterGen->settings.word("Beams:LHEF", lheFile_);
421  }
422 
423  if (!photonFluxParams.empty()) {
424  const auto &beamTypeA = photonFluxParams.getParameter<int>("beamTypeA");
425  const auto &beamTypeB = photonFluxParams.getParameter<int>("beamTypeB");
426  const auto &radiusA = photonFluxParams.getUntrackedParameter<double>("radiusA", -1.0);
427  const auto &radiusB = photonFluxParams.getUntrackedParameter<double>("radiusB", -1.0);
428  const auto &zA = photonFluxParams.getUntrackedParameter<int>("zA", -1);
429  const auto &zB = photonFluxParams.getUntrackedParameter<int>("zB", -1);
430  Pythia8::PDFPtr photonFluxA =
431  fMasterGen->settings.flag("PDF:beamA2gamma") ? make_shared<Nucleus2gamma2>(beamTypeA, radiusA, zA) : nullptr;
432  Pythia8::PDFPtr photonFluxB =
433  fMasterGen->settings.flag("PDF:beamB2gamma") ? make_shared<Nucleus2gamma2>(beamTypeB, radiusB, zB) : nullptr;
434  fMasterGen->setPhotonFluxPtr(photonFluxA, photonFluxB);
435  }
436 
437  if (!fUserHooksVector.get())
438  fUserHooksVector.reset(new UserHooksVector);
439  (fUserHooksVector->hooks).clear();
440 
441  if (fReweightUserHook.get())
442  (fUserHooksVector->hooks).push_back(fReweightUserHook);
443  if (fReweightEmpUserHook.get())
444  (fUserHooksVector->hooks).push_back(fReweightEmpUserHook);
445  if (fReweightRapUserHook.get())
446  (fUserHooksVector->hooks).push_back(fReweightRapUserHook);
447  if (fReweightPtHatRapUserHook.get())
448  (fUserHooksVector->hooks).push_back(fReweightPtHatRapUserHook);
449  if (fJetMatchingHook.get())
450  (fUserHooksVector->hooks).push_back(fJetMatchingHook);
451  if (fEmissionVetoHook1.get()) {
452  edm::LogInfo("Pythia8Interface") << "Turning on Emission Veto Hook 1 from CMSSW Pythia8Interface";
454  }
455 
456  if (fMasterGen->settings.mode("POWHEG:veto") > 0 || fMasterGen->settings.mode("POWHEG:MPIveto") > 0) {
457  if (fJetMatchingHook.get() || fEmissionVetoHook1.get())
458  throw edm::Exception(edm::errors::Configuration, "Pythia8Interface")
459  << " Attempt to turn on PowhegHooks by pythia8 settings but there are incompatible hooks on \n Incompatible "
460  "are : jetMatching, emissionVeto1 \n";
461 
462  if (!fEmissionVetoHook.get())
463  fEmissionVetoHook.reset(new PowhegHooks());
464 
465  edm::LogInfo("Pythia8Interface") << "Turning on Emission Veto Hook from pythia8 code";
467  }
468 
469  bool PowhegRes = fMasterGen->settings.flag("POWHEGres:calcScales");
470  if (PowhegRes) {
471  edm::LogInfo("Pythia8Interface") << "Turning on resonance scale setting from CMSSW Pythia8Interface";
472  if (!fPowhegResHook.get())
473  fPowhegResHook.reset(new PowhegResHook());
475  }
476 
477  bool PowhegBB4L = fMasterGen->settings.flag("POWHEG:bb4l");
478  if (PowhegBB4L) {
479  edm::LogInfo("Pythia8Interface") << "Turning on BB4l hook from CMSSW Pythia8Interface";
480  if (!fPowhegHooksBB4L.get())
481  fPowhegHooksBB4L.reset(new PowhegHooksBB4L());
483  }
484 
485  bool TopRecoilHook1 = fMasterGen->settings.flag("TopRecoilHook:doTopRecoilIn");
486  if (TopRecoilHook1) {
487  edm::LogInfo("Pythia8Interface") << "Turning on RecoilToTop hook from Pythia8Interface";
488  if (!fTopRecoilHook.get())
489  fTopRecoilHook.reset(new TopRecoilHook());
491  }
492 
493  //adapted from main89.cc in pythia8 examples
494  bool internalMatching = fMasterGen->settings.flag("JetMatching:merge");
495  bool internalMerging = !(fMasterGen->settings.word("Merging:Process") == "void");
496 
497  if (internalMatching && internalMerging) {
498  throw edm::Exception(edm::errors::Configuration, "Pythia8Interface")
499  << " Only one jet matching/merging scheme can be used at a time. \n";
500  }
501 
502  if (internalMatching) {
503  if (!fJetMatchingPy8InternalHook.get())
504  fJetMatchingPy8InternalHook.reset(new Pythia8::JetMatchingMadgraph);
506  }
507 
508  if (internalMerging) {
509  int scheme = (fMasterGen->settings.flag("Merging:doUMEPSTree") || fMasterGen->settings.flag("Merging:doUMEPSSubt"))
510  ? 1
511  : ((fMasterGen->settings.flag("Merging:doUNLOPSTree") ||
512  fMasterGen->settings.flag("Merging:doUNLOPSSubt") ||
513  fMasterGen->settings.flag("Merging:doUNLOPSLoop") ||
514  fMasterGen->settings.flag("Merging:doUNLOPSSubtNLO"))
515  ? 2
516  : 0);
517  if (!fMergingHook.get())
518  fMergingHook.reset(new Pythia8::amcnlo_unitarised_interface(scheme));
520  }
521 
522  bool biasedTauDecayer = fMasterGen->settings.flag("BiasedTauDecayer:filter");
523  if (biasedTauDecayer) {
524  if (!fBiasedTauDecayer.get()) {
525  Pythia8::Info localInfo = fMasterGen->info;
526  fBiasedTauDecayer.reset(new BiasedTauDecayer(&localInfo, &(fMasterGen->settings)));
527  }
528  std::vector<int> handledParticles;
529  handledParticles.push_back(15);
530  fMasterGen->setDecayPtr(fBiasedTauDecayer, handledParticles);
531  }
532 
533  bool resonanceDecayFilter = fMasterGen->settings.flag("ResonanceDecayFilter:filter");
534  if (resonanceDecayFilter) {
537  }
538 
539  bool PTFilter = fMasterGen->settings.flag("PTFilter:filter");
540  if (PTFilter) {
541  fPTFilterHook.reset(new PTFilterHook);
543  }
544 
545  if (!(fUserHooksVector->hooks).empty() && !UserHooksSet) {
546  for (auto &fUserHook : fUserHooksVector->hooks) {
547  fMasterGen->addUserHooksPtr(fUserHook);
548  }
549  UserHooksSet = true;
550  }
551 
552  if (fCustomHooksVector.get()) {
553  edm::LogInfo("Pythia8Interface") << "Adding customized user hooks";
554  for (const auto &fUserHook : fCustomHooksVector->hooks) {
555  fMasterGen->addUserHooksPtr(fUserHook);
556  }
557  }
558 
559  edm::LogInfo("Pythia8Interface") << "Initializing MasterGen";
560  status = fMasterGen->init();
561 
562  //clean up temp file
563  if (!slhafile_.empty()) {
564  std::remove(slhafile_.c_str());
565  }
566 
567  if (pythiaPylistVerbosity > 10) {
568  if (pythiaPylistVerbosity == 11 || pythiaPylistVerbosity == 13)
569  fMasterGen->settings.listAll();
570  if (pythiaPylistVerbosity == 12 || pythiaPylistVerbosity == 13)
571  fMasterGen->particleData.listAll();
572  }
573 
574  // init decayer
575  fDecayer->settings.flag("ProcessLevel:all", false); // trick
576  fDecayer->settings.flag("ProcessLevel:resonanceDecays", true);
577  edm::LogInfo("Pythia8Interface") << "Initializing Decayer";
578  status1 = fDecayer->init();
579 
580  if (useEvtGen) {
581  edm::LogInfo("Pythia8Hadronizer") << "Creating and initializing pythia8 EvtGen plugin";
582  if (!evtgenDecays.get()) {
583  evtgenDecays.reset(new EvtGenDecays(fMasterGen.get(), evtgenDecFile, evtgenPdlFile));
584  for (unsigned int i = 0; i < evtgenUserFiles.size(); i++)
585  evtgenDecays->readDecayFile(evtgenUserFiles.at(i));
586  }
587  }
588 
589  return (status && status1);
590 }
591 
593  edm::LogInfo("Pythia8Interface") << "Initializing for external partons";
594 
595  bool status = false, status1 = false;
596 
597  if (!fUserHooksVector.get())
598  fUserHooksVector.reset(new UserHooksVector);
599  (fUserHooksVector->hooks).clear();
600 
601  if (fReweightUserHook.get())
602  (fUserHooksVector->hooks).push_back(fReweightUserHook);
603  if (fReweightEmpUserHook.get())
604  (fUserHooksVector->hooks).push_back(fReweightEmpUserHook);
605  if (fReweightRapUserHook.get())
606  (fUserHooksVector->hooks).push_back(fReweightRapUserHook);
607  if (fReweightPtHatRapUserHook.get())
608  (fUserHooksVector->hooks).push_back(fReweightPtHatRapUserHook);
609  if (fJetMatchingHook.get())
610  (fUserHooksVector->hooks).push_back(fJetMatchingHook);
611  if (fEmissionVetoHook1.get()) {
612  edm::LogInfo("Pythia8Interface") << "Turning on Emission Veto Hook 1 from CMSSW Pythia8Interface";
614  }
615 
616  if (fCustomHooksVector.get()) {
617  edm::LogInfo("Pythia8Interface") << "Adding customized user hook";
618  for (const auto &fUserHook : fCustomHooksVector->hooks) {
619  (fUserHooksVector->hooks).push_back(fUserHook);
620  }
621  }
622 
623  if (fMasterGen->settings.mode("POWHEG:veto") > 0 || fMasterGen->settings.mode("POWHEG:MPIveto") > 0) {
624  if (fJetMatchingHook.get() || fEmissionVetoHook1.get())
625  throw edm::Exception(edm::errors::Configuration, "Pythia8Interface")
626  << " Attempt to turn on PowhegHooks by pythia8 settings but there are incompatible hooks on \n Incompatible "
627  "are : jetMatching, emissionVeto1 \n";
628 
629  if (!fEmissionVetoHook.get())
630  fEmissionVetoHook.reset(new PowhegHooks());
631 
632  edm::LogInfo("Pythia8Interface") << "Turning on Emission Veto Hook from pythia8 code";
634  }
635 
636  bool PowhegRes = fMasterGen->settings.flag("POWHEGres:calcScales");
637  if (PowhegRes) {
638  edm::LogInfo("Pythia8Interface") << "Turning on resonance scale setting from CMSSW Pythia8Interface";
639  if (!fPowhegResHook.get())
640  fPowhegResHook.reset(new PowhegResHook());
642  }
643 
644  bool PowhegBB4L = fMasterGen->settings.flag("POWHEG:bb4l");
645  if (PowhegBB4L) {
646  edm::LogInfo("Pythia8Interface") << "Turning on BB4l hook from CMSSW Pythia8Interface";
647  if (!fPowhegHooksBB4L.get())
648  fPowhegHooksBB4L.reset(new PowhegHooksBB4L());
650  }
651 
652  bool TopRecoilHook1 = fMasterGen->settings.flag("TopRecoilHook:doTopRecoilIn");
653  if (TopRecoilHook1) {
654  edm::LogInfo("Pythia8Interface") << "Turning on RecoilToTop hook from Pythia8Interface";
655  if (!fTopRecoilHook.get())
656  fTopRecoilHook.reset(new TopRecoilHook());
658  }
659 
660  //adapted from main89.cc in pythia8 examples
661  bool internalMatching = fMasterGen->settings.flag("JetMatching:merge");
662  bool internalMerging = !(fMasterGen->settings.word("Merging:Process") == "void");
663 
664  if (internalMatching && internalMerging) {
665  throw edm::Exception(edm::errors::Configuration, "Pythia8Interface")
666  << " Only one jet matching/merging scheme can be used at a time. \n";
667  }
668 
669  if (internalMatching) {
670  if (!fJetMatchingPy8InternalHook.get())
671  fJetMatchingPy8InternalHook.reset(new Pythia8::JetMatchingMadgraph);
673  }
674 
675  if (internalMerging) {
676  int scheme = (fMasterGen->settings.flag("Merging:doUMEPSTree") || fMasterGen->settings.flag("Merging:doUMEPSSubt"))
677  ? 1
678  : ((fMasterGen->settings.flag("Merging:doUNLOPSTree") ||
679  fMasterGen->settings.flag("Merging:doUNLOPSSubt") ||
680  fMasterGen->settings.flag("Merging:doUNLOPSLoop") ||
681  fMasterGen->settings.flag("Merging:doUNLOPSSubtNLO"))
682  ? 2
683  : 0);
684  if (!fMergingHook.get())
685  fMergingHook.reset(new Pythia8::amcnlo_unitarised_interface(scheme));
687  }
688 
689  bool biasedTauDecayer = fMasterGen->settings.flag("BiasedTauDecayer:filter");
690  if (biasedTauDecayer) {
691  if (!fBiasedTauDecayer.get()) {
692  Pythia8::Info localInfo = fMasterGen->info;
693  fBiasedTauDecayer.reset(new BiasedTauDecayer(&localInfo, &(fMasterGen->settings)));
694  }
695  std::vector<int> handledParticles;
696  handledParticles.push_back(15);
697  fMasterGen->setDecayPtr(fBiasedTauDecayer, handledParticles);
698  }
699 
700  bool resonanceDecayFilter = fMasterGen->settings.flag("ResonanceDecayFilter:filter");
701  if (resonanceDecayFilter) {
704  }
705 
706  bool PTFilter = fMasterGen->settings.flag("PTFilter:filter");
707  if (PTFilter) {
708  fPTFilterHook.reset(new PTFilterHook);
710  }
711 
712  if (!(fUserHooksVector->hooks).empty() && !UserHooksSet) {
713  for (auto &fUserHook : fUserHooksVector->hooks) {
714  fMasterGen->addUserHooksPtr(fUserHook);
715  }
716  UserHooksSet = true;
717  }
718 
719  if (!LHEInputFileName.empty()) {
720  edm::LogInfo("Pythia8Interface") << "Initialize direct pythia8 reading from LHE file " << LHEInputFileName;
721  edm::LogInfo("Pythia8Interface") << "Some LHE information can be not stored";
722  fMasterGen->settings.mode("Beams:frameType", 4);
723  fMasterGen->settings.word("Beams:LHEF", LHEInputFileName);
724  status = fMasterGen->init();
725 
726  } else {
727  lhaUP.reset(new LHAupLesHouches());
728  lhaUP->setScalesFromLHEF(fMasterGen->settings.flag("Beams:setProductionScalesFromLHEF"));
729  lhaUP->loadRunInfo(lheRunInfo());
730 
731  if (fJetMatchingHook.get()) {
732  fJetMatchingHook->init(lheRunInfo());
733  }
734 
735  fMasterGen->settings.mode("Beams:frameType", 5);
736  fMasterGen->setLHAupPtr(lhaUP);
737  edm::LogInfo("Pythia8Interface") << "Initializing MasterGen";
738  status = fMasterGen->init();
739  }
740 
741  //clean up temp file
742  if (!slhafile_.empty()) {
743  std::remove(slhafile_.c_str());
744  }
745 
746  if (pythiaPylistVerbosity > 10) {
747  if (pythiaPylistVerbosity == 11 || pythiaPylistVerbosity == 13)
748  fMasterGen->settings.listAll();
749  if (pythiaPylistVerbosity == 12 || pythiaPylistVerbosity == 13)
750  fMasterGen->particleData.listAll();
751  }
752 
753  // init decayer
754  fDecayer->settings.flag("ProcessLevel:all", false); // trick
755  fDecayer->settings.flag("ProcessLevel:resonanceDecays", true);
756  edm::LogInfo("Pythia8Interface") << "Initializing Decayer";
757  status1 = fDecayer->init();
758 
759  if (useEvtGen) {
760  edm::LogInfo("Pythia8Hadronizer") << "Creating and initializing pythia8 EvtGen plugin";
761  if (!evtgenDecays.get()) {
762  evtgenDecays.reset(new EvtGenDecays(fMasterGen.get(), evtgenDecFile, evtgenPdlFile));
763  for (unsigned int i = 0; i < evtgenUserFiles.size(); i++)
764  evtgenDecays->readDecayFile(evtgenUserFiles.at(i));
765  }
766  }
767 
768  return (status && status1);
769 }
770 
772  fMasterGen->stat();
773 
774  if (fEmissionVetoHook.get()) {
775  edm::LogPrint("Pythia8Interface") << "\n"
776  << "Number of ISR vetoed = " << nISRveto;
777  edm::LogPrint("Pythia8Interface") << "Number of FSR vetoed = " << nFSRveto;
778  }
779 
780  double xsec = fMasterGen->info.sigmaGen(); // cross section in mb
781  xsec *= 1.0e9; // translate to pb (CMS/Gen "convention" as of May 2009)
782  double err = fMasterGen->info.sigmaErr(); // cross section err in mb
783  err *= 1.0e9; // translate to pb (CMS/Gen "convention" as of May 2009)
785 }
786 
788  DJR.resize(0);
789  nME = -1;
790  nMEFiltered = -1;
791 
792  if (fJetMatchingHook.get()) {
793  fJetMatchingHook->resetMatchingStatus();
794  fJetMatchingHook->beforeHadronization(lheEvent());
795  }
796 
797  if (!fMasterGen->next())
798  return false;
799 
800  double mergeweight = fMasterGen.get()->info.mergingWeightNLO();
801  if (fMergingHook.get()) {
802  mergeweight *= fMergingHook->getNormFactor();
803  }
804 
805  //protect against 0-weight from ckkw or similar
806  if (std::abs(mergeweight) == 0.) {
807  event().reset();
808  return false;
809  }
810 
811  if (fJetMatchingPy8InternalHook.get()) {
812  const std::vector<double> djrmatch = fJetMatchingPy8InternalHook->getDJR();
813  //cap size of djr vector to save storage space (keep only up to first 6 elements)
814  unsigned int ndjr = std::min(djrmatch.size(), std::vector<double>::size_type(6));
815  for (unsigned int idjr = 0; idjr < ndjr; ++idjr) {
816  DJR.push_back(djrmatch[idjr]);
817  }
818 
819  nME = fJetMatchingPy8InternalHook->nMEpartons().first;
820  nMEFiltered = fJetMatchingPy8InternalHook->nMEpartons().second;
821  }
822 
823  if (evtgenDecays.get())
824  evtgenDecays->decay();
825 
826  event() = std::make_unique<HepMC::GenEvent>();
827  bool py8hepmc = toHepMC.fill_next_event(*(fMasterGen.get()), event().get());
828 
829  if (!py8hepmc) {
830  return false;
831  }
832 
833  // 0th weight is not filled anymore since v8.30x, pushback manually
834  event()->weights().push_back(fMasterGen->info.weight());
835 
836  //add ckkw/umeps/unlops merging weight
837  if (mergeweight != 1.) {
838  event()->weights()[0] *= mergeweight;
839  }
840 
841  if (fEmissionVetoHook.get()) {
842  nISRveto += fEmissionVetoHook->getNISRveto();
843  nFSRveto += fEmissionVetoHook->getNFSRveto();
844  }
845 
846  //fill additional weights for systematic uncertainties
847  if (fMasterGen->info.getWeightsDetailedSize() > 0) {
848  for (const string &key : fMasterGen->info.initrwgt->weightsKeys) {
849  double wgt = (*fMasterGen->info.weights_detailed)[key];
850  event()->weights().push_back(wgt);
851  }
852  } else if (fMasterGen->info.getWeightsCompressedSize() > 0) {
853  for (unsigned int i = 0; i < fMasterGen->info.getWeightsCompressedSize(); i++) {
854  double wgt = fMasterGen->info.getWeightsCompressedValue(i);
855  event()->weights().push_back(wgt);
856  }
857  }
858 
859  // fill shower weights
860  // http://home.thep.lu.se/~torbjorn/pythia82html/Variations.html
861  if (fMasterGen->info.nWeights() > 1) {
862  for (int i = 0; i < fMasterGen->info.nWeights(); ++i) {
863  double wgt = fMasterGen->info.weight(i);
864  event()->weights().push_back(wgt);
865  }
866  }
867 
868 #if 0
869  // VINCIA shower weights
870  // http://vincia.hepforge.org/current/share/Vincia/htmldoc/VinciaUncertainties.html
871  if (fvincia.get()) {
872  event()->weights()[0] *= fvincia->weight(0);
873  for (int iVar = 1; iVar < fvincia->nWeights(); iVar++) {
874  event()->weights().push_back(fvincia->weight(iVar));
875  }
876  }
877 
878  // Retrieve Dire shower weights
879  if (fDire.get()) {
880  fDire->weightsPtr->calcWeight(0.);
881  fDire->weightsPtr->reset();
882 
883  //Make sure the base weight comes first
884  event()->weights()[0] *= fDire->weightsPtr->getShowerWeight("base");
885 
886  unordered_map<string, double>::iterator it;
887  for (it = fDire->weightsPtr->getShowerWeights()->begin(); it != fDire->weightsPtr->getShowerWeights()->end();
888  it++) {
889  if (it->first == "base")
890  continue;
891  event()->weights().push_back(it->second);
892  }
893  }
894 #endif
895 
896  return true;
897 }
898 
900  DJR.resize(0);
901  nME = -1;
902  nMEFiltered = -1;
903  if (LHEInputFileName.empty())
904  lhaUP->loadEvent(lheEvent());
905 
906  if (fJetMatchingHook.get()) {
907  fJetMatchingHook->resetMatchingStatus();
908  fJetMatchingHook->beforeHadronization(lheEvent());
909  }
910 
911  bool py8next = fMasterGen->next();
912 
913  double mergeweight = fMasterGen.get()->info.mergingWeightNLO();
914  if (fMergingHook.get()) {
915  mergeweight *= fMergingHook->getNormFactor();
916  }
917 
918  //protect against 0-weight from ckkw or similar
919  if (!py8next || std::abs(mergeweight) == 0.) {
920  lheEvent()->count(lhef::LHERunInfo::kSelected, 1.0, mergeweight);
921  event().reset();
922  return false;
923  }
924 
925  if (fJetMatchingPy8InternalHook.get()) {
926  const std::vector<double> djrmatch = fJetMatchingPy8InternalHook->getDJR();
927  //cap size of djr vector to save storage space (keep only up to first 6 elements)
928  unsigned int ndjr = std::min(djrmatch.size(), std::vector<double>::size_type(6));
929  for (unsigned int idjr = 0; idjr < ndjr; ++idjr) {
930  DJR.push_back(djrmatch[idjr]);
931  }
932 
933  nME = fJetMatchingPy8InternalHook->nMEpartons().first;
934  nMEFiltered = fJetMatchingPy8InternalHook->nMEpartons().second;
935  }
936 
937  // update LHE matching statistics
938  //
939  lheEvent()->count(lhef::LHERunInfo::kAccepted, 1.0, mergeweight);
940 
941  if (evtgenDecays.get())
942  evtgenDecays->decay();
943 
944  event() = std::make_unique<HepMC::GenEvent>();
945 
946  bool py8hepmc = toHepMC.fill_next_event(*(fMasterGen.get()), event().get());
947 
948  if (!py8hepmc) {
949  return false;
950  }
951 
952  // 0th weight is not filled anymore since v8.30x, pushback manually
953  event()->weights().push_back(fMasterGen->info.weight());
954 
955  //add ckkw/umeps/unlops merging weight
956  if (mergeweight != 1.) {
957  event()->weights()[0] *= mergeweight;
958  }
959 
960  if (fEmissionVetoHook.get()) {
961  nISRveto += fEmissionVetoHook->getNISRveto();
962  nFSRveto += fEmissionVetoHook->getNFSRveto();
963  }
964 
965  // fill shower weights
966  // http://home.thep.lu.se/~torbjorn/pythia82html/Variations.html
967  if (fMasterGen->info.nWeights() > 1) {
968  for (int i = 0; i < fMasterGen->info.nWeights(); ++i) {
969  double wgt = fMasterGen->info.weight(i);
970  event()->weights().push_back(wgt);
971  }
972  }
973 
974  return true;
975 }
976 
978  Event *pythiaEvent = &(fMasterGen->event);
979 
980  int NPartsBeforeDecays = pythiaEvent->size();
981  int NPartsAfterDecays = event().get()->particles_size();
982 
983  if (NPartsAfterDecays == NPartsBeforeDecays)
984  return true;
985 
986  bool result = true;
987 
988  for (int ipart = NPartsAfterDecays; ipart > NPartsBeforeDecays; ipart--) {
989  HepMC::GenParticle *part = event().get()->barcode_to_particle(ipart);
990 
991  if (part->status() == 1 && (fDecayer->particleData).canDecay(part->pdg_id())) {
992  fDecayer->event.reset();
993  Particle py8part(part->pdg_id(),
994  93,
995  0,
996  0,
997  0,
998  0,
999  0,
1000  0,
1001  part->momentum().x(),
1002  part->momentum().y(),
1003  part->momentum().z(),
1004  part->momentum().t(),
1005  part->generated_mass());
1006  HepMC::GenVertex *ProdVtx = part->production_vertex();
1007  py8part.vProd(ProdVtx->position().x(), ProdVtx->position().y(), ProdVtx->position().z(), ProdVtx->position().t());
1008  py8part.tau((fDecayer->particleData).tau0(part->pdg_id()));
1009  fDecayer->event.append(py8part);
1010  int nentries = fDecayer->event.size();
1011  if (!fDecayer->event[nentries - 1].mayDecay())
1012  continue;
1013  fDecayer->next();
1014  int nentries1 = fDecayer->event.size();
1015  if (nentries1 <= nentries)
1016  continue; //same number of particles, no decays...
1017 
1018  part->set_status(2);
1019 
1020  result = toHepMC.fill_next_event(*(fDecayer.get()), event().get(), -1, true, part);
1021  }
1022  }
1023 
1024  return result;
1025 }
1026 
1028  bool lhe = lheEvent() != nullptr;
1029 
1030  // protection against empty weight container
1031  if ((event()->weights()).empty())
1032  (event()->weights()).push_back(1.);
1033 
1034  // now create the GenEventInfo product from the GenEvent and fill
1035  // the missing pieces
1036  eventInfo() = std::make_unique<GenEventInfoProduct>(event().get());
1037 
1038  // in pythia pthat is used to subdivide samples into different bins
1039  // in LHE mode the binning is done by the external ME generator
1040  // which is likely not pthat, so only filling it for Py6 internal mode
1041  if (!lhe) {
1042  eventInfo()->setBinningValues(std::vector<double>(1, fMasterGen->info.pTHat()));
1043  }
1044 
1045  eventInfo()->setDJR(DJR);
1046  eventInfo()->setNMEPartons(nME);
1047  eventInfo()->setNMEPartonsFiltered(nMEFiltered);
1048 
1049  //******** Verbosity ********
1050 
1052  maxEventsToPrint--;
1053  if (pythiaPylistVerbosity) {
1054  fMasterGen->info.list();
1055  fMasterGen->event.list();
1056  }
1057 
1058  if (pythiaHepMCVerbosity) {
1059  std::cout << "Event process = " << fMasterGen->info.code() << "\n"
1060  << "----------------------" << std::endl;
1061  event()->print();
1062  }
1064  std::cout << "Event process = " << fMasterGen->info.code() << "\n"
1065  << "----------------------" << std::endl;
1066  ascii_io->write_event(event().get());
1067  }
1068  }
1069 }
1070 
1071 std::unique_ptr<GenLumiInfoHeader> Pythia8Hadronizer::getGenLumiInfoHeader() const {
1072  auto genLumiInfoHeader = BaseHadronizer::getGenLumiInfoHeader();
1073 
1074  //fill lhe headers
1075  //*FIXME* initrwgt header is corrupt due to pythia bug
1076  for (const std::string &key : fMasterGen->info.headerKeys()) {
1077  genLumiInfoHeader->lheHeaders().emplace_back(key, fMasterGen->info.header(key));
1078  }
1079 
1080  //check, if it is not only nominal weight
1081  int weights_number = fMasterGen->info.nWeights();
1082  if (fMasterGen->info.initrwgt)
1083  weights_number += fMasterGen->info.initrwgt->weightsKeys.size();
1084  if (weights_number > 1) {
1085  genLumiInfoHeader->weightNames().reserve(weights_number + 1);
1086  genLumiInfoHeader->weightNames().push_back("nominal");
1087  }
1088 
1089  //fill weight names
1090  if (fMasterGen->info.initrwgt) {
1091  for (const std::string &key : fMasterGen->info.initrwgt->weightsKeys) {
1092  std::string weightgroupname;
1093  for (const auto &wgtgrp : fMasterGen->info.initrwgt->weightgroups) {
1094  const auto &wgtgrpwgt = wgtgrp.second.weights.find(key);
1095  if (wgtgrpwgt != wgtgrp.second.weights.end()) {
1096  weightgroupname = wgtgrp.first;
1097  }
1098  }
1099 
1100  std::ostringstream weightname;
1101  weightname << "LHE, id = " << key << ", ";
1102  if (!weightgroupname.empty()) {
1103  weightname << "group = " << weightgroupname << ", ";
1104  }
1105  weightname << fMasterGen->info.initrwgt->weights[key].contents;
1106  genLumiInfoHeader->weightNames().push_back(weightname.str());
1107  }
1108  }
1109 
1110  //fill shower labels
1111  // http://home.thep.lu.se/~torbjorn/pythia82html/Variations.html
1112  // http://home.thep.lu.se/~torbjorn/doxygen/classPythia8_1_1Info.html
1113  if (fMasterGen->info.nWeights() > 1) {
1114  for (int i = 0; i < fMasterGen->info.nWeights(); ++i) {
1115  genLumiInfoHeader->weightNames().push_back(fMasterGen->info.weightLabel(i));
1116  }
1117  }
1118 
1119 #if 0
1120  // VINCIA shower weights
1121  // http://vincia.hepforge.org/current/share/Vincia/htmldoc/VinciaUncertainties.html
1122  if (fvincia.get()) {
1123  for (int iVar = 0; iVar < fvincia->nWeights(); iVar++) {
1124  genLumiInfoHeader->weightNames().push_back(fvincia->weightLabel(iVar));
1125  }
1126  }
1127 
1128  if (fDire.get()) {
1129  //Make sure the base weight comes first
1130  genLumiInfoHeader->weightNames().push_back("base");
1131 
1132  unordered_map<string, double>::iterator it;
1133  for (it = fDire->weightsPtr->getShowerWeights()->begin(); it != fDire->weightsPtr->getShowerWeights()->end();
1134  it++) {
1135  if (it->first == "base")
1136  continue;
1137  genLumiInfoHeader->weightNames().push_back(it->first);
1138  }
1139  }
1140 #endif
1141 
1142  return genLumiInfoHeader;
1143 }
1144 
1147 
1150 
1154 
edm::ConcurrentGeneratorFilter< Pythia8Hadronizer, ConcurrentExternalDecayDriver > Pythia8ConcurrentGeneratorFilter
std::shared_ptr< PowhegHooksBB4L > fPowhegHooksBB4L
virtual bool residualDecay()
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
double comEnergy
Center-of-Mass energy.
std::shared_ptr< PowhegHooks > fEmissionVetoHook
std::shared_ptr< EmissionVetoHook1 > fEmissionVetoHook1
std::shared_ptr< BiasedTauDecayer > fBiasedTauDecayer
std::shared_ptr< Pythia8::EvtGenDecays > evtgenDecays
std::unique_ptr< Pythia8::Pythia > fDecayer
edm::GeneratorFilter< Pythia8Hadronizer, ExternalDecayDriver > Pythia8GeneratorFilter
bool initializeForInternalPartons() override
std::shared_ptr< TopRecoilHook > fTopRecoilHook
HepMC::IO_AsciiParticles * ascii_io
void statistics() override
bool exists(std::string const &parameterName) const
checks if a parameter exists
Nucleus2gamma2(int idBeamIn, double R=-1.0, int Z=-1)
std::string LHEInputFileName
void count(LHERunInfo::CountMode count, double weight=1.0, double matchWeight=1.0)
Definition: LHEEvent.cc:187
std::shared_ptr< UserHooks > fReweightRapUserHook
void setInternalXSec(const XSec &xsec)
uint16_t size_type
constexpr int pow2(int x)
Definition: TauNNIdHW.h:51
std::shared_ptr< LHAupLesHouches > lhaUP
std::vector< std::string > evtgenUserFiles
edm::ConcurrentHadronizerFilter< Pythia8Hadronizer, ConcurrentExternalDecayDriver > Pythia8ConcurrentHadronizerFilter
T getUntrackedParameter(std::string const &, T const &) const
GenRunInfoProduct & runInfo()
lhef::LHEEvent * lheEvent()
unsigned int ivhepmc
void xfUpdate(int, double x, double) override
bool empty() const
Definition: ParameterSet.h:202
T sqrt(T t)
Definition: SSEVec.h:23
static const std::vector< std::string > p8SharedResources
std::shared_ptr< UserHooksVector > fCustomHooksVector
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Log< level::Error, true > LogImportant
std::shared_ptr< ResonanceDecayFilterHook > fResonanceDecayFilterHook
key
prepare the HTCondor submission files and eventually submit them
std::shared_ptr< UserHooksVector > fUserHooksVector
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
unsigned int pythiaPylistVerbosity
const char * classname() const override
std::shared_ptr< PTFilterHook > fPTFilterHook
std::shared_ptr< Pythia8::JetMatchingMadgraph > fJetMatchingPy8InternalHook
std::unique_ptr< HepMC::GenEvent > & event()
Log< level::Warning, true > LogPrint
#define M_PI
lhef::LHERunInfo * lheRunInfo()
std::shared_ptr< JetMatchingHook > fJetMatchingHook
bool generatePartonsAndHadronize() override
Log< level::Info, false > LogInfo
edm::ParameterSet photonFluxParams
void doSetRandomEngine(CLHEP::HepRandomEngine *v) override
std::shared_ptr< UserHooks > fReweightUserHook
std::shared_ptr< Pythia8::amcnlo_unitarised_interface > fMergingHook
part
Definition: HCALResponse.h:20
std::unique_ptr< GenEventInfoProduct > & eventInfo()
unsigned int maxEventsToPrint
def remove(d, key, TELL=False)
Definition: MatrixUtil.py:234
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
std::shared_ptr< UserHooks > fReweightEmpUserHook
Pythia8Hadronizer(const edm::ParameterSet &params)
vector< float > DJR
std::shared_ptr< PowhegResHook > fPowhegResHook
float x
HepMC::Pythia8ToHepMC toHepMC
std::unique_ptr< GenLumiInfoHeader > getGenLumiInfoHeader() const override
std::shared_ptr< UserHooks > fReweightPtHatRapUserHook
std::unique_ptr< Pythia8::Pythia > fMasterGen
std::vector< std::string > const & doSharedResources() const override
#define get
static const std::string kPythia8
void clear(EGIsoObj &c)
Definition: egamma.h:82
void finalizeEvent() override
edm::HadronizerFilter< Pythia8Hadronizer, ExternalDecayDriver > Pythia8HadronizerFilter
~Pythia8Hadronizer() override