Skip to content

Commit

Permalink
fixed a bug in segmentation syntax. Also updated comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ShujieL committed Nov 15, 2024
1 parent f127bbd commit 6e3ca57
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 59 deletions.
103 changes: 56 additions & 47 deletions compact/tracking/vertex_barrel_curved.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
<constant name="SiVertexSensor_thickness" value="40*um" />
<constant name="RSU_width" value="19.564*mm" />
<constant name="RSU_length" value="21.666*mm" />
<constant name="Tile_width" value="9.197*mm"/>
<constant name="Tile_length" value="10.773*mm"/>
<constant name="Section_width" value="9.197*mm"/>
<constant name="Section_length" value="10.773*mm"/>

<comment>
1 RSU = 2x2 tiles with inactive areas
1 module = 1 tile
1 stave = 1 row of 12 RSU=24 tiles
1 RSU = 2x6 tiles with inactive areas == 2x2 sections
1 section (module) = 3-tiles along z
1 "stave" = 1 row of 12 RSU
</comment>
<constant name="VertexBarrelMod_length" value="RSU_length/2" />
<constant name="VertexBarrelLayer_nz" value="12*2" />
<comment>
# of staves in R: 12, 16, 40 RSUs = 24, 32, 80 tiles
# of staves in R: 12, 16, 40 RSUs = 24, 32, 80 sections
</comment>
<constant name="VertexBarrelStave_count1" value="12*2" />
<constant name="VertexBarrelStave_count2" value="16*2" />
Expand All @@ -31,15 +31,22 @@
<constant name="VertexBarrelStave2_width" value="RSU_width/2" />
<constant name="VertexBarrelStave3_width" value="RSU_width/2" />

<constant name="VertexBarrelMod1_rmin" value="VertexBarrelStave_count1*VertexBarrelStave1_width/2/Pi+0.01*mm" />
<constant name="VertexBarrelMod2_rmin" value="VertexBarrelStave_count2*VertexBarrelStave2_width/2/Pi+0.01*mm" />
<constant name="VertexBarrelMod3_rmin" value="VertexBarrelStave_count3*VertexBarrelStave3_width/2/Pi+0.01*mm" />
<constant name="VertexBarrelMod1_rmin" value="VertexBarrelStave_count1*VertexBarrelStave1_width/2/Pi" />
<constant name="VertexBarrelMod2_rmin" value="VertexBarrelStave_count2*VertexBarrelStave2_width/2/Pi" />
<constant name="VertexBarrelMod3_rmin" value="VertexBarrelStave_count3*VertexBarrelStave3_width/2/Pi" />

<documentation>
for the segmentation. Assume sensors are placed at the inner most surface for each layer
</documentation>
<constant name="VertexBarrelSeg1_r" value="VertexBarrelMod1_rmin+SiVertexSensor_thickness/2.0" />
<constant name="VertexBarrelSeg2_r" value="VertexBarrelMod2_rmin+SiVertexSensor_thickness/2.0" />
<constant name="VertexBarrelSeg3_r" value="VertexBarrelMod3_rmin+SiVertexSensor_thickness/2.0" />

<documentation>
- Currently there are 3 sensor layers: Layer 1,2,3 = L0, L1, L2.
- assume they are of the same length and aligned.
</documentation>

<constant name="VertexBarrelEnvelope_length" value="VertexTrackingRegion_length"/>
<constant name="VertexBarrelLayer_length" value="VertexBarrel_length + 1*um" />
<constant name="VertexBarrelLayer_zoff" value="0" />
<constant name="VertexBarrelLayer_zstart" value="-VertexBarrelLayer_length/2+VertexBarrelLayer_zoff" />
Expand All @@ -52,19 +59,13 @@
<constant name="VertexZCheck" value="sqrt(VertexBarrelLayer_length - VertexBarrelLayer_nz*VertexBarrelMod_length - .1*cm)" />

<constant name="VertexBarrelLayer_thickness" value="0.2*cm" />
<constant name="VertexBarrelLayer1_rmin"
value="VertexBarrelMod1_rmin" />
<constant name="VertexBarrelLayer1_rmax"
value="VertexBarrelLayer1_rmin + VertexBarrelLayer_thickness" />
<constant name="VertexBarrelLayer2_rmin"
value="VertexBarrelMod2_rmin" />
<constant name="VertexBarrelLayer2_rmax"
value="VertexBarrelLayer2_rmin + VertexBarrelLayer_thickness" />
<constant name="VertexBarrelLayer3_rmin"
value="VertexBarrelMod3_rmin" />
<constant name="VertexBarrelLayer3_rmax"
value="VertexBarrelLayer3_rmin + VertexBarrelLayer_thickness" />

<constant name="VertexBarrelLayer1_rmin" value="VertexBarrelMod1_rmin" />
<constant name="VertexBarrelLayer1_rmax" value="VertexBarrelLayer1_rmin + VertexBarrelLayer_thickness" />
<constant name="VertexBarrelLayer2_rmin" value="VertexBarrelMod2_rmin" />
<constant name="VertexBarrelLayer2_rmax" value="VertexBarrelLayer2_rmin + VertexBarrelLayer_thickness" />
<constant name="VertexBarrelLayer3_rmin" value="VertexBarrelMod3_rmin" />
<constant name="VertexBarrelLayer3_rmax" value="VertexBarrelLayer3_rmin + VertexBarrelLayer_thickness" />

<comment> ensure we are within the vertex envelope with some margin. </comment>
<constant name="VertexCheck" value="sqrt(VertexBarrel_rmax - VertexBarrelLayer3_rmax - .1*cm)" />
</define>
Expand All @@ -81,32 +82,40 @@
insideTrackingVolume="true">
<type_flags type="DetType_TRACKER + DetType_BARREL" />
<comment>
- Vertex Barrel Modules.
- For tiles (1 module = 1 upper/lower tile):
- Vertex Barrel Modules.
- For RSU (1 module = 1 upper/lower section of three tiles):
--Use [mod_name]_upper and [mod_name]_lower here, and [mod_name] in corresponding layer
to allow the geo plugin find both modules.
-- also need to specify type="upper" or "lower" in components.
- for other modules and components:
no need to specify upper and lower anywhere.
- one RSU ("|" = backbone. Length alone z.):
| ------readout-------- | -------readout--------
| tilex3 | tilex3
| ------biasing-------- | -------biasing--------
| ------biasing-------- | -------biasing--------
| tilex3 | tilex3
| ------readout-------- | -------readout--------

</comment>
<module name="Module1_upper" rmin="VertexBarrelMod1_rmin" width="VertexBarrelStave1_width"
length="VertexBarrelMod_length">
<module_component name="RSU" type="upper"
material="Silicon"
sensitive="true"
thickness="SiVertexSensor_thickness"
width="Tile_width"
length="Tile_length"
width="Section_width"
length="Section_length"
vis="VertexLayerVis" />
</module>
<module name="Module1_lower" rmin="VertexBarrelMod1_rmin" width="VertexBarrelStave1_width"
length="VertexBarrelMod_length">
<module_component name="RSU" type="lower"
material="Silicon"
sensitive="true"
thickness="SiVertexSensor_thickness"
width="Tile_width"
length="Tile_length"
thickness="SiVertexSensor_thickness"
width="Section_width"
length="Section_length"
vis="VertexLayerVis" />
</module>

Expand All @@ -116,18 +125,18 @@
material="Silicon"
sensitive="true"
thickness="SiVertexSensor_thickness"
width="Tile_width"
length="Tile_length"
width="Section_width"
length="Section_length"
vis="VertexLayerVis" />
</module>
<module name="Module2_lower" rmin="VertexBarrelMod2_rmin" width="VertexBarrelStave2_width"
length="VertexBarrelMod_length">
<module_component name="RSU" type="lower"
material="Silicon"
sensitive="true"
thickness="SiVertexSensor_thickness"
width="Tile_width"
length="Tile_length"
thickness="SiVertexSensor_thickness"
width="Section_width"
length="Section_length"
vis="VertexLayerVis" />
</module>

Expand All @@ -137,18 +146,18 @@
material="Silicon"
sensitive="true"
thickness="SiVertexSensor_thickness"
width="Tile_width"
length="Tile_length"
width="Section_width"
length="Section_length"
vis="VertexLayerVis" />
</module>
<module name="Module3_lower" rmin="VertexBarrelMod3_rmin" width="VertexBarrelStave3_width"
length="VertexBarrelMod_length">
<module_component name="RSU" type="lower"
material="Silicon"
sensitive="true"
thickness="SiVertexSensor_thickness"
width="Tile_width"
length="Tile_length"
thickness="SiVertexSensor_thickness"
width="Section_width"
length="Section_length"
vis="VertexLayerVis" />
</module>

Expand Down Expand Up @@ -214,15 +223,15 @@
<readout name="VertexBarrelHits">
<segmentation type="MultiSegmentation" key="layer">
<segmentation name="L0" type="CylindricalGridPhiZ" key_value="1"
grid_size_phi="0.02*mm/VertexBarrelLayer1_rmin" grid_size_z="0.02*mm"
radius="VertexBarrelMod1_rmin+SiVertexSensor_thickness/2.0" />
</segmentation>
grid_size_phi="0.02*mm/VertexBarrelSeg1_r" grid_size_z="0.02*mm"
radius="VertexBarrelSeg1_r" />
<segmentation name="L1" type="CylindricalGridPhiZ" key_value="2"
grid_size_phi="0.02*mm/VertexBarrelLayer2_rmin" grid_size_z="0.02*mm"
radius="VertexBarrelMod2_rmin+SiVertexSensor_thickness/2.0" />
grid_size_phi="0.02*mm/VertexBarrelSeg2_r" grid_size_z="0.02*mm"
radius="VertexBarrelSeg2_r" />
<segmentation name="L2" type="CylindricalGridPhiZ" key_value="4"
grid_size_phi="0.02*mm/VertexBarrelLayer3_rmin" grid_size_z="0.02*mm"
radius="VertexBarrelMod3_rmin+SiVertexSensor_thickness/2.0" />
grid_size_phi="0.02*mm/VertexBarrelSeg3_r" grid_size_z="0.02*mm"
radius="VertexBarrelSeg3_r" />
</segmentation>
<id>system:8,layer:4,module:12,sensor:3,phi:30:-18,z:-16</id>
</readout>
</readouts>
Expand Down
24 changes: 12 additions & 12 deletions src/SVTBarrelTracker_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* - Designed to process "vertex_barrel_curved.xml"
*
* - Derived from "BarrelTrackerWithFrame_geo.cpp".
* - Build-in RSU structure with four tiles and inactive areas
* - Build-in RSU structure with 12 tiles and inactive areas
*
* \code
* \endcode
Expand Down Expand Up @@ -101,30 +101,30 @@ static Ref_t create_SVTBarrelTracker(Detector& description, xml_h e, SensitiveDe
double c_rmin = m_rmin + thickness_so_far;
double c_dphi = c_width / c_rmin;

if (c_nam == "RSU") { // for RSU, create ONE upper or lower tile.
// **** hard-coded RSU design with 4 tiles, plus backbones, readout pads, biasing
if (c_nam=="RSU"){ // for RSU, create ONE upper or lower 3-tile sections.
// **** hard-coded RSU design with 12 tiles, plus backbones, readout pads, biasing
// Having issue including multiple sensitive surfaces in one Tube module (worked with box).
// Therefore use type "upper" and "lower" to create two tiles. (left right is identical)
// Therefore use type "upper" and "lower" to create two mirrored tile sections. (left right is identical)
//
// "|" = backbone. Length alone z.
//
// | ------readout-------- | -------readout--------
// | tile | tile
// | tilex3 | tilex3
// | ------biasing-------- | -------biasing--------
// | ------biasing-------- | -------biasing--------
// | tile | tile
// | tilex3 | tilex3
// | ------readout-------- | -------readout--------
const string frame_vis = "VertexSupportLayerVis";
const string c_type = x_comp.typeStr();
const double BiasingWidth = 0.06 * mm; // need to x2 for two sets
const double ReadoutPadsWidth = m_width - BiasingWidth - c_width;
const double BackboneLength = m_length - c_length; //0.06*mm;

double px = 0, py = 0, pz = 0;
double c_z0 = -m_length / 2;
double c_z1 = c_z0 + BackboneLength;
double c_z2 = m_length / 2;
pz = (c_z1 + c_z2) / 2; // tile central z
double px=0, py=0, pz=0;
double c_z0 = -m_length/2;
double c_z1 = c_z0+BackboneLength;
double c_z2 = m_length/2;
pz = (c_z1 + c_z2)/2; // section central z

double c_phi0 = 0;
double c_phi1, c_phi2;
Expand Down Expand Up @@ -186,7 +186,6 @@ static Ref_t create_SVTBarrelTracker(Detector& description, xml_h e, SensitiveDe
Vector3D u(-1., 0., 0.);
Vector3D v(0., -1., 0.);
Vector3D n(0., 0., 1.);

// compute the inner and outer thicknesses that need to be assigned to the tracking surface
// depending on wether the support is above or below the sensor
double inner_thickness = thickness_so_far + c_thickness / 2.0;
Expand All @@ -210,6 +209,7 @@ static Ref_t create_SVTBarrelTracker(Detector& description, xml_h e, SensitiveDe
string m_nam = x_layer.moduleStr();
string lay_nam = det_name + _toString(x_layer.id(), "_layer%d");
Tube lay_tub(x_barrel.inner_r(), x_barrel.outer_r(), x_barrel.z_length() / 2.0);

Volume lay_vol(lay_nam, lay_tub, air); // Create the layer envelope volume.
Position lay_pos(0, 0, getAttrOrDefault(x_barrel, _U(z0), 0.));
lay_vol.setVisAttributes(description.visAttributes(x_layer.visStr()));
Expand Down

0 comments on commit 6e3ca57

Please sign in to comment.