Skip to content
Snippets Groups Projects
Commit 6b94a7ef authored by Whitney Armstrong's avatar Whitney Armstrong
Browse files

Added a frame tag to TrapEndcapTracker

This allows for a frame to be defined as the subtraction of 2 trds.
parent 16d06df2
No related branches found
No related tags found
1 merge request!14Added a frame tag to TrapEndcapTracker
...@@ -428,6 +428,7 @@ ...@@ -428,6 +428,7 @@
</comment> </comment>
<constant name="BarrelTracking_length" value="TrackerBarrelOuter_length"/> <constant name="BarrelTracking_length" value="TrackerBarrelOuter_length"/>
<constant name="BarrelTracking_rmax" value="TrackerBarrel_rmax"/> <constant name="BarrelTracking_rmax" value="TrackerBarrel_rmax"/>
<constant name="BarrelTracking_zmax" value="BarrelTracking_length/2.0"/>
<constant name="BarrelTrackingAndPID_length" value="BarrelTracking_length "/> <constant name="BarrelTrackingAndPID_length" value="BarrelTracking_length "/>
<constant name="BarrelTrackingAndPID_rmax" value="BarrelTracking_rmax + BarrelExtraPIDThickness"/> <constant name="BarrelTrackingAndPID_rmax" value="BarrelTracking_rmax + BarrelExtraPIDThickness"/>
......
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
<vis name="SiVertexVis" alpha="0.9" r="1" g="0" b="1" showDaughters="true" /> <vis name="SiVertexVis" alpha="0.9" r="1" g="0" b="1" showDaughters="true" />
<vis name="SiTrackerBarrelVis" alpha="0.5" r="0.0" g="0.0" b="1.0" showDaughters="true" visible="true"/> <vis name="SiTrackerBarrelVis" alpha="0.5" r="0.0" g="0.0" b="1.0" showDaughters="true" visible="true"/>
<vis name="SiTrackerVis" alpha="0.9" r="1.0" g="0.0" b="0.0" showDaughters="true" lineStyle="solid" drawingStyle="solid" /> <vis name="SiTrackerVis" alpha="0.9" r="1.0" g="0.0" b="0.0" showDaughters="true" lineStyle="solid" drawingStyle="solid" />
<vis name="TrackerSupportVis" alpha="1.0" r="1.0" g="0.0" b="0.0" visible="true" showDaughters="false" />
<vis name="TrackerLayerVis" alpha="0.9" r="0.0" g="1.0" b="0.0" visible="true" showDaughters="true" /> <vis name="TrackerLayerVis" alpha="0.9" r="0.0" g="1.0" b="0.0" visible="true" showDaughters="true" />
<vis name="SiTrackerBarrelVis1" alpha="0.8" r="0.0" g="0.9" b="0.9" showDaughters="true" /> <vis name="SiTrackerBarrelVis1" alpha="0.8" r="0.0" g="0.9" b="0.9" showDaughters="true" />
......
...@@ -3,9 +3,15 @@ ...@@ -3,9 +3,15 @@
<comment> Endcap Tracker </comment> <comment> Endcap Tracker </comment>
<define> <define>
<constant name="GEMTrackerEndcap_zmin" value="BarrelTracking_length/2.0"/> <constant name="GEMTrackerEndcap_zmin" value="BarrelTracking_zmax"/>
<constant name="GEMTrackerEndcap_NLayers" value="1"/> <constant name="GEMTrackerEndcap_NLayers" value="1"/>
<constant name="GEMTrackerEndcapFoilOpeningAngle" value="30.1*degree"/> <constant name="GEMTrackerEndcapFoilOpeningAngle" value="30.1*degree"/>
<comment>
____X2____
\ /
\ / Y (=z for the trd)
\_X1_/
</comment>
<constant name="GEMTrackerEndcapFoilX1" value="43.0 * mm"/> <constant name="GEMTrackerEndcapFoilX1" value="43.0 * mm"/>
<constant name="GEMTrackerEndcapLayer_thickness" value="ForwardTrackingGEMLength/GEMTrackerEndcap_NLayers"/> <constant name="GEMTrackerEndcapLayer_thickness" value="ForwardTrackingGEMLength/GEMTrackerEndcap_NLayers"/>
...@@ -17,10 +23,9 @@ ...@@ -17,10 +23,9 @@
// Frame parameters accoring to Kondo's sbsCrossSection.pdf file), // Frame parameters accoring to Kondo's sbsCrossSection.pdf file),
<constant name="GEMTrackerEndcapFrame_thickness" value="18.0 * mm"/> <constant name="GEMTrackerEndcapFrame_thickness" value="18.0 * mm"/>
<constant name="GEMTrackerEndcapFrameBotEdge_width" value="30.0 * mm"/> <constant name="GEMTrackerEndcapFrameBotEdge_width" value="10.0 * mm"/>
<constant name="GEMTrackerEndcapFrameTopEdge_width" value="30.0 * mm"/> <constant name="GEMTrackerEndcapFrameTopEdge_width" value="10.0 * mm"/>
<constant name="GEMTrackerEndcapFrameSideEdge_width" value=" 8.0 * mm"/> <constant name="GEMTrackerEndcapFrameSideEdge_width" value=" 8.0 * mm"/>
<comment> <comment>
From https://github.com/eic/EicToyModel/blob/master/source/eicroot/GemGeoParData.cxx From https://github.com/eic/EicToyModel/blob/master/source/eicroot/GemGeoParData.cxx
...@@ -74,6 +79,16 @@ ...@@ -74,6 +79,16 @@
reflect="false"> reflect="false">
<module name="GEMModule1" vis="AnlProcess_Blue"> <module name="GEMModule1" vis="AnlProcess_Blue">
<trd x1="GEMTrackerEndcapFoilX1/2.0" x2="GEMTrackerEndcapFoilX2/2.0" z="GEMTrackerEndcapFoilY/2"/> <trd x1="GEMTrackerEndcapFoilX1/2.0" x2="GEMTrackerEndcapFoilX2/2.0" z="GEMTrackerEndcapFoilY/2"/>
<frame material="G10" thickness="GEMTrackerEndcapFrame_thickness" vis="TrackerSupportVis">
<position x="0" y="0" z="0" />
<trd x1="GEMTrackerEndcapFoilX1/2.0 - GEMTrackerEndcapFrameSideEdge_width/cos(GEMTrackerEndcapFoilOpeningAngle)
+ GEMTrackerEndcapFrameBotEdge_width*tan(GEMTrackerEndcapFoilOpeningAngle)"
x2="GEMTrackerEndcapFoilX2/2.0 - GEMTrackerEndcapFrameSideEdge_width/cos(GEMTrackerEndcapFoilOpeningAngle)
- GEMTrackerEndcapFrameTopEdge_width*tan(GEMTrackerEndcapFoilOpeningAngle)"
z="GEMTrackerEndcapFoilY/2 - (GEMTrackerEndcapFrameBotEdge_width +GEMTrackerEndcapFrameTopEdge_width)/2.0 ">
<position x="0" y="0" z="0" />
</trd>
</frame>
<comment> Going from HV side to readout side</comment> <comment> Going from HV side to readout side</comment>
<module_component thickness="0.127 * mm" material="Mylar"/> <module_component thickness="0.127 * mm" material="Mylar"/>
<module_component thickness="50.0*um" material="Kapton" name="entrance_window"/> <module_component thickness="50.0*um" material="Kapton" name="entrance_window"/>
...@@ -96,22 +111,37 @@ ...@@ -96,22 +111,37 @@
<module_component thickness="200.0*um" material="Epoxy" sensitive="true" vis="AnlProcess_Blue"/> <module_component thickness="200.0*um" material="Epoxy" sensitive="true" vis="AnlProcess_Blue"/>
</module> </module>
<module name="GEMSupportModule1" vis="AnlProcess_Blue"> <module name="GEMSupportModule1" vis="AnlProcess_Blue">
<trd x1="GEMTrackerEndcapFoilX2/2.0" x2="GEMTrackerEndcapFoilX1/2.0" z="GEMTrackerEndcapFrameBotEdge_width"/> <trd x1="GEMTrackerEndcapFoilX1/2.0" x2="GEMTrackerEndcapFoilX2/2.0" z="GEMTrackerEndcapFoilY/2"/>
<module_component thickness="GEMTrackerEndcapFrame_thickness" material="Mylar"/> <frame material="G10" thickness="GEMTrackerEndcapFrame_thickness" vis="TrackerSupportVis">
<position x="0" y="0" z="0" />
<trd x1="GEMTrackerEndcapFoilX1/2.0 - GEMTrackerEndcapFrameSideEdge_width/cos(GEMTrackerEndcapFoilOpeningAngle)
+ GEMTrackerEndcapFrameBotEdge_width*tan(GEMTrackerEndcapFoilOpeningAngle)"
x2="GEMTrackerEndcapFoilX2/2.0 - GEMTrackerEndcapFrameSideEdge_width/cos(GEMTrackerEndcapFoilOpeningAngle)
- GEMTrackerEndcapFrameTopEdge_width*tan(GEMTrackerEndcapFoilOpeningAngle)"
z="GEMTrackerEndcapFoilY/2 - (GEMTrackerEndcapFrameBotEdge_width +GEMTrackerEndcapFrameTopEdge_width)/2.0 ">
<position x="0" y="0" z="0" />
</trd>
</frame>
</module> </module>
<module name="GEMSupportModule2" vis="AnlProcess_Blue"> <module name="GEMSupportModule2" vis="AnlProcess_Blue">
<trd x1="GEMTrackerEndcapFrameSideEdge_width" x2="GEMTrackerEndcapFrameSideEdge_width" z="GEMTrackerEndcapFoilY/2"/> <trd x1="GEMTrackerEndcapFrameSideEdge_width" x2="GEMTrackerEndcapFrameSideEdge_width" z="GEMTrackerEndcapFoilY/2"/>
<module_component thickness="4.0*mm" material="Mylar"/> <module_component thickness="1.0*mm" material="Mylar"/>
</module> </module>
<layer id="1" > <layer id="1" >
<ring vis="AnlRed" <ring vis="AnlRed" module="GEMModule1"
r="GEMTrackerEndcapFoil_rmin+GEMTrackerEndcapFoilY/2.0" r="GEMTrackerEndcapFoil_rmin+GEMTrackerEndcapFoilY/2.0"
zstart="GEMTrackerEndcap_zmin + 0.5*GEMTrackerEndcapLayer_thickness" zstart="GEMTrackerEndcap_zmin + 0.5*GEMTrackerEndcapLayer_thickness"
nmodules="12" dz="10 * mm" module="GEMModule1" /> nmodules="12" dz="10 * mm" />
<ring vis="AnlBlue" phi0="15.0*degree" <!--
<ring vis="AnlRed" module="GEMSupportModule1"
r="GEMTrackerEndcapFoil_rmin+GEMTrackerEndcapFoilY/2.0" r="GEMTrackerEndcapFoil_rmin+GEMTrackerEndcapFoilY/2.0"
zstart="GEMTrackerEndcap_zmin + 0.5*GEMTrackerEndcapLayer_thickness" zstart="GEMTrackerEndcap_zmin + 0.5*GEMTrackerEndcapLayer_thickness"
nmodules="12" dz="0 * mm" module="GEMSupportModule2" /> nmodules="12" dz="10 * mm"/>
-->
<ring vis="AnlBlue" phi0="15.0*degree" module="GEMSupportModule2"
r="GEMTrackerEndcapFoil_rmin+GEMTrackerEndcapFoilY/2.0"
zstart="GEMTrackerEndcap_zmin + 0.5*GEMTrackerEndcapLayer_thickness"
nmodules="12" dz="0 * mm" />
</layer> </layer>
</detector> </detector>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
//========================================================================== //==========================================================================
// //
// Specialized generic detector constructor // Specialized generic detector constructor
// //
//========================================================================== //==========================================================================
#include "DD4hep/DetFactoryHelper.h" #include "DD4hep/DetFactoryHelper.h"
#include "XML/Layering.h" #include "XML/Layering.h"
...@@ -50,14 +50,14 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s ...@@ -50,14 +50,14 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
DetElement stave_det("stave0",det_id); DetElement stave_det("stave0",det_id);
double dx = 0.0; //mod_z / std::sin(dphi); // dx per layer double dx = 0.0; //mod_z / std::sin(dphi); // dx per layer
// Compute the top and bottom face measurements. // Compute the top and bottom face measurements.
double trd_x2 = (2 * std::tan(hphi) * outer_r - dx)/2 - tolerance; double trd_x2 = (2 * std::tan(hphi) * outer_r - dx)/2 - tolerance;
double trd_x1 = (2 * std::tan(hphi) * inner_r + dx)/2 - tolerance; double trd_x1 = (2 * std::tan(hphi) * inner_r + dx)/2 - tolerance;
double trd_y1 = x_dim.z()/2 - tolerance; double trd_y1 = x_dim.z()/2 - tolerance;
double trd_y2 = trd_y1; double trd_y2 = trd_y1;
double trd_z = mod_z/2 - tolerance; double trd_z = mod_z/2 - tolerance;
// Create the trapezoid for the stave. // Create the trapezoid for the stave.
Trapezoid trd(trd_x1, // Outer side, i.e. the "short" X side. Trapezoid trd(trd_x1, // Outer side, i.e. the "short" X side.
trd_x2, // Inner side, i.e. the "long" X side. trd_x2, // Inner side, i.e. the "long" X side.
...@@ -112,10 +112,10 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s ...@@ -112,10 +112,10 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
slice.setPlacement(slice_phv); slice.setPlacement(slice_phv);
// Increment Z position of slice. // Increment Z position of slice.
s_pos_z += s_thick; s_pos_z += s_thick;
// Increment slice number. // Increment slice number.
++s_num; ++s_num;
} }
// Set region, limitset, and vis of layer. // Set region, limitset, and vis of layer.
layer.setAttributes(description,l_vol,x_layer.regionStr(),x_layer.limitsStr(),x_layer.visStr()); layer.setAttributes(description,l_vol,x_layer.regionStr(),x_layer.limitsStr(),x_layer.visStr());
...@@ -126,7 +126,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s ...@@ -126,7 +126,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
// Increment to next layer Z position. // Increment to next layer Z position.
double xcut = l_thickness * tan_hphi; double xcut = l_thickness * tan_hphi;
l_dim_x += xcut; l_dim_x += xcut;
l_pos_z += l_thickness; l_pos_z += l_thickness;
++l_num; ++l_num;
} }
} }
......
...@@ -40,6 +40,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s ...@@ -40,6 +40,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
map<string, Placements> sensitives; map<string, Placements> sensitives;
PlacedVolume pv; PlacedVolume pv;
Acts::ActsExtension* detWorldExt = new Acts::ActsExtension(); Acts::ActsExtension* detWorldExt = new Acts::ActsExtension();
detWorldExt->addType("endcap", "detector"); detWorldExt->addType("endcap", "detector");
sdet.addExtension<Acts::ActsExtension>(detWorldExt); sdet.addExtension<Acts::ActsExtension>(detWorldExt);
...@@ -51,6 +52,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s ...@@ -51,6 +52,7 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
xml_comp_t x_mod = mi; xml_comp_t x_mod = mi;
string m_nam = x_mod.nameStr(); string m_nam = x_mod.nameStr();
xml_comp_t trd = x_mod.trd(); xml_comp_t trd = x_mod.trd();
double posY; double posY;
double x1 = trd.x1(); double x1 = trd.x1();
double x2 = trd.x2(); double x2 = trd.x2();
...@@ -61,9 +63,41 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s ...@@ -61,9 +63,41 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
total_thickness += xml_comp_t(ci).thickness(); total_thickness += xml_comp_t(ci).thickness();
y1 = y2 = total_thickness / 2; y1 = y2 = total_thickness / 2;
Volume m_volume(m_nam, Trapezoid(x1, x2, y1, y2, z), vacuum); Trapezoid m_solid(x1, x2, y1, y2, z);
Volume m_volume(m_nam, m_solid, vacuum);
m_volume.setVisAttributes(description.visAttributes(x_mod.visStr())); m_volume.setVisAttributes(description.visAttributes(x_mod.visStr()));
Solid frame_s;
if(x_mod.hasChild("frame")){
// build frame from trd (assumed to be smaller)
xml_comp_t m_frame = x_mod.child(_U(frame));
xml_comp_t f_pos = m_frame.child(_U(position));
xml_comp_t frame_trd = m_frame.trd();
double frame_thickness = getAttrOrDefault(m_frame, _U(thickness), total_thickness);
double frame_x1 = frame_trd.x1();
double frame_x2 = frame_trd.x2();
double frame_z = frame_trd.z();
std::cout << " x1 = " << x1 << "\n";
std::cout << " x2 = " << x2 << "\n";
std::cout << " z = " << z << "\n";
std::cout << "frame_x1 = " << frame_x1 << "\n";
std::cout << "frame_x2 = " << frame_x2 << "\n";
std::cout << "frame_z = " << frame_z << "\n";
// make the frame match the total thickness if thickness attribute is not given
Trapezoid f_solid1(x1, x2,frame_thickness / 2.0, frame_thickness / 2.0, z);
Trapezoid f_solid(frame_x1, frame_x2, frame_thickness / 2.0, frame_thickness / 2.0, frame_z) ;
SubtractionSolid frame_shape(f_solid1, f_solid);
frame_s = frame_shape;
Material f_mat = description.material(m_frame.materialStr());
Volume f_vol(m_nam + "_frame", frame_shape, f_mat);
f_vol.setVisAttributes(description.visAttributes(m_frame.visStr()));
// figure out how to best place
pv = m_volume.placeVolume(f_vol, Position(f_pos.x(), f_pos.y(), f_pos.z()));
std::cout << "Frame thickness : " << frame_thickness << "\n";
}
for (ci.reset(), n_sensor = 1, c_id = 0, posY = -y1; ci; ++ci, ++c_id) { for (ci.reset(), n_sensor = 1, c_id = 0, posY = -y1; ci; ++ci, ++c_id) {
xml_comp_t c = ci; xml_comp_t c = ci;
double c_thick = c.thickness(); double c_thick = c.thickness();
...@@ -73,7 +107,13 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s ...@@ -73,7 +107,13 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
Material c_mat = description.material(c.materialStr()); Material c_mat = description.material(c.materialStr());
string c_name = _toString(c_id, "component%d"); string c_name = _toString(c_id, "component%d");
Volume c_vol(c_name, Trapezoid(comp_x1, comp_x2, c_thick / 2e0, c_thick / 2e0, comp_height), c_mat);
Trapezoid comp_s1(comp_x1, comp_x2, c_thick / 2e0, c_thick / 2e0, comp_height);
Solid comp_shape = comp_s1;
if(frame_s.isValid()) {
comp_shape = SubtractionSolid( comp_s1, frame_s);
}
Volume c_vol(c_name, comp_shape, c_mat);
c_vol.setVisAttributes(description.visAttributes(c.visStr())); c_vol.setVisAttributes(description.visAttributes(c.visStr()));
pv = m_volume.placeVolume(c_vol, Position(0, posY + c_thick / 2, 0)); pv = m_volume.placeVolume(c_vol, Position(0, posY + c_thick / 2, 0));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment