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  November 2014

HPS-SVN November 2014

Subject:

r1588 - /java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/EcalRawConverter.java

From:

[log in to unmask]

Reply-To:

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

Date:

Tue, 25 Nov 2014 22:10:23 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (134 lines)

Author: [log in to unmask]
Date: Tue Nov 25 14:10:20 2014
New Revision: 1588

Log:
Remove hack where constant is added to raw energy.  Unset energy is now Double.MIN_VALUE so this should not be needed any longer.  Also make a few methods public so class is usable outside its package.

Modified:
    java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/EcalRawConverter.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	Tue Nov 25 14:10:20 2014
@@ -11,22 +11,20 @@
 import org.lcsim.geometry.Detector;
 
 /**
- *
- * @version $Id: HPSEcalRawConverterDriver.java,v 1.2 2012/05/03 00:17:54
- * phansson Exp $
+ * This class is used to convert {@link org.lcsim.event.RawCalorimeterHit} objects
+ * to {@link org.lcsim.event.CalorimeterHit} objects with energy information.
+ * It has methods to convert pedestal subtracted ADC counts to energy.  
+ * 
+ * @author Sho Uemura <[log in to unmask]>
+ * @author Jeremy McCormick <[log in to unmask]>
  */
 public class EcalRawConverter {
 
-    private final boolean debug = false;
     private boolean constantGain = false;
     private double gain;
     private boolean use2014Gain = true;
     
-    //get the database condition manager
-    
-//    Detector detector = DatabaseConditionsManager.getInstance().getDetectorObject();
     private EcalConditions ecalConditions = null;
-
 
     public EcalRawConverter() {	
     }
@@ -40,24 +38,13 @@
         this.use2014Gain = use2014Gain;
     }
 
-    private short sumADC(RawTrackerHit hit) {
-        //Sum all pedestal subtracted ADC values 
-        //return scale * (amplitude + 0.5) + pedestal;
-        if (debug) {
-            System.out.println("Summing ADC for hit: " + hit.toString());
-        }
-        
-        // Get the channel data.
-        EcalChannelConstants channelData = findChannel(hit.getCellID());
-        
+    public short sumADC(RawTrackerHit hit) {
+        EcalChannelConstants channelData = findChannel(hit.getCellID());        
         double pedestal = channelData.getCalibration().getPedestal();
         short sum = 0;
         short samples[] = hit.getADCValues();
         for (int isample = 0; isample < samples.length; ++isample) {
             sum += (samples[isample] - pedestal);
-            if (debug) {
-                System.out.println("Sample " + isample + " " + samples[isample] + " pedestal " + pedestal + " (" + sum + ")");
-            }
         }
         return sum;
     }
@@ -66,9 +53,7 @@
         double time = hit.getTime();
         long id = hit.getCellID();
         double rawEnergy = adcToEnergy(sumADC(hit), id);
-        HPSCalorimeterHit h1 = new HPSCalorimeterHit(rawEnergy + 0.0000001, time, id, 0);
-//        double[] pos = hit.getDetectorElement().getGeometry().getPosition().v();
-        //+0.0000001 is a horrible hack to ensure rawEnergy!=BaseCalorimeterHit.UNSET_CORRECTED_ENERGY
+        HPSCalorimeterHit h1 = new HPSCalorimeterHit(rawEnergy, time, id, 0);
         return h1;
     }
 
@@ -82,8 +67,7 @@
         EcalChannelConstants channelData = findChannel(id);
         double adcSum = hit.getAmplitude() - window * channelData.getCalibration().getPedestal();
         double rawEnergy = adcToEnergy(adcSum, id);
-        HPSCalorimeterHit h2 = new HPSCalorimeterHit(rawEnergy + 0.0000001, time + timeOffset, id, 0);
-        //+0.0000001 is a horrible hack to ensure rawEnergy!=BaseCalorimeterHit.UNSET_CORRECTED_ENERGY
+        HPSCalorimeterHit h2 = new HPSCalorimeterHit(rawEnergy, time + timeOffset, id, 0);
         return h2;
     }
 
@@ -124,30 +108,15 @@
             }
         }
     }
-    /*
-     public static CalorimeterHit HitDtoA(RawCalorimeterHit hit, int window, double g) {
-     if (hit.getTimeStamp() % 64 != 0) {
-     System.out.println("unexpected timestamp " + hit.getTimeStamp());
-     }
-     double time = hit.getTimeStamp() / 16.0;
-     long id = hit.getCellID();
-     double rawEnergy = g * (hit.getAmplitude() - window * EcalConditions.physicalToPedestal(id)) * ECalUtils.MeV;
-     CalorimeterHit h = new HPSCalorimeterHit(rawEnergy + 0.0000001, time, id, 0);
-     //+0.0000001 is a horrible hack to ensure rawEnergy!=BaseCalorimeterHit.UNSET_CORRECTED_ENERGY
-     return h;
-     }
-     */
+
     /** 
      * Must be set when an object EcalRawConverter is created.
      * @param detector (long)
      */   
-    void setDetector(Detector detector) {
-    	
+    public void setDetector(Detector detector) {
         // ECAL combined conditions object.
         ecalConditions = ConditionsManager.defaultInstance()
                 .getCachedConditions(EcalConditions.class, TableConstants.ECAL_CONDITIONS).getCachedData();
-        
-        //System.out.println("You are now using the database conditions for EcalRawConverter.");
     }
     
     /** 
@@ -155,7 +124,7 @@
      * @param cellID (long)
      * @return channel constants (EcalChannelConstants)
      */
-    private EcalChannelConstants findChannel(long cellID) {
+    public EcalChannelConstants findChannel(long cellID) {
         return ecalConditions.getChannelConstants(ecalConditions.getChannelCollection().findGeometric(cellID));
     }   
 }

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