lcsim/src/org/lcsim/recon/cluster/clumpfinder
diff -u -r1.1 -r1.2
--- HighHitDensityDecision.java 17 Jan 2006 00:11:05 -0000 1.1
+++ HighHitDensityDecision.java 19 Nov 2007 21:53:31 -0000 1.2
@@ -24,7 +24,7 @@
* Eventually this should be made more flexible and moved outside
* the "structural" package.
*
- * @version $Id: HighHitDensityDecision.java,v 1.1 2006/01/17 00:11:05 mcharles Exp $
+ * @version $Id: HighHitDensityDecision.java,v 1.2 2007/11/19 21:53:31 mcharles Exp $
*/
public class HighHitDensityDecision implements DecisionMakerSingle<CalorimeterHit>
@@ -44,8 +44,10 @@
/**
* Check if the CalorimeterHit has a high local hit density.
- * Currently hard-coded to look in a 5x5x3 grid and require
- * at least 6 other hits present.
+ * Currently hard-coded to check
+ * (a) a 5x5x3 grid, requiring at least 18 other hits present,
+ * (b) a 3x3x3 grid, requiring at least 6 other hits present.
+ * If either check passes, accept.
*/
public boolean valid(CalorimeterHit seedHit)
{
@@ -58,19 +60,31 @@
} else {
// Parameters (hard-coded for now);
int deltaLayer = 1;
- int deltaTheta = 2;
- int deltaPhi = 2;
- int minNeighbours = 6;
+ int deltaThetaWide = 2;
+ int deltaPhiWide = 2;
+ int minNeighboursWide = 18;
+ int deltaThetaNarrow = 1;
+ int deltaPhiNarrow = 1;
+ int minNeighboursNarrow = 6;
// Find all hits from [unusedHits] within range:
- long[] neighbourIDs = idCAL.getNeighbourIDs(deltaLayer, deltaTheta, deltaPhi);
- Set<Long> acceptedNeighbourIDs = new HashSet<Long>();
- for (long neighbourID : neighbourIDs) {
+ long[] wideWindowNeighbourIDs = idCAL.getNeighbourIDs(deltaLayer, deltaThetaWide, deltaPhiWide);
+ long[] narrowWindowNeighbourIDs = idCAL.getNeighbourIDs(deltaLayer, deltaThetaNarrow, deltaPhiNarrow);
+ Set<Long> wideWindowAcceptedNeighbourIDs = new HashSet<Long>();
+ Set<Long> narrowWindowAcceptedNeighbourIDs = new HashSet<Long>();
+ for (long neighbourID : wideWindowNeighbourIDs) {
if (m_hitIDSet.contains(new Long(neighbourID))) {
- acceptedNeighbourIDs.add(neighbourID);
+ wideWindowAcceptedNeighbourIDs.add(neighbourID);
+ }
+ }
+ for (long neighbourID : narrowWindowNeighbourIDs) {
+ if (m_hitIDSet.contains(new Long(neighbourID))) {
+ narrowWindowAcceptedNeighbourIDs.add(neighbourID);
}
}
// Were there enough?
- if (acceptedNeighbourIDs.size() >= minNeighbours) {
+ boolean passedNarrow = (narrowWindowAcceptedNeighbourIDs.size() >= minNeighboursNarrow);
+ boolean passedWide = ( wideWindowAcceptedNeighbourIDs.size() >= minNeighboursWide );
+ if (passedNarrow || passedWide) {
// Accept this
return true;
} else {