LISTSERV mailing list manager LISTSERV 16.5

Help for HPS-SVN Archives


HPS-SVN Archives

HPS-SVN Archives


HPS-SVN@LISTSERV.SLAC.STANFORD.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

HPS-SVN Home

HPS-SVN Home

HPS-SVN  February 2015

HPS-SVN February 2015

Subject:

r2111 - /java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ReconClusterer.java

From:

[log in to unmask]

Reply-To:

Notification of commits to the hps svn repository <[log in to unmask]>

Date:

Wed, 11 Feb 2015 22:18:55 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (128 lines)

Author: [log in to unmask]
Date: Wed Feb 11 14:18:50 2015
New Revision: 2111

Log:
hit time cuts in clustering

Modified:
    java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ReconClusterer.java

Modified: java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ReconClusterer.java
 =============================================================================
--- java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ReconClusterer.java	(original)
+++ java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ReconClusterer.java	Wed Feb 11 14:18:50 2015
@@ -64,7 +64,7 @@
     double minTime = 0.0;
 
     // Maximum time cut window range. Units in ns.
-    double timeWindow = 20.0;
+    double timeWindow = 25.0;
 
     // Make a map for quick calculation of the x-y position of crystal face
     Map<Point, double[]> correctedPositionMap = new HashMap<Point, double[]>();
@@ -73,7 +73,7 @@
 
     ReconClusterer() {
         super(new String[] { "hitEnergyThreshold", "seedEnergyThreshold", "clusterEnergyThreshold", "minTime", "timeWindow" }, 
-                new double[] { 0.0075, 0.1, 0.3, 0.0, 20.0 });
+                new double[] { 0.0075, 0.1, 0.3, 0.0, 25.0 });
     }
 
     void setUseTimeCut(boolean useTimeCut) {
@@ -116,10 +116,8 @@
         // Filter the hit list of any hits that fail to pass the
         // designated threshold.
         for (int index = hitList.size() - 1; index >= 0; index--) {
-            // If the hit is below threshold or outside of time window, kill it.
-            if ((hitList.get(index).getCorrectedEnergy() < hitEnergyThreshold) 
-            		|| (useTimeCut && (hitList.get(index).getTime() < minTime 
-            				|| hitList.get(index).getTime() > (minTime + timeWindow)))) {
+            // If the hit is below threshold, kill it.
+            if ((hitList.get(index).getCorrectedEnergy() < hitEnergyThreshold)) {
                 rejectedHitList.add(hitList.get(index));
                 hitList.remove(index);
             }
@@ -382,13 +380,35 @@
         for (CalorimeterHit ihit : hitList) {
             CalorimeterHit iseed = hitToSeed.get(ihit);
             BaseCluster icluster = seedToCluster.get(iseed);
-            icluster.addHit(ihit);
+            
+            // Consider time cut-is this hit in same time window as seed?
+            if (useTimeCut){
+            	if((ihit.getTime() - iseed.getTime()) < timeWindow)
+            	{	
+            		icluster.addHit(ihit);
+            	}
+            } // end of using time cut
+            else {icluster.addHit(ihit);}           
         }
 
         // Add common hits
         for (Map.Entry<CalorimeterHit, List<CalorimeterHit>> commHit : commonHits.entrySet()) {
-            CalorimeterHit seedA = commHit.getValue().get(0);
+        	// Check that the common hit is in both time windows to their clusters
+        	CalorimeterHit seedA = commHit.getValue().get(0);
             CalorimeterHit seedB = commHit.getValue().get(1);
+        	
+            boolean inTimeWithA = false;
+            boolean inTimeWithB = false;
+        	// In time window with seedA?
+            if ((commHit.getKey().getTime() - seedA.getTime()) < timeWindow){
+            	inTimeWithA = true;
+            }
+            
+            // In time window with seedB?
+            if ((commHit.getKey().getTime() - seedB.getTime()) < timeWindow){
+            	inTimeWithB = true;
+            }
+                    	
             double eclusterA = seedToCluster.get(seedA).getEnergy();
             double eclusterB = seedToCluster.get(seedB).getEnergy();
             double fractionA = eclusterA / (eclusterA + eclusterB);
@@ -399,10 +419,31 @@
             BaseCluster clusterA = seedToCluster.get(seedA);
             BaseCluster clusterB = seedToCluster.get(seedB);
 
-            clusterA.addHit(commHit.getKey(), hitcontributionA);
-            clusterB.addHit(commHit.getKey(), hitcontributionB);
-        }
-
+            if (useTimeCut){
+            	// Do this if the hit is in both cluster's windows
+            	if (inTimeWithA && inTimeWithB){
+            		clusterA.addHit(commHit.getKey(), hitcontributionA);
+            		clusterB.addHit(commHit.getKey(), hitcontributionB);
+            	}
+            
+            	//If the hit is only in 1 cluster's window, add the full contribution
+            	else if(inTimeWithA ^ inTimeWithB){
+            		if(inTimeWithA){
+            			clusterA.addHit(commHit.getKey());
+            		}
+            		else{
+            			clusterB.addHit(commHit.getKey());
+            		}
+            	}
+            } // end of using time cut
+            else{
+            	clusterA.addHit(commHit.getKey(), hitcontributionA);
+        		clusterB.addHit(commHit.getKey(), hitcontributionB);           	
+            }
+            
+        }
+
+        
         // Remove clusters that do not pass cluster threshold and add to rejectedHitList.
         for (int j = 0; j <= clusterList.size() - 1; j++) {
             BaseCluster checkcluster = (BaseCluster) clusterList.get(j);
@@ -419,6 +460,7 @@
                 continue;
             }
         }
+        //System.out.println("Number of clusters:"+clusterList.size());
         return clusterList;
     }
 

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

November 2017
August 2017
July 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013

ATOM RSS1 RSS2



LISTSERV.SLAC.STANFORD.EDU

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager

Privacy Notice, Security Notice and Terms of Use