lcsim/src/org/lcsim/recon/util
diff -u -r1.1 -r1.2
--- PfoSelector.java 15 Apr 2011 12:49:05 -0000 1.1
+++ PfoSelector.java 5 May 2011 17:24:23 -0000 1.2
@@ -311,7 +311,9 @@
selectPfo = useClusterLessPfos;
}
}
- if (!selectPfo) passPfoSelection = false;
+ if (!selectPfo) {
+ passPfoSelection = false;
+ }
}
// Print some diagnostic which PFOs are selected and which are rejected
@@ -542,7 +544,7 @@
s = sR;
} else {
// helix can reach endcap and barrel, which is closer?
- s = Math.min(helixSwimmer.getDistanceToZ(ecalZ), helixSwimmer.getDistanceToPolyhedra(ecalRadius, ecalNumSides));
+ s = Math.min(sZ, sR);
}
// time of flight along line of sight from IP to point of impact at the ECal
@@ -552,7 +554,7 @@
// time of flight along the helix, assuming particle to be pion
SpaceVector p = new CartesianVector(track.getMomentum());
double E = Math.sqrt(p.magnitudeSquared()+0.139*0.139);
- double minTime = s/300.0*E-tof;
+ double minTime = s/(300.*p.magnitude())*E-tof;
return new TravelTime(minTime, tof);
}
@@ -611,11 +613,11 @@
// The actual calculation of energy weighted cluster times
for (CalorimeterHit hit : hits) {
double hitTime = hit.getTime();
- double hitEnergy = hit.getCorrectedEnergy();
// Do not forget time of flight correction if needed
if (correctHitTimesForTimeOfFlight) hitTime -= tofCorrections.get(hit);
// Only use hits which are around the median time of the shower
if ((hitTime - medianTime) < deltaMedian ) {
+ double hitEnergy = hit.getCorrectedEnergy();
sumEnergy += hitEnergy;
sumTimeEnergy += hitEnergy*hitTime;
cT.nCaloHits++;