Skip to content

Commit

Permalink
endcap ready, tests passed
Browse files Browse the repository at this point in the history
  • Loading branch information
atolosadelgado committed May 16, 2023
1 parent 6a5271e commit f496a51
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
9 changes: 5 additions & 4 deletions compact/arc_endcap_v0.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
<includes>
<gdmlFile ref="elements.xml"/>
<gdmlFile ref="materials.xml"/>
<gdmlFile ref="RadiatorCell_FinaOptimisation.xml"/>
</includes>

<display>
<vis name="vessel_vis" r="236/256" g="237/256" b="232/256" alpha="1.0" showDaughters="true" visible="true" />
<vis name="vessel_vis" r="236/256" g="237/256" b="232/256" alpha="1.0" showDaughters="true" visible="false" />
<vis name="gas_vis" r="227/256" g="239/256" b="217/256" alpha="0.1" showDaughters="true" visible="true" />
<vis name="aerogel_vis" r="244/256" g="177/256" b="132/256" alpha="0.5" showDaughters="true" visible="true" />
<vis name="cooling_vis" r="254/256" g="230/256" b="151/256" alpha="0.5" showDaughters="true" visible="true" />
<vis name="aerogel_vis" r="244/256" g="177/256" b="132/256" alpha="0.1" showDaughters="true" visible="true" />
<vis name="cooling_vis" r="254/256" g="230/256" b="151/256" alpha="0.1" showDaughters="true" visible="true" />
<vis name="sensor_vis" r="255/256" g="0/256" b="0/256" alpha="1.0" showDaughters="true" visible="true" />
<vis name="filter_vis" r="0/256" g="96/256" b="156/256" alpha="1.0" showDaughters="true" visible="true" />
<vis name="mirror_vis" r="255/256" g="230/256" b="153/256" alpha="1.0" showDaughters="true" visible="true" />
Expand All @@ -44,7 +45,7 @@
<vis name="mirror_vis20" r="055/256" g="128/256" b="128/256" alpha="1.0" showDaughters="true" visible="true" />
<vis name="mirror_vis21" r="055/256" g="128/256" b="128/256" alpha="1.0" showDaughters="true" visible="true" />
<vis name="no_vis" showDaughters="true" visible="false" />
<vis name="envelope_vis" r="0/256" g="96/256" b="156/256" alpha="0.1" showDaughters="true" visible="true" />
<vis name="envelope_vis" r="0/256" g="96/256" b="156/256" alpha="0.1" showDaughters="true" visible="false" />
</display>

<define>
Expand Down
26 changes: 14 additions & 12 deletions src/ARC_endcap_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ static Ref_t create_endcap_cell(Detector &desc, xml::Handle_t handle, SensitiveD
// Build cells of a sector
// auto ncell = mycell_v[0];
// mycell_v = {mycell_v[19]};
phinmax = 1;
// phinmax = 1;
int cellCounter = 0;
int physicalVolumeCounter = 0;
auto createPhysVolID = [&](){return physicalVolumeCounter++;};
Expand Down Expand Up @@ -435,7 +435,7 @@ static Ref_t create_endcap_cell(Detector &desc, xml::Handle_t handle, SensitiveD
cellPV.addPhysVolID("cellnumber", createPhysVolID() );//6*cellCounter + 0);
cellDE.setPlacement( cellPV );

if (false && ncell.isReflected)
if ( ncell.isReflected)
{
std::string cellRefName = create_part_name_ff("cell_ref");
Volume cellV_reflected(cellRefName, cellS, gasvolMat);
Expand All @@ -454,8 +454,10 @@ static Ref_t create_endcap_cell(Detector &desc, xml::Handle_t handle, SensitiveD
SkinSurface mirror_ref_Skin(desc, mirror_ref_DE, Form("mirror_ref_optical_surface%d", cellCounter), mirrorSurf, mirrorVol_reflected); // FIXME: 3rd arg needs `imod`?
mirror_ref_Skin.isValid();

Transform3D sensorTr_reflected(RotationZYX(-alpha + 90 * deg, 0 /*90*deg-angle_of_sensor*/, angle_of_sensor),
Translation3D(0, center_of_sensor_x, sensor_z_origin_Martin));
// Transform3D sensorTr_reflected(RotationZYX(-alpha + 90 * deg, 0 /*90*deg-angle_of_sensor*/, angle_of_sensor),
// Translation3D(0, center_of_sensor_x, sensor_z_origin_Martin));
auto sensorTr_reflected = RotationZYX(-alpha + 90 * deg, 0 /*90*deg-angle_of_sensor*/, angle_of_sensor)*
Translation3D(0, center_of_sensor_x, sensor_z_origin_Martin);
PlacedVolume sensor_ref_PV = cellV_reflected.placeVolume(sensorVol, sensorTr_reflected);
// sensor_ref_PV.addPhysVolID("cellnumber", 6 * cellCounter+5);
DetElement sensor_ref_DE(cell_reflected_DE, create_part_name_ff("sensor") + "_ref_DE", 6 * cellCounter+5 );
Expand All @@ -474,8 +476,8 @@ static Ref_t create_endcap_cell(Detector &desc, xml::Handle_t handle, SensitiveD
// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ COOLING PLATE ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ //
// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ AEROGEL PLATE ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ //
// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ //
// cellV_reflected.placeVolume(coolingVol);
// cellV_reflected.placeVolume(aerogelVol);
cellV_reflected.placeVolume(coolingVol);
cellV_reflected.placeVolume(aerogelVol);


PlacedVolume cell_ref_PV = endcap_cells_gas_envelope.placeVolume(cellV_reflected, RotationZ(phistep * phin) * Translation3D(-ncell.x, ncell.y, 0));
Expand All @@ -499,12 +501,12 @@ static Ref_t create_endcap_cell(Detector &desc, xml::Handle_t handle, SensitiveD
endcapZPos_DE.setPlacement(endcapZPos_PV);


// Transform3D envelope_zreflected_Tr(RotationZYX( 0 ,0,180*deg), Translation3D(0, 0, -zpos_endcap));
// PlacedVolume endcapZNeg_PV = endcaps_assemblyV.placeVolume(endcap_cells_vessel_envelope, envelope_zreflected_Tr);
// endcapZNeg_PV.addPhysVolID("barrel", 2);
//
// DetElement endcapZNeg_DE(det, "endcapZNeg_DE", 2 );
// endcapZNeg_DE.setPlacement(endcapZNeg_PV);
Transform3D envelope_zreflected_Tr(RotationZYX( 0 ,0,180*deg), Translation3D(0, 0, -zpos_endcap));
PlacedVolume endcapZNeg_PV = endcaps_assemblyV.placeVolume(endcap_cells_vessel_envelope, envelope_zreflected_Tr);
endcapZNeg_PV.addPhysVolID("barrel", 2);

DetElement endcapZNeg_DE(det, "endcapZNeg_DE", 2 );
endcapZNeg_DE.setPlacement(endcapZNeg_PV);


PlacedVolume endcaps_PV = motherVol.placeVolume(endcaps_assemblyV);
Expand Down

0 comments on commit f496a51

Please sign in to comment.