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  April 2015

HPS-SVN April 2015

Subject:

r2785 - in /java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster: ClusterEnergyCorrection.java ClusterPositionCorrection.java ReconClusterPropertyCalculator.java

From:

[log in to unmask]

Reply-To:

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

Date:

Wed, 22 Apr 2015 19:44:30 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (171 lines)

Author: [log in to unmask]
Date: Wed Apr 22 12:44:22 2015
New Revision: 2785

Log:
updated cluster property corrections use after reconclusterer

Modified:
    java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ClusterEnergyCorrection.java
    java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ClusterPositionCorrection.java
    java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ReconClusterPropertyCalculator.java

Modified: java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ClusterEnergyCorrection.java
 =============================================================================
--- java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ClusterEnergyCorrection.java	(original)
+++ java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ClusterEnergyCorrection.java	Wed Apr 22 12:44:22 2015
@@ -4,8 +4,12 @@
 import org.lcsim.event.base.BaseCluster;
 
 /**
- * Cluster energy correction algorithm extracted from <code>HPSEcalClusterIC</code> class.
+ * This is the cluster energy correction requiring the particle id 
+ * uncorrected cluster energy. This is not accurate for edge crystals
+ * and should be used after cluster-track matching and after position
+ * corrections.
  * 
+ * @author Holly Vance <[log in to unmask]>
  * @author Jeremy McCormick <[log in to unmask]>
  */
 public final class ClusterEnergyCorrection {
@@ -71,12 +75,13 @@
     /**
      * Calculates the energy correction to a cluster given the variables from the fit as per
      * <a href="https://misportal.jlab.org/mis/physics/hps_notes/index.cfm?note_year=2014">HPS Note 2014-001</a>
+     * Note that this is correct as there is a typo in the formula print in the note. 
      * @param rawEnergy Raw energy of the cluster
      * @param A,B,C from fitting in note
      * @return Corrected Energy
      */   
     private static double computeCorrectedEnergy(double rawEnergy, double varA, double varB, double varC){
-        double corrEnergy = rawEnergy / (varA * rawEnergy + varB / (Math.sqrt(rawEnergy)) + varC);
+        double corrEnergy = rawEnergy / (varA / rawEnergy + varB / (Math.sqrt(rawEnergy)) + varC);
         return corrEnergy;
     }                   
 }

Modified: java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ClusterPositionCorrection.java
 =============================================================================
--- java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ClusterPositionCorrection.java	(original)
+++ java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ClusterPositionCorrection.java	Wed Apr 22 12:44:22 2015
@@ -4,36 +4,37 @@
 import org.lcsim.event.base.BaseCluster;
 
 /**
- * <p>
- * Cluster position corrections taken from the <code>HPSEcalClusterIC</code> class.
- * <p>
- * This should be used before the energy is corrected on the Cluster.
+ * This uses the uncorrected cluster energy to correct the position of the cluster.
+ * This should be used before the energy is corrected on the Cluster and after
+ * cluster-track matching.
  * 
+ * @author Holly Vance <[log in to unmask]>
  * @author Jeremy McCormick <[log in to unmask]>
  */
 public final class ClusterPositionCorrection {
            
     // Variables for electron position corrections.
-    static final double ELECTRON_POS_A = 0.0066;
-    static final double ELECTRON_POS_B = -0.03;
-    static final double ELECTRON_POS_C = 0.028;
-    static final double ELECTRON_POS_D = -0.45;
-    static final double ELECTRON_POS_E = 0.465;
+    static final double ELECTRON_POS_A1 = 0.0066;
+    static final double ELECTRON_POS_A2 = -0.03;
+    static final double ELECTRON_POS_B1 = 0.028;
+    static final double ELECTRON_POS_B2 = -0.451;
+    static final double ELECTRON_POS_B3 = 0.465;
     
     // Variables for positron position corrections.
-    static final double POSITRON_POS_A = 0.0072;
-    static final double POSITRON_POS_B = -0.031;
-    static final double POSITRON_POS_C = 0.007;
-    static final double POSITRON_POS_D = 0.342;
-    static final double POSITRON_POS_E = 0.108;
+    static final double POSITRON_POS_A1 = 0.0072;
+    static final double POSITRON_POS_A2 = -0.031;
+    static final double POSITRON_POS_B1 = 0.007;
+    static final double POSITRON_POS_B2 = 0.342;
+    static final double POSITRON_POS_B3 = 0.108;
     
     // Variables for photon position corrections.
-    static final double PHOTON_POS_A = 0.005;
-    static final double PHOTON_POS_B = -0.032;
-    static final double PHOTON_POS_C = 0.011;
-    static final double PHOTON_POS_D = -0.037;
-    static final double PHOTON_POS_E = 0.294;
+    static final double PHOTON_POS_A1 = 0.005;
+    static final double PHOTON_POS_A2 = -0.032;
+    static final double PHOTON_POS_B1 = 0.011;
+    static final double PHOTON_POS_B2 = -0.037;
+    static final double PHOTON_POS_B3 = 0.294;
     
+  
     public static double[] calculateCorrectedPosition(Cluster cluster) {
         double clusterPosition[] = cluster.getPosition();                
         double correctedPosition = computeCorrectedPosition(cluster.getParticleId(), clusterPosition[0], cluster.getEnergy());
@@ -58,17 +59,17 @@
      * @return Corrected x position
      */
     private static double computeCorrectedPosition(int pdg, double xPos, double rawEnergy) {
-        double xCl = xPos / 10.0;//convert to mm
+        double xCl = xPos / 10.0;//convert to cm
         double xCorr;
         switch(pdg) {
             case 11: //Particle is electron        
-                xCorr = positionCorrection(xCl, rawEnergy, ELECTRON_POS_A, ELECTRON_POS_B, ELECTRON_POS_C, ELECTRON_POS_D, ELECTRON_POS_E);
+                xCorr = positionCorrection(xCl, rawEnergy, ELECTRON_POS_A1, ELECTRON_POS_A2, ELECTRON_POS_B1, ELECTRON_POS_B2, ELECTRON_POS_B3);
                 return xCorr * 10.0;
             case -11:// Particle is positron       
-                xCorr = positionCorrection(xCl, rawEnergy, POSITRON_POS_A, POSITRON_POS_B, POSITRON_POS_C, POSITRON_POS_D, POSITRON_POS_E);
+                xCorr = positionCorrection(xCl, rawEnergy, POSITRON_POS_A1, POSITRON_POS_A2, POSITRON_POS_B1, POSITRON_POS_B2, POSITRON_POS_B3);
                 return xCorr * 10.0;
             case 22: // Particle is photon      
-                xCorr = positionCorrection(xCl, rawEnergy, PHOTON_POS_A, PHOTON_POS_B, PHOTON_POS_C, PHOTON_POS_D, PHOTON_POS_E);
+                xCorr = positionCorrection(xCl, rawEnergy, PHOTON_POS_A1, PHOTON_POS_A2, PHOTON_POS_B1, PHOTON_POS_B2, PHOTON_POS_B3);
                 return xCorr * 10.0;
             default: //Unknown 
                 xCorr = xCl;
@@ -82,14 +83,14 @@
     * <a href="https://misportal.jlab.org/mis/physics/hps_notes/index.cfm?note_year=2014">HPS Note 2014-001</a>
     * @param xCl
     * @param rawEnergy
-    * @param varA
-    * @param varB
-    * @param varC
-    * @param varD
-    * @param varE
+    * @param varA1
+    * @param varA2
+    * @param varB1
+    * @param varB2
+    * @param varB3
     * @return
     */    
-    private static double positionCorrection(double xCl, double rawEnergy, double varA, double varB, double varC, double varD, double varE) {
-        return xCl - (varA / Math.sqrt(rawEnergy) + varB ) * xCl - (varC * rawEnergy + varD / Math.sqrt(rawEnergy) + varE);
+    private static double positionCorrection(double xCl, double rawEnergy, double varA1, double varA2, double varB1, double varB2, double varB3) {
+        return ((xCl - (varB1 * rawEnergy + varB2 / Math.sqrt(rawEnergy) + varB3))/(varA1 / Math.sqrt(rawEnergy) + varA2 + 1));
     }
 }

Modified: java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ReconClusterPropertyCalculator.java
 =============================================================================
--- java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ReconClusterPropertyCalculator.java	(original)
+++ java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ReconClusterPropertyCalculator.java	Wed Apr 22 12:44:22 2015
@@ -43,9 +43,10 @@
             EcalCrystal crystal = (EcalCrystal) hit.getDetectorElement();
             Hep3Vector crystalPosition = crystal.getPositionFront();
             
-            eNumX += Math.max(0.0, (w0 + Math.log(hit.getCorrectedEnergy() / cluster.getEnergy()))) * (crystalPosition.x() / 10.0);
-            eNumY += Math.max(0.0, (w0 + Math.log(hit.getCorrectedEnergy() / cluster.getEnergy()))) * (crystalPosition.y() / 10.0);
-            eDen += Math.max(0.0, (w0 + Math.log(hit.getCorrectedEnergy() / cluster.getEnergy())));
+            double wi = Math.max(0.0, (w0 + Math.log(hit.getCorrectedEnergy() / cluster.getEnergy())));
+            eNumX += wi * (crystalPosition.x() / 10.0);
+            eNumY += wi * (crystalPosition.y() / 10.0);
+            eDen += wi;
 
         } // end for iteration through clusterHits
 

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