Commit in projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd on MAIN | |||
HPSTestRunTracker2014Dev1Builder.java | +8 | -8 | 3325 -> 3326 |
HPSTestRunTracker2014Dev1GeometryDefinition.java | +156 | added 3326 | |
HPSTestRunTracker2014Dev1LCDDBuilder.java | +9 | -9 | 3325 -> 3326 |
HPSTestRunTracker2014GeometryDefinition.java | +9 | -4 | 3325 -> 3326 |
HPSTrackerBuilder.java | +4 | -4 | 3325 -> 3326 |
+186 | -25 |
Improve dev geometry for testing.
--- projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTestRunTracker2014Dev1Builder.java 2014-09-17 03:17:04 UTC (rev 3325) +++ projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTestRunTracker2014Dev1Builder.java 2014-09-17 17:45:26 UTC (rev 3326) @@ -3,7 +3,6 @@
*/ package org.lcsim.geometry.compact.converter.lcdd;
-import org.lcsim.geometry.compact.converter.lcdd.HPSTestRunTracker2014GeometryDefinition.BaseGeometry;
/** *
@@ -31,23 +30,24 @@
// 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);
+ HPSTestRunTracker2014Dev1GeometryDefinition.TrackingBase tracking = new HPSTestRunTracker2014Dev1GeometryDefinition.TrackingBase("trackingVolume",null);
geometries.add(tracking);
+ HPSTestRunTracker2014Dev1GeometryDefinition.Base base = new HPSTestRunTracker2014Dev1GeometryDefinition.Base("base",tracking); + geometries.add(base);
-
// Build the half-module int layer = 1; String half = "bottom"; String moduleName = "module_L"+ layer + (half=="bottom"?"b":"t"); String side = "axial"; String volName = moduleName + "_halfmodule_" + side;
- BaseGeometry mother = tracking;
+ HPSTestRunTracker2014GeometryDefinition.BaseGeometry mother = base;
if(isDebug()) System.out.printf("%s: makeHalfModule with name %s\n", this.getClass().getSimpleName(), volName);
- HPSTestRunTracker2014GeometryDefinition.TestRunHalfModule halfModule - = new HPSTestRunTracker2014GeometryDefinition.TestRunHalfModuleAxial(volName, mother, layer, half);
+ HPSTestRunTracker2014Dev1GeometryDefinition.TestRunHalfModule halfModule + = new HPSTestRunTracker2014Dev1GeometryDefinition.TestRunHalfModuleAxial(volName, mother, layer, half);
if(isDebug()) System.out.printf("%s: %s\n", this.getClass().getSimpleName(), halfModule.toString());
@@ -65,7 +65,7 @@
int component_number = 0; //
- HPSTestRunTracker2014GeometryDefinition.Sensor sensor = new HPSTestRunTracker2014GeometryDefinition.Sensor(volName, mother, component_number);
+ HPSTestRunTracker2014Dev1GeometryDefinition.Sensor sensor = new HPSTestRunTracker2014Dev1GeometryDefinition.Sensor(volName, mother, component_number);
sensor.setMaterial("Silicon"); geometries.add(sensor);
@@ -85,7 +85,7 @@
if(isDebug()) { System.out.printf("%s: DONE constructing the geometry objects\n", this.getClass().getSimpleName()); System.out.printf("%s: List of all the geometry objects built\n", this.getClass().getSimpleName());
- for(BaseGeometry bg : geometries) {
+ for(HPSTestRunTracker2014GeometryDefinition.BaseGeometry bg : geometries) {
System.out.printf("-------\n%s\n", bg.toString()); } }
--- projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTestRunTracker2014Dev1GeometryDefinition.java (rev 0) +++ projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTestRunTracker2014Dev1GeometryDefinition.java 2014-09-17 17:45:26 UTC (rev 3326) @@ -0,0 +1,156 @@
+/** + * + */ +package org.lcsim.geometry.compact.converter.lcdd; + +import org.lcsim.geometry.compact.converter.lcdd.HPSTestRunTracker2014GeometryDefinition.BaseGeometry; +import org.lcsim.geometry.compact.converter.lcdd.HPSTestRunTracker2014GeometryDefinition.HalfModuleComponent; +import org.lcsim.geometry.compact.converter.lcdd.HPSTestRunTracker2014GeometryDefinition.HalfModuleLamination; + +import hep.physics.vec.BasicHep3Vector; + +/** + * + * Class containing geometry information for HPS Test run tracker 2014 + * + * @author Per Hansson Adrian <[log in to unmask]> + * + */ + +public class HPSTestRunTracker2014Dev1GeometryDefinition extends HPSTestRunTracker2014GeometryDefinition { + + + + + + public static class Base extends HPSTestRunTracker2014GeometryDefinition.BaseGeometry { + // height of the dummy box holding the entire SVT: + // this means the bottom of the base plate to the the inner surface of of the PS vac box for now + protected static final double base_height = PS_vac_box_inner_height - BasePlate.base_plate_offset_height; + protected static final double base_width = BasePlate.base_plate_width; + protected static final double base_length = BasePlate.base_plate_length; + + public Base(String name, HPSTestRunTracker2014GeometryDefinition.BaseGeometry mother) { + super(name,mother); + init(); + } + protected void setPos() { + //Default position +// final double ball_pos_base_x = -1.0*target_pos_wrt_base_plate_x; +// final double ball_pos_base_y = -1.0*target_pos_wrt_base_plate_y; +// final double ball_pos_base_z = target_pos_wrt_base_plate_z; +// final double vee_pos_base_x = ball_pos_base_x + BasePlate.base_plate_width; +// final double vee_pos_base_y = ball_pos_base_y; +// final double vee_pos_base_z = ball_pos_base_z; +// final double flat_pos_base_x = ball_pos_base_x; +// final double flat_pos_base_y = ball_pos_base_y; +// final double flat_pos_base_z = ball_pos_base_z - BasePlate.base_plate_length; + + //Unrotated compared to tracking coordinates position + final double ball_pos_base_x = 0; + final double ball_pos_base_y = 0; + final double ball_pos_base_z = 0; + final double vee_pos_base_x = ball_pos_base_x + BasePlate.base_plate_width; + final double vee_pos_base_y = ball_pos_base_y; + final double vee_pos_base_z = ball_pos_base_z; + final double flat_pos_base_x = ball_pos_base_x; + final double flat_pos_base_y = ball_pos_base_y + BasePlate.base_plate_length; + final double flat_pos_base_z = ball_pos_base_z; + setBallPos(ball_pos_base_x,ball_pos_base_y,ball_pos_base_z); + setVeePos(vee_pos_base_x,vee_pos_base_y,vee_pos_base_z); + setFlatPos(flat_pos_base_x, flat_pos_base_y, flat_pos_base_z); + } + protected void setCoord() { + setCoord(null); + } + protected void setCenter() { + //setCenter(base_width/2.0, base_length/2.0, base_height/2.0 - BasePlate.base_plate_thickness); + setCenter(0,0,0); + } + protected void setBoxDim() { + setBoxDim(base_width,base_length,base_height); + } + } + + + + + + + + + + + public static class TestRunHalfModuleAxial extends HPSTestRunTracker2014GeometryDefinition.TestRunHalfModuleAxial { + + public TestRunHalfModuleAxial(String name, HPSTestRunTracker2014GeometryDefinition.BaseGeometry mother, int layer, String half) { + super(name, mother, layer, half); + init(); + } + + protected void setPos() { + final double coldBlockThick = getLayer() <=3 ? TestRunColdBlockL13.coldblock_L13_thickness : TestRunColdBlockL45.coldblock_L45_thickness; + 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; + + final double ball_pos_halfmod_local_x = 0; + final double ball_pos_halfmod_local_y = 0; + final double ball_pos_halfmod_local_z = 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; + final double vee_pos_halfmod_local_z = ball_pos_halfmod_local_z; + final double flat_pos_halfmod_local_x = ball_pos_halfmod_local_x; + final double flat_pos_halfmod_local_y = ball_pos_halfmod_local_y + Sensor.getSensorThickness()/2.0; + final double flat_pos_halfmod_local_z = ball_pos_halfmod_local_z; + ballPos = new BasicHep3Vector(ball_pos_halfmod_local_x, ball_pos_halfmod_local_y, ball_pos_halfmod_local_z); + veePos = new BasicHep3Vector(vee_pos_halfmod_local_x, vee_pos_halfmod_local_y,vee_pos_halfmod_local_z); + flatPos = new BasicHep3Vector(flat_pos_halfmod_local_x, flat_pos_halfmod_local_y,flat_pos_halfmod_local_z); + + } + + protected void setCenter() { + // Find distance to center in the local coordinate system + // 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 = 0; + double box_center_local_y = 0; + double box_center_local_z = 0; + setCenter(box_center_local_x, box_center_local_y, box_center_local_z); + } + + } + + public static class Sensor extends HPSTestRunTracker2014GeometryDefinition.Sensor { + + public Sensor(String name, BaseGeometry m, int id) { + super(name, m, id); + init(); + } + + protected void setPos() { + // using SiStrips convention + setBallPos(0,0,0); + setVeePos(ballPos.x(), ballPos.y(), ballPos.z() + getSensorWidth()/2.0); + setFlatPos(ballPos.x() + getSensorLength()/2.0,ballPos.y(), ballPos.z()); + // default convention + //setBallPos(0,0,0); + //setVeePos(ballPos.x() + getSensorLength()/2.0, ballPos.y(), ballPos.z()); + //setFlatPos(ballPos.x(),ballPos.y() + getSensorThickness()/2.0, ballPos.z()); + + } + + protected void setBoxDim() { + // using SiStrips convention + setBoxDim(getSensorWidth(),getSensorLength(),getSensorThickness()); + // default convention + //setBoxDim(getSensorLength(),getSensorThickness(),getSensorWidth()); + + } + + } + +} + + + +
--- projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTestRunTracker2014Dev1LCDDBuilder.java 2014-09-17 03:17:04 UTC (rev 3325) +++ projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTestRunTracker2014Dev1LCDDBuilder.java 2014-09-17 17:45:26 UTC (rev 3326) @@ -1,9 +1,5 @@
package org.lcsim.geometry.compact.converter.lcdd;
-import org.lcsim.geometry.compact.converter.lcdd.HPSTestRunTracker2014GeometryDefinition.ActiveSensor; -import org.lcsim.geometry.compact.converter.lcdd.HPSTestRunTracker2014GeometryDefinition.Sensor; -import org.lcsim.geometry.compact.converter.lcdd.HPSTestRunTracker2014GeometryDefinition.TestRunHalfModuleAxial; -import org.lcsim.geometry.compact.converter.lcdd.HPSTestRunTracker2014GeometryDefinition.TrackingBase;
import org.lcsim.geometry.compact.converter.lcdd.util.Volume;
@@ -39,22 +35,26 @@
// Go through the list of volumes to build that is created in the generic builder class // TODO this is manual now since I don't have a way of knowing in the generic builder class what is a ghost volume at this point.
- LCDDBaseGeometry trackingGeometry = new LCDDBaseGeometry(_builder.getBaseGeometry(TrackingBase.class), worldVolume);
+ LCDDBaseGeometry trackingGeometry = new LCDDBaseGeometry(_builder.getBaseGeometry(HPSTestRunTracker2014GeometryDefinition.TrackingBase.class), worldVolume);
add(trackingGeometry);
- baseTrackerGeometry = trackingGeometry;
+ //baseTrackerGeometry = trackingGeometry;
+ baseTrackerGeometry = new LCDDBaseGeometry(_builder.getBaseGeometry(HPSTestRunTracker2014Dev1GeometryDefinition.Base.class), lcdd, trackingGeometry);
+ add(baseTrackerGeometry);
+ +
// build modules if(isDebug()) System.out.printf("%s: build modules\n", getClass().getSimpleName());
- LCDDBaseGeometry lcddHM = new LCDDBaseGeometry(_builder.getBaseGeometry(TestRunHalfModuleAxial.class),lcdd, baseTrackerGeometry);
+ LCDDBaseGeometry lcddHM = new LCDDBaseGeometry(_builder.getBaseGeometry(HPSTestRunTracker2014Dev1GeometryDefinition.TestRunHalfModuleAxial.class),lcdd, baseTrackerGeometry);
add(lcddHM); // create the sensor
- LCDDBaseGeometry lcddS = new LCDDBaseGeometry(_builder.getBaseGeometry(Sensor.class), lcdd, lcddHM);
+ LCDDBaseGeometry lcddS = new LCDDBaseGeometry(_builder.getBaseGeometry(HPSTestRunTracker2014GeometryDefinition.Sensor.class), lcdd, lcddHM);
add(lcddS); // create the active sensor
- LCDDBaseGeometry lcddAS = new LCDDBaseGeometry(_builder.getBaseGeometry(ActiveSensor.class), lcdd, lcddS);
+ LCDDBaseGeometry lcddAS = new LCDDBaseGeometry(_builder.getBaseGeometry(HPSTestRunTracker2014GeometryDefinition.ActiveSensor.class), lcdd, lcddS);
add(lcddAS); /* // create the lamination
--- projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTestRunTracker2014GeometryDefinition.java 2014-09-17 03:17:04 UTC (rev 3325) +++ projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTestRunTracker2014GeometryDefinition.java 2014-09-17 17:45:26 UTC (rev 3326) @@ -27,9 +27,10 @@
public class HPSTestRunTracker2014GeometryDefinition { //General
- private static final double inch = 25.4; //mm
+ static final double inch = 25.4; //mm
protected static final boolean useSiStripsConvention = true; protected static final boolean use30mradRotation = false;
+ protected static final boolean useFakeHalfModuleAxialPos = false;
// Global position references private static final double target_pos_wrt_base_plate_x = 162.3; //from Marco's 3D model
@@ -995,8 +996,12 @@
final double coldBlockThick = getLayer() <=3 ? TestRunColdBlockL13.coldblock_L13_thickness : TestRunColdBlockL45.coldblock_L45_thickness; 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;
- final double ball_pos_halfmod_local_x = dist_sensor_center_to_coldblock_hole_vdir; - final double ball_pos_halfmod_local_y = -1.0* (coldBlockThick/2.0 + TestRunHalfModule.getCFThickness() + HalfModuleLamination.kapton_thickness + HPSTestRunTracker2014GeometryDefinition.Sensor.getSensorThickness()/2.0);
+ 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) { + ball_pos_halfmod_local_x = ball_pos_halfmod_local_x*2.0; + ball_pos_halfmod_local_y = -2.0*ball_pos_halfmod_local_y; + }
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;
@@ -1173,7 +1178,7 @@
public static class Sensor extends HalfModuleComponent {
- private static final double sensor_length= 100.00;
+ static final double sensor_length= 100.00;
private static final double sensor_width = 40.34; private static final double sensor_thickness = 0.32; public Sensor(String name, BaseGeometry m, int id) {
--- projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTrackerBuilder.java 2014-09-17 03:17:04 UTC (rev 3325) +++ projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTrackerBuilder.java 2014-09-17 17:45:26 UTC (rev 3326) @@ -153,10 +153,10 @@
* @return the found type. */ public <T> T getBaseGeometry(Class<T> c) {
- if(isDebug()) System.out.printf("%s: get Item %s\n", this.getClass().getSimpleName(),c.getName());
+ //if(isDebug()) System.out.printf("%s: get Item %s\n", this.getClass().getSimpleName(),c.getName());
for(HPSTestRunTracker2014GeometryDefinition.BaseGeometry item : geometries) {
- if(isDebug()) System.out.printf("%s: item %s\n", getClass().getSimpleName(),item.getClass().getName());
+ //if(isDebug()) System.out.printf("%s: item %s\n", getClass().getSimpleName(),item.getClass().getName());
if(c.isInstance(item)) { return (T)item; }
@@ -262,7 +262,7 @@
* @return transform. */ public static Transform3D getTransform(Transform3D t, BaseGeometry mother, String targetMotherName) {
- int debug=1;
+ int debug=0;
if(debug>0) System.out.printf("getTransform mother %s target %s with current transform\n%s\n", mother.getName(), targetMotherName,t.toString()); if(mother==null) throw new RuntimeException("Trying to get mother transform but there is no mother?!"); if(mother.getName().equals(targetMotherName)) {
@@ -310,7 +310,7 @@
* @return transformed vector. */ public static Hep3Vector transformToTracking(Hep3Vector vec, BaseGeometry geometry) {
- int debug =1;
+ int debug =0;
if(debug>0) System.out.printf("\ntransformToTracking: vec %s in local coordiantes of %s with mother %s\n", vec.toString(), geometry.getName(), geometry.getMother().getName().toString()); Hep3Vector vec_mother_coord = geometry.getCoord().getTransformation().transformed(vec); if(debug>0) System.out.printf("vec_mother_coord %s\n",vec_mother_coord.toString());
Use REPLY-ALL to reply to list
To unsubscribe from the LCDET-SVN list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCDET-SVN&A=1