preventing SEGV in TDatabasePDG::ReadPDGTable()

From: Robert Hatcher <rhatcher_at_fnal.gov>
Date: Thu, 11 Mar 2010 20:36:58 -0600


If users call TDatabasePDG::ReadPDGTable() twice for the same input file the code SEGV's because AddParticle(), which normally returns a pointer to the newly added TParticlePDG, returns 0 if the particle already exists. If the entry also has decay info then it attempts to use the null pointer to AddDecayChannel(). The SEGV can be avoided by the addition of a simple "if (part)" conditional:

This isn't necessarily ideal in that it generates a lot of "already defined" warning messages (from the AddParticle calls) but it avoids a premature exit from the program.

-robert

Robert W. Hatcher | rhatcher_at_fnal.gov 630-840-3102 FNAL CD/REX (MINOS) | MS 220, PO Box 500, Batavia IL 60510 Received on Fri Mar 12 2010 - 03:37:19 CET

This archive was generated by hypermail 2.2.0 : Fri Mar 12 2010 - 17:50:02 CET