-
Notifications
You must be signed in to change notification settings - Fork 29
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 nested tube array geometry (optical fibers) #139
base: main
Are you sure you want to change the base?
Conversation
This will allow us to pass on fiber info like angle and length to processors.
Also added a validation macro and geometry for the nested tubes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks mostly ok with me on the geom construction perspective. I will wait on comments from others before merging.
Argh.. please fix the formatting as well. |
Changed "optical photon" back to "opticalphoton" to reflect the name of the G4 class it is referring to.
Just pushed changes that are clang-formatted. Sorry, I missed that requirement. |
Formatting was flagged, despite using clang-format on all edited files (I made sure the .clang-format file was being used). I've changed the flagged files to have the same format as similar existing files.
One can now set the cores of nested tubes as sensitive detectors. Useful if using as optical fibres.
I've just added some commits relating to adding the ability to make the core of the nested tubes a sensitive detector. This is particularly useful when using the nested tubes as optical fibers. The hit information from the sensitive detector gets saved to the rat DS every event and can be accessed by processors. |
Previously, the nested tube array code would save the information for all nested tubes in the array to the rat DS. This could potentially consume a lot of memory. The behaviour has now been changed so that information is only stored for nested tubes with sensitive detector hits.
I have successfully compiled the PR with no issues. However when I run the following macro:
I obtain the following error:
|
Apologies i forgot to update the macro. Yes that output is expected. It's demonstrating the construction of fibres. The different colors are for the different construction methods. One with the old method of defining individual tubes and the other with the new array method. |
Thank you, that makes sense! I did a quick test to test out the features with for four fibers. The visual output looks very nice. However, I am having difficulties accessing time and hit location in the outroot file (The error might be on my side). Have you cross-checked that hits are recorded for a test case scenario? |
The fibers are sensitive detectors. Any hits that occur in them are saved as a hit collection in the ratds. I haven't added them to the outroot file, but they're easily accessed in processors so could be added |
I have tried to add the sensitive detector option:
However, I am still not seeing any registered hits at this point. |
Hmm. I've never looked at the outroot output, but I'm able to extract the fibre hits from the ratds when I use a custom processor, so it should be added to the outroot output... Looking into this now |
It would be nice to add an option so that the output could be save optionally to the outntuple files `src/io. Maybe something like
|
The position of the logical volume for each nested tube was set to the position of detected photons in the sensitive detector, which looked strange in the visualiser. Fixed the issue by adding a new hit_position variable to the hit collection and using that instead of the logical volume position.
Forgot to update the header during last bugfix
We've changed the example macro to use some example WLS materials that we've added to ratdb. With these materials photons will actually get absorbed in the core of the nested tubes and be recorded by the sensitive detectors. Looking at the outroot file, I see entries for the
and if I try using the
I may just have things setup wrong, as I get the same errors when I try to retrieve hit information from the MCPMT class. |
Hey Wilf, you might need vectored versions of your data structures added to |
Hi James. I believe I'm already doing that. And if I had forgotten to do it it wouldn't explain why the same thing is happening for the MCPhoton info. I must be doing something wrong with my root setup such that cint isn't getting the info from linkdef. If someone else could test to confirm this is a "Wilf problem" rather than a general problem, that would help. |
I've just added the requested feature from Marc where the nested tube hits are written to the ntuple output if requested. If |
Optical fibers (such as wavelength shifting fibers) are not explicitly defined in ratpac, despite their prevalence in physics experiments. One could create such a fiber in ratpac by constructing several concentric tubes with relevant materials, but when simulating experiments with thousands of fibers this can lead to undesirably large geometry files.
To address this issue, this update will add the nested tube array geometry, that allows construction of an array of three concentric tubes (a core, an inner tube and an outer tube). The length, position, and direction of each nested tube can be set individually. Materials and radii are set for the whole array.
Validation has been performed to ensure the nested tube arrays are correctly placed in the geometry and have the same optical properties as concentric tubes manually placed in the geometry. A validation macro and geometry file have been added that demonstrate how the nested tube arrays are placed.
The rat DS has been updated to include nested tube array info such as direction, length and material. This is similar to the PMTInfo class.
No extra materials have been added that would be useful when using nested tube arrays as optical fibers. We hope to add this later when we have more accurate properties.
The documentation has been updated to include the nested tube array geometry.