Skip to content
Snippets Groups Projects
Commit 20a71bdf authored by Sylvester Joosten's avatar Sylvester Joosten
Browse files

put ScFi blocks at front of available space

parent 5755020d
Branches
Tags
1 merge request!236put ScFi blocks at front of available space
......@@ -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"
......
......@@ -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"/>
......
......@@ -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"/>
......
......@@ -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));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment