diff --git a/README.md b/README.md index 1f14ae3259..4f44ddeb3b 100644 --- a/README.md +++ b/README.md @@ -1,82 +1,51 @@ -[![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. + +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. + +**Modified files:** -### Adding/changing detector geometry +```src/BarrelTrackerWithFrame_geo.cpp``` -Hint: **Use the CI/CD pipelines**. +```compact/tracking/silicon_barrel.xml``` -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. +**Additional files:** -Here is how to begin: +```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. -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. +```TestOB.sh``` - script to test the geometry, using ```TestOB.C``` and ```epic_craterlake_tracking_only_cut.xml``` -See: -- [Talk at computing round table](https://indico.jlab.org/event/420/#17-automated-workflow-for-end) +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 -### Compiling (avoid it) -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: +**Tests** -- 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/ +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 +./TestOB.sh +``` +Mean nMeasurements: 5.02398 -Related useful links --------------------- +Test new curved model +``` +source install/bin/thisepic.sh +./TestOB.sh -- [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) +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 diff --git a/SimpleCurved_silicon_barrel.xml b/SimpleCurved_silicon_barrel.xml new file mode 100644 index 0000000000..c296a89fb6 --- /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..efa3999d0a --- /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..7d49d5d6b9 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..a97f047fb0 --- /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..cb292c3df1 100644 --- a/src/BarrelTrackerWithFrame_geo.cpp +++ b/src/BarrelTrackerWithFrame_geo.cpp @@ -173,24 +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"); - 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)); + + 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 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)); + 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());