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:

r2110 - /java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/ECalRunningPedestalDriver.java

From:

[log in to unmask]

Reply-To:

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

Date:

Wed, 11 Feb 2015 22:14:56 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (139 lines)

Author: [log in to unmask]
Date: Wed Feb 11 14:14:52 2015
New Revision: 2110

Log:
final RunningPedestalDriver for release

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

Modified: java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/ECalRunningPedestalDriver.java
 =============================================================================
--- java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/ECalRunningPedestalDriver.java	(original)
+++ java/trunk/ecal-recon/src/main/java/org/hps/recon/ecal/ECalRunningPedestalDriver.java	Wed Feb 11 14:14:52 2015
@@ -23,6 +23,10 @@
  * 
  * TODO: Use Logger.
  * 
+ * TODO: Timestamps from EVIO for some runs appear to not be monotonically increasing.
+ *       This interferes with minLookbackTime, so it defaults to disabled and its setter
+ *       is left private for now.
+ * 
  * @version $Id: ECalRunningPedestalDriver.java,v 1.0 2015/02/10 00:00:00
  * @author <[log in to unmask]>
  */
@@ -82,13 +86,12 @@
                         TableConstants.ECAL_CONDITIONS).getCachedData();
         for (int ii = 0; ii < nChannels; ii++) {
             EcalChannel chan = findChannel(ii + 1);
-            runningPedestals.put(chan, getStaticPedestal(chan));
-            eventPedestals.put(chan, new ArrayList<Integer>());
-            eventTimestamps.put(chan, new ArrayList<Long>());
+            runningPedestals.put(chan,getStaticPedestal(chan));
+            eventPedestals.put(chan,new ArrayList<Integer>());
+            eventTimestamps.put(chan,new ArrayList<Long>());
         }
         if (debug) {
-            System.out
-                    .println("Running and static pedestals better match here:");
+            System.out.println("Running and static pedestals better match here:");
             printPedestals();
         }
     }
@@ -105,15 +108,14 @@
 
     public void setMaxLookbackEvents(int nev) {
         if (nev > limitLookbackEvents) {
-            System.err
-                    .println("ECalRunningPedestalDriver:  Ignoring maxLookbackEvents too big:  "
-                            + nev);
+            System.err.println("ECalRunningPedestalDriver:  Ignoring maxLookbackEvents too big:  "
+                    + nev);
             nev = limitLookbackEvents;
         }
         maxLookbackEvents = nev;
     }
 
-    public void setMaxLookbackTime(int time) {
+    private void setMaxLookbackTime(int time) {
         maxLookbackTime = time;
     }
 
@@ -168,15 +170,17 @@
         List<Integer> peds = eventPedestals.get(chan);
         List<Long> times = eventTimestamps.get(chan);
 
-        // If new timestamp is older than previous one, restart pedestals.
-        // This should never happen unless firmware counter cycles back to zero,
-        // in which case it could be dealt with if max timestamp is known.
-        if (times.size() > 0 && times.get(0) > timestamp) {
-            System.err.println(String.format(
-                    "Event #%d, Old Timestamp:  %d < %d",
-                    event.getEventNumber(), timestamp, times.get(0)));
-            peds.clear();
-            times.clear();
+        if (maxLookbackTime > 0) {
+            // If new timestamp is older than previous one, restart pedestals.
+            // This should never happen unless firmware counter cycles back to zero,
+            // in which case it could be dealt with if max timestamp is known.
+            if (times.size() > 0 && times.get(0) > timestamp) {
+                System.err.println(String.format(
+                        "Event #%d, Old Timestamp:  %d < %d",
+                        event.getEventNumber(), timestamp, times.get(0)));
+                peds.clear();
+                times.clear();
+            }
         }
 
         // add pedestal to the list:
@@ -233,48 +237,4 @@
                 hit.getCellID());
     }
 
-    /*
-     * public double getPedestal(EcalChannel chan) { if
-     * (runningPedestals.containsKey(chan)) { return runningPedestals.get(chan);
-     * } else {
-     * System.err.println("RunningPedestalDriver:getPedestal:  Missing channel"
-     * ); return getStaticPedestal(chan); } } public double getPedestal(int
-     * channel_id) { return getPedestal(findChannel(channel_id)); } public
-     * double getPedestal(RawCalorimeterHit hit) { return
-     * getPedestal(getChannelID(hit)); }
-     * 
-     * private double getStaticNoise(int channel_id) { return
-     * getStaticCalibration(channel_id).getNoise(); }
-     * 
-     * private double getStaticPedestal(int channel_id) { return
-     * getStaticCalibration(channel_id).getPedestal(); } private double
-     * getStaticPedestal(RawCalorimeterHit hit) { return
-     * getStaticPedestal(getChannelID(hit)); }
-     * 
-     * private EcalCalibration getStaticCalibration(EcalChannel chan) { return
-     * ecalConditions.getChannelConstants(chan).getCalibration(); } private
-     * EcalCalibration getStaticCalibration(int channel_id) { return
-     * getStaticCalibration(findChannel(channel_id)); } private EcalCalibration
-     * getStaticCalibration(long cellID) { return
-     * getStaticCalibration(findChannel(cellID)); }
-     * 
-     * public int getChannelID(RawCalorimeterHit hit) { return
-     * findChannelConstants(hit.getCellID()).getCalibration().getChannelId(); }
-     * 
-     * public EcalChannelConstants findChannelConstants(long cellID) { return
-     * ecalConditions.getChannelConstants(findChannel(cellID)); }
-     * 
-     * public EcalChannelConstants findChannelConstants(int channel_id) { return
-     * ecalConditions.getChannelConstants(findChannel(channel_id)); }
-     * 
-     * public EcalChannel findChannel(long cellID) { return
-     * ecalConditions.getChannelCollection().findGeometric(cellID); }
-     * 
-     * public EcalChannel findChannel(int channel_id) { return
-     * ecalConditions.getChannelCollection().findChannel(channel_id); }
-     * 
-     * public EcalChannel findChannel(RawCalorimeterHit hit) { return
-     * findChannel(hit.getCellID()); }
-     */
-
 }

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