Skip to content

Commit

Permalink
Merge pull request cms-sw#2681 from smrenna/pythia8-check-ids
Browse files Browse the repository at this point in the history
Pythia8 -- Check if Pythia8 recognizes the stable particles
  • Loading branch information
nclopezo authored and bendavid committed Sep 28, 2014
1 parent 103f31f commit f6c01e2
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions GeneratorInterface/Pythia8Interface/src/Py8InterfaceBase.cc
Expand Up @@ -3,6 +3,7 @@
#include "GeneratorInterface/Core/interface/RNDMEngineAccess.h"

#include "FWCore/Utilities/interface/Exception.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"

using namespace Pythia8;

Expand Down Expand Up @@ -61,11 +62,19 @@ bool Py8InterfaceBase::declareStableParticles( const std::vector<int>& pdgIds )
//
// well, actually it looks like Py8 operates in PDT id's rather than Py6's
//
// int PyID = HepPID::translatePDTtoPythia( pdgIds[i] );
// int PyID = HepPID::translatePDTtoPythia( pdgIds[i] );
int PyID = pdgIds[i];
std::ostringstream pyCard ;
pyCard << PyID <<":mayDecay=false";
fMasterGen->readString( pyCard.str() );

if ( fMasterGen->particleData.isParticle( PyID ) ) {
fMasterGen->readString( pyCard.str() );
} else {

edm::LogWarning("DataNotUnderstood") << "Pythia8 does not "
<< "recognize particle id = "
<< PyID << std::endl;
}
// alternative:
// set the 2nd input argument warn=false
// - this way Py8 will NOT print warnings about unknown particle code(s)
Expand Down

0 comments on commit f6c01e2

Please sign in to comment.