Commit 0bffcd91 authored by Lynn Garren's avatar Lynn Garren
Browse files

fixing listPythiaNames test

parent 6b1dc2cf
// $Id: getPythiaid.cc,v 1.1.4.1 2004/04/21 23:06:33 garren Exp $
// $Id: getPythiaid.cc,v 1.1.4.2 2004/05/18 23:38:07 garren Exp $
// ----------------------------------------------------------------------
//
// getPythiaid.cc
......@@ -22,9 +22,16 @@ namespace HepPDT {
bool getPythiaid( int & id, const std::string & pdline )
{
int sl = pdline.length();
std::string firstc = pdline.substr(0,1);
id = 0;
if( sl > 30 && firstc == " " ){
// line is too short
if( sl < 30 ) return false;
// now check for various comments to avoid problems with Solaris
std::string stars = pdline.substr(1,2);
std::string kfline = pdline.substr(0,10);
if( stars == "**" || kfline == " KF" ) return false;
// try to read the kf number
std::string firstc = pdline.substr(0,1);
if( firstc == " " ){
std::istringstream var1( pdline.substr(0,10).c_str() );
var1 >> id; // if var1 is blank, id is not changed
return true;
......
// $Id: listPythiaTranslation.cc,v 1.1.4.1 2004/04/21 23:06:33 garren Exp $
// $Id: listPythiaTranslation.cc,v 1.1.4.2 2004/05/18 23:38:07 garren Exp $
// ----------------------------------------------------------------------
//
// listPythiaTranslation.cc
......@@ -68,8 +68,9 @@ ParticleTranslation getPythiaAntiParticle( int & anti,
std::string & aname, ParticleTranslation & pt )
{
std::string mc = std::string("Pythia");
ParticleID pid( translatePythiatoPDT( anti ) );
return ParticleTranslation( pid, anti, aname, mc );
int ap = -pt.oid();
ParticleID pid( translatePythiatoPDT( ap ) );
return ParticleTranslation( pid, ap, aname, mc );
}
bool listPythiaTranslation ( std::istream & pdfile, std::ostream & os )
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment