Skip to content

E cal endcap turbine v3 topo try2 #456

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 157 commits into from
Apr 24, 2025

Conversation

varnes
Copy link
Contributor

@varnes varnes commented Mar 27, 2025

To ease the review process, please consider the following before opening a pull request:

If you are modifying detector dimensions or adding new xml parameters, also consider the following:

  • the xml file free parameters that can not be modified without additional prescriptions are well indicated
  • the changes in this PR have not introduced any overlaps. You can check so with the following command: ddsim --compactFile PATH_TO_COMPACT_FILE --runType run --ui.commandsInitialize "/geometry/test/run" > overlapDump.txt

BEGINRELEASENOTES

This PR adds the ability to merge readout cells with the same z and rho indices in adjacent absorber blades. The number of blades to merge in each wheel is controlled by the xml file.

Also, some bugs in calculating the positions of the cells were fixed.

ENDRELEASENOTES

Erich Varnes and others added 6 commits March 27, 2025 14:24
@varnes varnes marked this pull request as ready for review March 28, 2025 03:13
@atolosadelgado
Copy link
Collaborator

Hi @varnes

Thank you for your PR!

Is it ready to be reviewed and merged?

Thank you for your time!

@varnes
Copy link
Contributor Author

varnes commented Apr 11, 2025

Hi @varnes

Thank you for your PR!

Is it ready to be reviewed and merged?

Thank you for your time!

Hi @atolosadelgado ,

Yes, I believe it is ready.

Best regards,
Erich

@atolosadelgado
Copy link
Collaborator

@varnes

Great! could you please rebase? It seems there will be some conflicts :)

@varnes
Copy link
Contributor Author

varnes commented Apr 12, 2025

Hi @atolosadelgado ,

Just to make sure I don't go down a wrong path (which I find it easy to do in git), is the rebasing needed just to come into sync with commits made by others since I opened this PR? I rebased just before opening it, and also made sure it had minimal changes wrt the main branch (only the pieces I intended to change are different, at least from what I see in the "Files changed" tab).

I did click the "Update branch" button on the PR, which might address some of your concerns? Though I'm admittedly not clear on what exactly that button does.

Thanks,
Erich

@atolosadelgado
Copy link
Collaborator

atolosadelgado commented Apr 12, 2025

Hi @varnes

Scott noticed some overlaps [1], and I was surprise by such big ones, internal to the ECAL endcap, could you please take a look to it?

-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : GeomVol1002
      issued by : G4PVPlacement::CheckOverlaps()
Overlap with volume already placed !
          Overlap is detected for volume ECAL_EndCapCryo_front_0:0 (G4Tubs) with ECAL_EndCapCryo_inner_2:2 (G4Tubs)
          overlap at local point (-318.002,199.072,-225) by 2.48263 cm  (max of 15 cases)
--
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : GeomVol1002
      issued by : G4PVPlacement::CheckOverlaps()
Overlap with volume already placed !
          Overlap is detected for volume ECAL_EndCapCryo_back_1:1 (G4Tubs) with ECAL_EndCapCryo_outer_3:3 (G4Tubs)
          overlap at local point (-186.615,-2843.71,200) by 4.98258 cm  (max of 340 cases)
--
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : GeomVol1002
      issued by : G4PVPlacement::CheckOverlaps()
Overlap with volume already placed !
          Overlap is detected for volume ECAL_EndCapCryo_inner_2:2 (G4Tubs) with ECAL_EndCapCryo_front_0:0 (G4Tubs)
          overlap at local point (358.985,119.009,0) by 2.5 cm  (max of 684 cases)
--
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : GeomVol1002
      issued by : G4PVPlacement::CheckOverlaps()
Overlap with volume already placed !
          Overlap is detected for volume ECAL_EndCapCryo_outer_3:3 (G4Tubs) with ECAL_EndCapCryo_front_0:0 (G4Tubs)
          overlap at local point (2604.74,1054.24,0) by 2.5 cm  (max of 1045 cases)
--
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : GeomVol1002
      issued by : G4PVPlacement::CheckOverlaps()
Overlap with volume already placed !
          Overlap is detected for volume LAr_bath_4:4 (G4Tubs) with ECAL_EndCapCryo_front_0:0 (G4Tubs)
          overlap at local point (-760.132,2694.85,0.32899) by 2.4671 cm  (max of 152 cases)

There are more than 500 overlaps up to 0.1mm, maybe worth to document this fact?

[1] #462

@varnes
Copy link
Contributor Author

varnes commented Apr 18, 2025

Hi @varnes

Scott noticed some overlaps [1], and I was surprise by such big ones, internal to the ECAL endcap, could you please take a look to it?

-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : GeomVol1002
      issued by : G4PVPlacement::CheckOverlaps()
Overlap with volume already placed !
          Overlap is detected for volume ECAL_EndCapCryo_front_0:0 (G4Tubs) with ECAL_EndCapCryo_inner_2:2 (G4Tubs)
          overlap at local point (-318.002,199.072,-225) by 2.48263 cm  (max of 15 cases)
--
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : GeomVol1002
      issued by : G4PVPlacement::CheckOverlaps()
Overlap with volume already placed !
          Overlap is detected for volume ECAL_EndCapCryo_back_1:1 (G4Tubs) with ECAL_EndCapCryo_outer_3:3 (G4Tubs)
          overlap at local point (-186.615,-2843.71,200) by 4.98258 cm  (max of 340 cases)
--
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : GeomVol1002
      issued by : G4PVPlacement::CheckOverlaps()
Overlap with volume already placed !
          Overlap is detected for volume ECAL_EndCapCryo_inner_2:2 (G4Tubs) with ECAL_EndCapCryo_front_0:0 (G4Tubs)
          overlap at local point (358.985,119.009,0) by 2.5 cm  (max of 684 cases)
--
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : GeomVol1002
      issued by : G4PVPlacement::CheckOverlaps()
Overlap with volume already placed !
          Overlap is detected for volume ECAL_EndCapCryo_outer_3:3 (G4Tubs) with ECAL_EndCapCryo_front_0:0 (G4Tubs)
          overlap at local point (2604.74,1054.24,0) by 2.5 cm  (max of 1045 cases)
--
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : GeomVol1002
      issued by : G4PVPlacement::CheckOverlaps()
Overlap with volume already placed !
          Overlap is detected for volume LAr_bath_4:4 (G4Tubs) with ECAL_EndCapCryo_front_0:0 (G4Tubs)
          overlap at local point (-760.132,2694.85,0.32899) by 2.4671 cm  (max of 152 cases)

There are more than 500 overlaps up to 0.1mm, maybe worth to document this fact?

[1] #462

Hi @atolosadelgado ,

Thanks for catching that! These were silly bugs in placing elements of the cryostat, which I've now fixed. There are still many micron-level overlaps that I suspect might take some effort to deal with. So let me know if you'd like to go ahead with the PR as is, or I can put it back into draft status while I work on these overlaps.

Best regards,
Erich

@atolosadelgado
Copy link
Collaborator

Hi @varnes,

Thanks for fixing the overlaps!

As a first approximation, the missing energy will be proportional to the volume of the overlap. The issue with having many small overlaps is that it introduces instability in the simulation results—each run may expose particles to different amounts of sensitive material.

This problem can be mitigated by including a safety distance, as discussed in other issues in this repo and as implemented in some detectors [1]. Additionally, numerical precision can be affected by nesting certain operations, such as square roots. I noticed your implementation makes extensive use of boolean operations, which may also contribute to these effects.

We can address this either in this PR or in a future one.
@BrieucF @giovannimarchiori, what do you think?

[1]

DCH_length_t safety_r_interspace = 1 * dd4hep::nm;

@BrieucF
Copy link
Contributor

BrieucF commented Apr 22, 2025

Up to @varnes to decide, but I am fine addressing the other overlaps in another PR.

@varnes
Copy link
Contributor Author

varnes commented Apr 22, 2025

Hi @atolosadelgado and @BrieucF ,

I think I have a solution to most of the micron-scale overlaps. There are a few remaining that I don't yet understand where they come from. I'd like a day or so to do some sanity checks to make sure the resolution still looks OK with my changes, and then I'll commit them so the PR can proceed.

Just for the record, I've also noticed in the geometry viewer that there are some small gaps between noble liquid volumes that I also don't understand, but those don't have the same potential for harm that overlaps do, so I'll defer fixing those.

-- Erich

@varnes
Copy link
Contributor Author

varnes commented Apr 24, 2025

Hi @atolosadelgado ,

My checks of the energy resolution look fine, so this PR is ready to proceed from my side.

Thanks,
Erich

@atolosadelgado atolosadelgado enabled auto-merge (squash) April 24, 2025 13:25
@atolosadelgado atolosadelgado merged commit 6a4b70a into key4hep:main Apr 24, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants