From 6a534f3965f7e93dbe90e991535201069da1b2b1 Mon Sep 17 00:00:00 2001 From: Sylvester Joosten <sjoosten@anl.gov> Date: Thu, 9 Sep 2021 03:55:42 +0000 Subject: [PATCH] put ScFi blocks at front of available space (cherry picked from commit 20a71bdfbcc0768c1bd9628d690d2d08cf376fca) --- compact/ci_ecal_scfi.xml | 2 +- compact/display.xml | 3 ++- compact/display_geoviewer.xml | 1 + src/ScFiCalorimeter_geo.cpp | 6 ++++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/compact/ci_ecal_scfi.xml b/compact/ci_ecal_scfi.xml index 9662825c..2ae955c2 100644 --- a/compact/ci_ecal_scfi.xml +++ b/compact/ci_ecal_scfi.xml @@ -34,7 +34,7 @@ readout="EcalEndcapPHits"> <position x="0" y="0" z="EcalEndcapP_zmin + EcalEndcapP_length/2."/> <dimensions rmin="EcalEndcapP_rmin" rmax="EcalEndcapP_rmax" length="EcalEndcapP_length"/> - <module sizex="25*mm" sizey="25*mm" sizez="170*mm" material="TungstenDens24" vis="EcalEndcapLayerVis"> + <module sizex="25*mm" sizey="25*mm" sizez="170*mm" material="TungstenDens24" vis="EcalEndcapBlockVis"> <fiber material="Polystyrene" radius="EcalEndcapP_FiberRadius" offset="EcalEndcapP_FiberOffset" diff --git a/compact/display.xml b/compact/display.xml index 30d508d4..e04529b3 100644 --- a/compact/display.xml +++ b/compact/display.xml @@ -33,8 +33,9 @@ <vis name="EcalBarrelSliceVis" ref="AnlGray" showDaughters="false" visible="true"/> <vis name="EcalBarrelFiberLayerVis" ref="AnlGold" showDaughters="false" visible="true" /> - <vis name="EcalEndcapVis" ref="AnlGold" showDaughters="false" visible="true"/> + <vis name="EcalEndcapVis" ref="AnlGold" showDaughters="true" visible="false"/> <vis name="EcalEndcapLayerVis" ref="AnlGold" showDaughters="false" visible="true"/> + <vis name="EcalEndcapBlockVis" ref="AnlGold" showDaughters="false" visible="true"/> <vis name="EcalEndcapNModuleVis" ref="AnlGold" showDaughters="false" visible="true"/> diff --git a/compact/display_geoviewer.xml b/compact/display_geoviewer.xml index 60a5ea60..e5db890e 100644 --- a/compact/display_geoviewer.xml +++ b/compact/display_geoviewer.xml @@ -35,6 +35,7 @@ <vis name="EcalVis" ref="AnlGold" showDaughters="true" visible="false"/> <vis name="EcalEndcapVis" ref="AnlGold" showDaughters="false" visible="true"/> <vis name="EcalEndcapLayerVis" ref="AnlGold" showDaughters="false" visible="true"/> + <vis name="EcalEndcapBlockVis" ref="AnlGold" showDaughters="false" visible="true"/> <vis name="EcalEndcapNModuleVis" ref="AnlGold" showDaughters="false" visible="true"/> diff --git a/src/ScFiCalorimeter_geo.cpp b/src/ScFiCalorimeter_geo.cpp index 5b170a00..d16e87cb 100644 --- a/src/ScFiCalorimeter_geo.cpp +++ b/src/ScFiCalorimeter_geo.cpp @@ -53,15 +53,17 @@ static Ref_t create_detector(Detector& desc, xml::Handle_t handle, SensitiveDete Volume env(detName + "_envelope", envShape, desc.material("Air")); env.setVisAttributes(desc.visAttributes(detElem.visStr())); - // build shashlik module + // build module auto [modVol, modSize] = build_module(desc, detElem.child(_Unicode(module)), sens); double modSizeR = std::sqrt(modSize.x() * modSize.x() + modSize.y() * modSize.y()); double assembly_rwidth = modSizeR*2.; int nas = int((rmax - rmin) / assembly_rwidth) + 1; std::vector<Assembly> assemblies; + // calorimeter block z-offsets (as blocks are shorter than the volume length) + const double block_offset = -0.5*(length - modSize.z()); for (int i = 0; i < nas; ++i) { Assembly assembly(detName + Form("_ring%d", i + 1)); - auto assemblyPV = env.placeVolume(assembly, Position{0., 0., 0.}); + auto assemblyPV = env.placeVolume(assembly, Position{0., 0., block_offset}); assemblyPV.addPhysVolID("ring", i + 1); assemblies.emplace_back(std::move(assembly)); } -- GitLab