slic/src
diff -u -r1.5 -r1.6
--- LcioMcpFactory.cc 21 Sep 2005 22:54:19 -0000 1.5
+++ LcioMcpFactory.cc 7 Oct 2005 21:08:51 -0000 1.6
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/slic/src/LcioMcpFactory.cc,v 1.5 2005/09/21 22:54:19 jeremy Exp $
+// $Header: /cvs/lcd/slic/src/LcioMcpFactory.cc,v 1.6 2005/10/07 21:08:51 jeremy Exp $
#include "LcioMcpFactory.hh"
// slic
@@ -26,6 +26,8 @@
using EVENT::MCParticle;
using IMPL::MCParticleImpl;
+#include <iostream>
+
namespace slic
{
@@ -296,8 +298,14 @@
// mass
mcp->setMass( primary->GetMass() / GeV );
- // charge
- mcp->setCharge( primary->GetCharge() );
+ /* Invalid charge from primary? --> Set to NaN in MCParticle. */
+ if ( std::isinf( primary->GetCharge() )) {
+ mcp->setCharge( LcioMcpManager::NO_CHARGE_FLAG );
+ }
+ /* Otherwise, the primary itself has a valid charge. (Can this happen???) */
+ else {
+ mcp->setCharge( primary->GetCharge() );
+ }
return mcp;
}