Author: [log in to unmask]
Date: Tue Apr 21 14:07:39 2015
New Revision: 2769
Log:
Add tp2 parameter to SVT shape fit class. HPSJAVA-495
Modified:
java/trunk/conditions/src/main/java/org/hps/conditions/svt/SvtShapeFitParameters.java
Modified: java/trunk/conditions/src/main/java/org/hps/conditions/svt/SvtShapeFitParameters.java
=============================================================================
--- java/trunk/conditions/src/main/java/org/hps/conditions/svt/SvtShapeFitParameters.java (original)
+++ java/trunk/conditions/src/main/java/org/hps/conditions/svt/SvtShapeFitParameters.java Tue Apr 21 14:07:39 2015
@@ -13,7 +13,7 @@
* @author <a href="mailto:[log in to unmask]">Jeremy McCormick</a>
* @author <a href="mailto:[log in to unmask]">Omar Moreno</a>
*/
-@Table(names = { "svt_shape_fit_parameters", "test_run_svt_shape_fit_parameters" })
+@Table(names = {"svt_shape_fit_parameters", "test_run_svt_shape_fit_parameters"})
@Converter(multipleCollectionsAction = MultipleCollectionsAction.LAST_CREATED)
// TODO: This class needs better documentation as to what these parameters actually mean.
public final class SvtShapeFitParameters extends BaseConditionsObject {
@@ -26,23 +26,28 @@
}
/**
+ * Size of array when retrieving all parameters together using {@link #toArray()}.
+ */
+ private static final int ARRAY_SIZE = 4;
+
+ /**
+ * Get the amplitude.
+ *
+ * @return The amplitude.
+ */
+ @Field(names = {"amplitude"})
+ public double getAmplitude() {
+ return getFieldValue(Double.class, "amplitude");
+ }
+
+ /**
* Get the SVT channel ID.
*
* @return The SVT channel ID.
*/
- @Field(names = { "svt_channel_id" })
+ @Field(names = {"svt_channel_id"})
public int getChannelID() {
return getFieldValue(Integer.class, "svt_channel_id");
- }
-
- /**
- * Get the amplitude.
- *
- * @return The amplifude.
- */
- @Field(names = { "amplitude" })
- public double getAmplitude() {
- return getFieldValue(Double.class, "amplitude");
}
/**
@@ -50,19 +55,29 @@
*
* @return t0
*/
- @Field(names = { "t0" })
+ @Field(names = {"t0"})
public double getT0() {
return getFieldValue(Double.class, "t0");
}
/**
- * Get tp.
+ * Get shaping time parameter.
*
- * @return tp
+ * @return the shaping time parameter
*/
- @Field(names = { "tp" })
+ @Field(names = {"tp"})
public double getTp() {
return getFieldValue(Double.class, "tp");
+ }
+
+ /**
+ * Get the second shaping time parameter.
+ *
+ * @return the second shaping time parameter
+ */
+ @Field(names = {"tp2"})
+ public double getTp2() {
+ return getFieldValue(Double.class, "tp2");
}
/**
@@ -71,10 +86,11 @@
* @return This object converted to an array of doubles.
*/
public double[] toArray() {
- final double[] values = new double[3];
+ final double[] values = new double[ARRAY_SIZE];
values[0] = getAmplitude();
values[1] = getT0();
values[2] = getTp();
+ values[3] = getTp2();
return values;
}
}
|