projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter
--- projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/HPSTestRunTracker2014GeometryDefinition.java 2014-10-17 20:52:02 UTC (rev 3371)
+++ projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/HPSTestRunTracker2014GeometryDefinition.java 2014-10-17 23:03:49 UTC (rev 3372)
@@ -3,10 +3,7 @@
*/
package org.lcsim.geometry.compact.converter;
-import hep.physics.vec.BasicHep3Matrix;
import hep.physics.vec.BasicHep3Vector;
-import hep.physics.vec.Hep3Vector;
-import hep.physics.vec.VecOp;
import java.util.ArrayList;
import java.util.List;
@@ -15,10 +12,6 @@
import org.apache.commons.math3.geometry.euclidean.threed.RotationOrder;
import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;
import org.jdom.Element;
-import org.lcsim.detector.Rotation3D;
-import org.lcsim.detector.Transform3D;
-import org.lcsim.detector.Translation3D;
-import org.lcsim.geometry.util.TransformationUtils;
/**
*
@@ -67,23 +60,23 @@
// Build the geometry from the basic building blocks in the geometry definition class
// Keep the order correct.
// Each item has knowledge of its mother but not its daughters
- HPSTestRunTracker2014GeometryDefinition.TrackingBase tracking = new HPSTestRunTracker2014GeometryDefinition.TrackingBase("trackingVolume",null);
+ TrackingVolume tracking = new TrackingVolume("trackingVolume",null);
geometries.add(tracking);
- HPSTestRunTracker2014GeometryDefinition.TrackerEnvelope base = new HPSTestRunTracker2014GeometryDefinition.TrackerEnvelope("base",tracking);
+ TrackerEnvelope base = new TrackerEnvelope("base",tracking);
geometries.add(base);
- HPSTestRunTracker2014GeometryDefinition.BasePlate basePlate = new HPSTestRunTracker2014GeometryDefinition.BasePlate("baseplate",base, "Aluminum");
+ BasePlate basePlate = new BasePlate("baseplate",base, "Aluminum");
geometries.add(basePlate);
- HPSTestRunTracker2014GeometryDefinition.CSupport cSupport = new HPSTestRunTracker2014GeometryDefinition.CSupport("c_support", base);
+ CSupport cSupport = new CSupport("c_support", base);
geometries.add(cSupport);
- HPSTestRunTracker2014GeometryDefinition.SupportBottom supportBottom = new HPSTestRunTracker2014GeometryDefinition.SupportBottom("support_bottom", base, cSupport);
+ SupportBottom supportBottom = new SupportBottom("support_bottom", base, cSupport);
geometries.add(supportBottom);
// The support survey positions are now with respect to its mother and not the reference coord. system.
// So to get the reference for the support plate I don't need to apply that extra transformation
- HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom supportPlateBottom = new HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom("support_plate_bottom", base, supportBottom, "Aluminum");
+ SupportPlateBottom supportPlateBottom = new SupportPlateBottom("support_plate_bottom", base, supportBottom, "Aluminum");
geometries.add(supportPlateBottom);
- HPSTestRunTracker2014GeometryDefinition.SupportTop supportTop = new HPSTestRunTracker2014GeometryDefinition.SupportTop("support_top", base, cSupport);
+ SupportTop supportTop = new SupportTop("support_top", base, cSupport);
geometries.add(supportTop);
- HPSTestRunTracker2014GeometryDefinition.SupportPlateTop supportPlateTop = new HPSTestRunTracker2014GeometryDefinition.SupportPlateTop("support_plate_top", base, supportTop, "Aluminum");
+ SupportPlateTop supportPlateTop = new SupportPlateTop("support_plate_top", base, supportTop, "Aluminum");
geometries.add(supportPlateTop);
// Modules are built using an encapsulating class that keeps tracks of all components
@@ -126,27 +119,27 @@
// find the mother and reference geometry
// Note that the reference geometry is the support plate and since that is assumed to be
// created through it's references we don't need more than one reference to reach the mother coordinate system
- final HPSTestRunTracker2014GeometryDefinition.SurveyVolume mother;
- final HPSTestRunTracker2014GeometryDefinition.SurveyVolume ref;
+ final SurveyVolume mother;
+ final SurveyVolume ref;
if(half == "bottom") {
- mother = getBaseGeometry(HPSTestRunTracker2014GeometryDefinition.TrackerEnvelope.class);
- ref = getBaseGeometry(HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.class);
+ mother = getBaseGeometry(TrackerEnvelope.class);
+ ref = getBaseGeometry(SupportPlateBottom.class);
} else {
- mother= getBaseGeometry(HPSTestRunTracker2014GeometryDefinition.TrackerEnvelope.class);
- ref = getBaseGeometry(HPSTestRunTracker2014GeometryDefinition.SupportPlateTop.class);
+ mother= getBaseGeometry(TrackerEnvelope.class);
+ ref = getBaseGeometry(SupportPlateTop.class);
}
//Create the module
- HPSTestRunTracker2014GeometryDefinition.TestRunModule module;
+ TestRunModule module;
if(isL13) {
- module = new HPSTestRunTracker2014GeometryDefinition.TestRunModuleL13(volName, mother, ref, layer, half);
+ module = new TestRunModuleL13(volName, mother, ref, layer, half);
} else {
- module = new HPSTestRunTracker2014GeometryDefinition.TestRunModuleL45(volName, mother, ref, layer, half);
+ module = new TestRunModuleL45(volName, mother, ref, layer, half);
}
// create the bundle for this module
- ModuleBundle bundle = new ModuleBundle(module);
+ TestRunModuleBundle bundle = new TestRunModuleBundle(module);
addModuleBundle(bundle);
if(doAxial) makeHalfModule("axial", module);
@@ -167,7 +160,7 @@
* Create the cold block object.
* @param mother to the cold block
*/
- private void makeColdBlock(HPSTestRunTracker2014GeometryDefinition.TestRunModule mother) {
+ private void makeColdBlock(TestRunModule mother) {
String moduleName = mother.getName();
@@ -181,12 +174,12 @@
int layer = getLayerFromVolumeName(moduleName);
// Build the half-module
- HPSTestRunTracker2014GeometryDefinition.TestRunColdBlock coldBlock;
+ TestRunColdBlock coldBlock;
if(layer >= 1 && layer <=3) {
- coldBlock = new HPSTestRunTracker2014GeometryDefinition.TestRunColdBlockL13(volName, mother, layer);
+ coldBlock = new TestRunColdBlockL13(volName, mother, layer);
} else if(layer >= 4 && layer <=5) {
- coldBlock = new HPSTestRunTracker2014GeometryDefinition.TestRunColdBlockL45(volName, mother, layer);
+ coldBlock = new TestRunColdBlockL45(volName, mother, layer);
} else {
throw new RuntimeException("wrong layer for " + volName);
}
@@ -202,7 +195,7 @@
* @param side - stereo or axial
* @param mother to the half-module
*/
- private void makeHalfModule(String side, HPSTestRunTracker2014GeometryDefinition.TestRunModule mother) {
+ private void makeHalfModule(String side, TestRunModule mother) {
String moduleName = mother.getName();
@@ -216,18 +209,18 @@
// find layer
int layer = mother.getLayer();
- ModuleBundle bundle = getModuleBundle(mother);
- HalfModuleBundle halfModuleBundle;
+ TestRunModuleBundle bundle = (TestRunModuleBundle)getModuleBundle(mother);
+ TestRunHalfModuleBundle halfModuleBundle;
// Build the half-module
- HPSTestRunTracker2014GeometryDefinition.TestRunHalfModule halfModule;
+ TestRunHalfModule halfModule;
if(side == "axial") {
- halfModule = new HPSTestRunTracker2014GeometryDefinition.TestRunHalfModuleAxial(volName, mother, layer, half);
- halfModuleBundle = new HalfModuleBundle(halfModule);
+ halfModule = new TestRunHalfModuleAxial(volName, mother, layer, half);
+ halfModuleBundle = new TestRunHalfModuleBundle(halfModule);
bundle.halfModuleAxial = halfModuleBundle;
} else if(side == "stereo") {
- halfModule = new HPSTestRunTracker2014GeometryDefinition.TestRunHalfModuleStereo(volName, mother, layer, half);
- halfModuleBundle = new HalfModuleBundle(halfModule);
+ halfModule = new TestRunHalfModuleStereo(volName, mother, layer, half);
+ halfModuleBundle = new TestRunHalfModuleBundle(halfModule);
bundle.halfModuleStereo = halfModuleBundle;
} else {
throw new IllegalArgumentException("not a valid half-module side " + side);
@@ -251,7 +244,7 @@
- private void makeHalfModuleComponentHybrid(HPSTestRunTracker2014GeometryDefinition.TestRunHalfModule mother) {
+ private void makeHalfModuleComponentHybrid(TestRunHalfModule mother) {
if(isDebug()) System.out.printf("%s: makeHalfModuleComponentHybrid for %s \n", this.getClass().getSimpleName(), mother.getName());
@@ -262,10 +255,10 @@
// id is hard coded
int component_number = 3;
- HPSTestRunTracker2014GeometryDefinition.Hybrid hybrid = new HPSTestRunTracker2014GeometryDefinition.Hybrid(volName,mother,component_number);
+ Hybrid hybrid = new Hybrid(volName,mother,component_number);
hybrid.setMaterial("G10");
- HalfModuleBundle hm = getHalfModuleBundle((HPSTestRunTracker2014GeometryDefinition.TestRunModule) mother.getMother(), mother.getName());
+ TestRunHalfModuleBundle hm = (TestRunHalfModuleBundle) getHalfModuleBundle((TestRunModule) mother.getMother(), mother.getName());
hm.hybrid = hybrid;
if(isDebug()) System.out.printf("%s: added hybrid to half-module with name %s \n", this.getClass().getSimpleName(), hm.halfModule.getName());
@@ -275,7 +268,7 @@
- private void makeHalfModuleComponentCF(HPSTestRunTracker2014GeometryDefinition.TestRunHalfModule mother) {
+ private void makeHalfModuleComponentCF(TestRunHalfModule mother) {
if(isDebug()) System.out.printf("%s: makeHalfModuleComponentCF for %s \n", this.getClass().getSimpleName(), mother.getName());
@@ -287,10 +280,10 @@
// id is hard coded
int component_number = 1;
- HPSTestRunTracker2014GeometryDefinition.CarbonFiber cf = new HPSTestRunTracker2014GeometryDefinition.CarbonFiber(volName,mother,component_number);
+ CarbonFiber cf = new CarbonFiber(volName,mother,component_number);
cf.setMaterial("CarbonFiber");
- HalfModuleBundle hm = getHalfModuleBundle((HPSTestRunTracker2014GeometryDefinition.TestRunModule) mother.getMother(), mother.getName());
+ TestRunHalfModuleBundle hm = (TestRunHalfModuleBundle) getHalfModuleBundle((TestRunModule) mother.getMother(), mother.getName());
hm.carbonFiber = cf;
}
@@ -298,7 +291,7 @@
- private void makeHalfModuleComponentKapton(HPSTestRunTracker2014GeometryDefinition.TestRunHalfModule mother) {
+ private void makeHalfModuleComponentKapton(TestRunHalfModule mother) {
if(isDebug()) System.out.printf("%s: makeHalfModuleComponentKapton for %s \n", this.getClass().getSimpleName(), mother.getName());
@@ -309,17 +302,17 @@
// id is hard coded
int component_number = 2;
- HPSTestRunTracker2014GeometryDefinition.HalfModuleLamination lamination = new HPSTestRunTracker2014GeometryDefinition.HalfModuleLamination(volName,mother,component_number);
+ HalfModuleLamination lamination = new HalfModuleLamination(volName,mother,component_number);
lamination.setMaterial("Kapton");
- HalfModuleBundle hm = getHalfModuleBundle((HPSTestRunTracker2014GeometryDefinition.TestRunModule) mother.getMother(), mother.getName());
+ TestRunHalfModuleBundle hm = (TestRunHalfModuleBundle) getHalfModuleBundle((TestRunModule) mother.getMother(), mother.getName());
hm.lamination = lamination;
}
- private void makeHalfModuleComponentSensor(HPSTestRunTracker2014GeometryDefinition.TestRunHalfModule mother) {
+ private void makeHalfModuleComponentSensor(TestRunHalfModule mother) {
if(isDebug()) System.out.printf("%s: makeHalfModuleComponentSensor for %s \n", this.getClass().getSimpleName(), mother.getName());
@@ -329,10 +322,10 @@
int component_number = 0;
//
- HPSTestRunTracker2014GeometryDefinition.Sensor sensor = new HPSTestRunTracker2014GeometryDefinition.Sensor(volName, mother, component_number);
+ Sensor sensor = new Sensor(volName, mother, component_number);
sensor.setMaterial("Silicon");
- HalfModuleBundle hm = getHalfModuleBundle((HPSTestRunTracker2014GeometryDefinition.TestRunModule) mother.getMother(), mother.getName());
+ TestRunHalfModuleBundle hm = (TestRunHalfModuleBundle) getHalfModuleBundle((TestRunModule) mother.getMother(), mother.getName());
hm.sensor = sensor;
@@ -342,16 +335,16 @@
}
- private void makeHalfModuleComponentActiveSensor(HPSTestRunTracker2014GeometryDefinition.Sensor mother) {
+ private void makeHalfModuleComponentActiveSensor(Sensor mother) {
if(isDebug()) System.out.printf("%s: makeHalfModuleComponentActiveSensor for %s \n", this.getClass().getSimpleName(), mother.getName());
String volName = mother.getName() + "_active";
- HPSTestRunTracker2014GeometryDefinition.ActiveSensor active_sensor = new HPSTestRunTracker2014GeometryDefinition.ActiveSensor(volName, mother);
+ ActiveSensor active_sensor = new ActiveSensor(volName, mother);
active_sensor.setMaterial("Silicon");
- HalfModuleBundle hm = getHalfModuleBundle((HPSTestRunTracker2014GeometryDefinition.TestRunModule) mother.getMother().getMother(), mother.getMother().getName());
+ TestRunHalfModuleBundle hm = (TestRunHalfModuleBundle) getHalfModuleBundle((TestRunModule) mother.getMother().getMother(), mother.getMother().getName());
hm.activeSensor = active_sensor;
}
@@ -363,244 +356,10 @@
/**
- * Class containing the final translation and rotation from alignment corrections.
- *
- * @author Per Hansson Adrian <[log in to unmask]>
- *
- */
- public static class AlignmentCorrection {
- private Rotation rotation = null;
- private Hep3Vector translation = null;
- public AlignmentCorrection() {
- }
- public Rotation getRotation() {
- return rotation;
- }
- public void setRotation(Rotation rotation) {
- this.rotation = rotation;
- }
- public void setRotation(double rot_x, double rot_y, double rot_z) {
- Rotation rx = new Rotation(new Vector3D(1,0,0),rot_x);
- Rotation ry = new Rotation(new Vector3D(0,1,0),rot_y);
- Rotation rz = new Rotation(new Vector3D(0,0,1),rot_z);
- // Build full rotation
- Rotation rzyx = rz.applyTo(ry.applyTo(rx));
- setRotation(rzyx);
- }
- public Hep3Vector getTranslation() {
- return translation;
- }
- public void setTranslation(Hep3Vector translation) {
- this.translation = translation;
- }
- }
-
-
- /**
- *
- * Base geometry class for generating volumes based on survey information.
- *
- */
- public static abstract class SurveyVolume {
- protected boolean debug = false;
- private String name;
- private String material = "Vacuum";
- private SurveyVolume mother;
- // The reference geometry is used when the survey points are w.r.t. to
- // a different/intermediate coord system. So that transformation has to be used when
- // transforming to the mother system
- protected List<SurveyVolume> referenceGeom = null;
- private Coord coord;
- protected Hep3Vector ballPos;
- protected Hep3Vector veePos;
- protected Hep3Vector flatPos;
- private Hep3Vector center;
- private Hep3Vector boxDim;
- private AlignmentCorrection alignmentCorrections;
-
- public SurveyVolume(String name, SurveyVolume m) {
- setName(name);
- setMother(m);
- }
- public SurveyVolume(String name, SurveyVolume m, SurveyVolume ref) {
- setName(name);
- setMother(m);
- addReferenceGeom(ref);
- }
- public SurveyVolume(String name, SurveyVolume m, List<SurveyVolume> ref) {
- setName(name);
- setMother(m);
- addReferenceGeom(ref);
- }
-
- protected abstract void setPos();
- protected abstract void setCoord();
- protected abstract void setCenter();
- protected abstract void setBoxDim();
-
- protected void init() {
- setPos();
- setCoord();
- setCenter();
- setBoxDim();
- applyGenericCoordinateSystemCorrections();
- applyAlignmentCorrections();
- }
-
- protected void applyGenericCoordinateSystemCorrections() {
- //do nothing here unless overridden
- }
-
- private void applyAlignmentCorrections() {
- // Apply alignment corrections to local coordinate system that is already built
-
- if(this.coord==null) throw new RuntimeException("no coordinate system was set before trying to apply alignment corrections.");
-
- if(alignmentCorrections!=null) {
-
- if(debug) System.out.printf("%s: Apply alignment corrections to this coord system:\n%s\n",this.getClass().getSimpleName(),getCoord().toString());
-
- // translate
- if(alignmentCorrections.getTranslation()!=null) {
-
- if(debug) System.out.printf("%s: Apply translation %s to coordinate system\n", this.getClass().getSimpleName(),alignmentCorrections.getTranslation().toString());
-
- getCoord().translate(alignmentCorrections.getTranslation());
-
- } else {
- if(debug) System.out.printf("%s: No translation to coordinate system\n", this.getClass().getSimpleName());
- }
-
- // rotate
- if(alignmentCorrections.getRotation()!=null) {
-
- if(debug) {
- System.out.printf("%s: Apply rotation to coordinate system. Matrix:\n", this.getClass().getSimpleName());
- double mat[][] = alignmentCorrections.getRotation().getMatrix();
- TransformationUtils.printMatrix(mat);
- // Get the Cardan angles of the rotation
- double res[] = alignmentCorrections.getRotation().getAngles(RotationOrder.ZYX);
- // Since the rotation was created based on active transformations convert to passive right here.
- // This conversion is simply to reverse the order of rotations.
- Hep3Vector res_passive = new BasicHep3Vector(res[2],res[1],res[0]);
- System.out.printf("%s: Corresponding LCDD Cardan angles:\n", this.getClass().getSimpleName(), res_passive.toString());
- }
-
- getCoord().rotateApache(alignmentCorrections.getRotation());
-
- } else {
- if(debug) System.out.printf("%s: No rotation to coordinate system\n", this.getClass().getSimpleName());
- }
-
- if(debug) System.out.printf("%s: coordinate system after alignment corrections:\n%s\n",this.getClass().getSimpleName(),getCoord().toString());
-
- } else {
- if(debug) System.out.printf("%s: No aligment corrections to coordinate system\n", this.getClass().getSimpleName());
- }
-
- }
-
- public void setBallPos(double x, double y, double z) {
- ballPos = new BasicHep3Vector(x,y,z);
- }
- public void setVeePos(double x, double y, double z) {
- veePos = new BasicHep3Vector(x,y,z);
- }
- public void setFlatPos(double x, double y, double z) {
- flatPos = new BasicHep3Vector(x,y,z);
- }
- public Hep3Vector getBallPos() {
- return ballPos;
- }
- public Hep3Vector getVeePos() {
- return veePos;
- }
- public Hep3Vector getFlatPos() {
- return flatPos;
- }
- public void setCoord(Hep3Vector origin) {
- if(ballPos==null || veePos==null || flatPos==null) {
- throw new RuntimeException("Need to set ball, vee and flat before building coord system!");
- }
- if(origin!=null) {
- coord = new Coord(origin, ballPos, veePos, flatPos);
- } else {
- coord = new Coord(ballPos, veePos, flatPos);
- }
- }
- public Coord getCoord() {
- if(coord == null) {
- throw new RuntimeException("Need to setCoord!");
- }
- return coord;
- }
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public Hep3Vector getCenter() {
- return center;
- }
- public void setCenter(Hep3Vector center) {
- this.center = center;
- }
- public void setCenter(double x, double y, double z) {
- this.center = new BasicHep3Vector(x,y,z);
- }
- public Hep3Vector getBoxDim() {
- return boxDim;
- }
- public void setBoxDim(double x, double y, double z) {
- this.boxDim = new BasicHep3Vector(x,y,z);
- }
- public SurveyVolume getMother() {
- return mother;
- }
- public void setMother(SurveyVolume mother) {
- this.mother = mother;
- }
- public void addReferenceGeom(SurveyVolume refGeom) {
- if(refGeom!=null) { // check that it's not a dummy call
- if(referenceGeom == null) {
- referenceGeom = new ArrayList<SurveyVolume>();
- }
- referenceGeom.add(refGeom);
- }
- }
- public void addReferenceGeom(List<SurveyVolume> refGeomList) {
- if(referenceGeom == null) {
- referenceGeom = new ArrayList<SurveyVolume>();
- }
- referenceGeom.addAll(refGeomList);
- }
- public void printSurveyPos() {
- if(debug) System.out.printf("Survey pos for %s:\n",getName());
- if(debug) System.out.printf("ballPos %s\n", ballPos.toString());
- if(debug) System.out.printf("veePos %s\n", veePos.toString());
- if(debug) System.out.printf("flatPos %s\n", flatPos.toString());
- }
- public String getMaterial() {
- return material;
- }
- public void setMaterial(String material) {
- this.material = material;
- }
- public String toString() {
- String s = "BaseGeometry " + getName();
- s += "\n" + this.getCoord().toString();
- return s;
- }
-
- }
-
-
- /**
* Tracking volume geometry definition.
*/
- public static class TrackingBase extends SurveyVolume {
- public TrackingBase(String name, SurveyVolume mother) {
+ public static class TrackingVolume extends SurveyVolume {
+ public TrackingVolume(String name, SurveyVolume mother) {
super(name,mother);
init();
}
@@ -718,7 +477,7 @@
init();
}
private void calcAndSetFlatPos() {
- if(HPSTestRunTracker2014GeometryDefinition.use30mradRotation) {
+ if(use30mradRotation) {
// find the rotation to place the flat point
Rotation rot1_csup =
new Rotation(
@@ -1175,29 +934,29 @@
if(isBottom()) {
switch (getLayer()) {
case 1:
- ballPos = new BasicHep3Vector(25.0, 661.1, HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.pedestal_height_L1-HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.support_plate_pocket_depth);
- veePos = new BasicHep3Vector(95.0, 661.1, HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.pedestal_height_L1-HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.support_plate_pocket_depth);
- flatPos = new BasicHep3Vector(60.0, 667.10, HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.pedestal_height_L1-HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.support_plate_pocket_depth);
+ ballPos = new BasicHep3Vector(25.0, 661.1, SupportPlateBottom.pedestal_height_L1-SupportPlateBottom.support_plate_pocket_depth);
+ veePos = new BasicHep3Vector(95.0, 661.1, SupportPlateBottom.pedestal_height_L1-SupportPlateBottom.support_plate_pocket_depth);
+ flatPos = new BasicHep3Vector(60.0, 667.10, SupportPlateBottom.pedestal_height_L1-SupportPlateBottom.support_plate_pocket_depth);
break;
case 2:
- ballPos = new BasicHep3Vector(25.0, 561.1, HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.pedestal_height_L2-HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.support_plate_pocket_depth);
- veePos = new BasicHep3Vector(95.0, 561.1, HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.pedestal_height_L2-HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.support_plate_pocket_depth);
- flatPos = new BasicHep3Vector(60.0, 567.10, HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.pedestal_height_L2-HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.support_plate_pocket_depth);
+ ballPos = new BasicHep3Vector(25.0, 561.1, SupportPlateBottom.pedestal_height_L2-SupportPlateBottom.support_plate_pocket_depth);
+ veePos = new BasicHep3Vector(95.0, 561.1, SupportPlateBottom.pedestal_height_L2-SupportPlateBottom.support_plate_pocket_depth);
+ flatPos = new BasicHep3Vector(60.0, 567.10, SupportPlateBottom.pedestal_height_L2-SupportPlateBottom.support_plate_pocket_depth);
break;
case 3:
- ballPos = new BasicHep3Vector(25.0, 461.1, HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.pedestal_height_L3-HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.support_plate_pocket_depth);
- veePos = new BasicHep3Vector(95.0, 461.1, HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.pedestal_height_L3-HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.support_plate_pocket_depth);
- flatPos = new BasicHep3Vector(60.0, 467.10, HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.pedestal_height_L3-HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.support_plate_pocket_depth);
+ ballPos = new BasicHep3Vector(25.0, 461.1, SupportPlateBottom.pedestal_height_L3-SupportPlateBottom.support_plate_pocket_depth);
+ veePos = new BasicHep3Vector(95.0, 461.1, SupportPlateBottom.pedestal_height_L3-SupportPlateBottom.support_plate_pocket_depth);
+ flatPos = new BasicHep3Vector(60.0, 467.10, SupportPlateBottom.pedestal_height_L3-SupportPlateBottom.support_plate_pocket_depth);
break;
case 4:
- ballPos = new BasicHep3Vector(25.0, 261.1, HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.pedestal_height_L4-HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.support_plate_pocket_depth);
- veePos = new BasicHep3Vector(95.0, 261.1, HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.pedestal_height_L4-HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.support_plate_pocket_depth);
- flatPos = new BasicHep3Vector(60.0, 267.10, HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.pedestal_height_L4-HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.support_plate_pocket_depth);
+ ballPos = new BasicHep3Vector(25.0, 261.1, SupportPlateBottom.pedestal_height_L4-SupportPlateBottom.support_plate_pocket_depth);
+ veePos = new BasicHep3Vector(95.0, 261.1, SupportPlateBottom.pedestal_height_L4-SupportPlateBottom.support_plate_pocket_depth);
+ flatPos = new BasicHep3Vector(60.0, 267.10, SupportPlateBottom.pedestal_height_L4-SupportPlateBottom.support_plate_pocket_depth);
break;
case 5:
- ballPos = new BasicHep3Vector(25.0, 61.1, HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.pedestal_height_L5-HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.support_plate_pocket_depth);
- veePos = new BasicHep3Vector(95.0, 61.1, HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.pedestal_height_L5-HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.support_plate_pocket_depth);
- flatPos = new BasicHep3Vector(60.0, 67.10, HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.pedestal_height_L5-HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.support_plate_pocket_depth);
+ ballPos = new BasicHep3Vector(25.0, 61.1, SupportPlateBottom.pedestal_height_L5-SupportPlateBottom.support_plate_pocket_depth);
+ veePos = new BasicHep3Vector(95.0, 61.1, SupportPlateBottom.pedestal_height_L5-SupportPlateBottom.support_plate_pocket_depth);
+ flatPos = new BasicHep3Vector(60.0, 67.10, SupportPlateBottom.pedestal_height_L5-SupportPlateBottom.support_plate_pocket_depth);
break;
default:
System.out.printf("ERROR invalid layer %d for half %s\n",getLayer(),getHalf());
@@ -1212,29 +971,29 @@
switch (getLayer()) {
case 1:
- ballPos = new BasicHep3Vector(25.0, 676.1, -1.0 * (HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.pedestal_height_L1-HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.support_plate_pocket_depth));
- veePos = new BasicHep3Vector(95.0, 676.1, -1.0 * (HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.pedestal_height_L1-HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.support_plate_pocket_depth));
- flatPos = new BasicHep3Vector(60.0, 670.1, -1.0 * (HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.pedestal_height_L1-HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.support_plate_pocket_depth));
+ ballPos = new BasicHep3Vector(25.0, 676.1, -1.0 * (SupportPlateBottom.pedestal_height_L1-SupportPlateBottom.support_plate_pocket_depth));
+ veePos = new BasicHep3Vector(95.0, 676.1, -1.0 * (SupportPlateBottom.pedestal_height_L1-SupportPlateBottom.support_plate_pocket_depth));
+ flatPos = new BasicHep3Vector(60.0, 670.1, -1.0 * (SupportPlateBottom.pedestal_height_L1-SupportPlateBottom.support_plate_pocket_depth));
break;
case 2:
- ballPos = new BasicHep3Vector(25.0, 576.1, -1.0 * (HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.pedestal_height_L2-HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.support_plate_pocket_depth));
- veePos = new BasicHep3Vector(95.0, 576.1, -1.0 * (HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.pedestal_height_L2-HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.support_plate_pocket_depth));
- flatPos = new BasicHep3Vector(60.0, 570.1, -1.0 * (HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.pedestal_height_L2-HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.support_plate_pocket_depth));
+ ballPos = new BasicHep3Vector(25.0, 576.1, -1.0 * (SupportPlateBottom.pedestal_height_L2-SupportPlateBottom.support_plate_pocket_depth));
+ veePos = new BasicHep3Vector(95.0, 576.1, -1.0 * (SupportPlateBottom.pedestal_height_L2-SupportPlateBottom.support_plate_pocket_depth));
+ flatPos = new BasicHep3Vector(60.0, 570.1, -1.0 * (SupportPlateBottom.pedestal_height_L2-SupportPlateBottom.support_plate_pocket_depth));
break;
case 3:
- ballPos = new BasicHep3Vector(25.0, 476.1, -1.0 * (HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.pedestal_height_L3-HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.support_plate_pocket_depth));
- veePos = new BasicHep3Vector(95.0, 476.1, -1.0 * (HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.pedestal_height_L3-HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.support_plate_pocket_depth));
- flatPos =new BasicHep3Vector(60.0, 470.1, -1.0 * (HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.pedestal_height_L3-HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.support_plate_pocket_depth));
+ ballPos = new BasicHep3Vector(25.0, 476.1, -1.0 * (SupportPlateBottom.pedestal_height_L3-SupportPlateBottom.support_plate_pocket_depth));
+ veePos = new BasicHep3Vector(95.0, 476.1, -1.0 * (SupportPlateBottom.pedestal_height_L3-SupportPlateBottom.support_plate_pocket_depth));
+ flatPos =new BasicHep3Vector(60.0, 470.1, -1.0 * (SupportPlateBottom.pedestal_height_L3-SupportPlateBottom.support_plate_pocket_depth));
break;
case 4:
- ballPos = new BasicHep3Vector(25.0, 276.1, -1.0 * (HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.pedestal_height_L4-HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.support_plate_pocket_depth));
- veePos = new BasicHep3Vector(95.0, 276.1, -1.0 * (HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.pedestal_height_L4-HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.support_plate_pocket_depth));
- flatPos = new BasicHep3Vector(60.0, 270.1, -1.0 * (HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.pedestal_height_L4-HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.support_plate_pocket_depth));
+ ballPos = new BasicHep3Vector(25.0, 276.1, -1.0 * (SupportPlateBottom.pedestal_height_L4-SupportPlateBottom.support_plate_pocket_depth));
+ veePos = new BasicHep3Vector(95.0, 276.1, -1.0 * (SupportPlateBottom.pedestal_height_L4-SupportPlateBottom.support_plate_pocket_depth));
+ flatPos = new BasicHep3Vector(60.0, 270.1, -1.0 * (SupportPlateBottom.pedestal_height_L4-SupportPlateBottom.support_plate_pocket_depth));
break;
case 5:
- ballPos = new BasicHep3Vector(25.0, 76.1, -1.0 * (HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.pedestal_height_L5-HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.support_plate_pocket_depth));
- veePos = new BasicHep3Vector(95.0, 76.1, -1.0 * (HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.pedestal_height_L5-HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.support_plate_pocket_depth));
- flatPos = new BasicHep3Vector(60.0, 70.1, -1.0 * (HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.pedestal_height_L5-HPSTestRunTracker2014GeometryDefinition.SupportPlateBottom.support_plate_pocket_depth));
+ ballPos = new BasicHep3Vector(25.0, 76.1, -1.0 * (SupportPlateBottom.pedestal_height_L5-SupportPlateBottom.support_plate_pocket_depth));
+ veePos = new BasicHep3Vector(95.0, 76.1, -1.0 * (SupportPlateBottom.pedestal_height_L5-SupportPlateBottom.support_plate_pocket_depth));
+ flatPos = new BasicHep3Vector(60.0, 70.1, -1.0 * (SupportPlateBottom.pedestal_height_L5-SupportPlateBottom.support_plate_pocket_depth));
break;
default:
System.out.printf("ERROR invalid layer %d for half %s\n",getLayer(),getHalf());
@@ -1332,9 +1091,9 @@
// Distance from screw hole to edge of cold block: 33.75mm
// Distance from edge of cold block to hole/ball position: 5mm
protected static final double dist_sensor_center_to_coldblock_hole_vdir = (180.0 - 30.0 + (33.75 - 5.0)) - Sensor.sensor_length/2.0;
- protected static final double half_module_thickness = HPSTestRunTracker2014GeometryDefinition.TestRunHalfModule.getHybridThickness() + HPSTestRunTracker2014GeometryDefinition.TestRunHalfModule.getCFThickness() + HalfModuleLamination.kapton_thickness;
- protected static final double half_module_length = HPSTestRunTracker2014GeometryDefinition.TestRunHalfModule.getCFLength();
- protected static final double half_module_width = 6.83 + HPSTestRunTracker2014GeometryDefinition.Sensor.getSensorWidth();
+ protected static final double half_module_thickness = TestRunHalfModule.getHybridThickness() + TestRunHalfModule.getCFThickness() + HalfModuleLamination.kapton_thickness;
+ protected static final double half_module_length = TestRunHalfModule.getCFLength();
+ protected static final double half_module_width = 6.83 + Sensor.getSensorWidth();
protected double stereo_angle = 0.0;
@@ -1347,9 +1106,9 @@
// Note that this can be different between axial and stereo since the survey positions determine the local coordinate
// system now.
// I'm not sure this feels good but this has to be done somewhere
- double box_center_local_x = HPSTestRunTracker2014GeometryDefinition.TestRunHalfModule.getLength()/2.0 - ( (170.00 + 10.00) - HPSTestRunTracker2014GeometryDefinition.Sensor.getSensorLength()/2.0);
- double box_center_local_y = -1.0*HPSTestRunTracker2014GeometryDefinition.TestRunHalfModule.getThickness()/2.0 + (HPSTestRunTracker2014GeometryDefinition.TestRunHalfModule.getCFThickness() + HalfModuleLamination.kapton_thickness + HPSTestRunTracker2014GeometryDefinition.Sensor.getSensorThickness()/2.0);
- double box_center_local_z = HPSTestRunTracker2014GeometryDefinition.TestRunHalfModule.getWidth()/2.0 - ( 12.66 - (8.83 -3.00) + HPSTestRunTracker2014GeometryDefinition.Sensor.getSensorWidth()/2.0 );
+ double box_center_local_x = TestRunHalfModule.getLength()/2.0 - ( (170.00 + 10.00) - Sensor.getSensorLength()/2.0);
+ double box_center_local_y = -1.0*TestRunHalfModule.getThickness()/2.0 + (TestRunHalfModule.getCFThickness() + HalfModuleLamination.kapton_thickness + Sensor.getSensorThickness()/2.0);
+ double box_center_local_z = TestRunHalfModule.getWidth()/2.0 - ( 12.66 - (8.83 -3.00) + Sensor.getSensorWidth()/2.0 );
setCenter(box_center_local_x, box_center_local_y, box_center_local_z);
}
protected void setCoord() {
@@ -1408,8 +1167,8 @@
final double dist_lower_sensor_edge_to_cold_block_mounting_surface = getLayer() <=3 ? TestRunModuleL13.dist_lower_sensor_edge_to_cold_block_mounting_surface : TestRunModuleL45.dist_lower_sensor_edge_to_cold_block_mounting_surface;
double ball_pos_halfmod_local_x = dist_sensor_center_to_coldblock_hole_vdir;
- double ball_pos_halfmod_local_y = -1.0* (coldBlockThick/2.0 + TestRunHalfModule.getCFThickness() + HalfModuleLamination.kapton_thickness + HPSTestRunTracker2014GeometryDefinition.Sensor.getSensorThickness()/2.0);
- if(HPSTestRunTracker2014GeometryDefinition.useFakeHalfModuleAxialPos) {
+ double ball_pos_halfmod_local_y = -1.0* (coldBlockThick/2.0 + TestRunHalfModule.getCFThickness() + HalfModuleLamination.kapton_thickness + Sensor.getSensorThickness()/2.0);
+ if(useFakeHalfModuleAxialPos) {
ball_pos_halfmod_local_x = ball_pos_halfmod_local_x*2.0;
ball_pos_halfmod_local_y = -2.0*ball_pos_halfmod_local_y;
}
@@ -1448,7 +1207,7 @@
final double ball_pos_halfmod_local_x = dist_sensor_center_to_coldblock_hole_vdir;
// note minus sign to separate from axial
- final double ball_pos_halfmod_local_y = -1.0 * (-1.0* (coldBlockThick/2.0 + TestRunHalfModule.getCFThickness() + HalfModuleLamination.kapton_thickness + HPSTestRunTracker2014GeometryDefinition.Sensor.getSensorThickness()/2.0));
+ final double ball_pos_halfmod_local_y = -1.0 * (-1.0* (coldBlockThick/2.0 + TestRunHalfModule.getCFThickness() + HalfModuleLamination.kapton_thickness + Sensor.getSensorThickness()/2.0));
final double ball_pos_halfmod_local_z = dist_lower_sensor_edge_to_cold_block_mounting_surface + Sensor.getSensorWidth()/2.0;
final double vee_pos_halfmod_local_x = ball_pos_halfmod_local_x + Sensor.getSensorLength()/2.0;
final double vee_pos_halfmod_local_y = ball_pos_halfmod_local_y;
@@ -1606,7 +1365,7 @@
return getSensorHeight();
}
protected void setPos() {
- if(HPSTestRunTracker2014GeometryDefinition.useSiStripsConvention) {
+ if(useSiStripsConvention) {
setBallPos(0,0,0);
setVeePos(ballPos.x(), ballPos.y(), ballPos.z() + getSensorWidth()/2.0);
setFlatPos(ballPos.x() + getSensorLength()/2.0,ballPos.y(), ballPos.z());
@@ -1623,7 +1382,7 @@
setCenter(0,0,0);
}
protected void setBoxDim() {
- if(HPSTestRunTracker2014GeometryDefinition.useSiStripsConvention) {
+ if(useSiStripsConvention) {
setBoxDim(getSensorWidth(),getSensorLength(),getSensorThickness());
} else {
setBoxDim(getSensorLength(),getSensorThickness(),getSensorWidth());
@@ -1664,7 +1423,7 @@
return getActiveSensorHeight();
}
protected void setPos() {
- if(HPSTestRunTracker2014GeometryDefinition.useSiStripsConvention) {
+ if(useSiStripsConvention) {
ballPos = new BasicHep3Vector(0,0,0);
veePos = new BasicHep3Vector(getActiveSensorWidth()/2.0,0,0);
flatPos = new BasicHep3Vector(0,getActiveSensorLength()/2.0,0);
@@ -1682,7 +1441,7 @@
}
@Override
protected void setBoxDim() {
- if(HPSTestRunTracker2014GeometryDefinition.useSiStripsConvention) {
+ if(useSiStripsConvention) {
setBoxDim(getActiveSensorWidth(), getActiveSensorLength(), getActiveSensorThickness());
} else {
setBoxDim(getActiveSensorLength(),getActiveSensorThickness(),getActiveSensorWidth());
@@ -1717,9 +1476,9 @@
init();
}
protected void setPos() {
- final double ball_pos_kapton_local_x = -1 * (180.0 - HPSTestRunTracker2014GeometryDefinition.Sensor.getSensorLength()/2.0) + 8.5;
- final double ball_pos_kapton_local_y = (HPSTestRunTracker2014GeometryDefinition.Sensor.getSensorThickness()/2.0 + HalfModuleLamination.kapton_thickness/2.0);
- final double ball_pos_kapton_local_z = -1 * (HPSTestRunTracker2014GeometryDefinition.Sensor.getSensorWidth()/2.0 + 12.66) + 8.83 - 3.00 + 6.00 ;
+ final double ball_pos_kapton_local_x = -1 * (180.0 - Sensor.getSensorLength()/2.0) + 8.5;
+ final double ball_pos_kapton_local_y = (Sensor.getSensorThickness()/2.0 + HalfModuleLamination.kapton_thickness/2.0);
+ final double ball_pos_kapton_local_z = -1 * (Sensor.getSensorWidth()/2.0 + 12.66) + 8.83 - 3.00 + 6.00 ;
final double vee_pos_kapton_local_x = ball_pos_kapton_local_x + 1.0; // arbitrary distance
final double vee_pos_kapton_local_y = ball_pos_kapton_local_y;
final double vee_pos_kapton_local_z = ball_pos_kapton_local_z;
@@ -1761,14 +1520,14 @@
init();
}
protected void setPos() {
- final double ball_pos_cf_local_x = -1 * (180.0 - HPSTestRunTracker2014GeometryDefinition.Sensor.getSensorLength()/2.0);
- final double ball_pos_cf_local_y = (HPSTestRunTracker2014GeometryDefinition.Sensor.getSensorThickness()/2.0 + HPSTestRunTracker2014GeometryDefinition.HalfModuleLamination.kapton_thickness + HPSTestRunTracker2014GeometryDefinition.TestRunHalfModule.getCFThickness()/2.0);
- final double ball_pos_cf_local_z = -1 * (HPSTestRunTracker2014GeometryDefinition.Sensor.getSensorWidth()/2.0 + 12.66) + 8.83 - 3.00;
+ final double ball_pos_cf_local_x = -1 * (180.0 - Sensor.getSensorLength()/2.0);
+ final double ball_pos_cf_local_y = (Sensor.getSensorThickness()/2.0 + HalfModuleLamination.kapton_thickness + TestRunHalfModule.getCFThickness()/2.0);
+ final double ball_pos_cf_local_z = -1 * (Sensor.getSensorWidth()/2.0 + 12.66) + 8.83 - 3.00;
final double vee_pos_cf_local_x = ball_pos_cf_local_x + 1.0; // arbitrary distance
final double vee_pos_cf_local_y = ball_pos_cf_local_y;
final double vee_pos_cf_local_z = ball_pos_cf_local_z;
final double flat_pos_cf_local_x = ball_pos_cf_local_x;
- final double flat_pos_cf_local_y = ball_pos_cf_local_y + HPSTestRunTracker2014GeometryDefinition.TestRunHalfModule.getCFThickness()/2.0; // arbitrary distance
+ final double flat_pos_cf_local_y = ball_pos_cf_local_y + TestRunHalfModule.getCFThickness()/2.0; // arbitrary distance
final double flat_pos_cf_local_z = ball_pos_cf_local_z;
setBallPos(ball_pos_cf_local_x,ball_pos_cf_local_y,ball_pos_cf_local_z);
setVeePos(vee_pos_cf_local_x,vee_pos_cf_local_y,vee_pos_cf_local_z);
@@ -1796,22 +1555,22 @@
public static class Hybrid extends HalfModuleComponent {
- protected static final double hybrid_length = 170.0 - HPSTestRunTracker2014GeometryDefinition.Sensor.getSensorLength(); // sensor b-to-b with hybrid
- protected static final double hybrid_width = HPSTestRunTracker2014GeometryDefinition.Sensor.getSensorWidth();
+ protected static final double hybrid_length = 170.0 - Sensor.getSensorLength(); // sensor b-to-b with hybrid
+ protected static final double hybrid_width = Sensor.getSensorWidth();
protected static final double hybrid_thickness = 4.0/64.0*inch;
public Hybrid(String name, SurveyVolume m, int id) {
super(name, m, id);
init();
}
protected void setPos() {
- final double ball_pos_hybrid_local_x = -1 * (170.0 - HPSTestRunTracker2014GeometryDefinition.Sensor.getSensorLength()/2.0);
- final double ball_pos_hybrid_local_y = (HPSTestRunTracker2014GeometryDefinition.Sensor.getSensorThickness()/2.0 - HPSTestRunTracker2014GeometryDefinition.TestRunHalfModule.getHybridThickness()/2.0);
- final double ball_pos_hybrid_local_z = -1 * (HPSTestRunTracker2014GeometryDefinition.Sensor.getSensorWidth()/2.0);
+ final double ball_pos_hybrid_local_x = -1 * (170.0 - Sensor.getSensorLength()/2.0);
+ final double ball_pos_hybrid_local_y = (Sensor.getSensorThickness()/2.0 - TestRunHalfModule.getHybridThickness()/2.0);
+ final double ball_pos_hybrid_local_z = -1 * (Sensor.getSensorWidth()/2.0);
final double vee_pos_hybrid_local_x = ball_pos_hybrid_local_x + 1.0; // arbitrary distance
final double vee_pos_hybrid_local_y = ball_pos_hybrid_local_y;
final double vee_pos_hybrid_local_z = ball_pos_hybrid_local_z;
final double flat_pos_hybrid_local_x = ball_pos_hybrid_local_x;
- final double flat_pos_hybrid_local_y = ball_pos_hybrid_local_y + HPSTestRunTracker2014GeometryDefinition.TestRunHalfModule.getHybridThickness()/2.0; // arbitrary distance
+ final double flat_pos_hybrid_local_y = ball_pos_hybrid_local_y + TestRunHalfModule.getHybridThickness()/2.0; // arbitrary distance
final double flat_pos_hybrid_local_z = ball_pos_hybrid_local_z;
setBallPos(ball_pos_hybrid_local_x,ball_pos_hybrid_local_y,ball_pos_hybrid_local_z);
setVeePos(vee_pos_hybrid_local_x,vee_pos_hybrid_local_y,vee_pos_hybrid_local_z);
@@ -1837,121 +1596,55 @@
setBoxDim(getLength(),getThickness(), getWidth());
}
}
-
-
-
-
-
- /**
- *
- * Class that keeps tracks of unit vectors and origin for a 3D coordinate system.
- *
- */
- public static class Coord {
- private final boolean debug = false;
- private Hep3Vector origin;
- private Hep3Vector u;
- private Hep3Vector v;
- private Hep3Vector w;
- public Coord(Hep3Vector org, Hep3Vector unit_x, Hep3Vector unit_y, Hep3Vector unit_z) {
- origin = org;
- u = unit_x;
- v = unit_y;
- w = unit_z;
- }
- public Coord(Hep3Vector ball, Hep3Vector vee, Hep3Vector flat) {
- origin = ball;
- Hep3Vector ball_to_vee = VecOp.sub(vee, ball);
- u = VecOp.unit(ball_to_vee);
- Hep3Vector ball_to_flat = VecOp.sub(flat, ball);
- w = VecOp.unit(VecOp.cross(ball_to_vee,ball_to_flat));
- v = VecOp.cross(w, u);
- check();
- }
-
- private void check() {
- checkUnitLength();
- checkAngles();
- }
+
+ public static class TestRunModuleBundle extends ModuleBundle {
+ TestRunModuleBundle(TestRunModule m) {
+ module = m;
+ }
+ public int getLayer() {
+ if(module==null) throw new RuntimeException("Need to add module to bundle first!");
+ return HPSTrackerBuilder.getLayerFromVolumeName(module.getName());
+ }
+ public String getHalf() {
+ if(module==null) throw new RuntimeException("Need to add module to bundle first!");
+ return HPSTrackerBuilder.getHalfFromName(module.getName());
+ }
+ /**
+ * Find mother to this module.
+ * @return mother
+ */
+ public SurveyVolume getMother() {
+ if(module==null) throw new RuntimeException("Need to add module to bundle first!");
+ return module.getMother();
+ }
+ public void print() {
+ if(module!=null) System.out.printf("%s: %s\n", this.getClass().getSimpleName(),module.getName());
+ if(halfModuleAxial!=null) halfModuleAxial.print();
+ if(coldBlock!=null)System.out.printf("%s: %s\n", this.getClass().getSimpleName(),coldBlock.getName());
+ if(halfModuleStereo!=null) halfModuleStereo.print();
+ }
+ }
- private void checkUnitLength() {
- if(u.magnitude()-1>0.00001 || v.magnitude()-1>0.00001 || v.magnitude()-1>0.00001) {
- throw new RuntimeException("Error: the unit vectors of the coordinate system is ill-defined " + toString());
- }
- }
- private void checkAngles() {
- if( (VecOp.dot(u, v)-1)>0.00001 || (VecOp.dot(u, w)-1)>0.00001 || (VecOp.dot(v, w)-1)>0.00001 ) {
- throw new RuntimeException("Error: the angles in coordinate system is ill-defined " + toString());
- }
- }
-
- public void rotateApache(Rotation r) {
- if(debug) System.out.printf("%s: apply apache rotation to this coord system\n%s\n", getClass().getSimpleName(),toString());
- this.u = new BasicHep3Vector(r.applyTo(new Vector3D(u.v())).toArray());
- this.v = new BasicHep3Vector(r.applyTo(new Vector3D(v.v())).toArray());
- this.w = new BasicHep3Vector(r.applyTo(new Vector3D(w.v())).toArray());
- if(debug) System.out.printf("%s: new coord system after apache rotation to this coord system\n%s\n", getClass().getSimpleName(),toString());
- }
+ public static class TestRunHalfModuleBundle extends HalfModuleBundle {
+ public SurveyVolume sensor = null;
+ public SurveyVolume activeSensor = null;
+ protected SurveyVolume lamination = null;
+ protected SurveyVolume carbonFiber = null;
+ protected SurveyVolume hybrid = null;
+ TestRunHalfModuleBundle(TestRunHalfModule hm) {
+ halfModule = hm;
+ }
+ public void print() {
+ System.out.printf("%s: %s\n", this.getClass().getSimpleName(),halfModule.getName());
+ }
+ }
-
- /*
- public void rotate(Hep3Vector euler_angles) {
- RotationGeant rotation = new RotationGeant(euler_angles.x(), euler_angles.y(), euler_angles.z());
- rotation.rotate(u);
- rotation.rotate(v);
- rotation.rotate(w);
- }
- */
- public void translate(Hep3Vector translation) {
- // update origin with local translation in u,v,w
- origin = VecOp.add(origin, translation);
- }
- public Hep3Vector origin() {
- return origin;
- }
- public Hep3Vector u() {
- return u;
- }
- public Hep3Vector v() {
- return v;
- }
- public Hep3Vector w() {
- return w;
- }
-
- public String toString() {
- return "Coordinate system: \norigin " + origin.toString() + "\nu " + u.toString() + "\nv " + v.toString() + "\nw " + w.toString();
- }
-
-
- /**
- * Find @ITransform3D to the coordinate system defined by the input.
- * @return resulting 3D transform
- */
- public Transform3D getTransformation() {
- // Find the transform between the two frames - use transform classes here (not really needed)
- Translation3D translation = new Translation3D(origin.x(), origin.y(), origin.z());
- //RotationGeant trackingToEnvelopeRotation = new RotationGeant(0, 0, 0);
- Rotation3D rotation = new Rotation3D(
- new BasicHep3Matrix(
- u.x(),v.x(),w.x(),
- u.y(),v.y(),w.y(),
- u.z(),v.z(),w.z()
- ));
- Transform3D envelopeToSupportTransform = new Transform3D(translation, rotation);
- return envelopeToSupportTransform;
- }
-
- }
-
-
-
}