From 30156e91f13f2db928ec000065961479925fa0d4 Mon Sep 17 00:00:00 2001 From: Samuel Henry Date: Fri, 22 Aug 2025 14:41:32 +0100 Subject: [PATCH 1/4] Implemented curved silicon surface for OB --- SimpleCurved_silicon_barrel.xml | 201 ++++++++++++++++++++++ TestOB.C | 7 + TestOB.sh | 4 + compact/tracking/silicon_barrel.xml | 234 ++++++++++++++------------ epic_craterlake_tracking_only_cut.xml | 137 +++++++++++++++ src/BarrelTrackerWithFrame_geo.cpp | 50 ++++-- 6 files changed, 513 insertions(+), 120 deletions(-) create mode 100644 SimpleCurved_silicon_barrel.xml create mode 100644 TestOB.C create mode 100755 TestOB.sh create mode 100644 epic_craterlake_tracking_only_cut.xml diff --git a/SimpleCurved_silicon_barrel.xml b/SimpleCurved_silicon_barrel.xml new file mode 100644 index 0000000000..df29cd1edc --- /dev/null +++ b/SimpleCurved_silicon_barrel.xml @@ -0,0 +1,201 @@ + + + + + + + Main parameters - this is for the more realistic June 2022 design + + + + + + + + + + + + + + + + + + + + Actual parametrization + + + + 84cm=2*42cm is the engineer max + + + + + + + + + + + + + + + + + + + + ### Actual detectors + + + + + Silicon Barrel Modules + + + + + + + Layers composed of many arrayed modules + + + + + + phi0 : Starting phi of first module. + phi_tilt : Phi tilt of a module. + rc : Radius of the module center. + nphi : Number of modules in phi. + rphi_dr : The delta radius of every other module. + z0 : Z position of first module in phi. + nz : Number of modules to place in z. + dr : Radial displacement parameter, of every other module. + + + + + + + ### Actual detectors + + + + + Silicon Barrel Modules + + + + + + + Layers composed of many arrayed modules + + + + + + phi0 : Starting phi of first module. + phi_tilt : Phi tilt of a module. + rc : Radius of the module center. + nphi : Number of modules in phi. + rphi_dr : The delta radius of every other module. + z0 : Z position of first module in phi. + nz : Number of modules to place in z. + dr : Radial displacement parameter, of every other module. + + + + + + + + + + + + + + + + + + + + + + + + + system:8,layer:4,module:12,sensor:2,phi:32:-16,z:-16 + + + + diff --git a/TestOB.C b/TestOB.C new file mode 100644 index 0000000000..bb0b45dd5b --- /dev/null +++ b/TestOB.C @@ -0,0 +1,7 @@ +void TestOB(){ + TFile* eicFile = new TFile("reconTest.edm4eic.root"); + TTree* eicTree = (TTree*)eicFile->Get("events"); + eicTree->Draw("CentralCKFTrajectories.nMeasurements>>nM"); + auto h0 = (TH1I*)gPad->GetPrimitive("nM"); + cout << "Mean nMeasurements: " << h0->GetMean() << endl; +} diff --git a/TestOB.sh b/TestOB.sh new file mode 100755 index 0000000000..4858f83021 --- /dev/null +++ b/TestOB.sh @@ -0,0 +1,4 @@ +#!/bin/bash +ddsim --compactFile epic_craterlake_tracking_only_cut.xml --outputFile test.edm4hep.root --numberOfEvents 1000 --enableGun --gun.thetaMin 50*deg --gun.thetaMax 130*deg --gun.distribution eta --gun.particle pi- --gun.momentumMin 10*GeV --gun.momentumMax 10*GeV --gun.multiplicity 1 +eicrecon -Pnthreads=1 -Pjana:debug_plugin_loading=1 -Ppodio:output_file=reconTest.edm4eic.root -Pdd4hep:xml_files=epic_craterlake_tracking_only_cut.xml -Ppodio:output_collections="MCParticles,CentralCKFTrajectories,CentralCKFTrackParameters,CentralCKFSeededTrackParameters,CentralCKFTruthSeededTrackParameters,CentralTrackVertices,ReconstructedChargedParticles,ReconstructedChargedParticleAssociations" test.edm4hep.root +root -b TestOB.C reconTest.edm4eic.root diff --git a/compact/tracking/silicon_barrel.xml b/compact/tracking/silicon_barrel.xml index 4fbce770b5..f45dd14b4c 100644 --- a/compact/tracking/silicon_barrel.xml +++ b/compact/tracking/silicon_barrel.xml @@ -7,48 +7,59 @@ Main parameters - this is for the more realistic June 2022 design - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + Actual parametrization - + 84cm=2*42cm is the engineer max - + + + + + + + + + + + + + + + - - - + + + + - - - - - - - - - ### Actual detectors + ### Actual detectors - + Silicon Barrel Modules - - - + + + + + - Layers composed of many arrayed modules - + Layers composed of many arrayed modules + - - + + - phi0 : Starting phi of first module. + phi0 : Starting phi of first module. phi_tilt : Phi tilt of a module. - rc : Radius of the module center. - nphi : Number of modules in phi. - rphi_dr : The delta radius of every other module. - z0 : Z position of first module in phi. - nz : Number of modules to place in z. - dr : Radial displacement parameter, of every other module. + rc : Radius of the module center. + nphi : Number of modules in phi. + rphi_dr : The delta radius of every other module. + z0 : Z position of first module in phi. + nz : Number of modules to place in z. + dr : Radial displacement parameter, of every other module. - - + + - ### Actual detectors + ### Actual detectors - + Silicon Barrel Modules - - + + material="Aluminum" + sensitive="false" + width="SiBarrelStave2_width" + length="SiBarrelMod2_length" + thickness="SiBarrelMod2Service_thickness" + vis="TrackerLayerVis" /> + + - Layers composed of many arrayed modules - + + Layers composed of many arrayed modules + - phi0 : Starting phi of first module. + phi0 : Starting phi of first module. phi_tilt : Phi tilt of a module. - rc : Radius of the module center. - nphi : Number of modules in phi. - rphi_dr : The delta radius of every other module. - z0 : Z position of first module in phi. - nz : Number of modules to place in z. - dr : Radial displacement parameter, of every other module. + rc : Radius of the module center. + nphi : Number of modules in phi. + rphi_dr : The delta radius of every other module. + z0 : Z position of first module in phi. + nz : Number of modules to place in z. + dr : Radial displacement parameter, of every other module. - - + + - - + + - - + + - - + + - - system:8,layer:4,module:12,sensor:2,x:32:-12,y:-20 + + system:8,layer:4,module:12,sensor:2,phi:32:-16,z:-16 + + diff --git a/epic_craterlake_tracking_only_cut.xml b/epic_craterlake_tracking_only_cut.xml new file mode 100644 index 0000000000..e72ce606ff --- /dev/null +++ b/epic_craterlake_tracking_only_cut.xml @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + # EPIC Detector + - https://github.com/eic/epic + - https://github.com/eic/ip6 + + + + + EPIC + + + + + + + + ## Main Constant Definitions + + The ip6 (or other ip) defines should be included first. + These files have only a define tags. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ## World Volume + + The world is a simple box, but could be a union of multiple regions. + + + + + + + + + ## Detector Subsystems + + ### IP Subsystems + + The interaction point subsystems are included before the central detector subsystems. + This is becuase the IP subsystems, for example the beampipe, will define paramters + which are subsquently used in the central detector construction -- e.g. the vertex tracker + uses the beampipe OD to help define its placement. + + The IP subsystems include the Far forward and backward regions. The list of subsystem includes: + - Interaction region beampipe + - B0 tracker + - Off-momentum tracker + - Far forward roman pots + - Zero Degree Calorimeter + - Beam line magnets. + - and more... + + + + + ## Electric and magnetic fields + + + + + ## Central tracking detectors + + + + + + + + + ## Central beam pipe + + + + diff --git a/src/BarrelTrackerWithFrame_geo.cpp b/src/BarrelTrackerWithFrame_geo.cpp index 0d0665279d..1eb190cf39 100644 --- a/src/BarrelTrackerWithFrame_geo.cpp +++ b/src/BarrelTrackerWithFrame_geo.cpp @@ -173,24 +173,40 @@ static Ref_t create_BarrelTrackerWithFrame(Detector& description, xml_h e, Sensi xml_comp_t x_pos = x_comp.position(false); xml_comp_t x_rot = x_comp.rotation(false); const string c_nam = _toString(ncomponents, "component%d"); - Box c_box(x_comp.width() / 2, x_comp.length() / 2, x_comp.thickness() / 2); - Volume c_vol(c_nam, c_box, description.material(x_comp.materialStr())); - - // Utility variable for the relative z-offset based off the previous components - const double zoff = thickness_sum + x_comp.thickness() / 2.0; - if (x_pos && x_rot) { - Position c_pos(x_pos.x(0), x_pos.y(0), x_pos.z(0) + zoff); - RotationZYX c_rot(x_rot.z(0), x_rot.y(0), x_rot.x(0)); - pv = m_vol.placeVolume(c_vol, Transform3D(c_rot, c_pos)); - } else if (x_rot) { - Position c_pos(0, 0, zoff); - pv = m_vol.placeVolume(c_vol, - Transform3D(RotationZYX(x_rot.z(0), x_rot.y(0), x_rot.x(0)), c_pos)); - } else if (x_pos) { - pv = m_vol.placeVolume(c_vol, Position(x_pos.x(0), x_pos.y(0), x_pos.z(0) + zoff)); - } else { - pv = m_vol.placeVolume(c_vol, Position(0, 0, zoff)); + + Volume c_vol; + if(x_comp.nameStr().find("CurvedSilicon") != std::string::npos){ + double c_rmin = x_comp.radius(); // radius of curvature in cm + double c_phi0 = x_comp.phi0(); // start and stop angle of segment in rad - zero is centre of stave + double c_phi1 = x_comp.phi1(); + double c_z0 = x_comp.offset(); // position of centre of cylinder in cm ( = radius of curvature - maximum height of curved surface above flat base) + Tube c_tube(c_rmin, c_rmin + x_comp.thickness(), x_comp.length()/2, M_PI/2 + c_phi0, M_PI/2 + c_phi1); + c_vol = Volume(c_nam, c_tube, description.material(x_comp.materialStr())); + const double zoff = thickness_sum + x_comp.thickness() / 2.0; + Position c_pos(0,0,c_z0 + zoff); + RotationZYX c_rot(0,0,M_PI/2); + pv = m_vol.placeVolume(c_vol, Transform3D(c_rot, c_pos)); } + else { + Box c_box(x_comp.width() / 2, x_comp.length() / 2, x_comp.thickness() / 2); + c_vol = Volume (c_nam, c_box, description.material(x_comp.materialStr())); + + // Utility variable for the relative z-offset based off the previous components + const double zoff = thickness_sum + x_comp.thickness() / 2.0; + if (x_pos && x_rot) { + Position c_pos(x_pos.x(0), x_pos.y(0), x_pos.z(0) + zoff); + RotationZYX c_rot(x_rot.z(0), x_rot.y(0), x_rot.x(0)); + pv = m_vol.placeVolume(c_vol, Transform3D(c_rot, c_pos)); + } else if (x_rot) { + Position c_pos(0, 0, zoff); + pv = m_vol.placeVolume(c_vol, Transform3D(RotationZYX(x_rot.z(0), x_rot.y(0), x_rot.x(0)), c_pos)); + } else if (x_pos) { + pv = m_vol.placeVolume(c_vol, Position(x_pos.x(0), x_pos.y(0), x_pos.z(0) + zoff)); + } else { + pv = m_vol.placeVolume(c_vol, Position(0, 0, zoff)); + } + } + c_vol.setRegion(description, x_comp.regionStr()); c_vol.setLimitSet(description, x_comp.limitsStr()); c_vol.setVisAttributes(description, x_comp.visStr()); From 74dde3d7297cfce9b7919fc4b74031a7a6e18828 Mon Sep 17 00:00:00 2001 From: Samuel Henry <167965843+henryg7vdj@users.noreply.github.com> Date: Fri, 22 Aug 2025 15:01:47 +0100 Subject: [PATCH 2/4] Update README.md --- README.md | 101 ++++++++++++++++++------------------------------------ 1 file changed, 34 insertions(+), 67 deletions(-) diff --git a/README.md b/README.md index 1f14ae3259..525b73fea1 100644 --- a/README.md +++ b/README.md @@ -1,82 +1,49 @@ -[![CI status](https://github.com/eic/epic/actions/workflows/linux-eic-shell.yml/badge.svg)](https://github.com/eic/epic/actions/workflows/linux-eic-shell.yml) - -Overview --------- - -craterlake - -**Detector geometry:** -- [Empty viewer](https://eic.github.io/epic/geoviewer) -- Craterlake: [viewer](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_craterlake.root&item=default;1&opt=clipx;clipy;transp30;zoom120;ROTY320;ROTZ340;trz0;trr0;ctrl;all) [tgeo](https://eic.github.io/epic//artifacts/tgeo/epic_craterlake.root) [step](https://eic.github.io/epic//artifacts/epic_craterlake_no_bhcal.stp/epic_craterlake_no_bhcal.stp) -- Subsystems: - - Inner detector: [viewer](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_inner_detector.root&item=default;1&opt=clipx;clipy;transp30;zoom120;ROTY320;ROTZ340;trz0;trr0;ctrl;all) [tgeo](https://eic.github.io/epic//artifacts/tgeo/epic_inner_detector.root) - - Calorimetry: [viewer](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_calorimeters.root&item=default;1&opt=clipx;clipy;transp30;zoom120;ROTY320;ROTZ340;trz0;trr0;ctrl;all) [tgeo](https://eic.github.io/epic//artifacts/tgeo/epic_calorimeters.root) - - Imaging: [viewer](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_imaging_only.root&item=default;1&opt=clipx;clipy;transp30;zoom55;ROTY49;ROTZ350;trz0;trr0;ctrl;all) [tgeo](https://eic.github.io/epic//artifacts/tgeo/epic_imaging.root) [step](https://eic.github.io/epic//artifacts/epic_imaging_only.stp/epic_imaging_only.stp) - - PID: [viewer](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_pid_only.root&item=default;1&opt=clipx;clipy;transp30;zoom75;ROTY320;ROTZ340;trz0;trr0;ctrl;all) [tgeo](https://eic.github.io/epic//artifacts/tgeo/epic_pid_only.root) - - dRICH: [viewer](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_drich_only.root&item=default;1&opt=clipx;clipy;transp30;zoom75;ROTY290;ROTZ350;trz0;trr0;ctrl;all) [tgeo](https://eic.github.io/epic//artifacts/tgeo/epic_drich_only.root) [step](https://eic.github.io/epic//artifacts/epic_drich_only.stp/epic_drich_only.stp) - - pfRICH: [viewer](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_pfrich_only.root&item=default;1&opt=clipx;clipy;transp30;zoom55;ROTY49;ROTZ350;trz0;trr0;ctrl;all) [tgeo](https://eic.github.io/epic//artifacts/tgeo/epic_pfrich_only.root) - - DIRC: [viewer](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_dirc_only.root&item=default;1&opt=clipx;clipy;transp30;zoom120;ROTY320;ROTZ340;trz0;trr0;ctrl;all) [tgeo](https://eic.github.io/epic//artifacts/tgeo/epic_dirc_only.root) [step](https://eic.github.io/epic//artifacts/epic_dirc_only.stp/epic_dirc_only.stp) - - Tracking: [viewer](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_craterlake_tracking_only.root&item=default;1&opt=clipx;clipy;transp30;zoom75;ROTY320;ROTZ340;trz0;trr0;ctrl;all) [tgeo](https://eic.github.io/epic//artifacts/tgeo/epic_craterlake_tracking_only.root) [step](https://eic.github.io/epic//artifacts/epic_craterlake_tracking_only.stp/epic_craterlake_tracking_only.stp) - - Vertex: [viewer](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_vertex_only.root&item=default;1&opt=clipx;clipy;transp30;zoom120;ROTY320;ROTZ340;trz0;trr0;ctrl;all) [tgeo](https://eic.github.io/epic//artifacts/tgeo/epic_vertex_only.root) - - TOF: [viewer](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_tof_only.root&item=default;1&opt=clipx;clipy;transp30;zoom55;ROTY49;ROTZ350;trz0;trr0;ctrl;all) [tgeo](https://eic.github.io/epic//artifacts/tgeo/epic_tof_only.root) - - Beamline: [viewer](https://eic.github.io/epic/geoviewer?nobrowser&file=artifacts/tgeo/epic_ip6.root&item=default;1&opt=clipx;clipy;transp30;zoom40;ROTY290;ROTZ350;trz0;trr0;ctrl;all) [tgeo](https://eic.github.io/epic//artifacts/tgeo/epic_ip6.root) [step](https://eic.github.io/epic//artifacts/epic_ip6.stp/epic_ip6.stp) - -**Detector parameters:** -- Craterlake: [text](https://eic.github.io/epic/artifacts/constants/epic_craterlake_constants.out) [toml](https://eic.github.io/epic/artifacts/constants/epic_craterlake_constants.toml) [csv](https://eic.github.io/epic/artifacts/DetectorParameterTable/epic_craterlake.csv) [html](https://eic.github.io/epic/artifacts/DetectorParameterTable/epic_craterlake.html) - -Getting Started ---------------- - -Get a copy of the latest version from this repository: -```bash -git clone https://github.com/eic/epic.git -``` +Curved OB geometry test +----------------------- -### Compilation +This branch has been created by Sam Henry to test a new outer barrel geometry with curved silicon surface. -To configure, build, and install the geometry (to the `install` directory), use the following commands: -```bash -cmake -B build -S . -DCMAKE_INSTALL_PREFIX=install -cmake --build build -cmake --install build -``` -To load the geometry, you can use the scripts in the `install` directory: -```bash -source install/bin/thisepic.sh -``` +The OB stave structure has replaced the flat silicon surface with a curved surface. The carbon fibre frame has been replaced with a flat layer. The staves are no longer tilted and are positioned alternately at radii separated by 6mm. -### Adding/changing detector geometry +In this test, the curved silicon surface for each stave is modelled as a single module - a segment of a cylinder with a radius of 80mm. In the final version we will include the top and bottom layers of the stave with 4 modules for L3 and 8 for L4. -Hint: **Use the CI/CD pipelines**. +This is not yet working - eicrecon does not see the outer barrel hits. -To avoid dealing with setting up all the dependencies, we recommend using the continuous integration/continuous deployment (CI/CD) pipelines to make changes and assess their effects. Any feedback to help this process is appreciated. +**Modified files:** -Here is how to begin: +```src/BarrelTrackerWithFrame_geo.cpp``` -1. Look at existing detector constructions and reuse if possible. Note that "compact detector descriptions" -> xml files, and "detector construction" -> cpp file. -2. Modify xml file or detector construction. -3. Create a WIP (or draft) merge request or pull request and look at the CI output for debugging. Then go to back to 2 if changes are needed. -4. Remove the WIP/Draft part of the merge request if you would like to see your changes merged into the main. +```compact/tracking/silicon_barrel.xml``` -See: +**Additional files:** -- [Talk at computing round table](https://indico.jlab.org/event/420/#17-automated-workflow-for-end) +```SimpleCurved_silicon_barrel.xml``` - alternative version of silicon_barrel.xml with a simpler curved model where all staves are segments of a single big cylinder. -### Compiling (avoid it) +```TestOB.sh``` - script to test the geometry, using ```TestOB.C``` and ```epic_craterlake_tracking_only_cut.xml``` -First, see if the use case above is best for you. It most likely is and can save a lot of time for newcomers. -To run the simulation locally, we suggest using the singularity image. -More details can be found at the links below: -- https://dd4hep.web.cern.ch/dd4hep/page/beginners-guide/ -- https://eic.phy.anl.gov/tutorials/eic_tutorial/ -- https://eicweb.phy.anl.gov/containers/eic_container/ +The test script runs a simulation shooting 1000 muons through the vertex and silicon barrels. It then runs eicrecon and prints the mean of CentralCKFTrajectories.nMeasurements - i.e. the number the barrels the tracks go through. If everything is well, this should be close to 5. If eicrecon is not seeing the outer barrels, it will be 3 -Related useful links --------------------- +**Tests** + +Control test with epic-main geometry +``` +source /opt/detector/epic-main/bin/thisepic.sh +./TestOB.sh +``` +Mean nMeasurements: 5.02398 -- [EIC tutorial](https://eic.phy.anl.gov/tutorials/eic_tutorial) -- [DD4hep repository](https://github.com/AIDAsoft/DD4hep) -- [DD4hep user manual](https://dd4hep.web.cern.ch/dd4hep/usermanuals/DD4hepManual/DD4hepManual.pdf) -- [ACTS DD4hep plugin documentation](https://acts.readthedocs.io/en/latest/plugins/dd4hep.html) +Test new curved model +``` +source install/bin/thisepic.sh +./TestOB.sh + +Mean nMeasurements: 3 +``` +Test simple curved model +``` +cp SimpleCurved_silicon_barrel.xml install/share/epic/compact/tracking/silicon_barrel.xml +./TestOB.sh +``` +Mean nMeasurements: 4.947 From c93d2fe015a2cbf094722a6f7419b92835b48000 Mon Sep 17 00:00:00 2001 From: Samuel Henry <167965843+henryg7vdj@users.noreply.github.com> Date: Fri, 22 Aug 2025 15:11:28 +0100 Subject: [PATCH 3/4] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 525b73fea1..297cb985d0 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,8 @@ The test script runs a simulation shooting 1000 muons through the vertex and sil **Tests** +Run tests in eic-shell --version 25.07.0-stable . In the latest version, eicrecon generates errors and the control test fails, presumably due to issues with a new ACTs version. + Control test with epic-main geometry ``` source /opt/detector/epic-main/bin/thisepic.sh From 34e09ae2e63a8c7dc6beacbfb81bcc602713b475 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 22 Aug 2025 14:45:38 +0000 Subject: [PATCH 4/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- README.md | 6 +-- SimpleCurved_silicon_barrel.xml | 10 ++-- TestOB.C | 2 +- compact/tracking/silicon_barrel.xml | 10 ++-- epic_craterlake_tracking_only_cut.xml | 4 +- src/BarrelTrackerWithFrame_geo.cpp | 68 ++++++++++++++------------- 6 files changed, 52 insertions(+), 48 deletions(-) diff --git a/README.md b/README.md index 297cb985d0..4f44ddeb3b 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This branch has been created by Sam Henry to test a new outer barrel geometry wi The OB stave structure has replaced the flat silicon surface with a curved surface. The carbon fibre frame has been replaced with a flat layer. The staves are no longer tilted and are positioned alternately at radii separated by 6mm. -In this test, the curved silicon surface for each stave is modelled as a single module - a segment of a cylinder with a radius of 80mm. In the final version we will include the top and bottom layers of the stave with 4 modules for L3 and 8 for L4. +In this test, the curved silicon surface for each stave is modelled as a single module - a segment of a cylinder with a radius of 80mm. In the final version we will include the top and bottom layers of the stave with 4 modules for L3 and 8 for L4. This is not yet working - eicrecon does not see the outer barrel hits. @@ -27,7 +27,7 @@ The test script runs a simulation shooting 1000 muons through the vertex and sil **Tests** -Run tests in eic-shell --version 25.07.0-stable . In the latest version, eicrecon generates errors and the control test fails, presumably due to issues with a new ACTs version. +Run tests in eic-shell --version 25.07.0-stable . In the latest version, eicrecon generates errors and the control test fails, presumably due to issues with a new ACTs version. Control test with epic-main geometry ``` @@ -45,7 +45,7 @@ Mean nMeasurements: 3 ``` Test simple curved model ``` -cp SimpleCurved_silicon_barrel.xml install/share/epic/compact/tracking/silicon_barrel.xml +cp SimpleCurved_silicon_barrel.xml install/share/epic/compact/tracking/silicon_barrel.xml ./TestOB.sh ``` Mean nMeasurements: 4.947 diff --git a/SimpleCurved_silicon_barrel.xml b/SimpleCurved_silicon_barrel.xml index df29cd1edc..c296a89fb6 100644 --- a/SimpleCurved_silicon_barrel.xml +++ b/SimpleCurved_silicon_barrel.xml @@ -70,7 +70,7 @@ height="SiBarrelMod1Frame_height" length="SiBarrelMod1_length" thickness="SiBarrelMod1Frame_thickness" /> - + - - + + Layers composed of many arrayed modules - + diff --git a/TestOB.C b/TestOB.C index bb0b45dd5b..efa3999d0a 100644 --- a/TestOB.C +++ b/TestOB.C @@ -1,4 +1,4 @@ -void TestOB(){ +void TestOB() { TFile* eicFile = new TFile("reconTest.edm4eic.root"); TTree* eicTree = (TTree*)eicFile->Get("events"); eicTree->Draw("CentralCKFTrajectories.nMeasurements>>nM"); diff --git a/compact/tracking/silicon_barrel.xml b/compact/tracking/silicon_barrel.xml index f45dd14b4c..7d49d5d6b9 100644 --- a/compact/tracking/silicon_barrel.xml +++ b/compact/tracking/silicon_barrel.xml @@ -74,14 +74,14 @@ length="SiBarrelLayer1_length" /> Silicon Barrel Modules - + + vis="TrackerLayerVis" /> - + Layers composed of many arrayed modules @@ -166,7 +166,7 @@ length="SiBarrelMod2_length" thickness="SiBarrelSensor_thickness" vis="TrackerLayerVis" /> - + Layers composed of many arrayed modules @@ -203,7 +203,7 @@ - + diff --git a/epic_craterlake_tracking_only_cut.xml b/epic_craterlake_tracking_only_cut.xml index e72ce606ff..a97f047fb0 100644 --- a/epic_craterlake_tracking_only_cut.xml +++ b/epic_craterlake_tracking_only_cut.xml @@ -119,7 +119,7 @@ ## Electric and magnetic fields - + ## Central tracking detectors @@ -128,7 +128,7 @@ - + ## Central beam pipe diff --git a/src/BarrelTrackerWithFrame_geo.cpp b/src/BarrelTrackerWithFrame_geo.cpp index 1eb190cf39..cb292c3df1 100644 --- a/src/BarrelTrackerWithFrame_geo.cpp +++ b/src/BarrelTrackerWithFrame_geo.cpp @@ -173,40 +173,44 @@ static Ref_t create_BarrelTrackerWithFrame(Detector& description, xml_h e, Sensi xml_comp_t x_pos = x_comp.position(false); xml_comp_t x_rot = x_comp.rotation(false); const string c_nam = _toString(ncomponents, "component%d"); - + Volume c_vol; - if(x_comp.nameStr().find("CurvedSilicon") != std::string::npos){ - double c_rmin = x_comp.radius(); // radius of curvature in cm - double c_phi0 = x_comp.phi0(); // start and stop angle of segment in rad - zero is centre of stave - double c_phi1 = x_comp.phi1(); - double c_z0 = x_comp.offset(); // position of centre of cylinder in cm ( = radius of curvature - maximum height of curved surface above flat base) - Tube c_tube(c_rmin, c_rmin + x_comp.thickness(), x_comp.length()/2, M_PI/2 + c_phi0, M_PI/2 + c_phi1); - c_vol = Volume(c_nam, c_tube, description.material(x_comp.materialStr())); - const double zoff = thickness_sum + x_comp.thickness() / 2.0; - Position c_pos(0,0,c_z0 + zoff); - RotationZYX c_rot(0,0,M_PI/2); - pv = m_vol.placeVolume(c_vol, Transform3D(c_rot, c_pos)); - } - else { - Box c_box(x_comp.width() / 2, x_comp.length() / 2, x_comp.thickness() / 2); - c_vol = Volume (c_nam, c_box, description.material(x_comp.materialStr())); - - // Utility variable for the relative z-offset based off the previous components - const double zoff = thickness_sum + x_comp.thickness() / 2.0; - if (x_pos && x_rot) { - Position c_pos(x_pos.x(0), x_pos.y(0), x_pos.z(0) + zoff); - RotationZYX c_rot(x_rot.z(0), x_rot.y(0), x_rot.x(0)); - pv = m_vol.placeVolume(c_vol, Transform3D(c_rot, c_pos)); - } else if (x_rot) { - Position c_pos(0, 0, zoff); - pv = m_vol.placeVolume(c_vol, Transform3D(RotationZYX(x_rot.z(0), x_rot.y(0), x_rot.x(0)), c_pos)); - } else if (x_pos) { - pv = m_vol.placeVolume(c_vol, Position(x_pos.x(0), x_pos.y(0), x_pos.z(0) + zoff)); - } else { - pv = m_vol.placeVolume(c_vol, Position(0, 0, zoff)); - } + if (x_comp.nameStr().find("CurvedSilicon") != std::string::npos) { + double c_rmin = x_comp.radius(); // radius of curvature in cm + double c_phi0 = + x_comp.phi0(); // start and stop angle of segment in rad - zero is centre of stave + double c_phi1 = x_comp.phi1(); + double c_z0 = + x_comp + .offset(); // position of centre of cylinder in cm ( = radius of curvature - maximum height of curved surface above flat base) + Tube c_tube(c_rmin, c_rmin + x_comp.thickness(), x_comp.length() / 2, M_PI / 2 + c_phi0, + M_PI / 2 + c_phi1); + c_vol = Volume(c_nam, c_tube, description.material(x_comp.materialStr())); + const double zoff = thickness_sum + x_comp.thickness() / 2.0; + Position c_pos(0, 0, c_z0 + zoff); + RotationZYX c_rot(0, 0, M_PI / 2); + pv = m_vol.placeVolume(c_vol, Transform3D(c_rot, c_pos)); + } else { + Box c_box(x_comp.width() / 2, x_comp.length() / 2, x_comp.thickness() / 2); + c_vol = Volume(c_nam, c_box, description.material(x_comp.materialStr())); + + // Utility variable for the relative z-offset based off the previous components + const double zoff = thickness_sum + x_comp.thickness() / 2.0; + if (x_pos && x_rot) { + Position c_pos(x_pos.x(0), x_pos.y(0), x_pos.z(0) + zoff); + RotationZYX c_rot(x_rot.z(0), x_rot.y(0), x_rot.x(0)); + pv = m_vol.placeVolume(c_vol, Transform3D(c_rot, c_pos)); + } else if (x_rot) { + Position c_pos(0, 0, zoff); + pv = m_vol.placeVolume( + c_vol, Transform3D(RotationZYX(x_rot.z(0), x_rot.y(0), x_rot.x(0)), c_pos)); + } else if (x_pos) { + pv = m_vol.placeVolume(c_vol, Position(x_pos.x(0), x_pos.y(0), x_pos.z(0) + zoff)); + } else { + pv = m_vol.placeVolume(c_vol, Position(0, 0, zoff)); + } } - + c_vol.setRegion(description, x_comp.regionStr()); c_vol.setLimitSet(description, x_comp.limitsStr()); c_vol.setVisAttributes(description, x_comp.visStr());