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 
21 
22 // PS matchning prototype
23 //
25 #include "Pythia8Plugins/JetMatching.h"
26 #include "Pythia8Plugins/aMCatNLOHooks.h"
27 
28 // Emission Veto Hooks
29 //
30 #include "Pythia8Plugins/PowhegHooks.h"
32 
33 // Resonance scale hook
36 
37 //biased tau decayer
39 
40 //decay filter hook
42 
43 //decay filter hook
45 
46 // EvtGen plugin
47 //
48 #include "Pythia8Plugins/EvtGen.h"
49 
55 
58 
62 
64 
65 #include "HepPID/ParticleIDTranslations.hh"
66 
69 
70 namespace CLHEP {
71  class HepRandomEngine;
72 }
73 
74 using namespace gen;
75 
77 public:
79  ~Pythia8Hadronizer() override;
80 
81  bool initializeForInternalPartons() override;
82  bool initializeForExternalPartons();
83 
84  bool generatePartonsAndHadronize() override;
85  bool hadronize();
86 
87  virtual bool residualDecay();
88 
89  void finalizeEvent() override;
90 
91  void statistics() override;
92 
93  const char *classname() const override { return "Pythia8Hadronizer"; }
94 
95  std::unique_ptr<GenLumiInfoHeader> getGenLumiInfoHeader() const override;
96 
97 private:
98  void doSetRandomEngine(CLHEP::HepRandomEngine *v) override { p8SetRandomEngine(v); }
99  std::vector<std::string> const &doSharedResources() const override { return p8SharedResources; }
100 
102  double comEnergy;
103 
105  std::shared_ptr<LHAupLesHouches> lhaUP;
106 
107  enum { PP, PPbar, ElectronPositron };
108  int fInitialState; // pp, ppbar, or e-e+
109 
110  double fBeam1PZ;
111  double fBeam2PZ;
112 
113  //helper class to allow multiple user hooks simultaneously
114  std::shared_ptr<UserHooksVector> fUserHooksVector;
116 
117  // Reweight user hooks
118  //
119  std::shared_ptr<UserHooks> fReweightUserHook;
120  std::shared_ptr<UserHooks> fReweightEmpUserHook;
121  std::shared_ptr<UserHooks> fReweightRapUserHook;
122  std::shared_ptr<UserHooks> fReweightPtHatRapUserHook;
123 
124  // PS matching prototype
125  //
126  std::shared_ptr<JetMatchingHook> fJetMatchingHook;
127  std::shared_ptr<Pythia8::JetMatchingMadgraph> fJetMatchingPy8InternalHook;
128  std::shared_ptr<Pythia8::amcnlo_unitarised_interface> fMergingHook;
129 
130  // Emission Veto Hooks
131  //
132  std::shared_ptr<PowhegHooks> fEmissionVetoHook;
133  std::shared_ptr<EmissionVetoHook1> fEmissionVetoHook1;
134 
135  // Resonance scale hook
136  std::shared_ptr<PowhegResHook> fPowhegResHook;
137  std::shared_ptr<PowhegHooksBB4L> fPowhegHooksBB4L;
138 
139  // biased tau decayer
140  std::shared_ptr<BiasedTauDecayer> fBiasedTauDecayer;
141 
142  //resonance decay filter hook
143  std::shared_ptr<ResonanceDecayFilterHook> fResonanceDecayFilterHook;
144 
145  //PT filter hook
146  std::shared_ptr<PTFilterHook> fPTFilterHook;
147 
158 
159  static const std::vector<std::string> p8SharedResources;
160 
161  vector<float> DJR;
162  int nME;
164 
165  int nISRveto;
166  int nFSRveto;
167 };
168 
170 
173  comEnergy(params.getParameter<double>("comEnergy")),
174  LHEInputFileName(params.getUntrackedParameter<std::string>("LHEInputFileName", "")),
175  fInitialState(PP),
176  UserHooksSet(false),
177  nME(-1),
178  nMEFiltered(-1),
179  nISRveto(0),
180  nFSRveto(0) {
181  // J.Y.: the following 3 parameters are hacked "for a reason"
182  //
183  if (params.exists("PPbarInitialState")) {
184  if (fInitialState == PP) {
186  edm::LogImportant("GeneratorInterface|Pythia8Interface")
187  << "Pythia8 will be initialized for PROTON-ANTIPROTON INITIAL STATE. "
188  << "This is a user-request change from the DEFAULT PROTON-PROTON initial state.";
189  } else {
190  // probably need to throw on attempt to override ?
191  }
192  } else if (params.exists("ElectronPositronInitialState")) {
193  if (fInitialState == PP) {
195  edm::LogInfo("GeneratorInterface|Pythia8Interface")
196  << "Pythia8 will be initialized for ELECTRON-POSITRON INITIAL STATE. "
197  << "This is a user-request change from the DEFAULT PROTON-PROTON initial state.";
198  } else {
199  // probably need to throw on attempt to override ?
200  }
201  } else if (params.exists("ElectronProtonInitialState") || params.exists("PositronProtonInitialState")) {
202  // throw on unknown initial state !
203  throw edm::Exception(edm::errors::Configuration, "Pythia8Interface")
204  << " UNKNOWN INITIAL STATE. \n The allowed initial states are: PP, PPbar, ElectronPositron \n";
205  }
206 
207  // Reweight user hook
208  //
209  if (params.exists("reweightGen")) {
210  edm::LogInfo("Pythia8Interface") << "Start setup for reweightGen";
211  edm::ParameterSet rgParams = params.getParameter<edm::ParameterSet>("reweightGen");
212  fReweightUserHook.reset(
213  new PtHatReweightUserHook(rgParams.getParameter<double>("pTRef"), rgParams.getParameter<double>("power")));
214  edm::LogInfo("Pythia8Interface") << "End setup for reweightGen";
215  }
216  if (params.exists("reweightGenEmp")) {
217  edm::LogInfo("Pythia8Interface") << "Start setup for reweightGenEmp";
218  edm::ParameterSet rgeParams = params.getParameter<edm::ParameterSet>("reweightGenEmp");
219 
220  std::string tuneName = "";
221  if (rgeParams.exists("tune"))
222  tuneName = rgeParams.getParameter<std::string>("tune");
223  fReweightEmpUserHook.reset(new PtHatEmpReweightUserHook(tuneName));
224  edm::LogInfo("Pythia8Interface") << "End setup for reweightGenEmp";
225  }
226  if (params.exists("reweightGenRap")) {
227  edm::LogInfo("Pythia8Interface") << "Start setup for reweightGenRap";
228  edm::ParameterSet rgrParams = params.getParameter<edm::ParameterSet>("reweightGenRap");
229  fReweightRapUserHook.reset(new RapReweightUserHook(rgrParams.getParameter<std::string>("yLabSigmaFunc"),
230  rgrParams.getParameter<double>("yLabPower"),
231  rgrParams.getParameter<std::string>("yCMSigmaFunc"),
232  rgrParams.getParameter<double>("yCMPower"),
233  rgrParams.getParameter<double>("pTHatMin"),
234  rgrParams.getParameter<double>("pTHatMax")));
235  edm::LogInfo("Pythia8Interface") << "End setup for reweightGenRap";
236  }
237  if (params.exists("reweightGenPtHatRap")) {
238  edm::LogInfo("Pythia8Interface") << "Start setup for reweightGenPtHatRap";
239  edm::ParameterSet rgrParams = params.getParameter<edm::ParameterSet>("reweightGenPtHatRap");
240  fReweightPtHatRapUserHook.reset(new PtHatRapReweightUserHook(rgrParams.getParameter<std::string>("yLabSigmaFunc"),
241  rgrParams.getParameter<double>("yLabPower"),
242  rgrParams.getParameter<std::string>("yCMSigmaFunc"),
243  rgrParams.getParameter<double>("yCMPower"),
244  rgrParams.getParameter<double>("pTHatMin"),
245  rgrParams.getParameter<double>("pTHatMax")));
246  edm::LogInfo("Pythia8Interface") << "End setup for reweightGenPtHatRap";
247  }
248 
249  if (params.exists("useUserHook"))
250  throw edm::Exception(edm::errors::Configuration, "Pythia8Interface")
251  << " Obsolete parameter: useUserHook \n Please use the actual one instead \n";
252 
253  // PS matching prototype
254  //
255  if (params.exists("jetMatching")) {
256  edm::ParameterSet jmParams = params.getUntrackedParameter<edm::ParameterSet>("jetMatching");
257  std::string scheme = jmParams.getParameter<std::string>("scheme");
258  if (scheme == "Madgraph" || scheme == "MadgraphFastJet") {
259  fJetMatchingHook.reset(new JetMatchingHook(jmParams, &fMasterGen->info));
260  }
261  }
262 
263  // Pythia8Interface emission veto
264  //
265  if (params.exists("emissionVeto1")) {
266  EV1_nFinal = -1;
267  if (params.exists("EV1_nFinal"))
268  EV1_nFinal = params.getParameter<int>("EV1_nFinal");
269  EV1_vetoOn = true;
270  if (params.exists("EV1_vetoOn"))
271  EV1_vetoOn = params.getParameter<bool>("EV1_vetoOn");
272  EV1_maxVetoCount = 10;
273  if (params.exists("EV1_maxVetoCount"))
274  EV1_maxVetoCount = params.getParameter<int>("EV1_maxVetoCount");
275  EV1_pThardMode = 1;
276  if (params.exists("EV1_pThardMode"))
277  EV1_pThardMode = params.getParameter<int>("EV1_pThardMode");
278  EV1_pTempMode = 0;
279  if (params.exists("EV1_pTempMode"))
280  EV1_pTempMode = params.getParameter<int>("EV1_pTempMode");
281  if (EV1_pTempMode > 2 || EV1_pTempMode < 0)
282  throw edm::Exception(edm::errors::Configuration, "Pythia8Interface") << " Wrong value for EV1_pTempMode code\n";
283  EV1_emittedMode = 0;
284  if (params.exists("EV1_emittedMode"))
285  EV1_emittedMode = params.getParameter<int>("EV1_emittedMode");
286  EV1_pTdefMode = 1;
287  if (params.exists("EV1_pTdefMode"))
288  EV1_pTdefMode = params.getParameter<int>("EV1_pTdefMode");
289  EV1_MPIvetoOn = false;
290  if (params.exists("EV1_MPIvetoOn"))
291  EV1_MPIvetoOn = params.getParameter<bool>("EV1_MPIvetoOn");
292  EV1_QEDvetoMode = 0;
293  if (params.exists("EV1_QEDvetoMode"))
294  EV1_QEDvetoMode = params.getParameter<int>("EV1_QEDvetoMode");
295  EV1_nFinalMode = 0;
296  if (params.exists("EV1_nFinalMode"))
297  EV1_nFinalMode = params.getParameter<int>("EV1_nFinalMode");
299  EV1_vetoOn,
308  0));
309  }
310 
311  if (params.exists("VinciaPlugin")) {
312  throw edm::Exception(edm::errors::Configuration, "Pythia8Interface")
313  << " Obsolete parameter: VinciaPlugin \n Please use the parameter PartonShowers:model instead \n";
314  }
315  if (params.exists("DirePlugin")) {
316  throw edm::Exception(edm::errors::Configuration, "Pythia8Interface")
317  << " Obsolete parameter: DirePlugin \n Please use the parameter PartonShowers:model instead \n";
318  }
319 }
320 
322 
324  bool status = false, status1 = false;
325 
326  if (lheFile_.empty()) {
327  if (fInitialState == PP) // default
328  {
329  fMasterGen->settings.mode("Beams:idA", 2212);
330  fMasterGen->settings.mode("Beams:idB", 2212);
331  } else if (fInitialState == PPbar) {
332  fMasterGen->settings.mode("Beams:idA", 2212);
333  fMasterGen->settings.mode("Beams:idB", -2212);
334  } else if (fInitialState == ElectronPositron) {
335  fMasterGen->settings.mode("Beams:idA", 11);
336  fMasterGen->settings.mode("Beams:idB", -11);
337  } else {
338  // throw on unknown initial state !
339  throw edm::Exception(edm::errors::Configuration, "Pythia8Interface")
340  << " UNKNOWN INITIAL STATE. \n The allowed initial states are: PP, PPbar, ElectronPositron \n";
341  }
342  fMasterGen->settings.parm("Beams:eCM", comEnergy);
343  } else {
344  fMasterGen->settings.mode("Beams:frameType", 4);
345  fMasterGen->settings.word("Beams:LHEF", lheFile_);
346  }
347 
348  if (!fUserHooksVector.get())
349  fUserHooksVector.reset(new UserHooksVector);
350  (fUserHooksVector->hooks).clear();
351 
352  if (fReweightUserHook.get())
353  (fUserHooksVector->hooks).push_back(fReweightUserHook);
354  if (fReweightEmpUserHook.get())
355  (fUserHooksVector->hooks).push_back(fReweightEmpUserHook);
356  if (fReweightRapUserHook.get())
357  (fUserHooksVector->hooks).push_back(fReweightRapUserHook);
358  if (fReweightPtHatRapUserHook.get())
359  (fUserHooksVector->hooks).push_back(fReweightPtHatRapUserHook);
360  if (fJetMatchingHook.get())
361  (fUserHooksVector->hooks).push_back(fJetMatchingHook);
362  if (fEmissionVetoHook1.get()) {
363  edm::LogInfo("Pythia8Interface") << "Turning on Emission Veto Hook 1 from CMSSW Pythia8Interface";
364  (fUserHooksVector->hooks).push_back(fEmissionVetoHook1);
365  }
366 
367  if (fMasterGen->settings.mode("POWHEG:veto") > 0 || fMasterGen->settings.mode("POWHEG:MPIveto") > 0) {
368  if (fJetMatchingHook.get() || fEmissionVetoHook1.get())
369  throw edm::Exception(edm::errors::Configuration, "Pythia8Interface")
370  << " Attempt to turn on PowhegHooks by pythia8 settings but there are incompatible hooks on \n Incompatible "
371  "are : jetMatching, emissionVeto1 \n";
372 
373  if (!fEmissionVetoHook.get())
374  fEmissionVetoHook.reset(new PowhegHooks());
375 
376  edm::LogInfo("Pythia8Interface") << "Turning on Emission Veto Hook from pythia8 code";
377  (fUserHooksVector->hooks).push_back(fEmissionVetoHook);
378  }
379 
380  bool PowhegRes = fMasterGen->settings.flag("POWHEGres:calcScales");
381  if (PowhegRes) {
382  edm::LogInfo("Pythia8Interface") << "Turning on resonance scale setting from CMSSW Pythia8Interface";
383  if (!fPowhegResHook.get())
384  fPowhegResHook.reset(new PowhegResHook());
385  (fUserHooksVector->hooks).push_back(fPowhegResHook);
386  }
387 
388  bool PowhegBB4L = fMasterGen->settings.flag("POWHEG:bb4l");
389  if (PowhegBB4L) {
390  edm::LogInfo("Pythia8Interface") << "Turning on BB4l hook from CMSSW Pythia8Interface";
391  if (!fPowhegHooksBB4L.get())
392  fPowhegHooksBB4L.reset(new PowhegHooksBB4L());
393  (fUserHooksVector->hooks).push_back(fPowhegHooksBB4L);
394  }
395 
396  //adapted from main89.cc in pythia8 examples
397  bool internalMatching = fMasterGen->settings.flag("JetMatching:merge");
398  bool internalMerging = !(fMasterGen->settings.word("Merging:Process") == "void");
399 
400  if (internalMatching && internalMerging) {
401  throw edm::Exception(edm::errors::Configuration, "Pythia8Interface")
402  << " Only one jet matching/merging scheme can be used at a time. \n";
403  }
404 
405  if (internalMatching) {
406  if (!fJetMatchingPy8InternalHook.get())
407  fJetMatchingPy8InternalHook.reset(new Pythia8::JetMatchingMadgraph);
408  (fUserHooksVector->hooks).push_back(fJetMatchingPy8InternalHook);
409  }
410 
411  if (internalMerging) {
412  int scheme = (fMasterGen->settings.flag("Merging:doUMEPSTree") || fMasterGen->settings.flag("Merging:doUMEPSSubt"))
413  ? 1
414  : ((fMasterGen->settings.flag("Merging:doUNLOPSTree") ||
415  fMasterGen->settings.flag("Merging:doUNLOPSSubt") ||
416  fMasterGen->settings.flag("Merging:doUNLOPSLoop") ||
417  fMasterGen->settings.flag("Merging:doUNLOPSSubtNLO"))
418  ? 2
419  : 0);
420  if (!fMergingHook.get())
421  fMergingHook.reset(new Pythia8::amcnlo_unitarised_interface(scheme));
422  (fUserHooksVector->hooks).push_back(fMergingHook);
423  }
424 
425  bool biasedTauDecayer = fMasterGen->settings.flag("BiasedTauDecayer:filter");
426  if (biasedTauDecayer) {
427  if (!fBiasedTauDecayer.get()) {
428  Pythia8::Info localInfo = fMasterGen->info;
429  fBiasedTauDecayer.reset(new BiasedTauDecayer(&localInfo, &(fMasterGen->settings)));
430  }
431  std::vector<int> handledParticles;
432  handledParticles.push_back(15);
433  fMasterGen->setDecayPtr(fBiasedTauDecayer, handledParticles);
434  }
435 
436  bool resonanceDecayFilter = fMasterGen->settings.flag("ResonanceDecayFilter:filter");
437  if (resonanceDecayFilter) {
439  (fUserHooksVector->hooks).push_back(fResonanceDecayFilterHook);
440  }
441 
442  bool PTFilter = fMasterGen->settings.flag("PTFilter:filter");
443  if (PTFilter) {
444  fPTFilterHook.reset(new PTFilterHook);
445  (fUserHooksVector->hooks).push_back(fPTFilterHook);
446  }
447 
448  if (!(fUserHooksVector->hooks).empty() && !UserHooksSet) {
449  fMasterGen->setUserHooksPtr(fUserHooksVector);
450  UserHooksSet = true;
451  }
452 
453  edm::LogInfo("Pythia8Interface") << "Initializing MasterGen";
454  status = fMasterGen->init();
455 
456  //clean up temp file
457  if (!slhafile_.empty()) {
458  std::remove(slhafile_.c_str());
459  }
460 
461  if (pythiaPylistVerbosity > 10) {
462  if (pythiaPylistVerbosity == 11 || pythiaPylistVerbosity == 13)
463  fMasterGen->settings.listAll();
464  if (pythiaPylistVerbosity == 12 || pythiaPylistVerbosity == 13)
465  fMasterGen->particleData.listAll();
466  }
467 
468  // init decayer
469  fDecayer->settings.flag("ProcessLevel:all", false); // trick
470  fDecayer->settings.flag("ProcessLevel:resonanceDecays", true);
471  edm::LogInfo("Pythia8Interface") << "Initializing Decayer";
472  status1 = fDecayer->init();
473 
474  if (useEvtGen) {
475  edm::LogInfo("Pythia8Hadronizer") << "Creating and initializing pythia8 EvtGen plugin";
476  if (!evtgenDecays.get()) {
477  evtgenDecays.reset(new EvtGenDecays(fMasterGen.get(), evtgenDecFile, evtgenPdlFile));
478  for (unsigned int i = 0; i < evtgenUserFiles.size(); i++)
479  evtgenDecays->readDecayFile(evtgenUserFiles.at(i));
480  }
481  }
482 
483  return (status && status1);
484 }
485 
487  edm::LogInfo("Pythia8Interface") << "Initializing for external partons";
488 
489  bool status = false, status1 = false;
490 
491  if (!fUserHooksVector.get())
492  fUserHooksVector.reset(new UserHooksVector);
493  (fUserHooksVector->hooks).clear();
494 
495  if (fReweightUserHook.get())
496  (fUserHooksVector->hooks).push_back(fReweightUserHook);
497  if (fReweightEmpUserHook.get())
498  (fUserHooksVector->hooks).push_back(fReweightEmpUserHook);
499  if (fReweightRapUserHook.get())
500  (fUserHooksVector->hooks).push_back(fReweightRapUserHook);
501  if (fReweightPtHatRapUserHook.get())
502  (fUserHooksVector->hooks).push_back(fReweightPtHatRapUserHook);
503  if (fJetMatchingHook.get())
504  (fUserHooksVector->hooks).push_back(fJetMatchingHook);
505  if (fEmissionVetoHook1.get()) {
506  edm::LogInfo("Pythia8Interface") << "Turning on Emission Veto Hook 1 from CMSSW Pythia8Interface";
507  (fUserHooksVector->hooks).push_back(fEmissionVetoHook1);
508  }
509 
510  if (fMasterGen->settings.mode("POWHEG:veto") > 0 || fMasterGen->settings.mode("POWHEG:MPIveto") > 0) {
511  if (fJetMatchingHook.get() || fEmissionVetoHook1.get())
512  throw edm::Exception(edm::errors::Configuration, "Pythia8Interface")
513  << " Attempt to turn on PowhegHooks by pythia8 settings but there are incompatible hooks on \n Incompatible "
514  "are : jetMatching, emissionVeto1 \n";
515 
516  if (!fEmissionVetoHook.get())
517  fEmissionVetoHook.reset(new PowhegHooks());
518 
519  edm::LogInfo("Pythia8Interface") << "Turning on Emission Veto Hook from pythia8 code";
520  (fUserHooksVector->hooks).push_back(fEmissionVetoHook);
521  }
522 
523  bool PowhegRes = fMasterGen->settings.flag("POWHEGres:calcScales");
524  if (PowhegRes) {
525  edm::LogInfo("Pythia8Interface") << "Turning on resonance scale setting from CMSSW Pythia8Interface";
526  if (!fPowhegResHook.get())
527  fPowhegResHook.reset(new PowhegResHook());
528  (fUserHooksVector->hooks).push_back(fPowhegResHook);
529  }
530 
531  bool PowhegBB4L = fMasterGen->settings.flag("POWHEG:bb4l");
532  if (PowhegBB4L) {
533  edm::LogInfo("Pythia8Interface") << "Turning on BB4l hook from CMSSW Pythia8Interface";
534  if (!fPowhegHooksBB4L.get())
535  fPowhegHooksBB4L.reset(new PowhegHooksBB4L());
536  (fUserHooksVector->hooks).push_back(fPowhegHooksBB4L);
537  }
538 
539  //adapted from main89.cc in pythia8 examples
540  bool internalMatching = fMasterGen->settings.flag("JetMatching:merge");
541  bool internalMerging = !(fMasterGen->settings.word("Merging:Process") == "void");
542 
543  if (internalMatching && internalMerging) {
544  throw edm::Exception(edm::errors::Configuration, "Pythia8Interface")
545  << " Only one jet matching/merging scheme can be used at a time. \n";
546  }
547 
548  if (internalMatching) {
549  if (!fJetMatchingPy8InternalHook.get())
550  fJetMatchingPy8InternalHook.reset(new Pythia8::JetMatchingMadgraph);
551  (fUserHooksVector->hooks).push_back(fJetMatchingPy8InternalHook);
552  }
553 
554  if (internalMerging) {
555  int scheme = (fMasterGen->settings.flag("Merging:doUMEPSTree") || fMasterGen->settings.flag("Merging:doUMEPSSubt"))
556  ? 1
557  : ((fMasterGen->settings.flag("Merging:doUNLOPSTree") ||
558  fMasterGen->settings.flag("Merging:doUNLOPSSubt") ||
559  fMasterGen->settings.flag("Merging:doUNLOPSLoop") ||
560  fMasterGen->settings.flag("Merging:doUNLOPSSubtNLO"))
561  ? 2
562  : 0);
563  if (!fMergingHook.get())
564  fMergingHook.reset(new Pythia8::amcnlo_unitarised_interface(scheme));
565  (fUserHooksVector->hooks).push_back(fMergingHook);
566  }
567 
568  bool biasedTauDecayer = fMasterGen->settings.flag("BiasedTauDecayer:filter");
569  if (biasedTauDecayer) {
570  if (!fBiasedTauDecayer.get()) {
571  Pythia8::Info localInfo = fMasterGen->info;
572  fBiasedTauDecayer.reset(new BiasedTauDecayer(&localInfo, &(fMasterGen->settings)));
573  }
574  std::vector<int> handledParticles;
575  handledParticles.push_back(15);
576  fMasterGen->setDecayPtr(fBiasedTauDecayer, handledParticles);
577  }
578 
579  bool resonanceDecayFilter = fMasterGen->settings.flag("ResonanceDecayFilter:filter");
580  if (resonanceDecayFilter) {
582  (fUserHooksVector->hooks).push_back(fResonanceDecayFilterHook);
583  }
584 
585  bool PTFilter = fMasterGen->settings.flag("PTFilter:filter");
586  if (PTFilter) {
587  fPTFilterHook.reset(new PTFilterHook);
588  (fUserHooksVector->hooks).push_back(fPTFilterHook);
589  }
590 
591  if (!(fUserHooksVector->hooks).empty() && !UserHooksSet) {
592  fMasterGen->setUserHooksPtr(fUserHooksVector);
593  UserHooksSet = true;
594  }
595 
596  if (!LHEInputFileName.empty()) {
597  edm::LogInfo("Pythia8Interface") << "Initialize direct pythia8 reading from LHE file " << LHEInputFileName;
598  edm::LogInfo("Pythia8Interface") << "Some LHE information can be not stored";
599  fMasterGen->settings.mode("Beams:frameType", 4);
600  fMasterGen->settings.word("Beams:LHEF", LHEInputFileName);
601  status = fMasterGen->init();
602 
603  } else {
604  lhaUP.reset(new LHAupLesHouches());
605  lhaUP->setScalesFromLHEF(fMasterGen->settings.flag("Beams:setProductionScalesFromLHEF"));
606  lhaUP->loadRunInfo(lheRunInfo());
607 
608  if (fJetMatchingHook.get()) {
609  fJetMatchingHook->init(lheRunInfo());
610  }
611 
612  fMasterGen->settings.mode("Beams:frameType", 5);
613  fMasterGen->setLHAupPtr(lhaUP);
614  edm::LogInfo("Pythia8Interface") << "Initializing MasterGen";
615  status = fMasterGen->init();
616  }
617 
618  //clean up temp file
619  if (!slhafile_.empty()) {
620  std::remove(slhafile_.c_str());
621  }
622 
623  if (pythiaPylistVerbosity > 10) {
624  if (pythiaPylistVerbosity == 11 || pythiaPylistVerbosity == 13)
625  fMasterGen->settings.listAll();
626  if (pythiaPylistVerbosity == 12 || pythiaPylistVerbosity == 13)
627  fMasterGen->particleData.listAll();
628  }
629 
630  // init decayer
631  fDecayer->settings.flag("ProcessLevel:all", false); // trick
632  fDecayer->settings.flag("ProcessLevel:resonanceDecays", true);
633  edm::LogInfo("Pythia8Interface") << "Initializing Decayer";
634  status1 = fDecayer->init();
635 
636  if (useEvtGen) {
637  edm::LogInfo("Pythia8Hadronizer") << "Creating and initializing pythia8 EvtGen plugin";
638  if (!evtgenDecays.get()) {
639  evtgenDecays.reset(new EvtGenDecays(fMasterGen.get(), evtgenDecFile, evtgenPdlFile));
640  for (unsigned int i = 0; i < evtgenUserFiles.size(); i++)
641  evtgenDecays->readDecayFile(evtgenUserFiles.at(i));
642  }
643  }
644 
645  return (status && status1);
646 }
647 
649  fMasterGen->stat();
650 
651  if (fEmissionVetoHook.get()) {
652  edm::LogPrint("Pythia8Interface") << "\n"
653  << "Number of ISR vetoed = " << nISRveto;
654  edm::LogPrint("Pythia8Interface") << "Number of FSR vetoed = " << nFSRveto;
655  }
656 
657  double xsec = fMasterGen->info.sigmaGen(); // cross section in mb
658  xsec *= 1.0e9; // translate to pb (CMS/Gen "convention" as of May 2009)
659  double err = fMasterGen->info.sigmaErr(); // cross section err in mb
660  err *= 1.0e9; // translate to pb (CMS/Gen "convention" as of May 2009)
662 }
663 
665  DJR.resize(0);
666  nME = -1;
667  nMEFiltered = -1;
668 
669  if (fJetMatchingHook.get()) {
670  fJetMatchingHook->resetMatchingStatus();
671  fJetMatchingHook->beforeHadronization(lheEvent());
672  }
673 
674  if (!fMasterGen->next())
675  return false;
676 
677  double mergeweight = fMasterGen.get()->info.mergingWeightNLO();
678  if (fMergingHook.get()) {
679  mergeweight *= fMergingHook->getNormFactor();
680  }
681 
682  //protect against 0-weight from ckkw or similar
683  if (std::abs(mergeweight) == 0.) {
684  event().reset();
685  return false;
686  }
687 
688  if (fJetMatchingPy8InternalHook.get()) {
689  const std::vector<double> djrmatch = fJetMatchingPy8InternalHook->getDJR();
690  //cap size of djr vector to save storage space (keep only up to first 6 elements)
691  unsigned int ndjr = std::min(djrmatch.size(), std::vector<double>::size_type(6));
692  for (unsigned int idjr = 0; idjr < ndjr; ++idjr) {
693  DJR.push_back(djrmatch[idjr]);
694  }
695 
696  nME = fJetMatchingPy8InternalHook->nMEpartons().first;
697  nMEFiltered = fJetMatchingPy8InternalHook->nMEpartons().second;
698  }
699 
700  if (evtgenDecays.get())
701  evtgenDecays->decay();
702 
703  event() = std::make_unique<HepMC::GenEvent>();
704  bool py8hepmc = toHepMC.fill_next_event(*(fMasterGen.get()), event().get());
705 
706  if (!py8hepmc) {
707  return false;
708  }
709 
710  //add ckkw/umeps/unlops merging weight
711  if (mergeweight != 1.) {
712  event()->weights()[0] *= mergeweight;
713  }
714 
715  if (fEmissionVetoHook.get()) {
716  nISRveto += fEmissionVetoHook->getNISRveto();
717  nFSRveto += fEmissionVetoHook->getNFSRveto();
718  }
719 
720  //fill additional weights for systematic uncertainties
721  if (fMasterGen->info.getWeightsDetailedSize() > 0) {
722  for (const string &key : fMasterGen->info.initrwgt->weightsKeys) {
723  double wgt = (*fMasterGen->info.weights_detailed)[key];
724  event()->weights().push_back(wgt);
725  }
726  } else if (fMasterGen->info.getWeightsCompressedSize() > 0) {
727  for (unsigned int i = 0; i < fMasterGen->info.getWeightsCompressedSize(); i++) {
728  double wgt = fMasterGen->info.getWeightsCompressedValue(i);
729  event()->weights().push_back(wgt);
730  }
731  }
732 
733  // fill shower weights
734  // http://home.thep.lu.se/~torbjorn/pythia82html/Variations.html
735  if (fMasterGen->info.nWeights() > 1) {
736  for (int i = 0; i < fMasterGen->info.nWeights(); ++i) {
737  double wgt = fMasterGen->info.weight(i);
738  event()->weights().push_back(wgt);
739  }
740  }
741 
742 #if 0
743  // VINCIA shower weights
744  // http://vincia.hepforge.org/current/share/Vincia/htmldoc/VinciaUncertainties.html
745  if (fvincia.get()) {
746  event()->weights()[0] *= fvincia->weight(0);
747  for (int iVar = 1; iVar < fvincia->nWeights(); iVar++) {
748  event()->weights().push_back(fvincia->weight(iVar));
749  }
750  }
751 
752  // Retrieve Dire shower weights
753  if (fDire.get()) {
754  fDire->weightsPtr->calcWeight(0.);
755  fDire->weightsPtr->reset();
756 
757  //Make sure the base weight comes first
758  event()->weights()[0] *= fDire->weightsPtr->getShowerWeight("base");
759 
760  unordered_map<string, double>::iterator it;
761  for (it = fDire->weightsPtr->getShowerWeights()->begin(); it != fDire->weightsPtr->getShowerWeights()->end();
762  it++) {
763  if (it->first == "base")
764  continue;
765  event()->weights().push_back(it->second);
766  }
767  }
768 #endif
769 
770  return true;
771 }
772 
774  DJR.resize(0);
775  nME = -1;
776  nMEFiltered = -1;
777  if (LHEInputFileName.empty())
778  lhaUP->loadEvent(lheEvent());
779 
780  if (fJetMatchingHook.get()) {
781  fJetMatchingHook->resetMatchingStatus();
782  fJetMatchingHook->beforeHadronization(lheEvent());
783  }
784 
785  bool py8next = fMasterGen->next();
786 
787  double mergeweight = fMasterGen.get()->info.mergingWeightNLO();
788  if (fMergingHook.get()) {
789  mergeweight *= fMergingHook->getNormFactor();
790  }
791 
792  //protect against 0-weight from ckkw or similar
793  if (!py8next || std::abs(mergeweight) == 0.) {
794  lheEvent()->count(lhef::LHERunInfo::kSelected, 1.0, mergeweight);
795  event().reset();
796  return false;
797  }
798 
799  if (fJetMatchingPy8InternalHook.get()) {
800  const std::vector<double> djrmatch = fJetMatchingPy8InternalHook->getDJR();
801  //cap size of djr vector to save storage space (keep only up to first 6 elements)
802  unsigned int ndjr = std::min(djrmatch.size(), std::vector<double>::size_type(6));
803  for (unsigned int idjr = 0; idjr < ndjr; ++idjr) {
804  DJR.push_back(djrmatch[idjr]);
805  }
806 
807  nME = fJetMatchingPy8InternalHook->nMEpartons().first;
808  nMEFiltered = fJetMatchingPy8InternalHook->nMEpartons().second;
809  }
810 
811  // update LHE matching statistics
812  //
813  lheEvent()->count(lhef::LHERunInfo::kAccepted, 1.0, mergeweight);
814 
815  if (evtgenDecays.get())
816  evtgenDecays->decay();
817 
818  event() = std::make_unique<HepMC::GenEvent>();
819  bool py8hepmc = toHepMC.fill_next_event(*(fMasterGen.get()), event().get());
820  if (!py8hepmc) {
821  return false;
822  }
823 
824  //add ckkw/umeps/unlops merging weight
825  if (mergeweight != 1.) {
826  event()->weights()[0] *= mergeweight;
827  }
828 
829  if (fEmissionVetoHook.get()) {
830  nISRveto += fEmissionVetoHook->getNISRveto();
831  nFSRveto += fEmissionVetoHook->getNFSRveto();
832  }
833 
834  // fill shower weights
835  // http://home.thep.lu.se/~torbjorn/pythia82html/Variations.html
836  if (fMasterGen->info.nWeights() > 1) {
837  for (int i = 0; i < fMasterGen->info.nWeights(); ++i) {
838  double wgt = fMasterGen->info.weight(i);
839  event()->weights().push_back(wgt);
840  }
841  }
842 
843  return true;
844 }
845 
847  Event *pythiaEvent = &(fMasterGen->event);
848 
849  int NPartsBeforeDecays = pythiaEvent->size();
850  int NPartsAfterDecays = event().get()->particles_size();
851 
852  if (NPartsAfterDecays == NPartsBeforeDecays)
853  return true;
854 
855  bool result = true;
856 
857  for (int ipart = NPartsAfterDecays; ipart > NPartsBeforeDecays; ipart--) {
858  HepMC::GenParticle *part = event().get()->barcode_to_particle(ipart);
859 
860  if (part->status() == 1 && (fDecayer->particleData).canDecay(part->pdg_id())) {
861  fDecayer->event.reset();
862  Particle py8part(part->pdg_id(),
863  93,
864  0,
865  0,
866  0,
867  0,
868  0,
869  0,
870  part->momentum().x(),
871  part->momentum().y(),
872  part->momentum().z(),
873  part->momentum().t(),
874  part->generated_mass());
875  HepMC::GenVertex *ProdVtx = part->production_vertex();
876  py8part.vProd(ProdVtx->position().x(), ProdVtx->position().y(), ProdVtx->position().z(), ProdVtx->position().t());
877  py8part.tau((fDecayer->particleData).tau0(part->pdg_id()));
878  fDecayer->event.append(py8part);
879  int nentries = fDecayer->event.size();
880  if (!fDecayer->event[nentries - 1].mayDecay())
881  continue;
882  fDecayer->next();
883  int nentries1 = fDecayer->event.size();
884  if (nentries1 <= nentries)
885  continue; //same number of particles, no decays...
886 
887  part->set_status(2);
888 
889  result = toHepMC.fill_next_event(*(fDecayer.get()), event().get(), -1, true, part);
890  }
891  }
892 
893  return result;
894 }
895 
897  bool lhe = lheEvent() != nullptr;
898 
899  // protection against empty weight container
900  if ((event()->weights()).empty())
901  (event()->weights()).push_back(1.);
902 
903  // now create the GenEventInfo product from the GenEvent and fill
904  // the missing pieces
905  eventInfo() = std::make_unique<GenEventInfoProduct>(event().get());
906 
907  // in pythia pthat is used to subdivide samples into different bins
908  // in LHE mode the binning is done by the external ME generator
909  // which is likely not pthat, so only filling it for Py6 internal mode
910  if (!lhe) {
911  eventInfo()->setBinningValues(std::vector<double>(1, fMasterGen->info.pTHat()));
912  }
913 
914  eventInfo()->setDJR(DJR);
915  eventInfo()->setNMEPartons(nME);
916  eventInfo()->setNMEPartonsFiltered(nMEFiltered);
917 
918  //******** Verbosity ********
919 
922  if (pythiaPylistVerbosity) {
923  fMasterGen->info.list();
924  fMasterGen->event.list();
925  }
926 
927  if (pythiaHepMCVerbosity) {
928  std::cout << "Event process = " << fMasterGen->info.code() << "\n"
929  << "----------------------" << std::endl;
930  event()->print();
931  }
933  std::cout << "Event process = " << fMasterGen->info.code() << "\n"
934  << "----------------------" << std::endl;
935  ascii_io->write_event(event().get());
936  }
937  }
938 }
939 
940 std::unique_ptr<GenLumiInfoHeader> Pythia8Hadronizer::getGenLumiInfoHeader() const {
941  auto genLumiInfoHeader = BaseHadronizer::getGenLumiInfoHeader();
942 
943  //fill lhe headers
944  //*FIXME* initrwgt header is corrupt due to pythia bug
945  for (const std::string &key : fMasterGen->info.headerKeys()) {
946  genLumiInfoHeader->lheHeaders().emplace_back(key, fMasterGen->info.header(key));
947  }
948 
949  //check, if it is not only nominal weight
950  int weights_number = fMasterGen->info.nWeights();
951  if (fMasterGen->info.initrwgt)
952  weights_number += fMasterGen->info.initrwgt->weightsKeys.size();
953  if (weights_number > 1) {
954  genLumiInfoHeader->weightNames().reserve(weights_number + 1);
955  genLumiInfoHeader->weightNames().push_back("nominal");
956  }
957 
958  //fill weight names
959  if (fMasterGen->info.initrwgt) {
960  for (const std::string &key : fMasterGen->info.initrwgt->weightsKeys) {
961  std::string weightgroupname;
962  for (const auto &wgtgrp : fMasterGen->info.initrwgt->weightgroups) {
963  const auto &wgtgrpwgt = wgtgrp.second.weights.find(key);
964  if (wgtgrpwgt != wgtgrp.second.weights.end()) {
965  weightgroupname = wgtgrp.first;
966  }
967  }
968 
969  std::ostringstream weightname;
970  weightname << "LHE, id = " << key << ", ";
971  if (!weightgroupname.empty()) {
972  weightname << "group = " << weightgroupname << ", ";
973  }
974  weightname << fMasterGen->info.initrwgt->weights[key].contents;
975  genLumiInfoHeader->weightNames().push_back(weightname.str());
976  }
977  }
978 
979  //fill shower labels
980  // http://home.thep.lu.se/~torbjorn/pythia82html/Variations.html
981  // http://home.thep.lu.se/~torbjorn/doxygen/classPythia8_1_1Info.html
982  if (fMasterGen->info.nWeights() > 1) {
983  for (int i = 0; i < fMasterGen->info.nWeights(); ++i) {
984  genLumiInfoHeader->weightNames().push_back(fMasterGen->info.weightLabel(i));
985  }
986  }
987 
988 #if 0
989  // VINCIA shower weights
990  // http://vincia.hepforge.org/current/share/Vincia/htmldoc/VinciaUncertainties.html
991  if (fvincia.get()) {
992  for (int iVar = 0; iVar < fvincia->nWeights(); iVar++) {
993  genLumiInfoHeader->weightNames().push_back(fvincia->weightLabel(iVar));
994  }
995  }
996 
997  if (fDire.get()) {
998  //Make sure the base weight comes first
999  genLumiInfoHeader->weightNames().push_back("base");
1000 
1001  unordered_map<string, double>::iterator it;
1002  for (it = fDire->weightsPtr->getShowerWeights()->begin(); it != fDire->weightsPtr->getShowerWeights()->end();
1003  it++) {
1004  if (it->first == "base")
1005  continue;
1006  genLumiInfoHeader->weightNames().push_back(it->first);
1007  }
1008  }
1009 #endif
1010 
1011  return genLumiInfoHeader;
1012 }
1013 
1016 
1019 
lhef::LHERunInfo::kAccepted
Definition: LHERunInfo.h:64
gen::Py8InterfaceBase::fMasterGen
std::unique_ptr< Pythia8::Pythia > fMasterGen
Definition: Py8InterfaceBase.h:47
genWeightsTable_cfi.genLumiInfoHeader
genLumiInfoHeader
Definition: genWeightsTable_cfi.py:5
Pythia8Hadronizer::~Pythia8Hadronizer
~Pythia8Hadronizer() override
Definition: Pythia8Hadronizer.cc:321
Pythia8Hadronizer::fUserHooksVector
std::shared_ptr< UserHooksVector > fUserHooksVector
Definition: Pythia8Hadronizer.cc:114
gen::BaseHadronizer::lheRunInfo
lhef::LHERunInfo * lheRunInfo()
Definition: BaseHadronizer.h:90
gen::Py8InterfaceBase::evtgenDecays
std::shared_ptr< Pythia8::EvtGenDecays > evtgenDecays
Definition: Py8InterfaceBase.h:62
gen::BaseHadronizer::lheEvent
lhef::LHEEvent * lheEvent()
Definition: BaseHadronizer.h:89
Pythia8Hadronizer::comEnergy
double comEnergy
Center-of-Mass energy.
Definition: Pythia8Hadronizer.cc:102
mps_fire.i
i
Definition: mps_fire.py:428
MessageLogger.h
funct::false
false
Definition: Factorize.h:29
LHAupLesHouches.h
gen::Py8InterfaceBase::ascii_io
HepMC::IO_AsciiParticles * ascii_io
Definition: Py8InterfaceBase.h:57
PowhegHooksBB4L.h
ResonanceDecayFilterHook
Definition: ResonanceDecayFilterHook.h:5
mps_update.status
status
Definition: mps_update.py:69
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
min
T min(T a, T b)
Definition: MathUtil.h:58
JetMatchingHook.h
RandomNumberGenerator.h
Pythia8Hadronizer::fBeam1PZ
double fBeam1PZ
Definition: Pythia8Hadronizer.cc:110
ExternalDecayDriver.h
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::LogPrint
Log< level::Warning, true > LogPrint
Definition: MessageLogger.h:130
Pythia8ConcurrentHadronizerFilter
edm::ConcurrentHadronizerFilter< Pythia8Hadronizer, ConcurrentExternalDecayDriver > Pythia8ConcurrentHadronizerFilter
Definition: Pythia8Hadronizer.cc:1021
Pythia8GeneratorFilter
edm::GeneratorFilter< Pythia8Hadronizer, ExternalDecayDriver > Pythia8GeneratorFilter
Definition: Pythia8Hadronizer.cc:1014
Pythia8Hadronizer::doSharedResources
const std::vector< std::string > & doSharedResources() const override
Definition: Pythia8Hadronizer.cc:99
Pythia8Hadronizer::fReweightUserHook
std::shared_ptr< UserHooks > fReweightUserHook
Definition: Pythia8Hadronizer.cc:119
Pythia8Hadronizer::fBeam2PZ
double fBeam2PZ
Definition: Pythia8Hadronizer.cc:111
Pythia8Hadronizer::classname
const char * classname() const override
Definition: Pythia8Hadronizer.cc:93
Pythia8Hadronizer::nISRveto
int nISRveto
Definition: Pythia8Hadronizer.cc:165
EmissionVetoHook1
Definition: EmissionVetoHook1.h:3
Pythia8Hadronizer::doSetRandomEngine
void doSetRandomEngine(CLHEP::HepRandomEngine *v) override
Definition: Pythia8Hadronizer.cc:98
ResonanceDecayFilterHook.h
Pythia8Hadronizer::EV1_pThardMode
int EV1_pThardMode
Definition: Pythia8Hadronizer.cc:151
Pythia8Hadronizer::fReweightPtHatRapUserHook
std::shared_ptr< UserHooks > fReweightPtHatRapUserHook
Definition: Pythia8Hadronizer.cc:122
GenRunInfoProduct::setInternalXSec
void setInternalXSec(const XSec &xsec)
Definition: GenRunInfoProduct.h:26
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
findQualityFiles.v
v
Definition: findQualityFiles.py:179
ConcurrentHadronizerFilter.h
Pythia8Hadronizer::EV1_pTempMode
int EV1_pTempMode
Definition: Pythia8Hadronizer.cc:152
GenRunInfoProduct.h
Pythia8Hadronizer::UserHooksSet
bool UserHooksSet
Definition: Pythia8Hadronizer.cc:115
Pythia8Hadronizer::fPowhegHooksBB4L
std::shared_ptr< PowhegHooksBB4L > fPowhegHooksBB4L
Definition: Pythia8Hadronizer.cc:137
Pythia8Hadronizer::DJR
vector< float > DJR
Definition: Pythia8Hadronizer.cc:161
edm::LogImportant
Log< level::Error, true > LogImportant
Definition: MessageLogger.h:133
FileInPath.h
Pythia8Hadronizer::fMergingHook
std::shared_ptr< Pythia8::amcnlo_unitarised_interface > fMergingHook
Definition: Pythia8Hadronizer.cc:128
edm::Exception
Definition: EDMException.h:77
Pythia8Hadronizer::EV1_pTdefMode
int EV1_pTdefMode
Definition: Pythia8Hadronizer.cc:154
edm::SharedResourceNames::kPythia8
static const std::string kPythia8
Definition: SharedResourceNames.h:27
lhef::LHERunInfo::kSelected
Definition: LHERunInfo.h:64
part
part
Definition: HCALResponse.h:20
Pythia8
Definition: PythiaDecays.h:21
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::GeneratorFilter
Definition: GeneratorFilter.h:40
Service.h
HLT_FULL_cff.weights
weights
Definition: HLT_FULL_cff.py:99244
Pythia8Hadronizer::nME
int nME
Definition: Pythia8Hadronizer.cc:162
gen::Py8InterfaceBase::useEvtGen
bool useEvtGen
Definition: Py8InterfaceBase.h:61
PtHatEmpReweightUserHook
Definition: ReweightUserHooks.h:27
Pythia8Hadronizer::residualDecay
virtual bool residualDecay()
Definition: Pythia8Hadronizer.cc:846
gen::Py8InterfaceBase::pythiaHepMCVerbosityParticles
bool pythiaHepMCVerbosityParticles
Definition: Py8InterfaceBase.h:55
Pythia8Hadronizer::fReweightEmpUserHook
std::shared_ptr< UserHooks > fReweightEmpUserHook
Definition: Pythia8Hadronizer.cc:120
PTFilterHook.h
gen::BaseHadronizer::eventInfo
std::unique_ptr< GenEventInfoProduct > & eventInfo()
Definition: BaseHadronizer.h:87
Pythia8Hadronizer::fEmissionVetoHook
std::shared_ptr< PowhegHooks > fEmissionVetoHook
Definition: Pythia8Hadronizer.cc:132
Pythia8Hadronizer::finalizeEvent
void finalizeEvent() override
Definition: Pythia8Hadronizer.cc:896
gen::BaseHadronizer::lheFile_
std::string lheFile_
Definition: BaseHadronizer.h:92
Pythia8Hadronizer::PPbar
Definition: Pythia8Hadronizer.cc:107
Pythia8::PowhegHooksBB4L
Definition: PowhegHooksBB4L.h:18
SharedResourceNames.h
gen
Definition: PythiaDecays.h:13
Pythia8Hadronizer::EV1_MPIvetoOn
bool EV1_MPIvetoOn
Definition: Pythia8Hadronizer.cc:155
Pythia8Hadronizer::fPTFilterHook
std::shared_ptr< PTFilterHook > fPTFilterHook
Definition: Pythia8Hadronizer.cc:146
gen::Py8InterfaceBase::evtgenUserFiles
std::vector< std::string > evtgenUserFiles
Definition: Py8InterfaceBase.h:65
gen::Py8InterfaceBase::pythiaPylistVerbosity
unsigned int pythiaPylistVerbosity
Definition: Py8InterfaceBase.h:53
CLHEP
Definition: CocoaGlobals.h:27
generator_cfi.comEnergy
comEnergy
Definition: generator_cfi.py:9
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Pythia8Hadronizer::getGenLumiInfoHeader
std::unique_ptr< GenLumiInfoHeader > getGenLumiInfoHeader() const override
Definition: Pythia8Hadronizer.cc:940
Pythia8Hadronizer::ElectronPositron
Definition: Pythia8Hadronizer.cc:107
edm::ParameterSet::exists
bool exists(std::string const &parameterName) const
checks if a parameter exists
Definition: ParameterSet.cc:681
Pythia8Hadronizer::fPowhegResHook
std::shared_ptr< PowhegResHook > fPowhegResHook
Definition: Pythia8Hadronizer.cc:136
Pythia8Hadronizer::initializeForInternalPartons
bool initializeForInternalPartons() override
Definition: Pythia8Hadronizer.cc:323
edm::ParameterSet
Definition: ParameterSet.h:47
clear
void clear(HadCaloObj &c)
Definition: data.h:124
gen::Py8InterfaceBase::evtgenPdlFile
std::string evtgenPdlFile
Definition: Py8InterfaceBase.h:64
GenRunInfoProduct::XSec
Definition: GenRunInfoProduct.h:32
Pythia8Hadronizer::fJetMatchingHook
std::shared_ptr< JetMatchingHook > fJetMatchingHook
Definition: Pythia8Hadronizer.cc:126
PtHatRapReweightUserHook
Definition: ReweightUserHooks.h:116
gen::Py8InterfaceBase::maxEventsToPrint
unsigned int maxEventsToPrint
Definition: Py8InterfaceBase.h:56
LHAupLesHouches
Definition: LHAupLesHouches.h:20
EmissionVetoHook1.h
Pythia8Hadronizer::p8SharedResources
static const std::vector< std::string > p8SharedResources
Definition: Pythia8Hadronizer.cc:159
GeneratorFilter.h
Pythia8Hadronizer::EV1_maxVetoCount
int EV1_maxVetoCount
Definition: Pythia8Hadronizer.cc:150
Pythia8Hadronizer::PP
Definition: Pythia8Hadronizer.cc:107
BiasedTauDecayer
Definition: BiasedTauDecayer.h:9
ConcurrentExternalDecayDriver.h
Pythia8Hadronizer::fBiasedTauDecayer
std::shared_ptr< BiasedTauDecayer > fBiasedTauDecayer
Definition: Pythia8Hadronizer.cc:140
PowhegResHook.h
Pythia8Hadronizer::initializeForExternalPartons
bool initializeForExternalPartons()
Definition: Pythia8Hadronizer.cc:486
submitPVResolutionJobs.err
err
Definition: submitPVResolutionJobs.py:85
ReweightUserHooks.h
RapReweightUserHook
Definition: ReweightUserHooks.h:67
Pythia8Hadronizer::EV1_QEDvetoMode
int EV1_QEDvetoMode
Definition: Pythia8Hadronizer.cc:156
get
#define get
BiasedTauDecayer.h
Pythia8Hadronizer::statistics
void statistics() override
Definition: Pythia8Hadronizer.cc:648
generator_cfi.scheme
scheme
Definition: generator_cfi.py:22
Pythia8Hadronizer::EV1_vetoOn
bool EV1_vetoOn
Definition: Pythia8Hadronizer.cc:149
Pythia8Hadronizer::LHEInputFileName
std::string LHEInputFileName
Definition: Pythia8Hadronizer.cc:104
JetMatchingHook
Definition: JetMatchingHook.h:18
HadronizerFilter.h
PowhegResHook
Definition: PowhegResHook.h:6
Pythia8Hadronizer::EV1_nFinalMode
int EV1_nFinalMode
Definition: Pythia8Hadronizer.cc:157
Py8InterfaceBase.h
GenParticle.GenParticle
GenParticle
Definition: GenParticle.py:18
std
Definition: JetResolutionObject.h:76
gen::BaseHadronizer::event
std::unique_ptr< HepMC::GenEvent > & event()
Definition: BaseHadronizer.h:86
gen::Py8InterfaceBase::pythiaHepMCVerbosity
bool pythiaHepMCVerbosity
Definition: Py8InterfaceBase.h:54
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
Exception
Definition: hltDiff.cc:246
gen::Py8InterfaceBase::toHepMC
HepMC::Pythia8ToHepMC toHepMC
Definition: Py8InterfaceBase.h:49
Pythia8Hadronizer::lhaUP
std::shared_ptr< LHAupLesHouches > lhaUP
Definition: Pythia8Hadronizer.cc:105
edm::ConcurrentHadronizerFilter
Definition: ConcurrentHadronizerFilter.h:79
MatrixUtil.remove
def remove(d, key, TELL=False)
Definition: MatrixUtil.py:219
Pythia8Hadronizer::Pythia8Hadronizer
Pythia8Hadronizer(const edm::ParameterSet &params)
Definition: Pythia8Hadronizer.cc:171
Pythia8Hadronizer
Definition: Pythia8Hadronizer.cc:76
edm::HadronizerFilter
Definition: HadronizerFilter.h:53
Particle
Definition: Particle.py:1
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
Pythia8Hadronizer::nFSRveto
int nFSRveto
Definition: Pythia8Hadronizer.cc:166
Pythia8Hadronizer::EV1_emittedMode
int EV1_emittedMode
Definition: Pythia8Hadronizer.cc:153
PtHatReweightUserHook
Definition: ReweightUserHooks.h:4
Pythia8Hadronizer::fInitialState
int fInitialState
Definition: Pythia8Hadronizer.cc:108
lhef::LHEEvent::count
void count(LHERunInfo::CountMode count, double weight=1.0, double matchWeight=1.0)
Definition: LHEEvent.cc:184
Pythia8Hadronizer::nMEFiltered
int nMEFiltered
Definition: Pythia8Hadronizer.cc:163
mps_fire.result
result
Definition: mps_fire.py:311
myMessageLogger_cff.statistics
statistics
Definition: myMessageLogger_cff.py:9
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Pythia8HadronizerFilter
edm::HadronizerFilter< Pythia8Hadronizer, ExternalDecayDriver > Pythia8HadronizerFilter
Definition: Pythia8Hadronizer.cc:1017
HepMCProduct.h
Pythia8Hadronizer::fResonanceDecayFilterHook
std::shared_ptr< ResonanceDecayFilterHook > fResonanceDecayFilterHook
Definition: Pythia8Hadronizer.cc:143
PTFilterHook
Definition: PTFilterHook.h:4
Pythia8Hadronizer::hadronize
bool hadronize()
Definition: Pythia8Hadronizer.cc:773
Pythia8Hadronizer::fEmissionVetoHook1
std::shared_ptr< EmissionVetoHook1 > fEmissionVetoHook1
Definition: Pythia8Hadronizer.cc:133
crabWrapper.key
key
Definition: crabWrapper.py:19
gen::BaseHadronizer::runInfo
GenRunInfoProduct & runInfo()
Definition: BaseHadronizer.h:85
gen::Py8InterfaceBase
Definition: Py8InterfaceBase.h:27
Pythia8Hadronizer::fJetMatchingPy8InternalHook
std::shared_ptr< Pythia8::JetMatchingMadgraph > fJetMatchingPy8InternalHook
Definition: Pythia8Hadronizer.cc:127
edm::errors::Configuration
Definition: EDMException.h:36
Pythia8Hadronizer::fReweightRapUserHook
std::shared_ptr< UserHooks > fReweightRapUserHook
Definition: Pythia8Hadronizer.cc:121
gen::Py8InterfaceBase::fDecayer
std::unique_ptr< Pythia8::Pythia > fDecayer
Definition: Py8InterfaceBase.h:48
Pythia8Hadronizer::generatePartonsAndHadronize
bool generatePartonsAndHadronize() override
Definition: Pythia8Hadronizer.cc:664
gen::Py8InterfaceBase::evtgenDecFile
std::string evtgenDecFile
Definition: Py8InterfaceBase.h:63
gen::Py8InterfaceBase::slhafile_
std::string slhafile_
Definition: Py8InterfaceBase.h:67
Pythia8Hadronizer::EV1_nFinal
int EV1_nFinal
Definition: Pythia8Hadronizer.cc:148