Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into dRICHlargeSensor
Browse files Browse the repository at this point in the history
  • Loading branch information
c-dilks committed Jan 25, 2023
2 parents 3dd9fd7 + ceadbd9 commit 1cefaac
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 100 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linux-eic-shell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
if-no-files-found: error
- run: |
source install/setup.sh
sed -i '/<fiber/,+6d' ${DETECTOR_PATH}/compact/ecal/barrel_interlayers.xml
sed -z 's|\(<fiber\)|<comment>\1|g; s|\(/fiber>\)|\1</comment>|g'
sed -i '/<fiber/,+4d' ${DETECTOR_PATH}/compact/ecal/forward_scfi.xml
sed -i '/<fiber/,+4d' ${DETECTOR_PATH}/compact/far_forward/ZDC_Ecal_WSciFi.xml
sed -i '/<lens/,+4d' ${DETECTOR_PATH}/compact/pid/mrich.xml
Expand Down
10 changes: 10 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cff-version: 1.2.0
title: 'DD4hep Geometry Description of the EPIC Experiment'
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: EPIC Collaboration
repository-code: 'https://github.com/eic/epic'
abstract: DD4hep Geometry Description of the EPIC Experiment
15 changes: 7 additions & 8 deletions compact/ecal/barrel_interlayers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<constant name="EcalBarrel_Calorimeter_offset"
value="(EcalBarrel_Calorimeter_zmax - EcalBarrel_Calorimeter_zmin)/2.0"/>

<constant name="EcalBarrel_Support_thickness" value="5*cm"/>
<constant name="EcalBarrel_Support_thickness" value="0*cm"/>
<constant name="EcalBarrel_SiliconThickness" value="500*um"/>
<constant name="EcalBarrel_ElectronicsThickness" value="150*um"/>
<constant name="EcalBarrel_CopperThickness" value="100*um"/>
Expand All @@ -39,13 +39,14 @@
<constant name="EcalBarrel_FiberRadius" value="0.5*mm"/>
<constant name="EcalBarrel_FiberXSpacing" value="1.34*mm"/>
<constant name="EcalBarrel_FiberZSpacing" value="1.22*mm"/>
<constant name="EcalBarrel_CladdingThickness" value="0.04*mm"/>
<constant name="EcalBarrel_SpaceBetween" value="0.1*mm"/>
<comment>
For Pb/SiFi (GlueX): X0 ~ 1.45 cm
For W/SiFi (sPHENIX): X0 ~ 0.7 cm (but different fiber orientation)
</comment>
<constant name="EcalBarrel_RadiatorThickness" value="EcalBarrel_FiberZSpacing*16"/>
<constant name="EcalBarrel_TotalFiberLayers_num" value="16"/>
<constant name="EcalBarrel_RadiatorThickness" value="EcalBarrel_FiberZSpacing*17"/>
<constant name="EcalBarrel_TotalFiberLayers_num" value="15"/>
<constant name="EcalBarrel_ModRepeat" value="EcalBarrelStavesN"/>
<constant name="EcalBarrel_ModLength" value="0.5*m"/>
<constant name="EcalBarrel_ModWidth" value="0.5*m"/>
Expand Down Expand Up @@ -142,18 +143,15 @@
<dimensions numsides="EcalBarrel_ModRepeat"
rmin="EcalBarrel_rmin"
z="EcalBarrel_Calorimeter_length"/>
<staves vis="EcalBarrelStaveVis">
<support material="Steel235" vis="EcalBarrelSupportVis" n_beams="3" grid_size="25.0*cm"
thickness="EcalBarrel_Support_thickness" beam_thickness="EcalBarrel_Support_thickness/4" >
</support>
</staves>
<staves vis="EcalBarrelStaveVis"/>
<layer repeat="EcalBarrelImagingLayers_num-1" vis="EcalBarrelLayerVis"
space_between="EcalBarrel_ImagingLayerThickness + EcalBarrel_SpaceBetween"
space_before="EcalBarrel_ImagingLayerThickness + EcalBarrel_SpaceBetween/2.">
<slice material="SciFiPb_PbGlue" thickness="EcalBarrel_RadiatorThickness" vis="EcalBarrelFiberLayerVis">
<fiber material="SciFiPb_Scintillator"
sensitive="yes"
radius="EcalBarrel_FiberRadius"
cladding_thickness="EcalBarrel_CladdingThickness"
spacing_x="EcalBarrel_FiberXSpacing"
spacing_z="EcalBarrel_FiberZSpacing"
vis="EcalBarrelFiberLayerVis">
Expand All @@ -170,6 +168,7 @@
<fiber material="SciFiPb_Scintillator"
sensitive="yes"
radius="EcalBarrel_FiberRadius"
cladding_thickness="EcalBarrel_CladdingThickness"
spacing_x="EcalBarrel_FiberXSpacing"
spacing_z="EcalBarrel_FiberZSpacing"
vis="EcalBarrelFiberLayerVis">
Expand Down
26 changes: 17 additions & 9 deletions src/BarrelCalorimeterInterlayers_geo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ void buildFibers(Detector& desc, SensitiveDetector& sens, Volume& s_vol, xml_com
{
auto [s_trd_x1, s_thick, s_length, hphi] = dimensions;
double f_radius = getAttrOrDefault(x_fiber, _U(radius), 0.1 * cm);
double f_cladding_thickness = getAttrOrDefault(x_fiber, _Unicode(cladding_thickness), 0.0 * cm);
double f_spacing_x = getAttrOrDefault(x_fiber, _Unicode(spacing_x), 0.122 * cm);
double f_spacing_z = getAttrOrDefault(x_fiber, _Unicode(spacing_z), 0.134 * cm);
std::string f_id_grid = getAttrOrDefault<std::string>(x_fiber, _Unicode(identifier_grid), "grid");
Expand All @@ -195,8 +196,11 @@ void buildFibers(Detector& desc, SensitiveDetector& sens, Volume& s_vol, xml_com
auto grid_div = getNdivisions(s_trd_x1, s_thick, 2.0 * cm, 2.0 * cm);
// Calculate polygonal grid coordinates (vertices)
auto grid_vtx = gridPoints(grid_div.first, grid_div.second, s_trd_x1, s_thick, hphi);
Tube f_tube(0, f_radius, s_length);
Volume f_vol("fiber_vol", f_tube, desc.material(x_fiber.materialStr()));
double f_radius_core = f_radius-f_cladding_thickness;
Tube f_tube_clad(f_radius_core, f_radius, s_length);
Volume f_vol_clad("fiber_vol", f_tube_clad, desc.material(x_fiber.materialStr()));
Tube f_tube_core(0, f_radius_core, s_length);
Volume f_vol_core("fiber_core_vol", f_tube_core, desc.material(x_fiber.materialStr()));

vector<int> f_id_count(grid_div.first * grid_div.second, 0);
auto f_pos = fiberPositions(f_radius, f_spacing_x, f_spacing_z, s_trd_x1, s_thick, hphi);
Expand All @@ -208,7 +212,8 @@ void buildFibers(Detector& desc, SensitiveDetector& sens, Volume& s_vol, xml_com
}
double l_pos_y = line.front().y();
// use assembly as intermediate volume container to reduce number of daughter volumes
Assembly lfibers(Form("fiber_array_line_%lu", il));
Assembly lfibers_clad(Form("fiber_clad_array_line_%lu", il));
Assembly lfibers_core(Form("fiber_core_array_line_%lu", il));
for (auto& p : line) {
int f_grid_id = -1;
int f_id = -1;
Expand Down Expand Up @@ -236,19 +241,22 @@ void buildFibers(Detector& desc, SensitiveDetector& sens, Volume& s_vol, xml_com
}

if (x_fiber.isSensitive()) {
f_vol.setSensitiveDetector(sens);
f_vol_core.setSensitiveDetector(sens);
}
f_vol.setAttributes(desc, x_fiber.regionStr(), x_fiber.limitsStr(), x_fiber.visStr());
f_vol_core.setAttributes(desc, x_fiber.regionStr(), x_fiber.limitsStr(), x_fiber.visStr());

// Fiber placement
// Transform3D f_tr(RotationZYX(0,0,M_PI*0.5),Position(p.x(), 0, p.y()));
// PlacedVolume fiber_phv = s_vol.placeVolume(f_vol, Position(p.x(), 0., p.y()));
PlacedVolume fiber_phv = lfibers.placeVolume(f_vol, Position(p.x(), 0., 0.));
fiber_phv.addPhysVolID(f_id_grid, f_grid_id + 1).addPhysVolID(f_id_fiber, f_id + 1);
PlacedVolume core_phv = lfibers_core.placeVolume(f_vol_core, Position(p.x(), 0., 0.));
core_phv.addPhysVolID(f_id_grid, f_grid_id + 1).addPhysVolID(f_id_fiber, f_id + 1);
lfibers_clad.placeVolume(f_vol_clad, Position(p.x(), 0., 0.));
}
lfibers.ptr()->Voxelize("");
lfibers_core.ptr()->Voxelize("");
lfibers_clad.ptr()->Voxelize("");
Transform3D l_tr(RotationZYX(0, 0, M_PI * 0.5), Position(0., 0, l_pos_y));
s_vol.placeVolume(lfibers, l_tr);
s_vol.placeVolume(lfibers_core, l_tr);
s_vol.placeVolume(lfibers_clad, l_tr);
}
}

Expand Down
Loading

0 comments on commit 1cefaac

Please sign in to comment.