On Dec 1, 2014, at 3:06 PM, Andrea Celentano <[log in to unmask]> wrote:

Hi Jeremy,
yes, this test is there just to dump to the screen (or to a text file via redirection) LED information that is saved on the database. If there's a better way to do this, with the print command, we can proceed this way.

You can do the same thing with more flexibility by using the conditions command line tool in the following way:

java -cp ./hps-distribution-3.1-SNAPSHOT-bin.jar org.hps.conditions.cli.CommandLineTool print -t ecal_leds -r 2000 -f ecal_leds.txt

I just tried this from an ifarm node and it works fine (with the Java from our group area).

I’ll leave your test for now until you get this figured out.

Regarding point 2, I did even know that tests are performed in the automatic build.. and no, I do not know how to avoid this.

Yes, any Java class that you add to trunk/[module]/src/test which extends TestCase automatically runs with the build of that module unless you explicitly disable it.  You can avoid this by adding a test exclusion.  (See integration-tests module for example of this under the maven-surefire-plugin configuration.)

Finally, the LED conditions are not actually not used in any place (analysis or reconstruction): the slow control system is not interacting with the conditions database to determine how to run LEDs, but relies on its own data files (this is how it was designed.. and it is not trivial at all to change this). Therefore, I think that it is good to have them in the database, but this is just for reference.

We can leave the LED information in there if you think it is potentially useful in the future.

Also, I think I found some mismatches in the values that are there: It is fine for me to change these LED values in the database, however, you should instruct me how to do this.

It is probably best to simply drop the existing conditions set and load a new one with the corrections.  That way you can do your work in a text file and then load it into the database.  Otherwise, you’d need to execute SQL ‘UPDATE’ commands from a mysql client to do this, which I assume you don’t know how to do.  If there are only a few changes to make then I can do the updates for you.  If you need to correct something specific in a lot of records, it is probably best to simply make a whole new conditions set and drop the old, incorrect one from the database.


On 12/01/2014 04:40 PM, McCormick, Jeremy I. wrote:
Hi, Andrea.

A couple things here about this test you added...

1) You put me down for the author in the comments on a commit that you made.  Your information should be listed here instead.

2) This test doesn't actually do anything, i.e. there aren't any assertions made so it questionable whether the test should even be in the code.
If you still want it in the conditions package for reference, then I believe it should not be run with the automatic builds.  (e.g. it should be added to the test
exclusions in the pom file...do you know how to do this yourself?)

3) You can dump the LED conditions using the 'print' command line option, which I'm not sure you're aware of so if that's all that is needed here,
then let me know and I'll tell you how to do it.  There doesn't need to be a test case if that's all you want to do here.

BTW, Nathan had indicated he wasn't sure why LED conditions needed to be in the database.  Can you elaborate on how you might use these
in the LCSim code for analysis or recon?

(FYI, this message is not CC'd to software list.)


-----Original Message-----
From: [log in to unmask] [mailto:[log in to unmask]] On Behalf Of [log in to unmask]
Sent: Monday, December 01, 2014 1:14 PM
To: hps-svn
Subject: r1604 - /java/trunk/conditions/src/test/java/org/hps/conditions/ecal/EcalLedTest.java

Author: [log in to unmask]
Date: Mon Dec  1 13:14:13 2014
New Revision: 1604

Added LED condition tests with database system


Added: java/trunk/conditions/src/test/java/org/hps/conditions/ecal/EcalLedTest.java
--- java/trunk/conditions/src/test/java/org/hps/conditions/ecal/EcalLedTest.java (added)
+++ java/trunk/conditions/src/test/java/org/hps/conditions/ecal/EcalLedTest.java Mon Dec  1 13:14:13 2014
@@ -0,0 +1,47 @@
+package org.hps.conditions.ecal;
+import junit.framework.TestCase;
+import org.hps.conditions.database.DatabaseConditionsManager;
+import org.hps.conditions.database.TableConstants;
+//import org.hps.conditions.config.DevReadOnlyConfiguration;
+import org.hps.conditions.ecal.EcalLed.EcalLedCollection;
+ * A very basic test to make sure ECAL LED information is
+ * readable from the conditions dev database.
+ * @author Jeremy McCormick <[log in to unmask]>  */ public
+class EcalLedTest extends TestCase {
+    DatabaseConditionsManager conditionsManager;
+  public void setUp() {
+        conditionsManager = DatabaseConditionsManager.getInstance();
+        try {
+            conditionsManager.setDetector("HPS-Proposal2014-v7-2pt2", 0);
+        } catch (ConditionsNotFoundException e) {
+            throw new RuntimeException(e);
+        }
+    }
+    public void testEcalLed() {
+        DatabaseConditionsManager manager = DatabaseConditionsManager.getInstance();
+        EcalLedCollection collection = manager.getConditionsData(EcalLedCollection.class, TableConstants.ECAL_LEDS);
+        for (EcalLed led : collection) {
+         System.out.println(led);
+            //System.out.println("ECAL LED info ...");
+            //System.out.println("ecal_channel_id: " + led.getEcalChannelId());
+            //System.out.println("crate: " + led.getCrateNumber());
+            //System.out.println("number: " + led.getLedNumber());
+            //System.out.println("time_delay: " + led.getTimeDelay());
+            //System.out.println("amplitude_low: " + led.getAmplitudeLow());
+            //System.out.println("amplitude_high: " + led.getAmplitudeHigh());
+            //System.out.println();
+        }
+    }

Use REPLY-ALL to reply to list

To unsubscribe from the HPS-SOFTWARE list, click the following link: