Author: [log in to unmask]
Date: Fri Jun 12 12:04:15 2015
New Revision: 3142
Log:
Fix sign of correction for rotations.
Modified:
java/trunk/detector-model/src/main/java/org/lcsim/geometry/compact/converter/MilleParameter.java
java/trunk/tracking/src/main/java/org/hps/svt/alignment/BuildMillepedeCompact.java
Modified: java/trunk/detector-model/src/main/java/org/lcsim/geometry/compact/converter/MilleParameter.java
=============================================================================
--- java/trunk/detector-model/src/main/java/org/lcsim/geometry/compact/converter/MilleParameter.java (original)
+++ java/trunk/detector-model/src/main/java/org/lcsim/geometry/compact/converter/MilleParameter.java Fri Jun 12 12:04:15 2015
@@ -26,6 +26,12 @@
public static final int half_offset = 10000;
public static final int type_offset = 1000;
public static final int dimension_offset = 100;
+ public static enum Type {
+ TRANSLATION(1), ROTATION(2);
+ private int value;
+ private Type(int value) {this.value = value;}
+ public int getType() {return this.value;}
+ };
public MilleParameter(String line) {
String[] vals = StringUtils.split(line);// line.split("\\s+");
Modified: java/trunk/tracking/src/main/java/org/hps/svt/alignment/BuildMillepedeCompact.java
=============================================================================
--- java/trunk/tracking/src/main/java/org/hps/svt/alignment/BuildMillepedeCompact.java (original)
+++ java/trunk/tracking/src/main/java/org/hps/svt/alignment/BuildMillepedeCompact.java Fri Jun 12 12:04:15 2015
@@ -176,7 +176,11 @@
if(replaceConstant) {
newValue = correction;
} else {
- newValue = oldValue + correction;
+ if (p.getType() == MilleParameter.Type.ROTATION.getType()) {
+ newValue = oldValue - correction;
+ } else {
+ newValue = oldValue + correction;
+ }
}
System.out.println("Update " + p.getId() + ": " + oldValue + " (corr. " + correction + ") -> " + newValue );
node.setAttribute("value", String.format("%.6f",newValue));
|