Skip to content

Commit

Permalink
Merge pull request #6455 from bendavid/pythia8checkinit_73x
Browse files Browse the repository at this point in the history
Add explicit initialization check to pythia8 interface (73x)
  • Loading branch information
cmsbuild committed Nov 17, 2014
2 parents 69dce88 + 4872c3f commit 39f16d8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion GeneratorInterface/Core/interface/HadronizerFilter.h
Expand Up @@ -369,7 +369,7 @@ namespace edm
throw edm::Exception(errors::Configuration)
<< "Failed to initialize hadronizer "
<< hadronizer_.classname()
<< " for internal parton generation\n";
<< " for external parton generation\n";
}

template <class HAD, class DEC>
Expand Down
23 changes: 14 additions & 9 deletions GeneratorInterface/Pythia8Interface/plugins/Pythia8Hadronizer.cc
Expand Up @@ -304,29 +304,32 @@ Pythia8Hadronizer::~Pythia8Hadronizer()

bool Pythia8Hadronizer::initializeForInternalPartons()
{

bool status = true;

if ( fInitialState == PP ) // default
{
//fMasterGen->init(2212, 2212, comEnergy);
fMasterGen->settings.mode("Beams:idA", 2212);
fMasterGen->settings.mode("Beams:idB", 2212);
fMasterGen->settings.parm("Beams:eCM", comEnergy);
fMasterGen->init();
status &= fMasterGen->init();
}
else if ( fInitialState == PPbar )
{
//fMasterGen->init(2212, -2212, comEnergy);
fMasterGen->settings.mode("Beams:idA", 2212);
fMasterGen->settings.mode("Beams:idB", -2212);
fMasterGen->settings.parm("Beams:eCM", comEnergy);
fMasterGen->init();
status &= fMasterGen->init();
}
else if ( fInitialState == ElectronPositron )
{
//fMasterGen->init(11, -11, comEnergy);
fMasterGen->settings.mode("Beams:idA", 11);
fMasterGen->settings.mode("Beams:idB", -11);
fMasterGen->settings.parm("Beams:eCM", comEnergy);
fMasterGen->init();
status &= fMasterGen->init();
}
else
{
Expand All @@ -350,9 +353,9 @@ bool Pythia8Hadronizer::initializeForInternalPartons()
//fDecayer->readString("ProcessLevel::resonanceDecays=on");
fDecayer->settings.flag("ProcessLevel:all", false ); // trick
fDecayer->settings.flag("ProcessLevel:resonanceDecays", true );
fDecayer->init();
status &= fDecayer->init();

return true;
return status;
}


Expand All @@ -361,6 +364,8 @@ bool Pythia8Hadronizer::initializeForExternalPartons()

edm::LogInfo("Pythia8Interface") << "Initializing for external partons";

bool status = true;

if((fMasterGen->settings.mode("POWHEG:veto") > 0 || fMasterGen->settings.mode("POWHEG:MPIveto") > 0) && !fEmissionVetoHook) {

if(fJetMatchingHook || fEmissionVetoHook1)
Expand Down Expand Up @@ -411,7 +416,7 @@ bool Pythia8Hadronizer::initializeForExternalPartons()
//fMasterGen->init(LHEInputFileName);
fMasterGen->settings.mode("Beams:frameType", 4);
fMasterGen->settings.word("Beams:LHEF", LHEInputFileName);
fMasterGen->init();
status &= fMasterGen->init();

} else {

Expand All @@ -426,7 +431,7 @@ bool Pythia8Hadronizer::initializeForExternalPartons()
//fMasterGen->init(lhaUP.get());
fMasterGen->settings.mode("Beams:frameType", 5);
fMasterGen->setLHAupPtr(lhaUP.get());
fMasterGen->init();
status &= fMasterGen->init();
}

if ( pythiaPylistVerbosity > 10 )
Expand All @@ -442,9 +447,9 @@ bool Pythia8Hadronizer::initializeForExternalPartons()
//fDecayer->readString("ProcessLevel::resonanceDecays=on");
fDecayer->settings.flag("ProcessLevel:all", false ); // trick
fDecayer->settings.flag("ProcessLevel:resonanceDecays", true );
fDecayer->init();
status &= fDecayer->init();

return true;
return status;
}


Expand Down

0 comments on commit 39f16d8

Please sign in to comment.