Commit in projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd on MAIN | |||
HPSTestRunTracker2014.java | +1497 | -1677 | 3177 -> 3178 |
HPSTestRunTracker2014GeomDef.java | +113 | -28 | 3177 -> 3178 |
+1610 | -1705 |
finished pulling out hybrid and carbon fiber. Added a new base class to harmonize half-module components. Need some clean up and update of baseplate function. Could further generalize geom objects. Work in progress.
--- projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTestRunTracker2014.java 2014-07-14 00:55:24 UTC (rev 3177) +++ projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTestRunTracker2014.java 2014-07-14 04:52:03 UTC (rev 3178) @@ -22,6 +22,7 @@
import org.lcsim.detector.RotationGeant; import org.lcsim.detector.Transform3D; import org.lcsim.detector.Translation3D;
+import org.lcsim.geometry.compact.converter.lcdd.HPSTestRunTracker2014GeomDef.BaseGeom;
import org.lcsim.geometry.compact.converter.lcdd.HPSTestRunTracker2014GeomDef.HalfModuleLamination; import org.lcsim.geometry.compact.converter.lcdd.HPSTestRunTracker2014GeomDef.TestRunColdBlockL13; import org.lcsim.geometry.compact.converter.lcdd.HPSTestRunTracker2014GeomDef.TestRunColdBlockL45;
@@ -212,7 +213,6 @@
makeBeamPlane(trackingVolume, ball_pos_beamplane, vee_pos_beamplane, flat_pos_beamplane, lcdd, sens); }
- //makeBase(trackingWrap, ball_pos_base_plate, vee_pos_base_plate, flat_pos_base_plate, lcdd, sens );
makeBase(trackingVolume,lcdd,sens);
@@ -305,106 +305,7 @@
// flat position is a randomly chosen point perpendicular to ball to vee vector and offset 10mm along the plate. // Note that the flat here sets the tilt angle of the support plates.
-/* - // find the rotation to place the flat point - org.apache.commons.math3.geometry.euclidean.threed.Rotation rot1_csup = - new org.apache.commons.math3.geometry.euclidean.threed.Rotation( - new org.apache.commons.math3.geometry.euclidean.threed.Vector3D(vee_pos_csup_pin_bottom_x-ball_pos_csup_pin_bottom_x, - vee_pos_csup_pin_bottom_y-ball_pos_csup_pin_bottom_y, - vee_pos_csup_pin_bottom_z-ball_pos_csup_pin_bottom_z), - new org.apache.commons.math3.geometry.euclidean.threed.Vector3D(1,0,0)); - - org.apache.commons.math3.geometry.euclidean.threed.Vector3D flat_pos_csup_pin_bottom_3D_rot = rot1_csup.applyTo(new org.apache.commons.math3.geometry.euclidean.threed.Vector3D(0,10.0,0)); - // translate - double flat_pos_csup_pin_bottom_x = ball_pos_csup_pin_bottom_x + flat_pos_csup_pin_bottom_3D_rot.getX(); - double flat_pos_csup_pin_bottom_y = ball_pos_csup_pin_bottom_y + flat_pos_csup_pin_bottom_3D_rot.getY(); - double flat_pos_csup_pin_bottom_z = ball_pos_csup_pin_bottom_z + flat_pos_csup_pin_bottom_3D_rot.getZ();
- // make vectors - Hep3Vector ball_pos_csup_pin_bottom = new BasicHep3Vector(ball_pos_csup_pin_bottom_x,ball_pos_csup_pin_bottom_y,ball_pos_csup_pin_bottom_z); - Hep3Vector vee_pos_csup_pin_bottom = new BasicHep3Vector(vee_pos_csup_pin_bottom_x,vee_pos_csup_pin_bottom_y,vee_pos_csup_pin_bottom_z); - Hep3Vector flat_pos_csup_pin_bottom = new BasicHep3Vector(flat_pos_csup_pin_bottom_x,flat_pos_csup_pin_bottom_y,flat_pos_csup_pin_bottom_z); - - // create the coordinate system of the c-support pin - HPSTestRunTracker2014GeomDef.Coord csup_pin_coord = new HPSTestRunTracker2014GeomDef.Coord(ball_pos_csup_pin_bottom, vee_pos_csup_pin_bottom, flat_pos_csup_pin_bottom); - Transform3D trans_csup_pin_to_base = getTransformation(csup_pin_coord); - - if(_debug) { - print(String.format("Creating the c-support pin positions\n")); - print(String.format("ball_pos_csup_pin_bottom %s", ball_pos_csup_pin_bottom.toString())); - print(String.format("vee_pos_csup_pin_bottom %s", vee_pos_csup_pin_bottom.toString())); - double csup_rot1_angles[] = rot1_csup.getAngles(org.apache.commons.math3.geometry.euclidean.threed.RotationOrder.XYZ); - print(String.format("rot1_csup angles (XYZ) (%f,%f,%f) ",csup_rot1_angles[0],csup_rot1_angles[1],csup_rot1_angles[2])); - print(String.format("flat_pos_csup_pin_bottom_3D_rot (%f,%f,%f) ", flat_pos_csup_pin_bottom_3D_rot.getX(),flat_pos_csup_pin_bottom_3D_rot.getY(),flat_pos_csup_pin_bottom_3D_rot.getZ())); - print(String.format("flat_pos_csup_pin_bottom %s", flat_pos_csup_pin_bottom.toString())); - print(String.format("csup_pin_coord:\n%s ", csup_pin_coord.toString())); - - } - - // now create the support box which will have it's coordinates at the rotation axis so that the flat determines the tilt of the plates - // it is referenced locally to the c-support pin coordinate system - - - - // use an arbitrary local flat position: 10.0mm along the support plate direction - double flat_pos_csup_bearings_bottom_x = ball_pos_csup_bearings_bottom_x; - double flat_pos_csup_bearings_bottom_y = ball_pos_csup_bearings_bottom_y + 10.0; - double flat_pos_csup_bearings_bottom_z = ball_pos_csup_bearings_bottom_z; - - // make vectors - Hep3Vector ball_pos_csup_bearings_bottom = new BasicHep3Vector(ball_pos_csup_bearings_bottom_x,ball_pos_csup_bearings_bottom_y,ball_pos_csup_bearings_bottom_z); - Hep3Vector vee_pos_csup_bearings_bottom = new BasicHep3Vector(vee_pos_csup_bearings_bottom_x,vee_pos_csup_bearings_bottom_y,vee_pos_csup_bearings_bottom_z); - - - // build the rotation to find the proper location of the flat - org.apache.commons.math3.geometry.euclidean.threed.Rotation rot_csup = - new org.apache.commons.math3.geometry.euclidean.threed.Rotation(org.apache.commons.math3.geometry.euclidean.threed.RotationOrder.XYZ, - support_plate_bottom_tilt_angle, 0.0, 0.0 ); - // apply to flat local position - org.apache.commons.math3.geometry.euclidean.threed.Vector3D flat_pos_csup_bearings_bottom_3D_rot = - rot_csup.applyTo(new org.apache.commons.math3.geometry.euclidean.threed.Vector3D(0.0,10.0,0.0)); - // translate - flat_pos_csup_bearings_bottom_x = ball_pos_csup_bearings_bottom_x + flat_pos_csup_bearings_bottom_3D_rot.getX(); - flat_pos_csup_bearings_bottom_y = ball_pos_csup_bearings_bottom_y + flat_pos_csup_bearings_bottom_3D_rot.getY(); - flat_pos_csup_bearings_bottom_z = ball_pos_csup_bearings_bottom_z + flat_pos_csup_bearings_bottom_3D_rot.getZ(); - Hep3Vector flat_pos_csup_bearings_bottom = new BasicHep3Vector(flat_pos_csup_bearings_bottom_x,flat_pos_csup_bearings_bottom_y,flat_pos_csup_bearings_bottom_z); - - // create the coordinate system of the c-support bearings - HPSTestRunTracker2014GeomDef.Coord csup_bearings_bottom_coord = new HPSTestRunTracker2014GeomDef.Coord(ball_pos_csup_bearings_bottom, vee_pos_csup_bearings_bottom, flat_pos_csup_bearings_bottom); - - - - - if(_debug) { - print(String.format("Creating the c-support bearings\n")); - print(String.format("ball_pos_csup_bearings_bottom %s", ball_pos_csup_bearings_bottom.toString())); - print(String.format("vee_pos_csup_bearings_bottom %s", vee_pos_csup_bearings_bottom.toString())); - print(String.format("csup_bottom_rot_angle_local_u %f", support_plate_bottom_tilt_angle )); - print(String.format("flat_pos_csup_bearings_bottom %s", flat_pos_csup_bearings_bottom.toString())); - print(String.format("csup_bearings_coord:\n%s ", csup_bearings_bottom_coord.toString())); - //Transform3D trans_csup_bearings_to_base = getTransformation(csup_pin_coord); - print(String.format("ball_pos_csup_bearings_bottom (in base) %s", trans_csup_pin_to_base.transformed(ball_pos_csup_bearings_bottom).toString())); - - } - - - // since we don't care (no volume is built) about the local position of the bearings in the pin coord system we'll get rid of it - // and find the bearings position in the base coordinate system directly - Hep3Vector ball_pos_csup_bottom = trans_csup_pin_to_base.transformed(ball_pos_csup_bearings_bottom); - Hep3Vector vee_pos_csup_bottom = trans_csup_pin_to_base.transformed(vee_pos_csup_bearings_bottom); - Hep3Vector flat_pos_csup_bottom = trans_csup_pin_to_base.transformed(flat_pos_csup_bearings_bottom); - - if(_debug) { - print(String.format("Creating the c-support in base coordinates\n")); - print(String.format("ball_pos_csup_bottom %s", ball_pos_csup_bottom.toString())); - print(String.format("vee_pos_csup_bottom %s", vee_pos_csup_bottom.toString())); - print(String.format("flat_pos_csup_bottom %s", flat_pos_csup_bottom.toString())); - } - - */ - - - //makeSupport("bottom", baseWrap, ball_pos_csup_bottom, vee_pos_csup_bottom, flat_pos_csup_bottom, lcdd, sens );
makeSupport("bottom",volume, lcdd, sens );
@@ -415,111 +316,10 @@
// the top has the same bearing positions as the bottom c-support except for the offset vertically from base plate // the tilt angle is independent though.
- /* - Hep3Vector ball_pos_csup_bearings_top = new BasicHep3Vector(ball_pos_csup_bearings_bottom.x(), - ball_pos_csup_bearings_bottom.y(), - ball_pos_csup_bearings_top_z); - Hep3Vector vee_pos_csup_bearings_top = new BasicHep3Vector(vee_pos_csup_bearings_bottom.x(), - vee_pos_csup_bearings_bottom.y(), - ball_pos_csup_bearings_top_z);
- - // build the rotation to find the proper location of the flat - org.apache.commons.math3.geometry.euclidean.threed.Rotation rot_csup_top = - new org.apache.commons.math3.geometry.euclidean.threed.Rotation(org.apache.commons.math3.geometry.euclidean.threed.RotationOrder.XYZ, - support_plate_top_tilt_angle, 0.0, 0.0 ); - // apply to flat local position (as for bottom it is arbitrary offset) - org.apache.commons.math3.geometry.euclidean.threed.Vector3D flat_pos_csup_bearings_top_3D_rot = - rot_csup.applyTo(new org.apache.commons.math3.geometry.euclidean.threed.Vector3D(0.0,10.0,0.0)); - // translate the flat position - double flat_pos_csup_bearings_top_x = ball_pos_csup_bearings_top.x() + flat_pos_csup_bearings_top_3D_rot.getX(); - double flat_pos_csup_bearings_top_y = ball_pos_csup_bearings_top.y() + flat_pos_csup_bearings_top_3D_rot.getY(); - double flat_pos_csup_bearings_top_z = ball_pos_csup_bearings_top.z() + flat_pos_csup_bearings_top_3D_rot.getZ(); - Hep3Vector flat_pos_csup_bearings_top = new BasicHep3Vector(flat_pos_csup_bearings_top_x,flat_pos_csup_bearings_top_y,flat_pos_csup_bearings_top_z); - - // create the coordinate system of the c-support bearings - HPSTestRunTracker2014GeomDef.Coord csup_bearings_top_coord = new HPSTestRunTracker2014GeomDef.Coord(ball_pos_csup_bearings_top, vee_pos_csup_bearings_top, flat_pos_csup_bearings_top); - //Transform3D trans_csup_bearings_to_pin = getTransformation(csup_pin_coord); - - - - if(_debug) { - print(String.format("Creating the c-support bearings for top\n")); - print(String.format("ball_pos_csup_bearings_top %s", ball_pos_csup_bearings_top.toString())); - print(String.format("vee_pos_csup_bearings_top %s", vee_pos_csup_bearings_top.toString())); - print(String.format("csup_top_rot_angle_local_u %f", support_plate_top_tilt_angle )); - print(String.format("flat_pos_csup_bearings_top %s", flat_pos_csup_bearings_top.toString())); - print(String.format("csup_bearings_top_coord:\n%s ", csup_bearings_top_coord.toString())); - //print(String.format("trans_csup_bearings_to_pin:\n%s ", trans_csup_bearings_to_pin.toString())); - } - - // similar to for bottom, find the bearing positions in the base coord directly - Hep3Vector ball_pos_csup_top = trans_csup_pin_to_base.transformed(ball_pos_csup_bearings_top); - Hep3Vector vee_pos_csup_top = trans_csup_pin_to_base.transformed(vee_pos_csup_bearings_top); - Hep3Vector flat_pos_csup_top = trans_csup_pin_to_base.transformed(flat_pos_csup_bearings_top); - - if(_debug) { - print(String.format("Creating the c-support in base coordinates\n")); - print(String.format("ball_pos_csup_top %s", ball_pos_csup_top.toString())); - print(String.format("vee_pos_csup_top %s", vee_pos_csup_top.toString())); - print(String.format("flat_pos_csup_top %s", flat_pos_csup_top.toString())); - } - - */ -
makeSupport("top", volume, lcdd, sens );
- //makeSupport("top", baseWrap, ball_pos_csup_top, vee_pos_csup_top, flat_pos_csup_top, lcdd, sens ); -
- - -// -// -// final double ball_pos_csup_top_x = ball_pos_csup_bearings_bottom_x; //+ csup_top_offset_x; -// final double ball_pos_csup_top_y = ball_pos_csup_bearings_bottom_y; -// final double ball_pos_csup_top_z = ball_pos_csup_bearings_bottom_z + 200.0; // TODO get the real number from c-support drawing -// -// final double vee_pos_csup_top_x = vee_pos_csup_bearings_bottom_x; //51.15 + csup_top_offset_x; -// final double vee_pos_csup_top_y = vee_pos_csup_bearings_bottom_y; -// final double vee_pos_csup_top_z = ball_pos_csup_top_z; -// -//// final double ball_pos_csup_top_x = ball_pos_csup_bottom_x; //51.15 + csup_top_offset_x; -//// final double ball_pos_csup_top_y = 115.02; -//// final double ball_pos_csup_top_z = 100.0; -//// final double vee_pos_csup_top_x = 271.05 + csup_top_offset_x; -//// final double vee_pos_csup_top_y = 121.62; -//// final double vee_pos_csup_top_z = ball_pos_csup_top_z; -// // use an arbitrary flat position: 10.0mm in support plate direction -// // the ball and vee position above sets the rotation angle of the c-support -// final double csup_top_rot_angle_local_w = Math.asin( (vee_pos_csup_top_y - ball_pos_csup_top_y)/(vee_pos_csup_top_x - ball_pos_csup_top_x) ); -// final double flat_pos_csup_top_x = ball_pos_csup_top_x - 10.0 * Math.sin(csup_top_rot_angle_local_w); -// final double flat_pos_csup_top_y = ball_pos_csup_top_y + 10.0 * Math.cos(csup_top_rot_angle_local_w); -// final double flat_pos_csup_top_z = ball_pos_csup_top_z; -// -// Hep3Vector ball_pos_csup_top = new BasicHep3Vector(ball_pos_csup_top_x,ball_pos_csup_top_y,ball_pos_csup_top_z); -// Hep3Vector vee_pos_csup_top = new BasicHep3Vector(vee_pos_csup_top_x,vee_pos_csup_top_y,vee_pos_csup_top_z); -// Hep3Vector flat_pos_csup_top = new BasicHep3Vector(flat_pos_csup_top_x,flat_pos_csup_top_y,flat_pos_csup_top_z); -// -// if(_debug) { -// print(String.format("csup_top_rot_angle_local_w %f", csup_top_rot_angle_local_w)); -// print(String.format("ball_pos_csup_top %s", ball_pos_csup_top.toString())); -// print(String.format("vee_pos_csup_top %s", vee_pos_csup_top.toString())); -// print(String.format("flat_pos_csup_top %s", flat_pos_csup_top.toString())); -// } - - - - - - - - - - - - - - //baseVolume.setVisAttributes(lcdd.getVisAttributes("BasePlateVis"));
+ //volume.setVisAttributes(lcdd.getVisAttributes("BasePlateVis"));
lcdd.add(volume);
@@ -530,10 +330,6 @@
-// private void makeBasePlate(VolWrapper baseWrap, -// Hep3Vector ball_pos_base_plate, -// Hep3Vector vee_pos_base_plate, -// Hep3Vector flat_pos_base_plate, LCDD lcdd, SensitiveDetector sens) throws JDOMException {
private void makeBasePlate(Volume motherVolume, LCDD lcdd, SensitiveDetector sens) throws JDOMException { if(_debug) {
@@ -544,15 +340,8 @@
Hep3Vector vee_pos_base_plate = basePlate.getVeePos(); Hep3Vector flat_pos_base_plate = basePlate.getFlatPos();
- // create the coordinate system - // width - u - // length - v - // thickness - w - // create the coordinate system
HPSTestRunTracker2014GeomDef.Coord base_plate_coord = basePlate.getCoord();
- //String volName = "baseplate"; - //Box box = new Box(volName + "Box", base_plate_width,base_plate_length, base_plate_thickness);
String volName = basePlate.getName(); Box box = new Box(volName + "Box", basePlate.getBoxDim().x(),basePlate.getBoxDim().y(),basePlate.getBoxDim().z()); lcdd.add(box);
@@ -602,33 +391,15 @@
print("Created physical vomume " + basePlatePV.getName()); }
- // Crate the wrapper for this volume -// VolWrapper basePlateWrap = new VolWrapper(); -// basePlateWrap.mother = baseWrap; -// basePlateWrap.vol = basePlateVolume; -// basePlateWrap.name = volName; -// basePlateWrap.coord = base_plate_coord2; -// basePlateWrap.pos_vol = pos; -// basePlateWrap.rot_vol = rot; -// baseWrap.daughters.add(basePlateWrap); -// - -
// add volume to lcdd basePlateVolume.setVisAttributes(lcdd.getVisAttributes("BasePlateVis")); lcdd.add(basePlateVolume);
- -
}
- - - -
private void makeSupport(String half, Volume motherVolume, LCDD lcdd, SensitiveDetector sens) throws JDOMException {
@@ -696,10 +467,8 @@
Hep3Vector box_center_support_local; if(half == "bottom") {
- //box_center_support_local = new BasicHep3Vector(support_width/2.0+1.0, support_length/2.0 + (17.00-10.50/2.0), support_height/2.0 - (12.70-6.66-1.34));
box_center_support_local = supportBottom.getCenter(); } else {
- //box_center_support_local = new BasicHep3Vector(support_width/2.0+1.0, support_length/2.0 + (17.00-10.50/2.0), -1.0 * (support_height/2.0 - (12.70-6.66-1.34)));
box_center_support_local = supportTop.getCenter(); }
@@ -804,283 +573,7 @@
- /*
- private void makeSupport(String half, VolWrapper baseWrap, - Hep3Vector ball_pos_csup, Hep3Vector vee_pos_csup, Hep3Vector flat_pos_csup, - LCDD lcdd, SensitiveDetector sens) throws JDOMException { - - - if(_debug) { - print("--- makeSupport for " + half + " half ----"); - - } - - - double support_length = -99999.9; - double support_width = -99999.9; - double support_height = -99999.9; - double support_plate_length = -99999.9; - double support_plate_width = -99999.9; - - if( half == "bottom" ) { - support_length = HPSTestRunTracker2014GeomDef.SupportBottom.support_bottom_length; - support_width = HPSTestRunTracker2014GeomDef.SupportBottom.support_bottom_width; - support_height = HPSTestRunTracker2014GeomDef.SupportBottom.support_bottom_height; - support_plate_length = HPSTestRunTracker2014GeomDef.SupportPlateBottom.support_plate_bottom_length; - support_plate_width = HPSTestRunTracker2014GeomDef.SupportPlateBottom.support_plate_bottom_width; - } - else if( half == "top" ) { - support_length = HPSTestRunTracker2014GeomDef.SupportTop.support_top_length; - support_width = HPSTestRunTracker2014GeomDef.SupportTop.support_top_width; - support_height = HPSTestRunTracker2014GeomDef.SupportTop.support_top_height; - support_plate_length = HPSTestRunTracker2014GeomDef.SupportPlateTop.support_plate_top_length; - support_plate_width = HPSTestRunTracker2014GeomDef.SupportPlateTop.support_plate_top_width; - } else { - print("Error: cannot make support for " + half); - System.exit(1); - } - - - // create the coordinate system of the c-support - HPSTestRunTracker2014GeomDef.Coord csup_coord = new HPSTestRunTracker2014GeomDef.Coord(ball_pos_csup, vee_pos_csup, flat_pos_csup); - Transform3D trans_csup_to_base = getTransformation(csup_coord); - - - - String volName = "support_" + half; - Box box = new Box(volName + "Box", support_width, support_length, support_height); - lcdd.add(box); - Volume supportVolume = new Volume(volName + "_volume", box, lcdd.getMaterial("Vacuum")); - - - if(_debug) { - print(String.format("ball_pos_csup %s", ball_pos_csup.toString())); - print(String.format("vee_pos_csup %s", vee_pos_csup.toString())); - print(String.format("flat_pos_csup %s", flat_pos_csup.toString())); - print(String.format("csup_coord:\n%s", csup_coord.toString())); - print(String.format("baseWrap.coord:\n%s", baseWrap.coord.toString())); - Transform3D trans_to_base = getTransformation(baseWrap.coord); - print(String.format("ball_pos_csup (in %s) %s", baseWrap.name, trans_to_base.transformed(ball_pos_csup).toString())); - } - - - - // Find distance to center in the local coordinate system - - // the support plate sits exactly in between the bearing positions - // it's offset along the local directions - - Hep3Vector box_center_support_local; - if(half == "bottom") { - //box_center_support_local = new BasicHep3Vector(support_width/2.0, support_length/2.0, support_height/2.0); - box_center_support_local = new BasicHep3Vector(support_width/2.0+1.0, support_length/2.0 + (17.00-10.50/2.0), support_height/2.0 - (12.70-6.66-1.34)); - } else { - //box_center_support_local = new BasicHep3Vector(support_width/2.0, support_length/2.0, -1.0 * support_height/2.0); - box_center_support_local = new BasicHep3Vector(support_width/2.0+1.0, support_length/2.0 + (17.00-10.50/2.0), -1.0 * (support_height/2.0 - (12.70-6.66-1.34))); - } - - //translate to the mother coordinate system - Hep3Vector box_center_support_base = trans_csup_to_base.transformed(box_center_support_local); - - // find the position of the center in the mother coord - Hep3Vector box_center = VecOp.sub(box_center_support_base, baseWrap.center); - - print(String.format("box_center_support_local %s", box_center_support_local.toString())); - print(String.format("box_center_support_base %s", box_center_support_base.toString())); - print(String.format("baseWrap.center %s", baseWrap.center.toString())); - print(String.format("box_center %s", box_center.toString())); - - // Create the LCDD position - Position pos = new Position(volName + "_position",box_center.x(), box_center.y(), box_center.z()); - - //Find LCDD Euler rotation angles from coordinate system unit vectors - Hep3Vector lcdd_rot_angles = getEulerAngles(csup_coord.u(), csup_coord.v(), new BasicHep3Vector(1,0,0),new BasicHep3Vector(0,1,0)); - Rotation rot = new Rotation(volName + "_rotation",lcdd_rot_angles.x(), lcdd_rot_angles.y(), lcdd_rot_angles.z()); - lcdd.add(pos); - lcdd.add(rot); - - - // Create the physical volume - PhysVol supportPV = new PhysVol(supportVolume, baseWrap.vol, pos, rot); - if(_debug) { - print("Created physical vomume " + supportPV.getName()); - } - - VolWrapper supportWrap = new VolWrapper(); - supportWrap.vol = supportVolume; - supportWrap.name = volName; - supportWrap.center = box_center_support_local; - supportWrap.pos_vol = pos; - supportWrap.rot_vol = rot; - supportWrap.mother = baseWrap; - supportWrap.coord = csup_coord; - baseWrap.daughters.add(supportWrap); - - - - - - // create the support plate inside the support box coordinate system - // survey points on the support plate are: - // ball: corner of the hinge end at the surface on the side where module cold blocks are - // vee: corner of the hinge end at the surface on the side where sensors are - // flat: middle of plate at upstream end at the surface - - Hep3Vector ball_pos_support_plate; - Hep3Vector vee_pos_support_plate; - Hep3Vector flat_pos_support_plate; - if(half == "bottom") { - ball_pos_support_plate = new BasicHep3Vector(1.0, (17.0-5.0), 6.66+1.34); - vee_pos_support_plate = new BasicHep3Vector(ball_pos_support_plate.x() + support_plate_width, ball_pos_support_plate.y(),ball_pos_support_plate.z()); - flat_pos_support_plate = new BasicHep3Vector(ball_pos_support_plate.x(), ball_pos_support_plate.y() + support_plate_length,ball_pos_support_plate.z()); - //ball_pos_support_plate = new BasicHep3Vector(0.0, 0.0, support_plate_height); // TODO figure out what height this should be from the C-support drawings - //vee_pos_support_plate = new BasicHep3Vector(ball_pos_support_plate.x() + support_plate_width, ball_pos_support_plate.y(),ball_pos_support_plate.z()); - //flat_pos_support_plate = new BasicHep3Vector(ball_pos_support_plate.x(), ball_pos_support_plate.y() + support_plate_length,ball_pos_support_plate.z()); - } else { - ball_pos_support_plate = new BasicHep3Vector(1.0, (17.0-5.0), -1.0 * (6.66+1.34)); // TODO figure out what height this should be from the C-support drawings - vee_pos_support_plate = new BasicHep3Vector(ball_pos_support_plate.x() + support_plate_width, ball_pos_support_plate.y(),ball_pos_support_plate.z()); - flat_pos_support_plate = new BasicHep3Vector(ball_pos_support_plate.x(), ball_pos_support_plate.y() + support_plate_length,ball_pos_support_plate.z()); - } - - //makeSupportPlate(supportWrap, ball_pos_support_plate, vee_pos_support_plate, flat_pos_support_plate, lcdd, sens ); - - if(half == "bottom") { - makeSupportPlate("bottom", supportVolume, lcdd, sens ); - } else { - makeSupportPlate("Top", supportVolume, lcdd, sens ); - } - - - - - - // create the module from positions of module ball, vee and flat w.r.t. support plate survey points - // ball: hole on the cold block mounting surface - // vee: slot on the cold block mounting surface - // flat: midpoint between line joining ball and vee and offset 90deg along plate going upstream - - if(_debug) { - print("Make modules on support plate"); - } - - for(int ilayer = 1; ilayer <=5; ++ilayer) { - - String layerName = String.format("L%d%s", ilayer,half=="bottom"?"b":"t"); - - print(layerName); - - Hep3Vector ball_pos_mod_local = null; - Hep3Vector vee_pos_mod_local = null; - Hep3Vector flat_pos_mod_local = null; - if(ilayer == 1) { - if(half == "bottom") { - ball_pos_mod_local = ball_pos_module1_support_plate_bottom_local; - vee_pos_mod_local = vee_pos_module1_support_plate_bottom_local; - flat_pos_mod_local = flat_pos_module1_support_plate_bottom_local; - } else { - ball_pos_mod_local = ball_pos_module1_support_plate_top_local; - vee_pos_mod_local = vee_pos_module1_support_plate_top_local; - flat_pos_mod_local = flat_pos_module1_support_plate_top_local; - } - } - else if (ilayer == 2) { - if(half == "bottom") { - ball_pos_mod_local = ball_pos_module2_support_plate_bottom_local; - vee_pos_mod_local = vee_pos_module2_support_plate_bottom_local; - flat_pos_mod_local = flat_pos_module2_support_plate_bottom_local; - } else { - ball_pos_mod_local = ball_pos_module2_support_plate_top_local; - vee_pos_mod_local = vee_pos_module2_support_plate_top_local; - flat_pos_mod_local = flat_pos_module2_support_plate_top_local; - } - } - else if (ilayer == 3) { - if(half == "bottom") { - ball_pos_mod_local = ball_pos_module3_support_plate_bottom_local; - vee_pos_mod_local = vee_pos_module3_support_plate_bottom_local; - flat_pos_mod_local = flat_pos_module3_support_plate_bottom_local; - } else { - ball_pos_mod_local = ball_pos_module3_support_plate_top_local; - vee_pos_mod_local = vee_pos_module3_support_plate_top_local; - flat_pos_mod_local = flat_pos_module3_support_plate_top_local; - } - } - else if (ilayer == 4) { - if(half == "bottom") { - ball_pos_mod_local = ball_pos_module4_support_plate_bottom_local; - vee_pos_mod_local = vee_pos_module4_support_plate_bottom_local; - flat_pos_mod_local = flat_pos_module4_support_plate_bottom_local; - } else { - ball_pos_mod_local = ball_pos_module4_support_plate_top_local; - vee_pos_mod_local = vee_pos_module4_support_plate_top_local; - flat_pos_mod_local = flat_pos_module4_support_plate_top_local; - } - } else if (ilayer == 5) { - if(half == "bottom") { - ball_pos_mod_local = ball_pos_module5_support_plate_bottom_local; - vee_pos_mod_local = vee_pos_module5_support_plate_bottom_local; - flat_pos_mod_local = flat_pos_module5_support_plate_bottom_local; - } else { - ball_pos_mod_local = ball_pos_module5_support_plate_top_local; - vee_pos_mod_local = vee_pos_module5_support_plate_top_local; - flat_pos_mod_local = flat_pos_module5_support_plate_top_local; - } - } else { - print("Not more than 5 layers!"); - System.exit(1); - } - - if(_debug) { - print(String.format("ball_pos_mod_local %s", ball_pos_mod_local.toString())); - print(String.format("vee_pos_mod_local %s", vee_pos_mod_local.toString())); - print(String.format("flat_pos_mod_local %s", flat_pos_mod_local.toString())); - } - - - // - // Note that the mother volume is the support wrap box which can be different than support plate coord system. - // Thus I need to take that into account when making the modules - // create the coordinate system of the support plate in the support box - HPSTestRunTracker2014GeomDef.Coord support_plate_coord = new HPSTestRunTracker2014GeomDef.Coord(ball_pos_support_plate, vee_pos_support_plate, flat_pos_support_plate); - Transform3D trans_support_plate_to_support = getTransformation(support_plate_coord); - - - - // transform module coordinates to support frame in case they are different - Hep3Vector ball_pos_mod = trans_support_plate_to_support.transformed(ball_pos_mod_local); - Hep3Vector ball_pos_mod_rot = trans_support_plate_to_support.rotated(ball_pos_mod_local); - Hep3Vector ball_pos_mod_tr = trans_support_plate_to_support.translated(ball_pos_mod_local); - Hep3Vector vee_pos_mod = trans_support_plate_to_support.transformed(vee_pos_mod_local); - Hep3Vector flat_pos_mod = trans_support_plate_to_support.transformed(flat_pos_mod_local); - - if(_debug) { - print(String.format("ball_pos_mod_rot %s", ball_pos_mod_rot.toString())); - print(String.format("ball_pos_mod_tr %s", ball_pos_mod_tr.toString())); - print(String.format("ball_pos_mod %s", ball_pos_mod.toString())); - print(String.format("vee_pos_mod %s", vee_pos_mod.toString())); - print(String.format("flat_pos_mod %s", flat_pos_mod.toString())); - } - - // make the module -// if(name=="bottom") { - makeModule(layerName,supportWrap, ball_pos_mod, vee_pos_mod, flat_pos_mod,lcdd, sens); -// } - } // ilayer - - - - // add support volume to lcdd - supportVolume.setVisAttributes(lcdd.getVisAttributes("SupportVolumeVis")); - lcdd.add(supportVolume); - - } - - - - */ - -
private void makeSupportPlate(String half, Volume motherVolume, LCDD lcdd, SensitiveDetector sens) throws JDOMException {
@@ -1171,101 +664,10 @@
}
-
- private void makeSupportPlate(VolWrapper supportWrap, - Hep3Vector ball_pos_support_plate, - Hep3Vector vee_pos_support_plate, - Hep3Vector flat_pos_support_plate, LCDD lcdd, SensitiveDetector sens) throws JDOMException { - - - String half = getHalfFromName(supportWrap.name); - - if(_debug) { - print("--- makeSupportPlate for " + half + " ----"); - - } - - - - // Create the box - String volName = supportWrap.name + "_supportplate"; - Box box = new Box(volName + "Box", HPSTestRunTracker2014GeomDef.SupportPlateBottom.support_plate_bottom_width, HPSTestRunTracker2014GeomDef.SupportPlateBottom.support_plate_bottom_length, HPSTestRunTracker2014GeomDef.SupportPlateBottom.support_plate_bottom_height); - lcdd.add(box); - Volume supportPlateVolume = new Volume(volName + "_volume", box, lcdd.getMaterial("Aluminum")); - - - // create the coordinate system - HPSTestRunTracker2014GeomDef.Coord support_plate_coord = new HPSTestRunTracker2014GeomDef.Coord(ball_pos_support_plate, vee_pos_support_plate, flat_pos_support_plate); - Transform3D trans_support_plate_to_support = getTransformation(support_plate_coord); - - if(_debug) { - print(String.format("ball_pos_support_plate %s", ball_pos_support_plate.toString())); - print(String.format("vee_pos_support_plate %s", vee_pos_support_plate.toString())); - print(String.format("flat_pos_support_plate %s", flat_pos_support_plate.toString())); - print(String.format("support_plate_coord:\n%s", support_plate_coord.toString())); - Hep3Vector ball_pos_support_plate_tmp1 = this.transformToMotherCoord(ball_pos_support_plate, supportWrap, "trackingVolume"); - print(String.format("ball_pos_support_plate tracking %s", ball_pos_support_plate_tmp1.toString())); - - } - - - // Find distance to center in the local coordinate system - Hep3Vector box_center_support_plate_local; - if(half == "bottom") { - box_center_support_plate_local = new BasicHep3Vector(HPSTestRunTracker2014GeomDef.SupportPlateBottom.support_plate_bottom_width/2.0, HPSTestRunTracker2014GeomDef.SupportPlateBottom.support_plate_bottom_length/2.0, -1.0 * HPSTestRunTracker2014GeomDef.SupportPlateBottom.support_plate_bottom_height/2.0); - } else { - box_center_support_plate_local = new BasicHep3Vector(HPSTestRunTracker2014GeomDef.SupportPlateBottom.support_plate_bottom_width/2.0, HPSTestRunTracker2014GeomDef.SupportPlateBottom.support_plate_bottom_length/2.0, HPSTestRunTracker2014GeomDef.SupportPlateBottom.support_plate_bottom_height/2.0); - } - - //translate to the mother coordinate system - Hep3Vector box_center_support = trans_support_plate_to_support.transformed(box_center_support_plate_local); - - // find the position of the center in the mother coord - Hep3Vector box_center = VecOp.sub(box_center_support, supportWrap.center); - - if(_debug) { - print(String.format("box_center_support_plate_local %s", box_center_support_plate_local.toString())); - print(String.format("box_center_support_plate %s", box_center_support.toString())); - print(String.format("supportWrap.center %s", supportWrap.center.toString())); - print(String.format("box_center %s", box_center.toString())); - } - - // Create the LCDD position - Position pos = new Position(volName + "_position",box_center.x(), box_center.y(), box_center.z()); - - //Find LCDD rotation angles from coordinate system unit vectors - Hep3Vector lcdd_rot_angles = this.getEulerAngles(support_plate_coord.u(), support_plate_coord.v(), new BasicHep3Vector(1,0,0), new BasicHep3Vector(0,1,0)); - Rotation rot = new Rotation(volName + "_rotation",lcdd_rot_angles.x(), lcdd_rot_angles.y(), lcdd_rot_angles.z()); - lcdd.add(pos); - lcdd.add(rot); - - PhysVol supportPlatePV = new PhysVol(supportPlateVolume, supportWrap.vol, pos, rot); - if(_debug) { - print("Created physical vomume " + supportPlatePV.getName()); - } - - VolWrapper supportPlateWrap = new VolWrapper(); - supportPlateWrap.mother = supportWrap; - supportPlateWrap.vol = supportPlateVolume; - supportPlateWrap.name = volName; - supportPlateWrap.pos_vol = pos; - supportPlateWrap.rot_vol = rot; - supportWrap.daughters.add(supportPlateWrap); - - - supportPlateVolume.setVisAttributes(lcdd.getVisAttributes("SupportPlateVis")); - lcdd.add(supportPlateVolume); - - - } -
- - -
private void makeModule(String half, String name, Volume motherVolume, LCDD lcdd, SensitiveDetector sens) throws JDOMException {
@@ -1300,21 +702,14 @@
module = new HPSTestRunTracker2014GeomDef.TestRunModuleL45(volName, mother, ref, layer, half); }
- // add it to list of module
+ // add it to list of modules
modules.add(module); Box box = new Box(volName + "_box", module.getBoxDim().x(), module.getBoxDim().y(), module.getBoxDim().z()); lcdd.add(box); Volume moduleVolume = new Volume(volName + "_volume", box, lcdd.getMaterial("Vacuum"));
- if(_debug) { - print(String.format("module.getBallPos() %s", module.getBallPos().toString())); - print(String.format("module.getVeePos() %s", module.getVeePos().toString())); - print(String.format("module.getFlatPos() %s", module.getFlatPos().toString())); - print(String.format("module_coord:\n%s", module.getCoord().toString())); - }
-
// Find distance to center in the local coordinate system Hep3Vector box_center_local = module.getCenter();
@@ -1345,15 +740,10 @@
PhysVol physVolume = new PhysVol(moduleVolume, motherVolume, pos, rot);
- //makeHalfModule("axial",moduleWrap, ball_pos_halfmod_axial_local, vee_pos_halfmod_axial_local, flat_pos_halfmod_axial_local,lcdd,sens);
makeHalfModule("axial", volName ,moduleVolume, lcdd,sens);
- - - //makeColdBlock(moduleWrap, ball_pos_coldblock_local, vee_pos_coldblock_local, flat_pos_coldblock_local,lcdd,sens);
makeColdBlock(volName, moduleVolume, lcdd,sens);
- //makeHalfModule("stereo",moduleWrap, ball_pos_halfmod_stereo_local, vee_pos_halfmod_stereo_local, flat_pos_halfmod_stereo_local,lcdd,sens);
makeHalfModule("stereo", volName ,moduleVolume, lcdd,sens);
@@ -1368,276 +758,7 @@
- /* - - - private void makeModule(String name, VolWrapper supportWrap, - Hep3Vector ball_pos_mod, Hep3Vector vee_pos_mod, Hep3Vector flat_pos_mod, - LCDD lcdd, SensitiveDetector sens) throws JDOMException - { - - print(String.format("----- makeModule() ------")); - - - - // build the module name - String volName = "module_" + name; - - // find the module layer - int layer = this.getLayerFromVolumeName(volName); - - // Create the box - double coldblock_thickness = -99999.9; - double dist_lower_sensor_edge_to_cold_block_mounting_surface = -99999.9; - double module_box_length = -99999.9; - double module_box_height = -99999.9; - double module_box_width = -99999.9; - if( layer >=1 && layer <=3 ) { - module_box_length = HPSTestRunTracker2014GeomDef.TestRunModuleL13.module_box_L13_length; - module_box_height = HPSTestRunTracker2014GeomDef.TestRunModuleL13.module_box_L13_height; - module_box_width = HPSTestRunTracker2014GeomDef.TestRunModuleL13.module_box_L13_width; - coldblock_thickness = TestRunColdBlockL13.coldblock_L13_thickness; - dist_lower_sensor_edge_to_cold_block_mounting_surface = 12.66; - - } else { - module_box_length = HPSTestRunTracker2014GeomDef.TestRunModuleL45.module_box_L45_length; - module_box_height = HPSTestRunTracker2014GeomDef.TestRunModuleL45.module_box_L45_height; - module_box_width = HPSTestRunTracker2014GeomDef.TestRunModuleL45.module_box_L45_width; - coldblock_thickness = TestRunColdBlockL45.coldblock_L45_thickness; - dist_lower_sensor_edge_to_cold_block_mounting_surface = 7.662; - } - - //box_dim_local = new BasicHep3Vector(module_box_length,module_box_height,module_box_thickness); - - - Box box = new Box(volName + "_box", module_box_length, module_box_height, module_box_width); - lcdd.add(box); - Volume moduleVolume = new Volume(volName + "_volume", box, lcdd.getMaterial("Vacuum")); - - - // create the coordinate system - HPSTestRunTracker2014GeomDef.Coord module_coord = new HPSTestRunTracker2014GeomDef.Coord(ball_pos_mod, vee_pos_mod, flat_pos_mod); - Transform3D trans_module_to_support = getTransformation(module_coord); - - if(_debug) { - print(String.format("ball_pos_mod %s", ball_pos_mod.toString())); - print(String.format("ball_pos_mod %s", ball_pos_mod.toString())); - print(String.format("ball_pos_mod %s", ball_pos_mod.toString())); - print(String.format("module_coord:\n%s", module_coord.toString())); - Hep3Vector ball_pos_mod_tmp1 = transformToMotherCoord(ball_pos_mod, supportWrap, "support_bottom"); - if(ball_pos_mod_tmp1==null) { - ball_pos_mod_tmp1 = transformToMotherCoord(ball_pos_mod, supportWrap, "support_top"); - } - print(String.format("ball_pos_mod tracking %s", ball_pos_mod_tmp1.toString())); - } - - - // Find distance to center in the local coordinate system - Hep3Vector box_center_local = new BasicHep3Vector(module_box_length/2.0-5.0, 0.0, module_box_width/2.0); - - //translate to the mother coordinate system - Hep3Vector box_center_support = trans_module_to_support.transformed(box_center_local); - - // find the position of the center in the mother coord - Hep3Vector box_center = VecOp.sub(box_center_support, supportWrap.center); - - if(_debug) { - print(String.format("box_center_local %s", box_center_local.toString())); - print(String.format("box_center_support %s", box_center_support.toString())); - print(String.format("supportWrap.center %s", supportWrap.center.toString())); - print(String.format("box_center %s", box_center.toString())); - } - - // Create the LCDD position - Position pos = new Position(volName + "_position",box_center.x(), box_center.y(), box_center.z()); - - //Find LCDD rotation angles from coordinate system unit vectors - Hep3Vector lcdd_rot_angles = this.getEulerAngles(module_coord.u(), module_coord.v(), new BasicHep3Vector(1,0,0), new BasicHep3Vector(0,1,0)); - Rotation rot = new Rotation(volName + "_rotation",lcdd_rot_angles.x(), lcdd_rot_angles.y(), lcdd_rot_angles.z()); - lcdd.add(pos); - lcdd.add(rot); - - - - PhysVol physVolume = new PhysVol(moduleVolume, supportWrap.vol, pos, rot); - - VolWrapper moduleWrap = new VolWrapper(); - moduleWrap.name = volName; - moduleWrap.vol = moduleVolume; - moduleWrap.mother = supportWrap; - moduleWrap.coord = module_coord; - moduleWrap.pv = physVolume; - moduleWrap.center = box_center_local; - moduleWrap.pos_vol = pos; - moduleWrap.rot_vol = rot; - supportWrap.daughters.add(moduleWrap); - - - // Find the coordinate system of the half-modules w.r.t. to the module survey points - // We are going to know the sensor center position w.r.t. module coordinate system so the half-module - // is really just a dummy volume to contain the daughters. Therefore place it at the same place - // as where the sensor coordinate system will be to make things simpler. - - // Hints: - // The local half-module coord system for axial sensor will be built - // with apv25 chips in more negative v-direction than sensor - // i.e. v-direction is pointing upstream - // For the stereo it is - // - - // Distance from sensor to CF edge: 180mm - // Distance from CF edge to screw hole: 30mm - // Distance from screw hole to edge of cold block: 33.75mm - // Distance from edge of cold block to hole/ball position: 5mm - final double dist_sensor_center_to_coldblock_hole_vdir = (180.0 - 30.0 + (33.75 - 5.0)) - HPSTestRunTracker2014GeomDef.Sensor.getSensorLength()/2.0; - final double ball_pos_halfmod_axial_local_x = dist_sensor_center_to_coldblock_hole_vdir; - final double ball_pos_halfmod_axial_local_y = -1.0* (coldblock_thickness/2.0 + HPSTestRunTracker2014GeomDef.TestRunHalfModule.getCFThickness() + HPSTestRunTracker2014GeomDef.TestRunHalfModule.getKaptonThickness() + HPSTestRunTracker2014GeomDef.Sensor.getSensorThickness()/2.0); - final double ball_pos_halfmod_axial_local_z = dist_lower_sensor_edge_to_cold_block_mounting_surface + HPSTestRunTracker2014GeomDef.Sensor.getSensorWidth()/2.0; - final double vee_pos_halfmod_axial_local_x = ball_pos_halfmod_axial_local_x + HPSTestRunTracker2014GeomDef.Sensor.getSensorLength()/2.0; - final double vee_pos_halfmod_axial_local_y = ball_pos_halfmod_axial_local_y; - final double vee_pos_halfmod_axial_local_z = ball_pos_halfmod_axial_local_z; - final double flat_pos_halfmod_axial_local_x = ball_pos_halfmod_axial_local_x; - final double flat_pos_halfmod_axial_local_y = ball_pos_halfmod_axial_local_y + HPSTestRunTracker2014GeomDef.Sensor.getSensorThickness()/2.0; - final double flat_pos_halfmod_axial_local_z = ball_pos_halfmod_axial_local_z; - Hep3Vector ball_pos_halfmod_axial_local = new BasicHep3Vector(ball_pos_halfmod_axial_local_x, ball_pos_halfmod_axial_local_y, ball_pos_halfmod_axial_local_z); - Hep3Vector vee_pos_halfmod_axial_local = new BasicHep3Vector(vee_pos_halfmod_axial_local_x, vee_pos_halfmod_axial_local_y,vee_pos_halfmod_axial_local_z); - Hep3Vector flat_pos_halfmod_axial_local = new BasicHep3Vector(flat_pos_halfmod_axial_local_x, flat_pos_halfmod_axial_local_y,flat_pos_halfmod_axial_local_z); - - - if(_debug) { - print(String.format("ball_pos_halfmod_axial_local %s", ball_pos_halfmod_axial_local.toString())); - print(String.format("vee_pos_halfmod_axial_local %s", vee_pos_halfmod_axial_local.toString())); - print(String.format("flat_pos_halfmod_axial_local %s", flat_pos_halfmod_axial_local.toString())); - } - - //makeHalfModule("axial",moduleWrap, ball_pos_halfmod_axial_local, vee_pos_halfmod_axial_local, flat_pos_halfmod_axial_local,lcdd,sens); - - - - // cold block position w.r.t. module box coordinate system - // this is a dummy coordinate system, make it simple - // edge of cold block on the mounting surface - - final double ball_pos_coldblock_local_x = -5.00; - final double ball_pos_coldblock_local_y = 0.00; - final double ball_pos_coldblock_local_z = 0.00; - final double vee_pos_coldblock_local_x = ball_pos_coldblock_local_x + 1.0; //arbitrary distance - final double vee_pos_coldblock_local_y = ball_pos_coldblock_local_y; - final double vee_pos_coldblock_local_z = ball_pos_coldblock_local_z; - final double flat_pos_coldblock_local_x = ball_pos_coldblock_local_x; - final double flat_pos_coldblock_local_y = ball_pos_coldblock_local_y + 1.0; //arbitrary distance - final double flat_pos_coldblock_local_z = ball_pos_coldblock_local_z; - - - Hep3Vector ball_pos_coldblock_local = new BasicHep3Vector(ball_pos_coldblock_local_x, ball_pos_coldblock_local_y, ball_pos_coldblock_local_z); - Hep3Vector vee_pos_coldblock_local = new BasicHep3Vector(vee_pos_coldblock_local_x, vee_pos_coldblock_local_y,vee_pos_coldblock_local_z); - Hep3Vector flat_pos_coldblock_local = new BasicHep3Vector(flat_pos_coldblock_local_x, flat_pos_coldblock_local_y,flat_pos_coldblock_local_z); - - - if(_debug) { - print(String.format("ball_pos_coldblock_local %s", ball_pos_coldblock_local.toString())); - print(String.format("vee_pos_coldblock_local %s", vee_pos_coldblock_local.toString())); - print(String.format("flat_pos_coldblock_local %s", flat_pos_coldblock_local.toString())); - } - - makeColdBlock(moduleWrap, ball_pos_coldblock_local, vee_pos_coldblock_local, flat_pos_coldblock_local,lcdd,sens); - - - - // stereo module - - - - final double ball_pos_halfmod_stereo_local_x = ball_pos_halfmod_axial_local_x; - final double ball_pos_halfmod_stereo_local_y = -1.0 * ball_pos_halfmod_axial_local_y; // note minus sign to separate from axial - final double ball_pos_halfmod_stereo_local_z = ball_pos_halfmod_axial_local_z; - final double vee_pos_halfmod_stereo_local_x = ball_pos_halfmod_stereo_local_x + HPSTestRunTracker2014GeomDef.Sensor.getSensorLength()/2.0; - //final double vee_pos_halfmod_stereo_local_x = ball_pos_halfmod_stereo_local_x + HPSTestRunTracker2014GeomDef.Sensor.getSensorLength()/2.0*Math.cos(stereo_angle); - final double vee_pos_halfmod_stereo_local_y = ball_pos_halfmod_stereo_local_y; - final double vee_pos_halfmod_stereo_local_z = ball_pos_halfmod_stereo_local_z; - //final double vee_pos_halfmod_stereo_local_z = ball_pos_halfmod_stereo_local_z + HPSTestRunTracker2014GeomDef.Sensor.getSensorLength()/2.0*Math.sin(stereo_angle); - final double flat_pos_halfmod_stereo_local_x = ball_pos_halfmod_stereo_local_x; - final double flat_pos_halfmod_stereo_local_y = ball_pos_halfmod_stereo_local_y + HPSTestRunTracker2014GeomDef.Sensor.getSensorThickness()/2.0; - final double flat_pos_halfmod_stereo_local_z = ball_pos_halfmod_stereo_local_z; - Hep3Vector ball_pos_halfmod_stereo_local = new BasicHep3Vector(ball_pos_halfmod_stereo_local_x, ball_pos_halfmod_stereo_local_y, ball_pos_halfmod_stereo_local_z); - Hep3Vector vee_pos_halfmod_stereo_local = new BasicHep3Vector(vee_pos_halfmod_stereo_local_x, vee_pos_halfmod_stereo_local_y,vee_pos_halfmod_stereo_local_z); - Hep3Vector flat_pos_halfmod_stereo_local = new BasicHep3Vector(flat_pos_halfmod_stereo_local_x, flat_pos_halfmod_stereo_local_y,flat_pos_halfmod_stereo_local_z); - - - if(_debug) { - print(String.format("ball_pos_halfmod_stereo_local %s", ball_pos_halfmod_stereo_local.toString())); - print(String.format("vee_pos_halfmod_stereo_local %s", vee_pos_halfmod_stereo_local.toString())); - print(String.format("flat_pos_halfmod_stereo_local %s", flat_pos_halfmod_stereo_local.toString())); - } - - -// // determine stereo angle -// // note that the sign of the stereo angle in this rotation is based on an active rotation, a convention different from lcdd. -// // I first flip around local u -// -// double sinTheta = Math.sin(Math.PI/2.0); -// double cosTheta = Math.cos(Math.PI/2.0); -// Hep3Matrix mat1 = new BasicHep3Matrix(1,0,0,0,cosTheta,-sinTheta,0,sinTheta,cosTheta); -// Rotation3D rot1 = new Rotation3D(mat1); -// -// // and then do a clockwise rotation (negative) of the stereo angle around local v -// double stereo_angle; -// if(layer<4) { -// stereo_angle = -0.1; -// } else { -// stereo_angle = -0.05; -// } -// -// sinTheta = Math.sin(stereo_angle); -// cosTheta = Math.cos(stereo_angle); -// -// Hep3Matrix mat2 = new BasicHep3Matrix(cosTheta,0,sinTheta,0,1,0,-sinTheta,0,cosTheta); -// Rotation3D rot2 = new Rotation3D(mat2); -// -// if(_debug) { -// print(String.format("flip for stereo half-module\nrot1:\n %s", rot1.toString())); -// -// } -// -// // apply to coordinate system to rotate into place -// rot1.rotate(ball_pos_halfmod_stereo_local); -// rot1.rotate(vee_pos_halfmod_stereo_local); -// rot1.rotate(flat_pos_halfmod_stereo_local); -// -// -// if(_debug) { -// print(String.format("ball_pos_halfmod_stereo_local %s", ball_pos_halfmod_stereo_local.toString())); -// print(String.format("vee_pos_halfmod_stereo_local %s", vee_pos_halfmod_stereo_local.toString())); -// print(String.format("flat_pos_halfmod_stereo_local %s", flat_pos_halfmod_stereo_local.toString())); -// } -// -// print(String.format("stereo angle rotationfor stereo half-module\nrot2:\n %s", rot2.toString())); -// -// // apply to coordinate system to rotate into place -// rot2.rotate(ball_pos_halfmod_stereo_local); -// rot2.rotate(vee_pos_halfmod_stereo_local); -// rot2.rotate(flat_pos_halfmod_stereo_local); -// -// if(_debug) { -// print(String.format("ball_pos_halfmod_stereo_local %s", ball_pos_halfmod_stereo_local.toString())); -// print(String.format("vee_pos_halfmod_stereo_local %s", vee_pos_halfmod_stereo_local.toString())); -// print(String.format("flat_pos_halfmod_stereo_local %s", flat_pos_halfmod_stereo_local.toString())); -// } -// - - //makeHalfModule("stereo",moduleWrap, ball_pos_halfmod_stereo_local, vee_pos_halfmod_stereo_local, flat_pos_halfmod_stereo_local,lcdd,sens); - - - moduleVolume.setVisAttributes(lcdd.getVisAttributes("ModuleVis"));[truncated at 1000 lines; 2630 more skipped]
--- projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTestRunTracker2014GeomDef.java 2014-07-14 00:55:24 UTC (rev 3177) +++ projects/lcsim/trunk/detector-framework/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTestRunTracker2014GeomDef.java 2014-07-14 04:52:03 UTC (rev 3178) @@ -713,15 +713,7 @@
// 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 cf_length = 200.; - protected static final double cf_width = 45.; - protected static final double cf_thickness = 0.250; - - protected static final double hybrid_length = 170.0 - HPSTestRunTracker2014GeomDef.Sensor.getSensorLength(); // sensor b-to-b with hybrid - protected static final double hybrid_width = HPSTestRunTracker2014GeomDef.Sensor.getSensorWidth(); - protected static final double hybrid_thickness = 4.0/64.0*inch; - - protected static final double half_module_thickness = HPSTestRunTracker2014GeomDef.TestRunHalfModule.getHybridThickness() + HPSTestRunTracker2014GeomDef.TestRunHalfModule.getCFThickness() + HalfModuleLamination.getKaptonThickness();
+ protected static final double half_module_thickness = HPSTestRunTracker2014GeomDef.TestRunHalfModule.getHybridThickness() + HPSTestRunTracker2014GeomDef.TestRunHalfModule.getCFThickness() + HalfModuleLamination.getThickness();
protected static final double half_module_length = HPSTestRunTracker2014GeomDef.TestRunHalfModule.getCFLength(); protected static final double half_module_width = 6.83 + HPSTestRunTracker2014GeomDef.Sensor.getSensorWidth();
@@ -743,28 +735,28 @@
// system now. // I'm not sure this feels good but this has to be done somewhere double box_center_local_x = HPSTestRunTracker2014GeomDef.TestRunHalfModule.getLength()/2.0 - ( (170.00 + 10.00) - HPSTestRunTracker2014GeomDef.Sensor.getSensorLength()/2.0);
- double box_center_local_y = -1.0*HPSTestRunTracker2014GeomDef.TestRunHalfModule.getThickness()/2.0 + (HPSTestRunTracker2014GeomDef.TestRunHalfModule.getCFThickness() + HalfModuleLamination.getKaptonThickness() + HPSTestRunTracker2014GeomDef.Sensor.getSensorThickness()/2.0);
+ double box_center_local_y = -1.0*HPSTestRunTracker2014GeomDef.TestRunHalfModule.getThickness()/2.0 + (HPSTestRunTracker2014GeomDef.TestRunHalfModule.getCFThickness() + HalfModuleLamination.getThickness() + HPSTestRunTracker2014GeomDef.Sensor.getSensorThickness()/2.0);
double box_center_local_z = HPSTestRunTracker2014GeomDef.TestRunHalfModule.getWidth()/2.0 - ( 12.66 - (8.83 -3.00) + HPSTestRunTracker2014GeomDef.Sensor.getSensorWidth()/2.0 ); setCenter(box_center_local_x, box_center_local_y, box_center_local_z); } public static double getCFThickness() {
- return cf_thickness;
+ return CarbonFiber.cf_thickness;
} public static double getCFLength() {
- return cf_length;
+ return CarbonFiber.cf_length;
} public static double getCFWidth() {
- return cf_width;
+ return CarbonFiber.cf_width;
} public static double getHybridLength() {
- return hybrid_length;
+ return Hybrid.hybrid_length;
} public static double getHybridWidth() {
- return hybrid_width;
+ return Hybrid.hybrid_width;
} public static double getHybridThickness() {
- return hybrid_thickness;
+ return Hybrid.hybrid_thickness;
} public static double getThickness() { return half_module_thickness;
@@ -791,7 +783,7 @@
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_axial_local_x = dist_sensor_center_to_coldblock_hole_vdir;
- final double ball_pos_halfmod_axial_local_y = -1.0* (coldBlockThick/2.0 + TestRunHalfModule.getCFThickness() + HalfModuleLamination.getKaptonThickness() + HPSTestRunTracker2014GeomDef.Sensor.getSensorThickness()/2.0);
+ final double ball_pos_halfmod_axial_local_y = -1.0* (coldBlockThick/2.0 + TestRunHalfModule.getCFThickness() + HalfModuleLamination.getThickness() + HPSTestRunTracker2014GeomDef.Sensor.getSensorThickness()/2.0);
final double ball_pos_halfmod_axial_local_z = dist_lower_sensor_edge_to_cold_block_mounting_surface + Sensor.getSensorWidth()/2.0; final double vee_pos_halfmod_axial_local_x = ball_pos_halfmod_axial_local_x + Sensor.getSensorLength()/2.0; final double vee_pos_halfmod_axial_local_y = ball_pos_halfmod_axial_local_y;
@@ -823,7 +815,7 @@
final double ball_pos_halfmod_axial_local_x = dist_sensor_center_to_coldblock_hole_vdir; // note minus sign to separate from axial
- final double ball_pos_halfmod_axial_local_y = -1.0 * (-1.0* (coldBlockThick/2.0 + TestRunHalfModule.getCFThickness() + HalfModuleLamination.getKaptonThickness() + HPSTestRunTracker2014GeomDef.Sensor.getSensorThickness()/2.0));
+ final double ball_pos_halfmod_axial_local_y = -1.0 * (-1.0* (coldBlockThick/2.0 + TestRunHalfModule.getCFThickness() + HalfModuleLamination.getThickness() + HPSTestRunTracker2014GeomDef.Sensor.getSensorThickness()/2.0));
final double ball_pos_halfmod_axial_local_z = dist_lower_sensor_edge_to_cold_block_mounting_surface + Sensor.getSensorWidth()/2.0; final double vee_pos_halfmod_axial_local_x = ball_pos_halfmod_axial_local_x + Sensor.getSensorLength()/2.0; final double vee_pos_halfmod_axial_local_y = ball_pos_halfmod_axial_local_y;
@@ -993,27 +985,41 @@
} }
+ public static abstract class HalfModuleComponent extends BaseGeom { + public HalfModuleComponent(String name, BaseGeom m) { + super(name, m); + setPos(); + setCoord(); + } + protected abstract void setPos(); + protected abstract double getThickness(); + protected abstract double getHeigth(); + protected abstract double getWidth(); + protected abstract double getLength(); + + + }
public static class HalfModuleLamination extends BaseGeom {
- protected static final double kapton_length = 184.0; - protected static final double kapton_width = 40.0; - protected static final double kapton_thickness = 0.050;
+ protected static final double kapton_length = 184.0; + protected static final double kapton_width = 40.0; + protected static final double kapton_thickness = 0.050;
public HalfModuleLamination(String name, BaseGeom m) { super(name, m); setPos(); setCoord();
- setCenter(HalfModuleLamination.getKaptonLength()/2.0, 0.0, HalfModuleLamination.getKaptonWidth()/2.0); - setBoxDim(HalfModuleLamination.getKaptonLength(),HalfModuleLamination.getKaptonThickness(),HalfModuleLamination.getKaptonWidth());
+ setCenter(getLength()/2.0, 0.0, getWidth()/2.0); + setBoxDim(getLength(),getThickness(),getWidth());
} private void setPos() { final double ball_pos_kapton_local_x = -1 * (180.0 - HPSTestRunTracker2014GeomDef.Sensor.getSensorLength()/2.0) + 8.5;
- final double ball_pos_kapton_local_y = (HPSTestRunTracker2014GeomDef.Sensor.getSensorThickness()/2.0 + HalfModuleLamination.getKaptonThickness()/2.0);
+ final double ball_pos_kapton_local_y = (HPSTestRunTracker2014GeomDef.Sensor.getSensorThickness()/2.0 + HalfModuleLamination.getThickness()/2.0);
final double ball_pos_kapton_local_z = -1 * (HPSTestRunTracker2014GeomDef.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; final double flat_pos_kapton_local_x = ball_pos_kapton_local_x;
- final double flat_pos_kapton_local_y = ball_pos_kapton_local_y + HalfModuleLamination.getKaptonThickness()/2.0; // arbitrary distance
+ final double flat_pos_kapton_local_y = ball_pos_kapton_local_y + HalfModuleLamination.getThickness()/2.0; // arbitrary distance
final double flat_pos_kapton_local_z = ball_pos_kapton_local_z; ballPos = new BasicHep3Vector(ball_pos_kapton_local_x,ball_pos_kapton_local_y,ball_pos_kapton_local_z);
@@ -1021,19 +1027,98 @@
flatPos = new BasicHep3Vector(flat_pos_kapton_local_x,flat_pos_kapton_local_y,flat_pos_kapton_local_z); }
- public static double getKaptonThickness() {
+ public static double getThickness() {
return kapton_thickness; }
- public static double getKaptonWidth() {
+ public static double getHeight() {
+ return getThickness();
+ }
+ public static double getWidth() {
return kapton_width; }
- public static double getKaptonLength() {
+ public static double getLength() {
return kapton_length; } }
+ public static class CarbonFiber extends HalfModuleComponent { + protected static final double cf_length = 200.; + protected static final double cf_width = 45.; + protected static final double cf_thickness = 0.250; + public CarbonFiber(String name, BaseGeom m) { + super(name, m); + setCenter(getLength()/2.0, 0.0, getWidth()/2.0); + setBoxDim(getLength(),getThickness(),getWidth()); + } + protected void setPos() { + final double ball_pos_cf_local_x = -1 * (180.0 - HPSTestRunTracker2014GeomDef.Sensor.getSensorLength()/2.0); + final double ball_pos_cf_local_y = (HPSTestRunTracker2014GeomDef.Sensor.getSensorThickness()/2.0 + HPSTestRunTracker2014GeomDef.HalfModuleLamination.getThickness() + HPSTestRunTracker2014GeomDef.TestRunHalfModule.getCFThickness()/2.0); + final double ball_pos_cf_local_z = -1 * (HPSTestRunTracker2014GeomDef.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 + HPSTestRunTracker2014GeomDef.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); + setFlatPos(flat_pos_cf_local_x,flat_pos_cf_local_y,flat_pos_cf_local_z); + + } + protected double getThickness() { + return cf_thickness; + } + protected double getWidth() { + return cf_width; + } + protected double getLength() { + return cf_length; + } + protected double getHeigth() { + return getThickness(); + } + }
+ public static class Hybrid extends HalfModuleComponent { + protected static final double hybrid_length = 170.0 - HPSTestRunTracker2014GeomDef.Sensor.getSensorLength(); // sensor b-to-b with hybrid + protected static final double hybrid_width = HPSTestRunTracker2014GeomDef.Sensor.getSensorWidth(); + protected static final double hybrid_thickness = 4.0/64.0*inch; + public Hybrid(String name, BaseGeom m) { + super(name, m); + setCenter(getLength()/2.0, 0.0, getWidth()/2.0); + setBoxDim(getLength(),getThickness(), getWidth()); + + } + protected void setPos() { + final double ball_pos_hybrid_local_x = -1 * (170.0 - HPSTestRunTracker2014GeomDef.Sensor.getSensorLength()/2.0); + final double ball_pos_hybrid_local_y = (HPSTestRunTracker2014GeomDef.Sensor.getSensorThickness()/2.0 - HPSTestRunTracker2014GeomDef.TestRunHalfModule.getHybridThickness()/2.0); + final double ball_pos_hybrid_local_z = -1 * (HPSTestRunTracker2014GeomDef.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 + HPSTestRunTracker2014GeomDef.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); + setFlatPos(flat_pos_hybrid_local_x,flat_pos_hybrid_local_y,flat_pos_hybrid_local_z); + + } + protected double getThickness() { + return hybrid_thickness; + } + protected double getHeigth() { + return getThickness(); + } + protected double getWidth() { + return hybrid_width; + } + protected double getLength() { + return hybrid_length; + } + } +
public static class Coord { private Hep3Vector origin; private Hep3Vector u;
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