-
Notifications
You must be signed in to change notification settings - Fork 61
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
New DRC sensitive detector using RegEx #367
base: main
Are you sure you want to change the base?
Conversation
…ardcoded geometry and add dimensions in xml file
…e, Clarify the units, write detector description
…constructor to remove warnings
😍 How long does it take to build the geometry now? |
@BrieucF I didn't measure it precisely, but maybe around 10mins? (when I tested with the |
Hi @SanghyunKo thank you very much for this example. We will need to check how to use the volume hierarchy with the tubes geometry but I am pretty sure it is not hard to do. The optical photons treatment you just described is identical to what we are doing for Hidra simulation since a few years. Indeed I can confirm a few seconds per event (depending on energy and slightly on particle type). Apart from this, I will study with @s6anloes this solution and get back to you. |
since AIDASoft/DD4hep#1308 is now merged, I'll update the steering file shortly once we have new nightlies |
Could you remind me what are the next steps to be done in this PR? Best, |
Hello @atolosadelgado, this was opened as a draft to discuss about regexSD (thank you @SanghyunKo !). regexSD is working fine in IDEA_o2 and is now available in key4hep (not just the nightlies). Other than that I let Sanghyun comment about this PR. |
@atolosadelgado apart from the obvious checks that I have to make (e.g. fix conflicts, testing with new nightlies since it's been a while), I'll probably need to revisit the strategy on how to retrieve @lopezzot it seems that you eventually settled downed with using the G4 copy numbers, if I see the PR #411. Is it correct? |
BEGINRELEASENOTES
Geant4RegexSensitivesConstruction
to avoid large memory consumption.ENDRELEASENOTES
This is a draft PR for the update on the DRC sensitive detector using the new
Geant4RegexSensitivesConstruction
introduced in DD4hep recently. By using this, we can avoid large memory consumption caused by the creation of SD objects for every fiber.Note that this is not free, the cost of memory consumption is transferred to the overhead time for matching regex pattern. By trying appropriate pattern, we can suppress the overhead time caused by the
Geant4RegexSensitivesConstruction
down to a few minutes scale. However, this can easily explode up to an hour with complex patterns (so one needs to pay attention). The example steering file can be found in theDRCfastSDsteer.py
.Aside from the introduction of
Geant4RegexSensitivesConstruction
, the default behavior of SD is now modified to skip optical photon propagation for scintillation channels. For scintillation channels, we switched to the defaultGeant4Calorimeter::Hit
(with Birks constant) and retrieve energy deposits from it. For Cherenkov channels, we check whether the optical photon has consecutive total internal reflection. If it has, then we count the photon and kill it to save CPU time. With these, the CPU consumption is now suppressed down to a few seconds per event.The tricky part is retrieving
cellID
. Since each individual fiber is not a unique SD anymore,cellID
now must be retrieved using the segmentation based on the volumeID of the mother tower. To do this, I assigned volumeID for each tower at the detector construction step, then navigateG4VTouchable
object during the SD process. For this I strictly assumed world->detector->tower hierarchy (i.e. the tower volume should be depth 2), and this should be discussed with the capillary tube DRC colleagues.There are still several outstanding action items (e.g., to validate
cellID
encoding, update CI), but I took liberty to push PR already to discuss whether people agree with this approach (conceptually).@lopezzot @swkim95 @s6anloes