Tracking Assembly Volume Numbers of a Replica Element


Working through my first GEANT4 project and I’ve run into a snag I can’t figure out. I’m using a sensitive detector on a logical volume that is created first via a division into adjacent anode strips along the ‘Y’ axis (400 of them in the current version) inside of a mother volume anode. This along with the other pieces of an element is placed with assembly volume because they need to step and rotate along ‘Z’. I didn’t see how to make a rotation on a replica or division and I will eventually be doing a parameter sweep for 2-1024 elements and would rather not place them all as physical volumes via loops.

With the output set to /tracking/verbose 2, I can see the particles moving and forming secondaries using the “av_WWW_impr_XXX_YYY_ZZZ” format for the volumes except for the steps in the anode strips where it’s just a name. I can’t find a way to access that XXX number in the step or any of it’s decedents. For particles that exit the volume I can pull it out of the GetNextVolume() method but if they reach 0 energy that field is just anode strips.

Any suggestions on where I can pull that assembly imprint number out of the step or any of it’s decendents?


Geant4 version Name: geant4-10-07-patch-03 [MT] (19-November-2021)
Operating System:_CentOS Linux 7 (Core)
Compiler/Version:_Unsure, CMakeCache.txt looks like it’s pointed at spark-base inside of CentOS
CMake Version:_3.22.2

I tried relocating the call to the Division in the sequence but any other location than between the definition of the mother volume and the placement of the mother volume in the assembly results in the strips disappearing or a runtime error for trying to call the daughters multiple times. I find it very interesting that the mother volume doesn’t bear the imprint number from the loop placements.

I have found a 90% solution to this problem so I’m not calling it done but enough to move on for now.
EDITED, found what was causing the overage in Assembly Volumes

My Assembly Volumes are made up of 6 internal volumes which using the GetReplicaNo() method will pull first the replica number and then something related to the stack number of the volume in the sequence. For most, but not all for some reason, the assembly volume imprint number is (stack_number + 2) / volumes_in_element. I think the 2 is from having an air volume, a gas volume, and then a singular plate in front of the Assembly Volume stackup. What doesn’t work all the time is some positions (which I did verify with the /track/verbose 2) that the correct answer is ceil(imprint number) which is strange.