HPS-SOFTWARE Archives

Software for the Heavy Photon Search Experiment

HPS-SOFTWARE@LISTSERV.SLAC.STANFORD.EDU

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"McCormick, Jeremy I." <[log in to unmask]>
Reply To:
Software for the Heavy Photon Search Experiment <[log in to unmask]>
Date:
Sat, 17 Jan 2015 00:56:08 +0000
Content-Type:
text/plain
Parts/Attachments:
text/plain (49 lines)
Hi,

I have imported the beam conditions from the ECAL commissioning so that they are available now in HPS Java, which resolves this JIRA item.

https://jira.slac.stanford.edu/browse/HPSJAVA-312

This information includes

current (nA)
position X (mm)
positionY (mm)
energy (GeV)

You can test this by running 

cd conditions; mvn test -Dtest=BeamConditionsTest

which prints all beam conditions that were recorded.

These values do not represent averages but are a single measurement taken at some unspecified time by a shifter.

In your Java analysis code you can access this new information using a code snippet such as

BeamConditionsCollection beamCollection =
    DatabaseConditionsManager.getInstance().getConditionsData(BeamConditionsCollection.class, "beam");
BeamConditions beam = beamCollection.get(0);
Double current = beam.getCurrent();
Double positionX = beam.getPositionX();
Double positionY = beam.getPositionY();
Double energy = beam.getEnergy();

The energy is 1.92 GeV for every run, when beam was on and measured.

We follow the convention that these values are 0 if the beam was not on, and null if they were unmeasured.

One import thing to note is that when accessing these values in Java, you should not use the "double" primitive type but the "Double" class.

Attempting to use the primitive type when there are null values for the run will result in a NullPointerException, as converting Double to double does not work for null values.

Let me know if you have any questions or comments.

--Jeremy

########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the HPS-SOFTWARE list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=HPS-SOFTWARE&A=1

ATOM RSS1 RSS2