CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes
Pythia8Hadronizer Class Reference
Inheritance diagram for Pythia8Hadronizer:
gen::BaseHadronizer gen::Py8InterfaceBase

Public Member Functions

const char * classname () const override
 
void finalizeEvent () override
 
bool generatePartonsAndHadronize () override
 
bool hadronize ()
 
bool initializeForExternalPartons ()
 
bool initializeForInternalPartons () override
 
 Pythia8Hadronizer (const edm::ParameterSet &params)
 
virtual bool residualDecay ()
 
void statistics () override
 
 ~Pythia8Hadronizer ()
 
- Public Member Functions inherited from gen::BaseHadronizer
 BaseHadronizer (edm::ParameterSet const &ps)
 
edm::EventgetEDMEvent () const
 
HepMC::GenEvent * getGenEvent ()
 
GenEventInfoProductgetGenEventInfo ()
 
GenRunInfoProductgetGenRunInfo ()
 
const boost::shared_ptr
< lhef::LHERunInfo > & 
getLHERunInfo () const
 
void resetEvent (HepMC::GenEvent *event)
 
void resetEventInfo (GenEventInfoProduct *eventInfo)
 
virtual bool select (HepMC::GenEvent *) const
 
void setEDMEvent (edm::Event &event)
 
void setLHEEvent (lhef::LHEEvent *event)
 
void setLHERunInfo (lhef::LHERunInfo *runInfo)
 
void setRandomEngine (CLHEP::HepRandomEngine *v)
 
std::vector< std::string > const & sharedResources () const
 
 ~BaseHadronizer ()
 
- Public Member Functions inherited from gen::Py8InterfaceBase
bool decay ()
 
bool declareSpecialSettings (const std::vector< std::string > &)
 
bool declareStableParticles (const std::vector< int > &)
 
void p8SetRandomEngine (CLHEP::HepRandomEngine *v)
 
 Py8InterfaceBase (edm::ParameterSet const &ps)
 
P8RndmEnginerandomEngine ()
 
bool readSettings (int)
 
 ~Py8InterfaceBase ()
 

Private Types

enum  { PP, PPbar, ElectronPositron }
 

Private Member Functions

virtual void doSetRandomEngine (CLHEP::HepRandomEngine *v) override
 
virtual std::vector
< std::string > const & 
doSharedResources () const override
 

Private Attributes

double comEnergy
 Center-of-Mass energy. More...
 
int EV1_emittedMode
 
int EV1_maxVetoCount
 
bool EV1_MPIvetoOn
 
int EV1_nFinal
 
int EV1_pTdefMode
 
int EV1_pTempMode
 
int EV1_pThardMode
 
bool EV1_vetoOn
 
double fBeam1PZ
 
double fBeam2PZ
 
EmissionVetoHookfEmissionVetoHook
 
EmissionVetoHook1fEmissionVetoHook1
 
int fInitialState
 
JetMatchingHookfJetMatchingHook
 
UserHooks * fReweightUserHook
 
std::auto_ptr< LHAupLesHoucheslhaUP
 
string LHEInputFileName
 

Static Private Attributes

static const std::vector
< std::string > 
p8SharedResources = { edm::SharedResourceNames::kPythia8 }
 

Additional Inherited Members

- Protected Member Functions inherited from gen::BaseHadronizer
std::auto_ptr< HepMC::GenEvent > & event ()
 
std::auto_ptr
< GenEventInfoProduct > & 
eventInfo ()
 
lhef::LHEEventlheEvent ()
 
lhef::LHERunInfolheRunInfo ()
 
GenRunInfoProductrunInfo ()
 
- Protected Attributes inherited from gen::Py8InterfaceBase
std::auto_ptr< Pythia8::Pythia > fDecayer
 
std::auto_ptr< Pythia8::Pythia > fMasterGen
 
ParameterCollector fParameters
 
unsigned int maxEventsToPrint
 
bool pythiaHepMCVerbosity
 
unsigned int pythiaPylistVerbosity
 
HepMC::I_Pythia8 toHepMC
 

Detailed Description

Definition at line 54 of file Pythia8Hadronizer.cc.

Member Enumeration Documentation

anonymous enum
private

Constructor & Destructor Documentation

Pythia8Hadronizer::Pythia8Hadronizer ( const edm::ParameterSet params)

Definition at line 119 of file Pythia8Hadronizer.cc.

References gen::ParameterCollector::begin(), edm::errors::Configuration, gather_cfg::cout, ElectronPositron, gen::ParameterCollector::end(), EV1_emittedMode, EV1_maxVetoCount, EV1_MPIvetoOn, EV1_nFinal, EV1_pTdefMode, EV1_pTempMode, EV1_pThardMode, EV1_vetoOn, edm::hlt::Exception, edm::ParameterSet::exists(), python.connectstrParser::f1, fEmissionVetoHook, fEmissionVetoHook1, fInitialState, fJetMatchingHook, gen::Py8InterfaceBase::fMasterGen, gen::Py8InterfaceBase::fParameters, fReweightUserHook, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), geometryCSVtoXML::line, PP, PPbar, and AlCaHLTBitMon_QueryRunRegistry::string.

119  :
120  BaseHadronizer(params), Py8InterfaceBase(params),
121  comEnergy(params.getParameter<double>("comEnergy")),
122  LHEInputFileName(params.getUntrackedParameter<string>("LHEInputFileName","")),
123  fInitialState(PP),
125  fJetMatchingHook(0),
127 {
128 
129  // J.Y.: the following 3 parameters are hacked "for a reason"
130  //
131  if ( params.exists( "PPbarInitialState" ) )
132  {
133  if ( fInitialState == PP )
134  {
136  edm::LogInfo("GeneratorInterface|Pythia6Interface")
137  << "Pythia6 will be initialized for PROTON-ANTIPROTON INITIAL STATE. "
138  << "This is a user-request change from the DEFAULT PROTON-PROTON initial state." << std::endl;
139  std::cout << "Pythia6 will be initialized for PROTON-ANTIPROTON INITIAL STATE." << std::endl;
140  std::cout << "This is a user-request change from the DEFAULT PROTON-PROTON initial state." << std::endl;
141  }
142  else
143  {
144  // probably need to throw on attempt to override ?
145  }
146  }
147  else if ( params.exists( "ElectronPositronInitialState" ) )
148  {
149  if ( fInitialState == PP )
150  {
152  edm::LogInfo("GeneratorInterface|Pythia6Interface")
153  << "Pythia6 will be initialized for ELECTRON-POSITRON INITIAL STATE. "
154  << "This is a user-request change from the DEFAULT PROTON-PROTON initial state." << std::endl;
155  std::cout << "Pythia6 will be initialized for ELECTRON-POSITRON INITIAL STATE." << std::endl;
156  std::cout << "This is a user-request change from the DEFAULT PROTON-PROTON initial state." << std::endl;
157  }
158  else
159  {
160  // probably need to throw on attempt to override ?
161  }
162  }
163  else if ( params.exists( "ElectronProtonInitialState" ) || params.exists( "PositronProtonInitialState" ) )
164  {
165  // throw on unknown initial state !
166  throw edm::Exception(edm::errors::Configuration,"Pythia8Interface")
167  <<" UNKNOWN INITIAL STATE. \n The allowed initial states are: PP, PPbar, ElectronPositron \n";
168  }
169 
170  if( params.exists( "SLHAFileForPythia8" ) ) {
171  std::string slhafilenameshort = params.getParameter<string>("SLHAFileForPythia8");
172  edm::FileInPath f1( slhafilenameshort );
173  std::string slhafilename = f1.fullPath();
174  std::string pythiacommandslha = std::string("SLHA:file = ") + slhafilename;
175  fMasterGen->readString(pythiacommandslha);
177  line != fParameters.end(); ++line ) {
178  if (line->find("SLHA:file") != std::string::npos)
179  throw cms::Exception("PythiaError") << "Attempted to set SLHA file name twice, "
180  << "using Pythia8 card SLHA:file and Pythia8Interface card SLHAFileForPythia8"
181  << std::endl;
182  }
183  }
184 
185  // Reweight user hook
186  //
187  if( params.exists( "reweightGen" ) )
189 
190  if( params.exists( "useUserHook" ) )
191  throw edm::Exception(edm::errors::Configuration,"Pythia8Interface")
192  <<" Obsolete parameter: useUserHook \n Please use the actual one instead \n";
193 
194  // PS matching prototype
195  //
196  if ( params.exists("jetMatching") )
197  {
198  edm::ParameterSet jmParams =
199  params.getUntrackedParameter<edm::ParameterSet>("jetMatching");
200  std::string scheme = jmParams.getParameter<std::string>("scheme");
201  if ( scheme == "Madgraph" || scheme == "MadgraphFastJet" )
202  {
203  fJetMatchingHook = new JetMatchingHook( jmParams, &fMasterGen->info );
204  }
205  }
206 
207  // Emission vetos
208  //
209  if ( params.exists("emissionVeto") )
210  {
212  }
213 
214  if ( params.exists("emissionVeto1") )
215  {
216  EV1_nFinal = -1;
217  if(params.exists("EV1_nFinal")) EV1_nFinal = params.getParameter<int>("EV1_nFinal");
218  EV1_vetoOn = true;
219  if(params.exists("EV1_vetoOn")) EV1_vetoOn = params.getParameter<bool>("EV1_vetoOn");
220  EV1_maxVetoCount = 10;
221  if(params.exists("EV1_maxVetoCount")) EV1_maxVetoCount = params.getParameter<int>("EV1_maxVetoCount");
222  EV1_pThardMode = 1;
223  if(params.exists("EV1_pThardMode")) EV1_pThardMode = params.getParameter<int>("EV1_pThardMode");
224  EV1_pTempMode = 0;
225  if(params.exists("EV1_pTempMode")) EV1_pTempMode = params.getParameter<int>("EV1_pTempMode");
226  if(EV1_pTempMode > 2 || EV1_pTempMode < 0)
227  throw edm::Exception(edm::errors::Configuration,"Pythia8Interface")
228  <<" Wrong value for EV1_pTempMode code\n";
229  EV1_emittedMode = 0;
230  if(params.exists("EV1_emittedMode")) EV1_emittedMode = params.getParameter<int>("EV1_emittedMode");
231  EV1_pTdefMode = 1;
232  if(params.exists("EV1_pTdefMode")) EV1_pTdefMode = params.getParameter<int>("EV1_pTdefMode");
233  EV1_MPIvetoOn = false;
234  if(params.exists("EV1_MPIvetoOn")) EV1_MPIvetoOn = params.getParameter<bool>("EV1_MPIvetoOn");
238  }
239 
240  int NHooks=0;
241  if(fReweightUserHook) NHooks++;
242  if(fJetMatchingHook) NHooks++;
243  if(fEmissionVetoHook) NHooks++;
244  if(fEmissionVetoHook1) NHooks++;
245  if(NHooks > 1)
246  throw edm::Exception(edm::errors::Configuration,"Pythia8Interface")
247  <<" Too many User Hooks. \n Please choose one from: reweightGen, jetMatching, emissionVeto \n";
248 
249  if(fReweightUserHook) fMasterGen->setUserHooksPtr(fReweightUserHook);
250  if(fJetMatchingHook) fMasterGen->setUserHooksPtr(fJetMatchingHook);
252  cout << "Turning on Emission Veto Hook";
253  if(fEmissionVetoHook1) cout << " 1";
254  cout << endl;
255  int nversion = (int)(1000.*(fMasterGen->settings.parm("Pythia:versionNumber") - 8.));
256  if(nversion < 157) {
257  cout << "obsolete pythia8 version for this Emission Veto code" << endl;
258  cout << "Please update pythia8 version using the instructions here:" << endl;
259  cout << "https://twiki.cern.ch/twiki/bin/view/CMS/Pythia8Interface" << endl;
260  cout << "or try to use tag V00-01-28 of this interface" << endl;
261  throw edm::Exception(edm::errors::Configuration,"Pythia8Interface")
262  <<" Obsolete pythia8 version for this Emission Veto code\n";
263  }
264  if(fEmissionVetoHook) fMasterGen->setUserHooksPtr(fEmissionVetoHook);
265  if(fEmissionVetoHook1) fMasterGen->setUserHooksPtr(fEmissionVetoHook1);
266  }
267 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
ParameterCollector fParameters
double comEnergy
Center-of-Mass energy.
std::auto_ptr< Pythia8::Pythia > fMasterGen
EmissionVetoHook1 * fEmissionVetoHook1
UserHooks * fReweightUserHook
EmissionVetoHook * fEmissionVetoHook
BaseHadronizer(edm::ParameterSet const &ps)
bool exists(std::string const &parameterName) const
checks if a parameter exists
Py8InterfaceBase(edm::ParameterSet const &ps)
JetMatchingHook * fJetMatchingHook
const_iterator end() const
const_iterator begin() const
tuple cout
Definition: gather_cfg.py:121
Pythia8Hadronizer::~Pythia8Hadronizer ( )

Definition at line 270 of file Pythia8Hadronizer.cc.

References fEmissionVetoHook, and fEmissionVetoHook1.

271 {
272 // do we need to delete UserHooks/JetMatchingHook here ???
273 
276 }
EmissionVetoHook1 * fEmissionVetoHook1
EmissionVetoHook * fEmissionVetoHook

Member Function Documentation

const char* Pythia8Hadronizer::classname ( ) const
inlineoverridevirtual

Implements gen::Py8InterfaceBase.

Definition at line 73 of file Pythia8Hadronizer.cc.

73 { return "Pythia8Hadronizer"; }
virtual void Pythia8Hadronizer::doSetRandomEngine ( CLHEP::HepRandomEngine *  v)
inlineoverrideprivatevirtual

Reimplemented from gen::BaseHadronizer.

Definition at line 77 of file Pythia8Hadronizer.cc.

77 { p8SetRandomEngine(v); }
void p8SetRandomEngine(CLHEP::HepRandomEngine *v)
virtual std::vector<std::string> const& Pythia8Hadronizer::doSharedResources ( ) const
inlineoverrideprivatevirtual

Reimplemented from gen::BaseHadronizer.

Definition at line 78 of file Pythia8Hadronizer.cc.

78 { return p8SharedResources; }
static const std::vector< std::string > p8SharedResources
void Pythia8Hadronizer::finalizeEvent ( )
overridevirtual

Implements gen::Py8InterfaceBase.

Definition at line 508 of file Pythia8Hadronizer.cc.

References gather_cfg::cout, gen::BaseHadronizer::event(), gen::BaseHadronizer::eventInfo(), gen::Py8InterfaceBase::fMasterGen, gen::BaseHadronizer::lheEvent(), gen::Py8InterfaceBase::maxEventsToPrint, gen::Py8InterfaceBase::pythiaHepMCVerbosity, and gen::Py8InterfaceBase::pythiaPylistVerbosity.

509 {
510  bool lhe = lheEvent() != 0;
511 
512  // now create the GenEventInfo product from the GenEvent and fill
513  // the missing pieces
514  eventInfo().reset( new GenEventInfoProduct( event().get() ) );
515 
516  // in pythia pthat is used to subdivide samples into different bins
517  // in LHE mode the binning is done by the external ME generator
518  // which is likely not pthat, so only filling it for Py6 internal mode
519  if (!lhe) {
520  eventInfo()->setBinningValues(std::vector<double>(1, fMasterGen->info.pTHat()));
521  }
522 
523  //******** Verbosity ********
524 
525  if (maxEventsToPrint > 0 &&
528  if (pythiaPylistVerbosity) {
529  fMasterGen->info.list(std::cout);
530  fMasterGen->event.list(std::cout);
531  }
532 
533  if (pythiaHepMCVerbosity) {
534  std::cout << "Event process = "
535  << fMasterGen->info.code() << "\n"
536  << "----------------------" << std::endl;
537  event()->print();
538  }
539  }
540 }
std::auto_ptr< Pythia8::Pythia > fMasterGen
std::auto_ptr< HepMC::GenEvent > & event()
lhef::LHEEvent * lheEvent()
unsigned int pythiaPylistVerbosity
std::auto_ptr< GenEventInfoProduct > & eventInfo()
unsigned int maxEventsToPrint
tuple cout
Definition: gather_cfg.py:121
bool Pythia8Hadronizer::generatePartonsAndHadronize ( )
overridevirtual

Implements gen::Py8InterfaceBase.

Definition at line 392 of file Pythia8Hadronizer.cc.

References gen::BaseHadronizer::event(), gen::Py8InterfaceBase::fMasterGen, and gen::Py8InterfaceBase::toHepMC.

393 {
394 
395  if (!fMasterGen->next()) return false;
396 
397  event().reset(new HepMC::GenEvent);
398  return toHepMC.fill_next_event( *(fMasterGen.get()), event().get());
399 
400 }
std::auto_ptr< Pythia8::Pythia > fMasterGen
HepMC::I_Pythia8 toHepMC
std::auto_ptr< HepMC::GenEvent > & event()
bool Pythia8Hadronizer::hadronize ( )

Definition at line 403 of file Pythia8Hadronizer.cc.

References JetMatchingHook::beforeHadronization(), lhef::LHEEvent::count(), gen::BaseHadronizer::event(), fJetMatchingHook, gen::Py8InterfaceBase::fMasterGen, lhef::LHERunInfo::kAccepted, lhef::LHERunInfo::kSelected, lhaUP, gen::BaseHadronizer::lheEvent(), LHEInputFileName, JetMatchingHook::resetMatchingStatus(), and gen::Py8InterfaceBase::toHepMC.

404 {
405  if(LHEInputFileName == string()) lhaUP->loadEvent(lheEvent());
406 
407  if ( fJetMatchingHook )
408  {
411  }
412 
413  bool py8next = fMasterGen->next();
414 
415  if (!py8next)
416  {
418  event().reset();
419  return false;
420  }
421 
422  // update LHE matching statistics
423  //
425 
426  event().reset(new HepMC::GenEvent);
427  return toHepMC.fill_next_event( *(fMasterGen.get()), event().get());
428 
429 }
std::auto_ptr< Pythia8::Pythia > fMasterGen
HepMC::I_Pythia8 toHepMC
void count(LHERunInfo::CountMode count, double weight=1.0, double matchWeight=1.0)
Definition: LHEEvent.cc:212
virtual void beforeHadronization(lhef::LHEEvent *lhee)
std::auto_ptr< HepMC::GenEvent > & event()
std::auto_ptr< LHAupLesHouches > lhaUP
lhef::LHEEvent * lheEvent()
JetMatchingHook * fJetMatchingHook
void resetMatchingStatus()
bool Pythia8Hadronizer::initializeForExternalPartons ( )

Definition at line 322 of file Pythia8Hadronizer.cc.

References gather_cfg::cout, gen::Py8InterfaceBase::fDecayer, fJetMatchingHook, gen::Py8InterfaceBase::fMasterGen, JetMatchingHook::init(), lhaUP, LHEInputFileName, gen::BaseHadronizer::lheRunInfo(), and gen::Py8InterfaceBase::pythiaPylistVerbosity.

323 {
324 
325  std::cout << "Initializing for external partons" << std::endl;
326 
327  // pythiaEvent = &pythia->event;
328 
329  if(LHEInputFileName != string()) {
330 
331  cout << endl;
332  cout << "LHE Input File Name = " << LHEInputFileName << endl;
333  cout << endl;
335 
336  } else {
337 
338  lhaUP.reset(new LHAupLesHouches());
339  lhaUP->loadRunInfo(lheRunInfo());
340 
341  if ( fJetMatchingHook )
342  {
344  }
345 
346  fMasterGen->init(lhaUP.get());
347 
348  }
349 
350  if ( pythiaPylistVerbosity > 10 )
351  {
352  if ( pythiaPylistVerbosity == 11 || pythiaPylistVerbosity == 13 )
353  fMasterGen->settings.listAll();
354  if ( pythiaPylistVerbosity == 12 || pythiaPylistVerbosity == 13 )
355  fMasterGen->particleData.listAll();
356  }
357 
358  // init decayer
359  fDecayer->readString("ProcessLevel:all = off"); // trick
360  fDecayer->readString("Standalone:allowResDec=on");
361  // pythia->readString("ProcessLevel::resonanceDecays=on");
362  fDecayer->init();
363 
364  return true;
365 }
std::auto_ptr< Pythia8::Pythia > fMasterGen
std::auto_ptr< LHAupLesHouches > lhaUP
unsigned int pythiaPylistVerbosity
lhef::LHERunInfo * lheRunInfo()
virtual void init(lhef::LHERunInfo *runInfo)
JetMatchingHook * fJetMatchingHook
std::auto_ptr< Pythia8::Pythia > fDecayer
tuple cout
Definition: gather_cfg.py:121
bool Pythia8Hadronizer::initializeForInternalPartons ( )
overridevirtual

Implements gen::Py8InterfaceBase.

Definition at line 278 of file Pythia8Hadronizer.cc.

References comEnergy, edm::errors::Configuration, ElectronPositron, edm::hlt::Exception, gen::Py8InterfaceBase::fDecayer, fInitialState, gen::Py8InterfaceBase::fMasterGen, PP, PPbar, and gen::Py8InterfaceBase::pythiaPylistVerbosity.

279 {
280 
281  // pythiaEvent = &pythia->event;
282 
283  if ( fInitialState == PP ) // default
284  {
285  fMasterGen->init(2212, 2212, comEnergy);
286  }
287  else if ( fInitialState == PPbar )
288  {
289  fMasterGen->init(2212, -2212, comEnergy);
290  }
291  else if ( fInitialState == ElectronPositron )
292  {
293  fMasterGen->init(11, -11, comEnergy);
294  }
295  else
296  {
297  // throw on unknown initial state !
298  throw edm::Exception(edm::errors::Configuration,"Pythia8Interface")
299  <<" UNKNOWN INITIAL STATE. \n The allowed initial states are: PP, PPbar, ElectronPositron \n";
300  }
301 
302  fMasterGen->settings.listChanged();
303 
304  if ( pythiaPylistVerbosity > 10 )
305  {
306  if ( pythiaPylistVerbosity == 11 || pythiaPylistVerbosity == 13 )
307  fMasterGen->settings.listAll();
308  if ( pythiaPylistVerbosity == 12 || pythiaPylistVerbosity == 13 )
309  fMasterGen->particleData.listAll();
310  }
311 
312  // init decayer
313  fDecayer->readString("ProcessLevel:all = off"); // trick
314  fDecayer->readString("Standalone:allowResDec=on");
315  // pythia->readString("ProcessLevel::resonanceDecays=on");
316  fDecayer->init();
317 
318  return true;
319 }
double comEnergy
Center-of-Mass energy.
std::auto_ptr< Pythia8::Pythia > fMasterGen
unsigned int pythiaPylistVerbosity
std::auto_ptr< Pythia8::Pythia > fDecayer
bool Pythia8Hadronizer::residualDecay ( )
virtual

Definition at line 432 of file Pythia8Hadronizer.cc.

References gen::BaseHadronizer::event(), gen::Py8InterfaceBase::fDecayer, gen::Py8InterfaceBase::fMasterGen, and configurableAnalysis::GenParticle.

433 {
434 
435  Event* pythiaEvent = &(fMasterGen->event);
436 
437  int NPartsBeforeDecays = pythiaEvent->size();
438  int NPartsAfterDecays = event().get()->particles_size();
439  int NewBarcode = NPartsAfterDecays;
440 
441  for ( int ipart=NPartsAfterDecays; ipart>NPartsBeforeDecays; ipart-- )
442  {
443 
444  HepMC::GenParticle* part = event().get()->barcode_to_particle( ipart );
445 
446  if ( part->status() == 1 )
447  {
448  fDecayer->event.reset();
449  Particle py8part( part->pdg_id(), 93, 0, 0, 0, 0, 0, 0,
450  part->momentum().x(),
451  part->momentum().y(),
452  part->momentum().z(),
453  part->momentum().t(),
454  part->generated_mass() );
455  HepMC::GenVertex* ProdVtx = part->production_vertex();
456  py8part.vProd( ProdVtx->position().x(), ProdVtx->position().y(),
457  ProdVtx->position().z(), ProdVtx->position().t() );
458  py8part.tau( (fDecayer->particleData).tau0( part->pdg_id() ) );
459  fDecayer->event.append( py8part );
460  int nentries = fDecayer->event.size();
461  if ( !fDecayer->event[nentries-1].mayDecay() ) continue;
462  fDecayer->next();
463  int nentries1 = fDecayer->event.size();
464  // fDecayer->event.list(std::cout);
465  if ( nentries1 <= nentries ) continue; //same number of particles, no decays...
466 
467  part->set_status(2);
468 
469  Particle& py8daughter = fDecayer->event[nentries]; // the 1st daughter
470  HepMC::GenVertex* DecVtx = new HepMC::GenVertex( HepMC::FourVector(py8daughter.xProd(),
471  py8daughter.yProd(),
472  py8daughter.zProd(),
473  py8daughter.tProd()) );
474 
475  DecVtx->add_particle_in( part ); // this will cleanup end_vertex if exists, replace with the new one
476  // I presume (vtx) barcode will be given automatically
477 
478  HepMC::FourVector pmom( py8daughter.px(), py8daughter.py(), py8daughter.pz(), py8daughter.e() );
479 
480  HepMC::GenParticle* daughter =
481  new HepMC::GenParticle( pmom, py8daughter.id(), 1 );
482 
483  NewBarcode++;
484  daughter->suggest_barcode( NewBarcode );
485  DecVtx->add_particle_out( daughter );
486 
487  for ( int ipart1=nentries+1; ipart1<nentries1; ipart1++ )
488  {
489  py8daughter = fDecayer->event[ipart1];
490  HepMC::FourVector pmomN( py8daughter.px(), py8daughter.py(), py8daughter.pz(), py8daughter.e() );
491  HepMC::GenParticle* daughterN =
492  new HepMC::GenParticle( pmomN, py8daughter.id(), 1 );
493  NewBarcode++;
494  daughterN->suggest_barcode( NewBarcode );
495  DecVtx->add_particle_out( daughterN );
496  }
497 
498  event().get()->add_vertex( DecVtx );
499  // fCurrentEventState->add_vertex( DecVtx );
500 
501  }
502  }
503  return true;
504 
505 }
std::auto_ptr< Pythia8::Pythia > fMasterGen
std::auto_ptr< HepMC::GenEvent > & event()
part
Definition: HCALResponse.h:20
std::auto_ptr< Pythia8::Pythia > fDecayer
void Pythia8Hadronizer::statistics ( )
overridevirtual

Reimplemented from gen::Py8InterfaceBase.

Definition at line 382 of file Pythia8Hadronizer.cc.

References gen::Py8InterfaceBase::fMasterGen, gen::BaseHadronizer::runInfo(), and GenRunInfoProduct::setInternalXSec().

383 {
384  fMasterGen->statistics();
385 
386  double xsec = fMasterGen->info.sigmaGen(); // cross section in mb
387  xsec *= 1.0e9; // translate to pb (CMS/Gen "convention" as of May 2009)
388  runInfo().setInternalXSec(xsec);
389 }
std::auto_ptr< Pythia8::Pythia > fMasterGen
void setInternalXSec(const XSec &xsec)
GenRunInfoProduct & runInfo()

Member Data Documentation

double Pythia8Hadronizer::comEnergy
private

Center-of-Mass energy.

Definition at line 81 of file Pythia8Hadronizer.cc.

Referenced by initializeForInternalPartons().

int Pythia8Hadronizer::EV1_emittedMode
private

Definition at line 110 of file Pythia8Hadronizer.cc.

Referenced by Pythia8Hadronizer().

int Pythia8Hadronizer::EV1_maxVetoCount
private

Definition at line 107 of file Pythia8Hadronizer.cc.

Referenced by Pythia8Hadronizer().

bool Pythia8Hadronizer::EV1_MPIvetoOn
private

Definition at line 112 of file Pythia8Hadronizer.cc.

Referenced by Pythia8Hadronizer().

int Pythia8Hadronizer::EV1_nFinal
private

Definition at line 105 of file Pythia8Hadronizer.cc.

Referenced by Pythia8Hadronizer().

int Pythia8Hadronizer::EV1_pTdefMode
private

Definition at line 111 of file Pythia8Hadronizer.cc.

Referenced by Pythia8Hadronizer().

int Pythia8Hadronizer::EV1_pTempMode
private

Definition at line 109 of file Pythia8Hadronizer.cc.

Referenced by Pythia8Hadronizer().

int Pythia8Hadronizer::EV1_pThardMode
private

Definition at line 108 of file Pythia8Hadronizer.cc.

Referenced by Pythia8Hadronizer().

bool Pythia8Hadronizer::EV1_vetoOn
private

Definition at line 106 of file Pythia8Hadronizer.cc.

Referenced by Pythia8Hadronizer().

double Pythia8Hadronizer::fBeam1PZ
private

Definition at line 89 of file Pythia8Hadronizer.cc.

double Pythia8Hadronizer::fBeam2PZ
private

Definition at line 90 of file Pythia8Hadronizer.cc.

EmissionVetoHook* Pythia8Hadronizer::fEmissionVetoHook
private

Definition at line 102 of file Pythia8Hadronizer.cc.

Referenced by Pythia8Hadronizer(), and ~Pythia8Hadronizer().

EmissionVetoHook1* Pythia8Hadronizer::fEmissionVetoHook1
private

Definition at line 103 of file Pythia8Hadronizer.cc.

Referenced by Pythia8Hadronizer(), and ~Pythia8Hadronizer().

int Pythia8Hadronizer::fInitialState
private

Definition at line 87 of file Pythia8Hadronizer.cc.

Referenced by initializeForInternalPartons(), and Pythia8Hadronizer().

JetMatchingHook* Pythia8Hadronizer::fJetMatchingHook
private

Definition at line 98 of file Pythia8Hadronizer.cc.

Referenced by hadronize(), initializeForExternalPartons(), and Pythia8Hadronizer().

UserHooks* Pythia8Hadronizer::fReweightUserHook
private

Definition at line 94 of file Pythia8Hadronizer.cc.

Referenced by Pythia8Hadronizer().

std::auto_ptr<LHAupLesHouches> Pythia8Hadronizer::lhaUP
private

Definition at line 84 of file Pythia8Hadronizer.cc.

Referenced by hadronize(), and initializeForExternalPartons().

string Pythia8Hadronizer::LHEInputFileName
private

Definition at line 83 of file Pythia8Hadronizer.cc.

Referenced by hadronize(), and initializeForExternalPartons().

const std::vector< std::string > Pythia8Hadronizer::p8SharedResources = { edm::SharedResourceNames::kPythia8 }
staticprivate

Definition at line 114 of file Pythia8Hadronizer.cc.