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