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:

r2093 - /java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ClusterDriver.java

From:

[log in to unmask]

Reply-To:

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

Date:

Tue, 10 Feb 2015 22:50:28 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (154 lines)

Author: [log in to unmask]
Date: Tue Feb 10 14:50:23 2015
New Revision: 2093

Log:
Remove options for applying corrections.  HPSJAVA-418

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

Modified: java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ClusterDriver.java
 =============================================================================
--- java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ClusterDriver.java	(original)
+++ java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ClusterDriver.java	Tue Feb 10 14:50:23 2015
@@ -2,7 +2,6 @@
 
 import java.util.ArrayList;
 import java.util.List;
-import java.util.logging.Level;
 
 import org.lcsim.event.CalorimeterHit;
 import org.lcsim.event.Cluster;
@@ -45,8 +44,6 @@
     protected boolean skipNoClusterEvents = false;
     protected boolean writeClusterCollection = true;
     protected boolean storeHits = true;
-    protected boolean calculateProperties = false;
-    protected boolean applyCorrections = false;
     protected boolean sortHits = false;
     protected boolean validateClusters = false;
     
@@ -71,7 +68,7 @@
      */
     public void setOutputClusterCollectionName(String outputClusterCollectionName) {        
         this.outputClusterCollectionName = outputClusterCollectionName;
-        this.getLogger().config("outputClusterCollectionName = " + this.outputClusterCollectionName);
+        getLogger().config("outputClusterCollectionName = " + this.outputClusterCollectionName);
     }
     
     /**
@@ -80,7 +77,7 @@
      */
     public void setInputHitCollectionName(String inputHitCollectionName) {
         this.inputHitCollectionName = inputHitCollectionName;
-        this.getLogger().config("inputClusterCollectionName = " + this.inputHitCollectionName);
+        getLogger().config("inputClusterCollectionName = " + this.inputHitCollectionName);
     }
     
     /**
@@ -89,7 +86,7 @@
      */
     public void setSkipNoClusterEvents(boolean skipNoClusterEvents) {
         this.skipNoClusterEvents = skipNoClusterEvents;       
-        this.getLogger().config("skipNoClusterEvents = " + this.skipNoClusterEvents);
+        getLogger().config("skipNoClusterEvents = " + this.skipNoClusterEvents);
     }
     
     /**
@@ -98,7 +95,7 @@
      */
     public void setWriteClusterCollection(boolean writeClusterCollection) {
         this.writeClusterCollection = writeClusterCollection;
-        this.getLogger().config("writeClusterCollection = " + this.writeClusterCollection);
+        getLogger().config("writeClusterCollection = " + this.writeClusterCollection);
     }
     
     /**
@@ -119,29 +116,13 @@
     }
     
     /**
-     * True to calculate cluster properties before writing to event.
-     * @param calculateProperties True to calculate cluster properties.
-     */
-    public void setCalculateProperties(boolean calculateProperties) {
-        this.calculateProperties = calculateProperties;
-    }
-    
-    /**
      * True to sort the clusters' hits before writing to event.
      * @param sortHits True to sort hits.
      */
     public void setSortHits(boolean sortHits) {
         this.sortHits = sortHits;
     }
-    
-    /**
-     * True to apply cluster position and energy corrections.
-     * @param applyCorrections True to apply corrections.
-     */
-    public void setApplyCorrections(boolean applyCorrections) {
-        this.applyCorrections = applyCorrections;
-    }
-    
+           
     /**
      * Set the Clusterer by name.  
      * This will use a factory method which first tries to use some hard-coded names from 
@@ -212,18 +193,22 @@
         if (this.cuts != null) {
             this.clusterer.getCuts().setValues(cuts);
         } 
-        getLogger().config("Clusterer has the following cuts ...");
+        StringBuffer sb = new StringBuffer();
+        sb.append("Clusterer has the following cuts ...");
+        sb.append('\n');
         for (int cutIndex = 0; cutIndex < clusterer.getCuts().getValues().length; cutIndex++) {
-            getLogger().config("  " + this.clusterer.getCuts().getNames()[cutIndex] + " = " + this.clusterer.getCuts().getValue(cutIndex));
-        }            
-        getLogger().config("initializing clusterer " + clusterer.getClass().getName());
+            sb.append(this.clusterer.getCuts().getNames()[cutIndex] + " = " + this.clusterer.getCuts().getValue(cutIndex));
+            sb.append('\n');
+        } 
+        getLogger().config(sb.toString());
         this.clusterer.initialize();
     }
     
     /**
      * This method implements the default clustering procedure based on input parameters.
      */
-    public void process(EventHeader event) {               
+    public void process(EventHeader event) {    
+                       
         if (event.hasCollection(CalorimeterHit.class, inputHitCollectionName)) {       
             List<CalorimeterHit> hits = event.get(CalorimeterHit.class, inputHitCollectionName);
             getLogger().fine("input hit collection " + inputHitCollectionName + " has " + hits.size() + " hits");
@@ -250,16 +235,7 @@
                 if (sortHits) {
                     // Sort the hits.
                     ClusterUtilities.sortReconClusterHits(clusters);
-                }
-                if (calculateProperties) {
-                    // Calculate properties using default property calculator.
-                    ClusterUtilities.calculateProperties(clusters);
-                }
-                if (applyCorrections) {
-                    // Apply additional position and energy corrections.
-                    ClusterUtilities.applyCorrections(clusters);
-                }
-                                                
+                }                                                           
                 getLogger().finer("writing " + clusters.size() + " clusters to collection " + outputClusterCollectionName);
                 event.put(outputClusterCollectionName, clusters, Cluster.class, flags);
                 if (!this.writeClusterCollection) {
@@ -273,7 +249,7 @@
                 }
             }
         } else {
-            this.getLogger().severe("The input hit collection " + this.inputHitCollectionName + " is missing from the event.");
+            getLogger().severe("The input hit collection " + this.inputHitCollectionName + " is missing from the event.");
             if (this.raiseErrorNoHitCollection) {
                 throw new RuntimeException("The expected input hit collection is missing from the event.");
             }

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