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  March 2016

HPS-SVN March 2016

Subject:

r4306 - /java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/EcalTimeWalk.java

From:

[log in to unmask]

Reply-To:

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

Date:

Fri, 18 Mar 2016 21:44:16 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (135 lines)

Author: [log in to unmask]
Date: Fri Mar 18 14:44:14 2016
New Revision: 4306

Log:
updated time walk correction to read from db

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

Modified: java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/EcalTimeWalk.java
 =============================================================================
--- java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/EcalTimeWalk.java	(original)
+++ java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/EcalTimeWalk.java	Fri Mar 18 14:44:14 2016
@@ -1,4 +1,6 @@
 package org.hps.recon.ecal;
+
+import org.hps.conditions.database.DatabaseConditionsManager;
 
 public final class EcalTimeWalk {
 
@@ -6,62 +8,76 @@
     // Put parameters in the conditions database once functional form is fixed.
 
     // From a fit of Pass0 Run 3261 (Mode-3 FADC):
-    //  (p0+p1*e+e^2*p2) * exp(-(p3*e+p4*e^2+p5*e^4))
-    private static final double[] pars = { 
-            3.64218e+01, 
-           -4.60756e+02, 
-            9.18743e+03,
-            3.73873e+01, 
-           -6.57130e+01, 
-            1.07182e+02 
-    };
+    // (p0+p1*e+e^2*p2) * exp(-(p3*e+p4*e^2+p5*e^4))
+    private static final double[] pars = { 3.64218e+01, -4.60756e+02,
+            9.18743e+03, 3.73873e+01, -6.57130e+01, 1.07182e+02 };
 
     private EcalTimeWalk() {
     }
 
     /**
      * Perform Time Walk Correction
-     * @param time   - FADC Mode-3 Hit time (ns)
-     * @param energy - Pulse energy (GeV)
+     * 
+     * @param time
+     *            - FADC Mode-3 Hit time (ns)
+     * @param energy
+     *            - Pulse energy (GeV)
      * @return corrected time (ns)
      */
     public static final double correctTimeWalk(double time, double energy) {
-        final double poly1 = pars[0] + 
-                             pars[1] * energy +
-                             pars[2] * energy * energy;
-        final double poly2 = pars[3] * energy +
-                             pars[4] * energy * energy +
-                             pars[5] * Math.pow(energy, 4);
+        final double poly1 = pars[0] + pars[1] * energy + pars[2] * energy
+                * energy;
+        final double poly2 = pars[3] * energy + pars[4] * energy * energy
+                + pars[5] * Math.pow(energy, 4);
         return time - poly1 * Math.exp(-poly2);
     }
-    
+
     /*
      * Time walk parameters for pulse fitting
      */
+
     private static final double[] par = {
-        0.9509,
-        -33.21,
-        0.2614,
-        -0.9128,
-        0.6251
-   };
-    
+            DatabaseConditionsManager
+                    .getInstance()
+                    .getCachedConditions(
+                            org.hps.conditions.ecal.EcalTimeWalk.class,
+                            "ecal_time_walk").getCachedData().getP0(),
+            DatabaseConditionsManager
+                    .getInstance()
+                    .getCachedConditions(
+                            org.hps.conditions.ecal.EcalTimeWalk.class,
+                            "ecal_time_walk").getCachedData().getP1(),
+            DatabaseConditionsManager
+                    .getInstance()
+                    .getCachedConditions(
+                            org.hps.conditions.ecal.EcalTimeWalk.class,
+                            "ecal_time_walk").getCachedData().getP2(),
+            DatabaseConditionsManager
+                    .getInstance()
+                    .getCachedConditions(
+                            org.hps.conditions.ecal.EcalTimeWalk.class,
+                            "ecal_time_walk").getCachedData().getP3(),
+            DatabaseConditionsManager
+                    .getInstance()
+                    .getCachedConditions(
+                            org.hps.conditions.ecal.EcalTimeWalk.class,
+                            "ecal_time_walk").getCachedData().getP4() };
+
     /**
      * Perform Time Walk Correction for Mode 1 hits using pulse fitting
-     * @param time - FADC Mode 1 hit time from pulse fitting (ns)
-     * @param energy - Pulse energy from pulse fitting (GeV)
+     * 
+     * @param time
+     *            - FADC Mode 1 hit time from pulse fitting (ns)
+     * @param energy
+     *            - Pulse energy from pulse fitting (GeV)
      * @return corrected time (ns)
      */
-    public static final double correctTimeWalkPulseFitting(double time, double energy) {
-        final double polyA = par[0] + par[1]*energy;
-        final double polyB = par[2] + par[3] * energy + par[4] * Math.pow(energy, 2);
+    public static final double correctTimeWalkPulseFitting(double time,
+            double energy) {
+        final double polyA = par[0] + par[1] * energy;
+        final double polyB = par[2] + par[3] * energy + par[4]
+                * Math.pow(energy, 2);
         return time - (Math.exp(polyA) + polyB);
     }
-    
-    
-    
-    
-    
-    
 
 }

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