Author: [log in to unmask] Date: Fri Sep 4 18:53:20 2015 New Revision: 3539 Log: vertex more freely between different track types; fix a dumb bug in BilliorTrack Modified: java/trunk/recon/src/main/java/org/hps/recon/particle/HpsReconParticleDriver.java java/trunk/recon/src/main/java/org/hps/recon/vertexing/BilliorTrack.java Modified: java/trunk/recon/src/main/java/org/hps/recon/particle/HpsReconParticleDriver.java ============================================================================= --- java/trunk/recon/src/main/java/org/hps/recon/particle/HpsReconParticleDriver.java (original) +++ java/trunk/recon/src/main/java/org/hps/recon/particle/HpsReconParticleDriver.java Fri Sep 4 18:53:20 2015 @@ -19,6 +19,7 @@ import org.lcsim.fit.helicaltrack.HelicalTrackFit; import org.lcsim.recon.tracking.seedtracker.SeedTrack; import org.hps.recon.tracking.CoordinateTransformations; +import org.hps.recon.tracking.TrackType; import org.hps.recon.vertexing.BilliorTrack; import org.hps.recon.vertexing.BilliorVertex; import org.hps.recon.vertexing.BilliorVertexer; @@ -150,10 +151,14 @@ for(ReconstructedParticle positron : positrons) { for(ReconstructedParticle electron : electrons) { - // Only vertex particles that are of the same type. This is - // only needed when using multiple track collections and - // should be removed once all strategies are combined into one. - if (positron.getType() != electron.getType()) continue; + // Don't vertex a GBL track with a SeedTrack. + if (TrackType.isGBL(positron.getType()) != TrackType.isGBL(electron.getType())) { + continue; + } + // Only vertex two particles if at least one strategy found both tracks. Take out this check once we reduce the number of tracks. + if ((positron.getType() & electron.getType() & 0x1f) == 0) { + continue; + } // Make V0 candidates this.makeV0Candidates(electron, positron); @@ -172,11 +177,16 @@ // Moller candidates. if (firstElectron == secondElectron) continue; - // Only vertex particles that are of the same type. This is - // only needed when using multiple track collections and - // should be removed once all strategies are combined into one. - if (firstElectron.getType() != secondElectron.getType()) continue; - + // Don't vertex a GBL track with a SeedTrack. + if (TrackType.isGBL(firstElectron.getType()) != TrackType.isGBL(secondElectron.getType())) { + continue; + } + + // Only vertex two particles if at least one strategy found both tracks. Take out this check once we reduce the number of tracks. + if ((firstElectron.getType() & secondElectron.getType() & 0x1f) == 0) { + continue; + } + // Require the the mollers are in opposite volumes if (firstElectron.getTracks().get(0).getTrackStates().get(0).getTanLambda() *secondElectron.getTracks().get(0).getTrackStates().get(0).getTanLambda() > 0) continue; @@ -391,10 +401,7 @@ * </code> object. */ private BilliorTrack toBilliorTrack(Track track) { - // Convert the track to a helical track fit. - HelicalTrackFit trackFit = ((SeedTrack) track).getSeedCandidate().getHelix(); - // Generate and return the billior track. - return new BilliorTrack(trackFit); + return new BilliorTrack(track); } } Modified: java/trunk/recon/src/main/java/org/hps/recon/vertexing/BilliorTrack.java ============================================================================= --- java/trunk/recon/src/main/java/org/hps/recon/vertexing/BilliorTrack.java (original) +++ java/trunk/recon/src/main/java/org/hps/recon/vertexing/BilliorTrack.java Fri Sep 4 18:53:20 2015 @@ -90,7 +90,7 @@ TrackState ts=track.getTrackStates().get(0); double[] helixparameters = ts.getParameters(); _parameters = convertParsToBillior(helixparameters); - SymmetricMatrix helixcovmatrix = new SymmetricMatrix(3,ts.getCovMatrix(),true); + SymmetricMatrix helixcovmatrix = new SymmetricMatrix(5,ts.getCovMatrix(),true); _covmatrix = convertCovarianceToBillior(helixcovmatrix, helixparameters); _chisq[0]= track.getChi2(); _nhchisq = 0.;