lcsim/src/org/lcsim/recon/tracking/seedtracker
diff -u -r1.15 -r1.16
--- FastCheck.java 28 Feb 2011 19:17:12 -0000 1.15
+++ FastCheck.java 12 Jul 2013 20:53:39 -0000 1.16
@@ -32,6 +32,8 @@
private double _eps = 1.0e-6;
private ISeedTrackerDiagnostics _diag;
private boolean _skipchecks = false;
+ private boolean _doSectorBinCheck = false;
+ private SectorManager _sectorManager = null;
public FastCheck(SeedStrategy strategy, double bfield, ISeedTrackerDiagnostics diag) {
_strategy = strategy;
@@ -50,6 +52,11 @@
// Instantiate the three point circle fitter
_cfit3 = new ThreePointCircleFitter();
}
+
+ public void setDoSectorBinCheck(SectorManager sectorManager) {
+ _doSectorBinCheck = true;
+ _sectorManager = sectorManager;
+ }
public boolean CheckHitSeed(HelicalTrackHit hit, SeedCandidate seed) {
@@ -58,6 +65,11 @@
// Check the hit against each hit in the seed
for (HelicalTrackHit hit2 : seed.getHits()) {
if (!TwoPointCircleCheck(hit, hit2, seed)) return false;
+ if (this._doSectorBinCheck) {
+ if (!zSectorCheck(hit,hit2)) {
+ return false;
+ }
+ }
}
return true;
@@ -113,6 +125,17 @@
// Check the z0 limits
boolean zOK = checkz0(smin1, smax1, zmin, zmax, smin2, smax2, zmin2, zmax2);
+
+ if(!zOK) return false;
+
+ boolean zSectorOK = true;
+
+ if(_doSectorBinCheck) {
+ zSectorOK = zSectorCheck(hit,sector);
+ }
+
+ if(!zSectorOK) return false;
+
}
return true;
}
@@ -155,12 +178,19 @@
// Check that the sectors are compatible in the non-bend coordinate
boolean zOK = checkz0(s1min, s1max, z1min, z1max, s2min, s2max, z2min, z2max);
+
+ if (!zOK) return false;
+
+ boolean zSectorOK = true;
+
+ if(_doSectorBinCheck) {
+ zSectorOK = zSectorCheck(s1,s2);
+ }
- return zOK;
+ return zSectorOK;
}
public boolean TwoPointCircleCheck(HelicalTrackHit hit1, HelicalTrackHit hit2, SeedCandidate seed) {
-
if (_skipchecks) return true;
// Initialize the hit coordinates for an unknown track direction
@@ -180,7 +210,7 @@
// Check for success
if (!success) return false;
-
+
// Initialize the minimum/maximum arc lengths
double s1min = 1.0e99;
double s1max = -1.0e99;
@@ -235,8 +265,16 @@
// Check the z0 limits using the min/max path lengths
boolean zOK = checkz0(s1min, s1max, z1min, z1max, s2min, s2max, z2min, z2max);
+ if(!zOK) return false;
+
+ boolean zSectorOK = true;
+
+ if(_doSectorBinCheck) {
+ zSectorOK = zSectorCheck(hit1,hit2);
+ }
+
// Done!
- return zOK;
+ return zSectorOK;
}
public boolean ThreePointHelixCheck(HelicalTrackHit hit1, HelicalTrackHit hit2, HelicalTrackHit hit3) {
@@ -343,7 +381,7 @@
if (dphi[i] > Math.PI) dphi[i] -= twopi;
if (dphi[i] < -Math.PI) dphi[i] += twopi;
if (Math.abs(dphi[i]) < Math.abs(dphimin)) dphimin = dphi[i];
- }
+ }
// Use the hit closest to the DCA to determine the circle "direction"
boolean cw = dphimin < 0.;
@@ -358,7 +396,7 @@
// Treat the case where a point has dphi opposite in sign to dphimin as an incoming looper hit
if (s[i] < 0.) s[i] += twopi * rcurv;
- }
+ }
// Order the arc lengths and z info by increasing arc length
for (int i=0; i<2; i++) {
@@ -523,4 +561,21 @@
return _nsig * Math.sqrt(hit.getCorrectedCovMatrix().diagonal(2));
}
}
+
+ private boolean zSectorCheck(Sector s1, Sector s2) {
+ return s1.zSector()==s2.zSector();
+ }
+
+ private boolean zSectorCheck(HelicalTrackHit hit, Sector sector) {
+ int zSector = sector.zSector();
+ int zBin = this._sectorManager.ZBin(hit);
+ return zBin==zSector;
+ }
+
+ private boolean zSectorCheck(HelicalTrackHit hit, HelicalTrackHit hit2) {
+ int zBin = this._sectorManager.ZBin(hit);
+ int zBin2 = this._sectorManager.ZBin(hit2);
+ return zBin==zBin2;
+ }
+
}
\ No newline at end of file