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:

r1450 - in /java/trunk: evio/src/main/java/org/hps/evio/ monitoring-app/src/main/java/org/hps/monitoring/gui/

From:

[log in to unmask]

Reply-To:

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

Date:

Fri, 7 Nov 2014 21:10:09 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (189 lines)

Author: [log in to unmask]
Date: Fri Nov  7 13:10:05 2014
New Revision: 1450

Log:
Fix up event builder setup so it works with monitoring app.

Modified:
    java/trunk/evio/src/main/java/org/hps/evio/ECalEvioReader.java
    java/trunk/evio/src/main/java/org/hps/evio/LCSimEventBuilder.java
    java/trunk/evio/src/main/java/org/hps/evio/LCSimTestRunEventBuilder.java
    java/trunk/monitoring-app/src/main/java/org/hps/monitoring/gui/MonitoringApplication.java

Modified: java/trunk/evio/src/main/java/org/hps/evio/ECalEvioReader.java
 =============================================================================
--- java/trunk/evio/src/main/java/org/hps/evio/ECalEvioReader.java	(original)
+++ java/trunk/evio/src/main/java/org/hps/evio/ECalEvioReader.java	Fri Nov  7 13:10:05 2014
@@ -41,7 +41,7 @@
     private static final String readoutName = "EcalHits";
     private static final String subdetectorName = "Ecal";
 //    private Detector detector;
-    private final Subdetector subDetector;
+    private Subdetector subDetector;
 
     private static EcalConditions ecalConditions = null;
     private static IIdentifierHelper helper = null;
@@ -53,22 +53,13 @@
         this.botBankTag = botBankTag;
         hitCollectionName = "EcalReadoutHits";
 
-        subDetector = DatabaseConditionsManager.getInstance().getDetectorObject().getSubdetector(subdetectorName);
-
-        // ECAL combined conditions object.
-        ecalConditions = ConditionsManager.defaultInstance()
-                .getCachedConditions(EcalConditions.class, TableConstants.ECAL_CONDITIONS).getCachedData();
-
-        helper = subDetector.getDetectorElement().getIdentifierHelper();
-
-        System.out.println("You are now using the database conditions for ECalEvioReader.java");
+        //System.out.println("You are now using the database conditions for ECalEvioReader.java");
         // ID helper.
 //        helper = detector.getSubdetector("Ecal").getDetectorElement().getIdentifierHelper();
     }
 
     public void setTopBankTag(int topBankTag) {
         this.topBankTag = topBankTag;
-
     }
 
     public void setBotBankTag(int botBankTag) {
@@ -307,4 +298,14 @@
         }
         return hits;
     }
+    
+    void initialize() {
+        subDetector = DatabaseConditionsManager.getInstance().getDetectorObject().getSubdetector(subdetectorName);
+        
+        // ECAL combined conditions object.
+        ecalConditions = ConditionsManager.defaultInstance()
+                .getCachedConditions(EcalConditions.class, TableConstants.ECAL_CONDITIONS).getCachedData();
+
+        helper = subDetector.getDetectorElement().getIdentifierHelper();
+    }
 }

Modified: java/trunk/evio/src/main/java/org/hps/evio/LCSimEventBuilder.java
 =============================================================================
--- java/trunk/evio/src/main/java/org/hps/evio/LCSimEventBuilder.java	(original)
+++ java/trunk/evio/src/main/java/org/hps/evio/LCSimEventBuilder.java	Fri Nov  7 13:10:05 2014
@@ -1,9 +1,10 @@
 package org.hps.evio;
 
 import org.jlab.coda.jevio.EvioEvent;
+import org.lcsim.conditions.ConditionsListener;
 import org.lcsim.event.EventHeader;
 
-public interface LCSimEventBuilder {
+public interface LCSimEventBuilder extends ConditionsListener {
 
     /**
      * Read any run information out of an EVIO event (not necessarily a physics event).
@@ -18,8 +19,10 @@
      */
     EventHeader makeLCSimEvent(EvioEvent evioEvent);
 
+    // FIXME: Why is this needed here when checking the header tag is a static operation on the EvioEvent?  
     boolean isPhysicsEvent(EvioEvent evioEvent);
 
+    // FIXME: This should not be a method on the API.  It should come from the conditions system.
     void setDetectorName(String detectorName);
 
     void setDebug(boolean debug);

Modified: java/trunk/evio/src/main/java/org/hps/evio/LCSimTestRunEventBuilder.java
 =============================================================================
--- java/trunk/evio/src/main/java/org/hps/evio/LCSimTestRunEventBuilder.java	(original)
+++ java/trunk/evio/src/main/java/org/hps/evio/LCSimTestRunEventBuilder.java	Fri Nov  7 13:10:05 2014
@@ -5,12 +5,15 @@
 import java.util.List;
 import java.util.logging.Level;
 import java.util.logging.Logger;
+
 import org.hps.readout.ecal.TriggerData;
 import org.jlab.coda.jevio.BaseStructure;
 import org.jlab.coda.jevio.EvioEvent;
+import org.lcsim.conditions.ConditionsEvent;
+import org.lcsim.conditions.ConditionsListener;
+import org.lcsim.conditions.ConditionsManager;
 import org.lcsim.event.EventHeader;
 import org.lcsim.event.base.BaseLCSimEvent;
-import org.lcsim.geometry.Detector;
 
 /**
  * Build LCSim events from EVIO data.
@@ -20,13 +23,14 @@
  * @version $Id: LCSimTestRunEventBuilder.java,v 1.24 2013/03/01 01:30:25 meeg
  * Exp $
  */
-public class LCSimTestRunEventBuilder implements LCSimEventBuilder {
+public class LCSimTestRunEventBuilder implements LCSimEventBuilder, ConditionsListener {
 
     // Names of subdetectors.
 //    private String trackerName;
     // Detector conditions object.
-    protected Detector detector;
+	//protected Detector detector;
     // Debug flag.
+	String detectorName = null;
     protected boolean debug = false;
     ECalEvioReader ecalReader = null;
     SVTEvioReader svtReader = null;
@@ -42,10 +46,7 @@
 
     @Override
     public void setDetectorName(String detectorName) {
-        // Make a dummy event to setup the conditions system.
-        EventHeader dummyEvent = new BaseLCSimEvent(0, 0, detectorName);
-        detector = dummyEvent.getDetector();
-//        EcalConditions.loadDaqMap(detector, "Ecal");
+    	this.detectorName = detectorName;
     }
 
     @Override
@@ -156,8 +157,9 @@
         }
 
         // Create a new LCSimEvent.
-        EventHeader lcsimEvent = new BaseLCSimEvent(run, eventID[0], detector.getDetectorName(), time);
-
+        //EventHeader lcsimEvent = new BaseLCSimEvent(run, eventID[0], detector.getDetectorName(), time);
+        EventHeader lcsimEvent = new BaseLCSimEvent(run, eventID[0], detectorName, time);
+        
         lcsimEvent.put("TriggerBank", triggerList, TriggerData.class, 0);
         return lcsimEvent;
     }
@@ -187,4 +189,9 @@
         time = ((long) triggerData.getTime()) * 1000000000;
         return triggerData;
     }
+
+	@Override
+	public void conditionsChanged(ConditionsEvent conditionsEvent) {
+		ecalReader.initialize();
+	}
 }

Modified: java/trunk/monitoring-app/src/main/java/org/hps/monitoring/gui/MonitoringApplication.java
 =============================================================================
--- java/trunk/monitoring-app/src/main/java/org/hps/monitoring/gui/MonitoringApplication.java	(original)
+++ java/trunk/monitoring-app/src/main/java/org/hps/monitoring/gui/MonitoringApplication.java	Fri Nov  7 13:10:05 2014
@@ -95,6 +95,7 @@
 import org.hps.record.et.EtConnection;
 import org.jlab.coda.jevio.EvioException;
 import org.jlab.coda.jevio.EvioReader;
+import org.lcsim.conditions.ConditionsManager;
 import org.lcsim.job.JobControlManager;
 import org.lcsim.lcio.LCIOReader;
 import org.lcsim.util.Driver;
@@ -1191,6 +1192,8 @@
 
         // Set the detector name on the event builder so it can find conditions data.
         eventBuilder.setDetectorName(configurationModel.getDetectorName());
+        
+        ConditionsManager.defaultInstance().addConditionsListener(eventBuilder);
 
         log(Level.CONFIG, "Successfully initialized event builder <" + eventBuilderClassName + ">");
     }

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