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:

r2119 - in /java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal: EcalRawConverter.java EcalRawConverterDriver.java

From:

[log in to unmask]

Reply-To:

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

Date:

Thu, 12 Feb 2015 02:38:06 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (107 lines)

Author: [log in to unmask]
Date: Wed Feb 11 18:38:01 2015
New Revision: 2119

Log:
implementing time-walk correction for Mode-3 data, disabled by default in EcalRawConverter

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

Modified: java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/EcalRawConverter.java
 =============================================================================
--- java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/EcalRawConverter.java	(original)
+++ java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/EcalRawConverter.java	Wed Feb 11 18:38:01 2015
@@ -27,6 +27,7 @@
  */
 public class EcalRawConverter {
 
+    private boolean useTimeWalkCorrection = false;
     private boolean useRunningPedestal = false;
     private boolean constantGain = false;
     private double gain;
@@ -49,9 +50,17 @@
     public void setUseRunningPedestal(boolean useRunningPedestal) {
         this.useRunningPedestal=useRunningPedestal;
     }
-   
-    // Choose whether to use static pedestal from database or running pedestal (NAB Feb 11, 2015):
-    public double getPedestal(EventHeader event,RawCalorimeterHit hit)
+    
+    public void setUseTimeWalkCorrection(boolean useTimeWalkCorrection) {
+        this.useTimeWalkCorrection=useTimeWalkCorrection;
+    }
+  
+    /*
+     * NAB 2015/02/11 
+     * Choose whether to use static pedestal from database or running pedestal.
+     * This can only used for Mode-7 data.
+     */
+    public double getMode7Pedestal(EventHeader event,RawCalorimeterHit hit)
     {
         if (useRunningPedestal) {
             if (event.hasItem("EcalRunningPedestals")) {
@@ -94,32 +103,37 @@
         return CalorimeterHitUtilities.create(rawEnergy, time, id);
     }
 
+    /*
+     * This HitDtoA is for Mode-3 data at least, but definitely not Mode-7.
+     * A time-walk correction can be applied.  (NAB 2015/02/11).
+     */
     public CalorimeterHit HitDtoA(RawCalorimeterHit hit, int window, double timeOffset) {
         if (hit.getTimeStamp() % 64 != 0) {
             System.out.println("unexpected timestamp " + hit.getTimeStamp());
         }
         double time = hit.getTimeStamp() / 16.0;
         long id = hit.getCellID();
-        // Get the channel data.
         EcalChannelConstants channelData = findChannel(id);
         double adcSum = hit.getAmplitude() - window * channelData.getCalibration().getPedestal();
         double rawEnergy = adcToEnergy(adcSum, id);
+        if (useTimeWalkCorrection) {
+           time = EcalTimeWalk.correctTimeWalk(time,rawEnergy);
+        }
         return CalorimeterHitUtilities.create(rawEnergy, time + timeOffset, id);
-        //return h2;
     }
 
+    /*
+     * This HitDtoA is exclusively for Mode-7 data, hence the GenericObject parameter.
+     * The decision to call this method is made in EcalRawConverterDriver based on the
+     * format of the input EVIO data.  EventHeader is also passed in order to allow access
+     * to running pedestals, which is only applicable to Mode-7 data.  (NAB, 2015/02/11)
+     */
     public CalorimeterHit HitDtoA(EventHeader event,RawCalorimeterHit hit, GenericObject mode7Data, int window, double timeOffset) {
         double time = hit.getTimeStamp() / 16.0; //timestamps use the full 62.5 ps resolution
         long id = hit.getCellID();
-//        // Get the channel data.
-//        EcalChannelConstants channelData = findChannel(id);
-//        double adcSum = hit.getAmplitude() - window * channelData.getCalibration().getPedestal();
-//        double adcSum = hit.getAmplitude() - window * Mode7Data.getAmplLow(mode7Data);                              //A.C. is this the proper way to pedestal subtract in mode 7?
-        double adcSum = hit.getAmplitude() - window * getPedestal(event,hit);
+        double adcSum = hit.getAmplitude() - window * getMode7Pedestal(event,hit);
         double rawEnergy = adcToEnergy(adcSum, id);        
         return CalorimeterHitUtilities.create(rawEnergy, time + timeOffset, id);
-                       
-        //return h2;
     }
 
     public RawCalorimeterHit HitAtoD(CalorimeterHit hit, int window) {

Modified: java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/EcalRawConverterDriver.java
 =============================================================================
--- java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/EcalRawConverterDriver.java	(original)
+++ java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/EcalRawConverterDriver.java	Wed Feb 11 18:38:01 2015
@@ -51,6 +51,9 @@
         converter.setUse2014Gain(use2014Gain);
     }
 
+    public void setUseTimeWalkCorrection(boolean useTimeWalkCorrection) {
+        converter.setUseTimeWalkCorrection(useTimeWalkCorrection);
+    }
     public void setUseRunningPedestal(boolean useRunningPedestal) {
         converter.setUseRunningPedestal(useRunningPedestal);
     }

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