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

Cleanup unused/deprecated files

parent f645d27b
No related branches found
No related tags found
No related merge requests found
Showing
with 289 additions and 17 deletions
...@@ -115,11 +115,6 @@ dump_geometry: ...@@ -115,11 +115,6 @@ dump_geometry:
- print_env.sh - print_env.sh
## DEBUG ## DEBUG
- mkdir -p geo - mkdir -p geo
## disable fibers in SciFi endcap ECAL for better performance
## not needed, as we have no fibers in the current setup
#- sed -i '/<fiber/,+4d' ${DETECTOR_PATH}/compact/ci_ecal_scfi.xml
## finally: remove tracking subassemblies as they lower the display priority
## of some tracking detectors
- | - |
sed -i -e '/<detectors>/,/<\/detectors>/d' ${DETECTOR_PATH}/compact/tracking_config*.xml sed -i -e '/<detectors>/,/<\/detectors>/d' ${DETECTOR_PATH}/compact/tracking_config*.xml
mv ${DETECTOR_PATH}/compact/display_geoviewer.xml ${DETECTOR_PATH}/compact/display.xml mv ${DETECTOR_PATH}/compact/display_geoviewer.xml ${DETECTOR_PATH}/compact/display.xml
...@@ -142,11 +137,13 @@ dump_geometry: ...@@ -142,11 +137,13 @@ dump_geometry:
## print some useful output ## print some useful output
- | - |
echo "Geometry viewer at:" echo "Geometry viewer at:"
echo "https://eic.phy.anl.gov/geoviewer/index.htm?file=https://eicweb.phy.anl.gov/EIC/detectors/athena/-/jobs/${CI_JOB_ID}/artifacts/raw/geo/detector_geo_full.root?job=dump_geometry&item=default;1&opt=clipx;clipy;transp30;zoom75;ROTY290;ROTZ350;trz0;trr0;ctrl;all&" echo "https://eic.phy.anl.gov/geoviewer/index.htm?file=https://eicweb.phy.anl.gov/EIC/detectors/athena/-/jobs/${CI_JOB_ID}/artifacts/raw/geo/detector_geo_full.root?job=dump_geometry&item=default;1&opt=clipx;clipy;transp30;zoom75;ROTY290;ROTZ350;trz0;trr0;ctrl;all"
echo " - Central detector view at: "
echo "https://eic.phy.anl.gov/geoviewer/index.htm?file=https://eicweb.phy.anl.gov/EIC/detectors/athena/-/jobs/${CI_JOB_ID}/artifacts/raw/geo/detector_geo.root?job=dump_geometry&item=default;1&opt=clipx;clipy;transp30;zoom120;ROTY320;ROTZ340;trz0;trr0;ctrl;all"
for xml in ${DETECTOR_PATH}/compact/subsystem_views/*.xml; do for xml in ${DETECTOR_PATH}/compact/subsystem_views/*.xml; do
geo_name=`basename $xml .xml`_geo.root geo_name=`basename $xml .xml`_geo.root
echo " - Subsystem view for `basename $xml .xml` at:" echo " - Subsystem view for `basename $xml .xml` at:"
echo " https://eic.phy.anl.gov/geoviewer/index.htm?file=https://eicweb.phy.anl.gov/EIC/detectors/athena/-/jobs/${CI_JOB_ID}/artifacts/raw/geo/${geo_name}?job=dump_geometry&item=default;1&opt=clipx;clipy;transp30;zoom75;ROTY290;ROTZ350;trz0;trr0;ctrl;all&" echo " https://eic.phy.anl.gov/geoviewer/index.htm?file=https://eicweb.phy.anl.gov/EIC/detectors/athena/-/jobs/${CI_JOB_ID}/artifacts/raw/geo/${geo_name}?job=dump_geometry&item=default;1&opt=clipx;clipy;transp30;zoom75;ROTY320;ROTZ340;trz0;trr0;ctrl;all"
done done
detector_documentation: detector_documentation:
...@@ -199,6 +196,7 @@ overlap_check_tgeo: ...@@ -199,6 +196,7 @@ overlap_check_tgeo:
script: script:
## disable fibers in ECAL for normal overlap check ## disable fibers in ECAL for normal overlap check
- sed -i '/<fiber/,+6d' ${DETECTOR_PATH}/compact/ecal_barrel_interlayers.xml - sed -i '/<fiber/,+6d' ${DETECTOR_PATH}/compact/ecal_barrel_interlayers.xml
- sed -i '/<fiber/,+4d' ${DETECTOR_PATH}/ip6/far_forward_ZDC_Ecal_WSciFi.xml
- checkOverlaps -c ${DETECTOR_PATH}/athena.xml | tee doc/overlap_check_tgeo.out - checkOverlaps -c ${DETECTOR_PATH}/athena.xml | tee doc/overlap_check_tgeo.out
- echo "$(cat doc/overlap_check_tgeo.out | grep ovlp | wc -l) overlaps..." - echo "$(cat doc/overlap_check_tgeo.out | grep ovlp | wc -l) overlaps..."
- if [[ "$(cat doc/overlap_check_tgeo.out | grep ovlp | wc -l)" -gt "0" ]] ; then echo "Overlaps exist!" && false ; fi - if [[ "$(cat doc/overlap_check_tgeo.out | grep ovlp | wc -l)" -gt "0" ]] ; then echo "Overlaps exist!" && false ; fi
...@@ -210,6 +208,7 @@ overlap_check_geant4:full_fast: ...@@ -210,6 +208,7 @@ overlap_check_geant4:full_fast:
script: script:
## disable fibers in ECAL for normal overlap check ## disable fibers in ECAL for normal overlap check
- sed -i '/<fiber/,+6d' ${DETECTOR_PATH}/compact/ecal_barrel_interlayers.xml - sed -i '/<fiber/,+6d' ${DETECTOR_PATH}/compact/ecal_barrel_interlayers.xml
- sed -i '/<fiber/,+4d' ${DETECTOR_PATH}/ip6/far_forward_ZDC_Ecal_WSciFi.xml
## reduce the number of fibers in Hadron EMCal for overlap check ## reduce the number of fibers in Hadron EMCal for overlap check
## not needed, as we are running with a different setup now ## not needed, as we are running with a different setup now
#- sed -i 's/radius="EcalEndcapP_FiberRadius"/radius="EcalEndcapP_FiberRadius*10"/' ${DETECTOR_PATH}/compact/ci_ecal_scfi.xml #- sed -i 's/radius="EcalEndcapP_FiberRadius"/radius="EcalEndcapP_FiberRadius*10"/' ${DETECTOR_PATH}/compact/ci_ecal_scfi.xml
......
...@@ -24,17 +24,15 @@ set(a_lib_name athena) ...@@ -24,17 +24,15 @@ set(a_lib_name athena)
dd4hep_configure_output() dd4hep_configure_output()
dd4hep_add_plugin(${a_lib_name} SOURCES dd4hep_add_plugin(${a_lib_name} SOURCES
src/BackwardGEMTracker_geo.cpp
src/BarrelBarDetectorWithSideFrame_geo.cpp src/BarrelBarDetectorWithSideFrame_geo.cpp
src/BarrelCalorimeter_geo.cpp src/BarrelCalorimeter_geo.cpp
src/BarrelCalorimeterHybrid_geo.cpp
src/BarrelCalorimeterInterlayers_geo.cpp src/BarrelCalorimeterInterlayers_geo.cpp
src/BarrelTrackerWithFrame_geo.cpp src/BarrelTrackerWithFrame_geo.cpp
src/CompositeTracker_geo.cpp src/CompositeTracker_geo.cpp
src/CylinderTrackerBarrel_geo.cpp src/CylinderTrackerBarrel_geo.cpp
src/DIRC_geo.cpp src/DIRC_geo.cpp
src/DRich_geo.cpp src/DRICH_geo.cpp
src/ERich_geo.cpp src/PfRICH_geo.cpp
src/FileLoader.cpp src/FileLoader.cpp
src/FieldMapBrBz.cpp src/FieldMapBrBz.cpp
src/GaseousRICH_geo.cpp src/GaseousRICH_geo.cpp
......
...@@ -3,8 +3,18 @@ Overview ...@@ -3,8 +3,18 @@ Overview
The Athena Detector at IP6 for Electron-Ion Collider experiment. The Athena Detector at IP6 for Electron-Ion Collider experiment.
**Detector geometry viewer:** **Detector geometry viewer:**
- [Central detector geometry](https://eic.phy.anl.gov/geoviewer/index.htm?nobrowser&file=https://eicweb.phy.anl.gov/api/v4/projects/473/jobs/artifacts/master/raw/geo/detector_geo.root?job=report&item=default;1&opt=clipxyz;transp30;zoom100;ROTY0;ROTZ0;trz100;trr0;ctrl;all&) - [Central detector](https://eic.phy.anl.gov/geoviewer/index.htm?nobrowser&file=https://eicweb.phy.anl.gov/api/v4/projects/473/jobs/artifacts/master/raw/geo/detector_geo.root?job=dump_geometry&item=default;1&opt=clipx;clipy;transp30;zoom120;ROTY320;ROTZ340;trz0;trr0;ctrl;all)
- [Full Detector geometry (including beamline)](https://eic.phy.anl.gov/geoviewer/index.htm?nobrowser&file=https://eicweb.phy.anl.gov/api/v4/projects/473/jobs/artifacts/master/raw/geo/detector_geo_full.root?job=report&item=default;1&opt=clipxyz;transp30;zoom75;ROTY290;ROTZ350;trz0;trr0;ctrl;all&) - [Full Detector (including beamline)](https://eic.phy.anl.gov/geoviewer/index.htm?nobrowser&file=https://eicweb.phy.anl.gov/api/v4/projects/473/jobs/artifacts/master/raw/geo/detector_geo_full.root?job=dump_geometry&item=default;1&opt=clipx;clipy;transp30;zoom75;ROTY290;ROTZ350;trz0;trr0;ctrl;all)
- [Inner detector (without calorimetry)](https://eic.phy.anl.gov/geoviewer/index.htm?nobrowser&file=https://eicweb.phy.anl.gov/api/v4/projects/473/jobs/artifacts/master/raw/geo/inner_detector_geo.root?job=dump_geometry&item=default;1&opt=clipx;clipy;transp30;zoom75;ROTY320;ROTZ340;trz0;trr0;ctrl;all)
- Subsystem views:
- [Calorimetry](https://eic.phy.anl.gov/geoviewer/index.htm?nobrowser&file=https://eicweb.phy.anl.gov/api/v4/projects/473/jobs/artifacts/master/raw/geo/calorimeters_geo.root?job=dump_geometry&item=default;1&opt=clipx;clipy;transp30;zoom120;ROTY320;ROTZ340;trz0;trr0;ctrl;all)
- [PID](https://eic.phy.anl.gov/geoviewer/index.htm?nobrowser&file=https://eicweb.phy.anl.gov/api/v4/projects/473/jobs/artifacts/master/raw/geo/pid_only_geo.root?job=dump_geometry&item=default;1&opt=clipx;clipy;transp30;zoom75;ROTY320;ROTZ340;trz0;trr0;ctrl;all)
- [dRICH](https://eic.phy.anl.gov/geoviewer/index.htm?nobrowser&file=https://eicweb.phy.anl.gov/api/v4/projects/473/jobs/artifacts/master/raw/geo/drich_only_geo.root?job=dump_geometry&item=default;1&opt=clipx;clipy;transp30;zoom75;ROTY290;ROTZ350;trz0;trr0;ctrl;all)
- [pfRICH](https://eic.phy.anl.gov/geoviewer/index.htm?nobrowser&file=https://eicweb.phy.anl.gov/api/v4/projects/473/jobs/artifacts/master/raw/geo/pfrich_only_geo.root?job=dump_geometry&item=default;1&opt=clipx;clipy;transp30;zoom55;ROTY49;ROTZ350;trz0;trr0;ctrl;all&)
- [DIRC](https://eic.phy.anl.gov/geoviewer/index.htm?nobrowser&file=https://eicweb.phy.anl.gov/api/v4/projects/473/jobs/artifacts/master/raw/geo/dirc_only_geo.root?job=dump_geometry&item=default;1&opt=clipx;clipy;transp30;zoom120;ROTY320;ROTZ340;trz0;trr0;ctrl;all)
- [Tracking](https://eic.phy.anl.gov/geoviewer/index.htm?nobrowser&file=https://eicweb.phy.anl.gov/api/v4/projects/473/jobs/artifacts/master/raw/geo/tracking_only_geo.root?job=dump_geometry&item=default;1&opt=clipx;clipy;transp30;zoom75;ROTY320;ROTZ340;trz0;trr0;ctrl;all)
- [Vertex detector](https://eic.phy.anl.gov/geoviewer/index.htm?nobrowser&file=https://eicweb.phy.anl.gov/api/v4/projects/473/jobs/artifacts/master/raw/geo/vertex_only_geo.root?job=dump_geometry&item=default;1&opt=clipx;clipy;transp30;zoom120;ROTY320;ROTZ340;trz0;trr0;ctrl;all)
- [Far-forward](https://eic.phy.anl.gov/geoviewer/index.htm?nobrowser&file=https://eicweb.phy.anl.gov/api/v4/projects/473/jobs/artifacts/master/raw/geo/ip6_only_geo.root?job=dump_geometry&item=default;1&opt=clipx;clipy;transp30;zoom40;ROTY290;ROTZ350;trz0;trr0;ctrl;all)
<a href="https://eicweb.phy.anl.gov/api/v4/projects/473/jobs/artifacts/master/raw/images/view01.pdf?job=report"> <a href="https://eicweb.phy.anl.gov/api/v4/projects/473/jobs/artifacts/master/raw/images/view01.pdf?job=report">
<img src="https://eicweb.phy.anl.gov/api/v4/projects/473/jobs/artifacts/master/raw/images/view01.png?job=report" width="400px" /> <img src="https://eicweb.phy.anl.gov/api/v4/projects/473/jobs/artifacts/master/raw/images/view01.png?job=report" width="400px" />
......
<lccdd> <lccdd>
<comment> Endcap Tracker </comment> <comment> Endcap Tracker for Acadia </comment>
<define> <define>
<constant name="GEMTrackerEndcapP_thickness" value="min(10.0*cm,ForwardTrackingRegion_length)" /> <constant name="GEMTrackerEndcapP_thickness" value="min(10.0*cm,ForwardTrackingRegion_length)" />
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
<include ref="fake_dirc.xml"/> <include ref="fake_dirc.xml"/>
<!--include ref="dirc.xml"/--> <!--include ref="dirc.xml"/-->
<!--include ref="mrich.xml"/-->
<include ref="drich.xml"/> <include ref="drich.xml"/>
<include ref="erich.xml"/> <include ref="erich.xml"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<lccdd>
<define>
<constant name="Pi" value="3.14159265359"/>
<constant name="world_side" value="30*m"/>
<constant name="world_x" value="world_side"/>
<constant name="world_y" value="world_side"/>
<constant name="world_z" value="100*m"/>
<constant name="BeamPipeB0_ID" value="1"/>
<constant name="BeamPipe_ID" value="2"/>
<include ref="ip6/ip6_defs.xml" />
<comment> Change this to 275/100/41 to change the field setup</comment>
<include ref="ip6/far_forward_fields_275.xml" />
<comment>
=====================================
(150-169) Far Forward Detectors
=====================================
Forward B0 Tracker ID: 150 - 153
Forward Roman Pot ID: 155 - 158
Zero Degree Cal. Ecal ID: 163
Zero Degree Cal. Hcal ID: 164
</comment>
<constant name="B0Tracker_Station_1_ID" value="150"/>
<constant name="B0Tracker_Station_2_ID" value="151"/>
<constant name="B0Tracker_Station_3_ID" value="152"/>
<constant name="B0Tracker_Station_4_ID" value="153"/>
<constant name="B0Preshower_Station_1_ID" value="154"/>
<constant name="ForwardRomanPot_Station_1_ID" value="155"/>
<constant name="ForwardRomanPot_Station_2_ID" value="156"/>
<constant name="BeamOrbitTracker_station_1_ID" value="157"/>
<constant name="BeamOrbitTracker_station_2_ID" value="158"/>
<constant name="ForwardOffMTracker_station_1_ID" value="159"/>
<constant name="ForwardOffMTracker_station_2_ID" value="160"/>
<constant name="ForwardOffMTracker_station_3_ID" value="161"/>
<constant name="ForwardOffMTracker_station_4_ID" value="162"/>
<constant name="ffi_ZDC_ECAL_ID" value="163"/>
<constant name="ffi_ZDC_HCAL_ID" value="164"/>
<constant name="VacuumMagnetElement_1_ID" value="165"/>
<constant name="tracker_region_zmax" value="10*m"/>
<constant name="tracker_region_rmax" value="1*m"/>
<comment>
=====================================
(170-189) Forward Beamline Magnets
=====================================
</comment>
<comment>
=====================================
(190-199) Backward Beamline Magnets
=====================================
</comment>
</define>
<includes>
<gdmlFile ref="ip6/elements.xml"/>
<gdmlFile ref="ip6/materials.xml"/>
</includes>
<display>
<include ref="compact/colors.xml" />
<include ref="compact/display.xml" />
</display>
<include ref="ip6/beampipe.xml" />
<include ref="ip6/forward_ion_beamline.xml" />
<include ref="ip6/beampipe_hadron_B0.xml" />
<include ref="ip6/B0_tracker.xml"/>
<include ref="ip6/B0_preshower.xml"/>
<include ref="ip6/far_forward_offM_tracker.xml"/>
<include ref="ip6/far_forward_detectors.xml"/>
<include ref="ip6/roman_pots_eRD24_design.xml"/>
<!--
Old BOM not used
<include ref="ip6/beam_orbit_tracker.xml"/>
-->
<include ref="ip6/inner_vacuum_FF_magnets.xml"/>
<!--
Magnet file not used for some reason
<include ref="ip6/magnets.xml" />
-->
<fields>
<field name="B0PF_Magnet" type="MultipoleMagnet">
<position x="B0PF_XPosition" y="0" z="B0PF_CenterPosition"/>
<rotation x="0" y="B0PF_RotationAngle" z="0"/>
<shape type="Tube" rmin="0.0" rmax="B0PF_InnerRadius" dz="B0PF_Length*0.5"/>
<coefficient coefficient="B0PF_Bmax" skew="0.0*tesla"/>
<coefficient coefficient="B0PF_GradientMax" skew="0.0*tesla/m"/>
</field>
<field name="B0APF_Magnet" type="MultipoleMagnet">
<position x="B0APF_XPosition" y="0" z="B0APF_CenterPosition"/>
<rotation x="0" y="B0APF_RotationAngle" z="0"/>
<shape type="Tube" rmin="0.0" rmax="B0APF_InnerRadius" dz="B0APF_Length*0.5"/>
<coefficient coefficient="B0APF_Bmax" skew="0.0*tesla"/>
<coefficient coefficient="B0APF_GradientMax" skew="0.0*tesla"/>
</field>
<field name="Q1APF_Magnet" type="MultipoleMagnet">
<position x="Q1APF_XPosition" y="0" z="Q1APF_CenterPosition"/>
<rotation x="0" y="Q1APF_RotationAngle" z="0"/>
<shape type="Tube" rmin="0.0" rmax="Q1APF_InnerRadius" dz="Q1APF_Length*0.5"/>
<coefficient coefficient="Q1APF_Bmax" skew="0.0*tesla"/>
<coefficient coefficient="Q1APF_GradientMax" skew="0.0*tesla/m"/>
</field>
<field name="Q1BPF_Magnet" type="MultipoleMagnet">
<position x="Q1BPF_XPosition" y="0" z="Q1BPF_CenterPosition"/>
<rotation x="0" y="Q1BPF_RotationAngle" z="0"/>
<shape type="Tube" rmin="0.0" rmax="Q1BPF_InnerRadius" dz="Q1BPF_Length*0.5"/>
<coefficient coefficient="Q1BPF_Bmax" skew="0.0*tesla"/>
<coefficient coefficient="Q1BPF_GradientMax" skew="0.0*tesla/m"/>
</field>
<field name="Q2PF_Magnet" type="MultipoleMagnet">
<position x="Q2PF_XPosition" y="0" z="Q2PF_CenterPosition"/>
<rotation x="0" y="Q2PF_RotationAngle" z="0"/>
<shape type="Tube" rmin="0.0" rmax="Q2PF_InnerRadius" dz="Q2PF_Length*0.5"/>
<coefficient coefficient="Q2PF_Bmax" skew="0.0*tesla"/>
<coefficient coefficient="Q2PF_GradientMax" skew="0.0*tesla/m"/>
</field>
<field name="B1PF_Magnet" type="MultipoleMagnet">
<position x="B1PF_XPosition" y="0" z="B1PF_CenterPosition"/>
<rotation x="0" y="B1PF_RotationAngle" z="0"/>
<shape type="Tube" rmin="0.0" rmax="B1PF_InnerRadius" dz="B1PF_Length*0.5"/>
<coefficient coefficient="B1PF_Bmax" skew="0.0*tesla"/>
<coefficient coefficient="B1PF_GradientMax" skew="0.0*tesla/m"/>
</field>
<field name="B1APF_Magnet" type="MultipoleMagnet">
<position x="B1APF_XPosition" y="0" z="B1APF_CenterPosition"/>
<rotation x="0" y="B1APF_RotationAngle" z="0"/>
<shape type="Tube" rmin="0.0" rmax="B1APF_InnerRadius" dz="B1APF_Length*0.5"/>
<coefficient coefficient="B1APF_Bmax" skew="0.0*tesla"/>
<coefficient coefficient="B1APF_GradientMax" skew="0.0*tesla/m"/>
</field>
<field name="B2PF_Magnet" type="MultipoleMagnet">
<position x="B2PF_XPosition" y="0" z="B2PF_CenterPosition"/>
<rotation x="0" y="B2PF_RotationAngle" z="0"/>
<shape type="Tube" rmin="0.0" rmax="B2PF_InnerRadius" dz="B2PF_Length*0.5"/>
<coefficient coefficient="B2PF_Bmax" skew="0.0*tesla"/>
<coefficient coefficient="B2PF_GradientMax" skew="0.0*tesla/cm"/>
</field>
</fields>
</lccdd>
File moved
File moved
...@@ -21,7 +21,7 @@ using namespace dd4hep; ...@@ -21,7 +21,7 @@ using namespace dd4hep;
using namespace dd4hep::detail; using namespace dd4hep::detail;
typedef ROOT::Math::XYPoint Point; typedef ROOT::Math::XYPoint Point;
// fiber placement helpers, defined in BarrelCalorimeterHybrid_geo // fiber placement helpers, defined below
vector<vector<Point>> fiberPositions(double radius, double x_spacing, double z_spacing, vector<vector<Point>> fiberPositions(double radius, double x_spacing, double z_spacing,
double x, double z, double phi, double spacing_tol = 1e-2); double x, double z, double phi, double spacing_tol = 1e-2);
std::pair<int, int> getNdivisions(double x, double z, double dx, double dz); std::pair<int, int> getNdivisions(double x, double z, double dx, double dz);
...@@ -333,5 +333,116 @@ void buildSupport(Detector& desc, Volume &mod_vol, xml_comp_t x_support, ...@@ -333,5 +333,116 @@ void buildSupport(Detector& desc, Volume &mod_vol, xml_comp_t x_support,
mod_vol.placeVolume(env_vol, Position(0.0, 0.0, l_pos_z + support_thickness/2.)); mod_vol.placeVolume(env_vol, Position(0.0, 0.0, l_pos_z + support_thickness/2.));
} }
// Fill fiber lattice into trapezoid starting from position (0,0) in x-z coordinate system
vector<vector<Point>> fiberPositions(double radius, double x_spacing, double z_spacing, double x, double z, double phi,
double spacing_tol)
{
// z_spacing - distance between fiber layers in z
// x_spacing - distance between fiber centers in x
// x - half-length of the shorter (bottom) base of the trapezoid
// z - height of the trapezoid
// phi - angle between z and trapezoid arm
vector<vector<Point>> positions;
int z_layers = floor((z / 2 - radius - spacing_tol) / z_spacing); // number of layers that fit in z/2
double z_pos = 0.;
double x_pos = 0.;
for (int l = -z_layers; l < z_layers + 1; l++) {
vector<Point> xline;
z_pos = l * z_spacing;
double x_max = x + (z / 2. + z_pos) * tan(phi) - spacing_tol; // calculate max x at particular z_pos
(l % 2 == 0) ? x_pos = 0. : x_pos = x_spacing / 2; // account for spacing/2 shift
while (x_pos < (x_max - radius)) {
xline.push_back(Point(x_pos, z_pos));
if (x_pos != 0.)
xline.push_back(Point(-x_pos, z_pos)); // using symmetry around x=0
x_pos += x_spacing;
}
// Sort fiber IDs for a better organization
sort(xline.begin(), xline.end(), [](const Point& p1, const Point& p2) { return p1.x() < p2.x(); });
positions.emplace_back(std::move(xline));
}
return positions;
}
// Calculate number of divisions for the readout grid for the fiber layers
std::pair<int, int> getNdivisions(double x, double z, double dx, double dz)
{
// x and z defined as in vector<Point> fiberPositions
// dx, dz - size of the grid in x and z we want to get close to with the polygons
// See also descripltion when the function is called
double SiPMsize = 13.0 * mm;
double grid_min = SiPMsize + 3.0 * mm;
if (dz < grid_min) {
dz = grid_min;
}
if (dx < grid_min) {
dx = grid_min;
}
int nfit_cells_z = floor(z / dz);
int n_cells_z = nfit_cells_z;
if (nfit_cells_z == 0)
n_cells_z++;
int nfit_cells_x = floor((2 * x) / dx);
int n_cells_x = nfit_cells_x;
if (nfit_cells_x == 0)
n_cells_x++;
return std::make_pair(n_cells_x, n_cells_z);
}
// Calculate dimensions of the polygonal grid in the cartesian coordinate system x-z
vector<tuple<int, Point, Point, Point, Point>> gridPoints(int div_x, int div_z, double x, double z, double phi)
{
// x, z and phi defined as in vector<Point> fiberPositions
// div_x, div_z - number of divisions in x and z
double dz = z / div_z;
std::vector<std::tuple<int, Point, Point, Point, Point>> points;
for (int iz = 0; iz < div_z + 1; iz++) {
for (int ix = 0; ix < div_x + 1; ix++) {
double A_z = -z / 2 + iz * dz;
double B_z = -z / 2 + (iz + 1) * dz;
double len_x_for_z = 2 * (x + iz * dz * tan(phi));
double len_x_for_z_plus_1 = 2 * (x + (iz + 1) * dz * tan(phi));
double dx_for_z = len_x_for_z / div_x;
double dx_for_z_plus_1 = len_x_for_z_plus_1 / div_x;
double A_x = -len_x_for_z / 2. + ix * dx_for_z;
double B_x = -len_x_for_z_plus_1 / 2. + ix * dx_for_z_plus_1;
double C_z = B_z;
double D_z = A_z;
double C_x = B_x + dx_for_z_plus_1;
double D_x = A_x + dx_for_z;
int id = ix + div_x * iz;
auto A = Point(A_x, A_z);
auto B = Point(B_x, B_z);
auto C = Point(C_x, C_z);
auto D = Point(D_x, D_z);
// vertex points filled in the clock-wise direction
points.push_back(make_tuple(id, A, B, C, D));
}
}
return points;
}
DECLARE_DETELEMENT(athena_EcalBarrelInterlayers, create_detector) DECLARE_DETELEMENT(athena_EcalBarrelInterlayers, create_detector)
File moved
...@@ -313,4 +313,5 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec ...@@ -313,4 +313,5 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec
}; };
// clang-format off // clang-format off
DECLARE_DETELEMENT(athena_PfRICH, createDetector)
DECLARE_DETELEMENT(athena_ERICH, createDetector) DECLARE_DETELEMENT(athena_ERICH, createDetector)
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
// //
//========================================================================== //==========================================================================
// //
// Modified for TOPSiDE detector // Modified for ATHENA detector
// //
//========================================================================== //==========================================================================
#include "DD4hep/DetFactoryHelper.h" #include "DD4hep/DetFactoryHelper.h"
...@@ -129,3 +129,4 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s ...@@ -129,3 +129,4 @@ static Ref_t create_detector(Detector& description, xml_h e, SensitiveDetector s
// clang-format off // clang-format off
DECLARE_DETELEMENT(athena_PolyhedraEndcapCalorimeter2, create_detector) DECLARE_DETELEMENT(athena_PolyhedraEndcapCalorimeter2, create_detector)
DECLARE_DETELEMENT(athena_PolyhedraEndcapCalorimeter, create_detector)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment