-
Notifications
You must be signed in to change notification settings - Fork 100
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
Problem with regexSensitiveDetector and volume IDs #1319
Comments
Lorenzo, Now to your problem: |
Hello Markus, thank you!
you mean navigating the Geant4 history and get Geant4 copynumbers (i.e. |
Hi Lorenzo,
This is nothing else what the Another possibility would be to have some alternative You see there are multiple possibilities to address this problem - depending on the specific needs and requirements. The existing |
Hello Markus, thank you once again!
this works in my simulation, however it makes it about 350 times slower. |
Yes. Something like this.
|
P.S. Another possibility would e.g. be to play with the copy numbers provided there are no assemblies in the volume chain. |
Yes, I was thinking about this possibility (I do not use assemblies in the dd4hep geometry constructor). One could use the "Geant4" copynumbers which are fast to access ( The only question I have about this method is as follows. Thank you |
You have to be careful here:
|
Ok... then what you meant with this
is that I can construct some ID using the copynumbers, but there is no way to make this ID identical to the volID of DD4hep. Correct? Please allow another question here. If copynumbers are assigned "automatically" and are "not changeable". Why does such a method exist in DD4hep?
|
I think I should remove this placement operation from DD4hep. |
Setting aside the timing bomb method Simulating highly-granular calorimeters with DD4hep standard sensitive detector (action) will cache some information that allows the
but this makes the simulation slower by order of magnitudes (another no-no). Unfortunately, this seems like a strong limitation. My geometry represents a calorimeter with 30 million volumes, but using proper nesting I managed to have in-memory less than 1 million placed volumes. I agree this is huge but I do not consider it out-of-this-world. |
Actually, I am observing something different about I am setting some copynumbers with it to 99. Then inside Are you sure about this?
|
If you have non-secutive copy numbers typical loops like
Did not work for me at some point in time......At least I once ran into SEGV's. I cannot verify this now in the TGeoVolume code. You may perhaps give it a try. |
|
Nodes would be something like "TObjArray" in this case. Discussion is void. We have no handle on internals of TGeo. |
Hello, trying to add something on This method adds a node to the parent volume (
where
and
DD4hep users can set One last thing, I can confirm that Geant4 physical volume copynumbers created in the geometry conversion are copied from their TGeo counterpart (whatever this number is). DD4hep users can check this with something like this
in my simulation, they are identical. Regardless of this issue, I still have the problem I summarized a few messages above. The simulation I am doing is part of the CERN FCCee program, I cannot give up on this (yet). Please let me know what could be done. |
OK. But then your problem should be sort of solved: Then, during simulation you use the touchable history, walk up the path, logically 'or' the copy numbers and Whether to implement this as a utility is another question to be discussed, but the mechanism should work as described. |
Hi, yes this is what I had in mind. And I thought that by keeping the copynumbers and the volIDs identical in the geometry constructor, one could even use the However, I kind of understood from your comments before that setting copynumbers is dangerous and you experienced problems with it in the past.
Would you consider this approach safe or not? Thank you. |
Concerning the crashes:I am not perfect, maybe I made a mistake in the past and remembered the failure with the copy numbers this as folklore.... Concerning volids:The Hence: P.S. If you could come up with a sort of |
Dear All, Apologies for the long delay.
Then, I can allocate 64 bits to reconstruct the DD4hep
This Now, can this become a generic utility? I am not sure at the moment... for sure some gymnastic is needed and also checks that the bit-shifting operations stay within boundaries. FYI @s6anloes @SanghyunKo |
Hi @lopezzot There is a tool for the volumeID gymnastics, the BitFieldCoder. VolumeID VolID = 0;
BitFieldCoder bc("stave:10,tower:6,air:1,col:16,row:16,clad:1,core:1,cherenkov:1");
bc.set(VolID, "stave" , StaveID);
bc.set(VolID, "tower" , TowerID);
//...
Though it doesn't do range checks |
Hi, I believe the last part when the However, when I have to split the copynumber into two sets of 16-bits in the geometry construction, there should be range check with some protections like the one I added. My two cents. |
You mean add a |
Sort of, yes. A function that takes a vector of (name, value, bits) and creates an Then one would need a function to be used in the I don't know if this should be a generic utility of just be left to the users to implement. |
Dear All,
I need to ask about an issue with the recent
regexSensitiveDetector
. I am using it on lxplus alma9 machines sourcing the key4hep nightlies. The geometry I am developing has several sensitive volumes (optical fibers) hence the memory footprint is huge (in the configuration used below it takes about 6 GB (4 from geometry and 2 from sensitive detectors)). UsingregexSensitiveDetector
helps a lot and the memory footprint reduces to 4 GB (i.e. only the geometry contribution).Unfortunately, when using
regexSensitiveDetector
I find a problem using the methodvolumeID(aStep)
insideGeant4SensitiveAction<>::process()
. When using standard sensitive detectors,volumeID(aStep)
returns the correct volume ID number; but when I useregexSensitiveDetector
it returns 0.The only difference when using
regexSensitiveDetector
is: marking optical fibers as "non sensitive" in the compact file and adding in the steering filePlease let me know if I am doing anything wrong here. Thank you!
Reproducer using lxplus alma9 machines.
Using standard sensitive detector (action):
In the sensitive detector action process method I added this printout:
Note here "Volume ID" is not 0 (and correct).
If the same is repeated using
regexSensitiveDetector
the printout becomes
Note here "Volume ID" is 0, and the
volID()
method throws a warningGeant4VolumeManager INFO +++ Bad volume Geant4 Path: /Tank_0/phiER_9/towerLog_22/capillary_CLog_4275/DRETSclad_CLog_0
.The text was updated successfully, but these errors were encountered: