lcsim/src/org/lcsim/event/util
diff -u -r1.1 -r1.2
--- ParticleTypeClassifier.java 29 Nov 2007 01:02:39 -0000 1.1
+++ ParticleTypeClassifier.java 29 Nov 2007 22:12:37 -0000 1.2
@@ -16,7 +16,7 @@
* </ul>
*
* @author Jeremy McCormick <[log in to unmask]>
- * @version $Id: ParticleTypeClassifier.java,v 1.1 2007/11/29 01:02:39 jeremy Exp $
+ * @version $Id: ParticleTypeClassifier.java,v 1.2 2007/11/29 22:12:37 jeremy Exp $
*
*/
public final class ParticleTypeClassifier
@@ -41,14 +41,13 @@
/**
* True if <code>p</code> is a charged lepton.
- * Checks that particle is a lepton and that
- * <code>p</code> is even numbered.
* @param p The PDGID.
* @return True if <code>p</code> is a charged lepton.
*/
public static boolean isChargedLepton(int p)
{
- return isLepton(p) && (abs(p) % 2) == 0;
+ int pp = abs(p);
+ return pp == 11 || pp == 13 || pp == 15 || pp == 17;
}
/**
@@ -59,7 +58,8 @@
*/
public static boolean isNeutrino(int p)
{
- return isLepton(p) && (abs(p) % 2) != 0;
+ int pp = abs(p);
+ return pp == 12 || pp == 14 || pp == 16 || pp == 18;
}
/**
@@ -148,7 +148,7 @@
* True if <code>p</code> is a hadron.
* @param p The PDGID.
* @return True if <code>p</code> is a hadron.
- * FIXME: May be incorrect.
+ * FIXME: This may be incorrect. Needs to be checked.
*/
public static boolean isHadron(int p)
{
@@ -333,7 +333,7 @@
* @return True if <code>p</code> is an ion or nucleus.
* FIXME: This relies on the PDGID of ions and nuclei being 0, which may
* not be completely accurate. For instance, geantinos have a PDGID
- * of 0 also.
+ * of 0 also, so it may not be correct for all cases.
*/
public static boolean isIon(int p)
{
@@ -361,7 +361,7 @@
}
/**
- * True if <code>p</code> is a Higgs boson.
+ * True if <code>p</code> is any type of Higgs boson.
* @param p The PDGID.
* @return True if <code>p</code> is a Higgs boson.
*/
@@ -394,7 +394,7 @@
/**
* Get the flavor of a hadron indicating its quark content.
- * This method is only used internally to this class.
+ * This method is only used internally.
* @param p The PDGID.
* @return The flavor of the particle.
*/