Skip to content

Commit

Permalink
Merge pull request #5475 from cms-sw/revert-5436-topythia8200pre1_73
Browse files Browse the repository at this point in the history
Revert "Updated minimal pythia 8 interface changes for 8.200pre1"
  • Loading branch information
aledegano committed Sep 22, 2014
2 parents 3b1c7de + ab2f17e commit 9752db5
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 56 deletions.
2 changes: 1 addition & 1 deletion FastSimulation/ParticleDecay/interface/PythiaDecays.h
Expand Up @@ -8,7 +8,7 @@
#include <HepMC/GenEvent.h>
#include <HepMC/GenParticle.h>
#include <Pythia8/Pythia.h>
#include "Pythia8Plugins/HepMC2.h"
#include <Pythia8/Pythia8ToHepMC.h>
#include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
#include "SimDataFormats/GeneratorProducts/interface/GenRunInfoProduct.h"
#include "GeneratorInterface/ExternalDecays/interface/ExternalDecayDriver.h"
Expand Down
6 changes: 3 additions & 3 deletions FastSimulation/ParticleDecay/src/PythiaDecays.cc
Expand Up @@ -36,9 +36,9 @@ PythiaDecays::PythiaDecays(std::string program)
decayer.reset(new Pythia8::Pythia);
p8RndmEngine.reset(new gen::P8RndmEngine);
decayer->setRndmEnginePtr(p8RndmEngine.get());
decayer->settings.flag("ProcessLevel:all",false);
decayer->settings.flag("PartonLevel:FSRinResonances",false);
decayer->settings.flag("ProcessLevel:resonanceDecays",false);
decayer->readString("ProcessLevel:all = off");
decayer->readString("PartonLevel:FSRinResonances = off"); //?
decayer->readString("ProcessLevel:resonanceDecays = off"); //?
decayer->init();

// forbid all decays
Expand Down
Expand Up @@ -11,7 +11,7 @@
#define Pythia8_SetNumberOfPartonsDynamically_H

#include "Pythia8/Pythia.h"
#include "Pythia8Plugins/HepMC2.h"
#include "Pythia8/Pythia8ToHepMC.h"
#include <unistd.h>

#include "HepMC/GenEvent.h"
Expand Down
2 changes: 1 addition & 1 deletion GeneratorInterface/Pythia8Interface/interface/Py8GunBase.h
Expand Up @@ -25,7 +25,7 @@
#include "FWCore/ParameterSet/interface/ParameterSet.h"

#include <Pythia8/Pythia.h>
#include <Pythia8Plugins/HepMC2.h>
#include <Pythia8/Pythia8ToHepMC.h>

// foward declarations
namespace edm {
Expand Down
Expand Up @@ -8,7 +8,7 @@
#include "GeneratorInterface/Pythia8Interface/interface/P8RndmEngine.h"

#include <Pythia8/Pythia.h>
#include <Pythia8Plugins/HepMC2.h>
#include <Pythia8/Pythia8ToHepMC.h>

namespace CLHEP {
class HepRandomEngine;
Expand Down
Expand Up @@ -13,7 +13,7 @@

#include "Pythia8/Pythia.h"
#include "Pythia8/LesHouches.h"
#include "Pythia8Plugins/HepMC2.h"
#include "Pythia8/Pythia8ToHepMC.h"

#include "SimDataFormats/GeneratorProducts/interface/LesHouches.h"
#include "GeneratorInterface/LHEInterface/interface/LHERunInfo.h"
Expand Down
@@ -1,7 +1,7 @@
#ifndef gen_Py8toJetInput_h
#define gen_Py8toJetInput_h

#include "Pythia8Plugins/FastJet3.h" // Py8 overhead on top of FastJets package
#include "Pythia8/FastJet3.h" // Py8 overhead on top of FastJets package
#include "Pythia8/Event.h"

namespace lhef {
Expand Down
64 changes: 22 additions & 42 deletions GeneratorInterface/Pythia8Interface/plugins/Pythia8Hadronizer.cc
Expand Up @@ -9,7 +9,7 @@
#include "HepMC/GenParticle.h"

#include "Pythia8/Pythia.h"
#include "Pythia8Plugins/HepMC2.h"
#include "Pythia8/Pythia8ToHepMC.h"

#include "GeneratorInterface/Pythia8Interface/interface/Py8InterfaceBase.h"

Expand Down Expand Up @@ -316,29 +316,20 @@ Pythia8Hadronizer::~Pythia8Hadronizer()

bool Pythia8Hadronizer::initializeForInternalPartons()
{

// pythiaEvent = &pythia->event;

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();
fMasterGen->init(2212, 2212, comEnergy);
}
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();
fMasterGen->init(2212, -2212, comEnergy);
}
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();
fMasterGen->init(11, -11, comEnergy);
}
else
{
Expand All @@ -358,10 +349,8 @@ bool Pythia8Hadronizer::initializeForInternalPartons()
}

// init decayer
//fDecayer->readString("ProcessLevel:all = off"); // trick
//fDecayer->readString("ProcessLevel::resonanceDecays=on");
fDecayer->settings.flag("ProcessLevel:all", false ); // trick
fDecayer->settings.flag("ProcessLevel:resonanceDecays", true );
fDecayer->readString("ProcessLevel:all = off"); // trick
fDecayer->readString("ProcessLevel::resonanceDecays=on");
fDecayer->init();

return true;
Expand All @@ -375,13 +364,10 @@ bool Pythia8Hadronizer::initializeForExternalPartons()

if(LHEInputFileName != string()) {

edm::LogInfo("Pythia8Interface") << "Initialize direct pythia8 reading from LHE file "
<< LHEInputFileName;
edm::LogInfo("Pythia8Interface") << "Some LHE information can be not stored";
//fMasterGen->init(LHEInputFileName);
fMasterGen->settings.mode("Beams:frameType", 4);
fMasterGen->settings.word("Beams:LHEF", LHEInputFileName);
fMasterGen->init();
std::cout << std::endl;
std::cout << "LHE Input File Name = " << LHEInputFileName << std::endl;
std::cout << std::endl;
fMasterGen->init(LHEInputFileName);

} else {

Expand Down Expand Up @@ -410,18 +396,14 @@ bool Pythia8Hadronizer::initializeForExternalPartons()
}
file.close();

//std::string lhareadcmd = "SLHA:readFrom = 2";
//std::string lhafilecmd = std::string("SLHA:file = ") + std::string(fname);
//fMasterGen->readString(lhareadcmd);
//fMasterGen->readString(lhafilecmd);
fMasterGen->settings.mode("SLHA:readFrom", 2);
fMasterGen->settings.word("SLHA:file", std::string(fname));
std::string lhareadcmd = "SLHA:readFrom = 2";
std::string lhafilecmd = std::string("SLHA:file = ") + std::string(fname);

fMasterGen->readString(lhareadcmd);
fMasterGen->readString(lhafilecmd);
}

//fMasterGen->init(lhaUP.get());
fMasterGen->settings.mode("Beams:frameType", 5);
fMasterGen->setLHAupPtr(lhaUP.get());
fMasterGen->init();
fMasterGen->init(lhaUP.get());

if (doslha) {
std::remove( fname );
Expand All @@ -438,10 +420,8 @@ bool Pythia8Hadronizer::initializeForExternalPartons()
}

// init decayer
//fDecayer->readString("ProcessLevel:all = off"); // trick
//fDecayer->readString("ProcessLevel::resonanceDecays=on");
fDecayer->settings.flag("ProcessLevel:all", false ); // trick
fDecayer->settings.flag("ProcessLevel:resonanceDecays", true );
fDecayer->readString("ProcessLevel:all = off"); // trick
fDecayer->readString("ProcessLevel::resonanceDecays=on");
fDecayer->init();

return true;
Expand All @@ -450,7 +430,7 @@ bool Pythia8Hadronizer::initializeForExternalPartons()

void Pythia8Hadronizer::statistics()
{
fMasterGen->stat();
fMasterGen->statistics();

double xsec = fMasterGen->info.sigmaGen(); // cross section in mb
xsec *= 1.0e9; // translate to pb (CMS/Gen "convention" as of May 2009)
Expand Down
2 changes: 1 addition & 1 deletion GeneratorInterface/Pythia8Interface/src/Py8GunBase.cc
Expand Up @@ -167,7 +167,7 @@ void Py8GunBase::finalizeEvent()
void Py8GunBase::statistics()
{

fMasterGen->stat();
fMasterGen->statistics();

double xsec = fMasterGen->info.sigmaGen(); // cross section in mb
xsec *= 1.0e9; // translate to pb (CMS/Gen "convention" as of May 2009)
Expand Down
Expand Up @@ -95,7 +95,7 @@ bool Py8InterfaceBase:: declareSpecialSettings( const std::vector<std::string>&
void Py8InterfaceBase::statistics()
{

fMasterGen->stat();
fMasterGen->statistics();
return;

}
Expand Down
3 changes: 0 additions & 3 deletions GeneratorInterface/Pythia8Interface/test/pythia8ex2_cfg.py
Expand Up @@ -38,9 +38,6 @@
)
)

# in order to use lhapdf PDF add a line like this to pythia8_example02:
# 'PDF:pSet = LHAPDF5:MRST2004nlo.LHpdf'

process.load("FWCore.MessageLogger.MessageLogger_cfi")
process.MessageLogger = cms.Service("MessageLogger",
cout = cms.untracked.PSet(
Expand Down

0 comments on commit 9752db5

Please sign in to comment.