Author: [log in to unmask]
Date: Mon Dec 19 11:03:25 2016
New Revision: 4647
Log:
Determine the track charge directly from its curvature.
Modified:
java/trunk/recon/src/main/java/org/hps/recon/particle/ReconParticleDriver.java
Modified: java/trunk/recon/src/main/java/org/hps/recon/particle/ReconParticleDriver.java
=============================================================================
--- java/trunk/recon/src/main/java/org/hps/recon/particle/ReconParticleDriver.java (original)
+++ java/trunk/recon/src/main/java/org/hps/recon/particle/ReconParticleDriver.java Mon Dec 19 11:03:25 2016
@@ -270,7 +270,7 @@
// the best match is.
// TODO: At some point, pull this out to it's own method
for (List<Track> tracks : trackCollections) {
-
+
for (Track track : tracks) {
// Create a reconstructed particle to represent the track.
@@ -278,14 +278,15 @@
// Store the track in the particle.
particle.addTrack(track);
-
+
// Set the type of the particle. This is used to identify
// the tracking strategy used in finding the track associated with
// this particle.
((BaseReconstructedParticle) particle).setType(track.getType());
// Derive the charge of the particle from the track.
- ((BaseReconstructedParticle) particle).setCharge(track.getCharge() * flipSign);
+ int charge = (int) Math.signum(track.getTrackStates().get(0).getOmega());
+ ((BaseReconstructedParticle) particle).setCharge(charge * flipSign);
// initialize PID quality to a junk value:
((BaseReconstructedParticle)particle).setGoodnessOfPid(9999);
|