Skip to content
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

Add volume-to-material mapping and change import data #1378

Merged
merged 18 commits into from
Aug 29, 2024

Conversation

sethrj
Copy link
Member

@sethrj sethrj commented Aug 27, 2024

This adds to the OpticalMaterial a mapping of volume ID to optical material ID; it is allowable to have no ID assigned (so that another part of the code can kill the track etc.) I've also changed the import material data so that the optical material ID is associated with the physical material ID, since it's conceivable we'd want to turn on/off optical physics in different regions of the problem.

A few changes are:

  • Instead of looking for scintillation etc. in the first optical material, we look at all materials, since the user might want to turn off processes on a per-material basis
  • Any material with an RINDEX property is considered "optical"; the other physics properties are optional.
  • I've added an "optical" data selection to the geant importer that defaults to on; we should think about detecting the presence of optical processes to specify whether cerenkov (e.g.) is enabled

Currently

@sethrj sethrj requested review from amandalund and stognini August 27, 2024 19:01
@sethrj sethrj added enhancement New feature or request physics Particles, processes, and stepping algorithms labels Aug 28, 2024
Copy link
Contributor

@amandalund amandalund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks @sethrj!

@sethrj sethrj enabled auto-merge (squash) August 29, 2024 13:07
@sethrj sethrj merged commit 61d86de into celeritas-project:develop Aug 29, 2024
29 checks passed

Input input;
input.resolution_scale.resize(num_optmats);
if (data.optical_params.scintillation_by_particle)
{
// Collect ScintillationParticleIds
input.pid_to_scintpid.resize(data.particles.size());
ScintillationParticleId scintpid{0};
for (auto const& [matid, iom] : data.optical)
ScintillationParticleId::size_type scintpid{0};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just so I am in the same page, let me know if this statement is correct: the plan is to keep the scintillation by particle import code, but we're not implementing that yet in our generator. So we keep per-particle data on the import side (and ScintillationData, though will be empty), but do not enable it in our ScintillationParams, leaving the stepping loop to be material-only. And if/when we do add scintillation by particle type, all the backend and data storage is already in place, since the current extra bits shouldn't make any real difference in the stepping loop.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's about the sum of it. Since I don't think we've yet found any sincillation-by-particle detector we could probably delete it and restore it later if needed... 🤔

@sethrj sethrj deleted the optical-material branch August 29, 2024 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request physics Particles, processes, and stepping algorithms
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants