Howdy,
I am building a detector that is made up of many of the same multipiece detector elements rotated about and stacked along the Z axis. The data that comes back has a periodic frequency to it that has to be related to the way it’s being generated.
The Z-step stacking is working as verified by G4cout of the Z position and the angles are correct in the same readout. However it seems the center of rotation might not be the centerline axis causing the elements to rotate out of then back into the beam. All the assembly elements are G4Box and set with a translate and rotation local to the assembly.
G4RotationMatrix *Ra = new G4RotationMatrix();
Ra->rotateX(0.* deg); Ra->rotateY(0.* deg); Ra->rotateZ(0.* deg);
G4ThreeVector Ta = G4ThreeVector(0., 0., 0.);
G4AssemblyVolume* assembly = new G4AssemblyVolume();
G4VSolid* solidGasGap = new G4Box("Gas Gap", 0.5 * SubstrateX, 0.5 * SubstrateY, 0.5 * GasGapZ);
G4LogicalVolume* logicGasGap = new G4LogicalVolume(solidGasGap, P10, "Gas Gap");
Ta.setZ(ElmS + (0.5 * GasGapZ));
assembly->AddPlacedVolume(logicGasGap, Ta, Ra);
A new set of global translation and rotations are initialized for the placement.
G4RotationMatrix *Rm = new G4RotationMatrix();
Rm->rotateX(0.* deg); Rm->rotateY(0.* deg); Rm->rotateZ(0.* deg);
G4ThreeVector Tm = G4ThreeVector(0., 0., 0.);
This is what places the imprints of the assembly within the mother volume logicGas. There’s a set of switch statements that determine the angle about Z that is stored as rot. My first version of DetectorConstruction used a linear increase in rot which worked fine. However, that’s tomographically inefficient so I changed to a periodic stagger driven by the switch statement. The angles come back correct in the readback of rot but do not seem to be implemented as I desire.
Rm->rotateZ(rot);
G4int lay = ((r * sym) + e);
Tm.setZ(ElmC + (lay * ElmZ));
G4cout << lay << "-Z: " << Tm.getZ() + GasC << ", Ang: " << rot / deg << G4endl;
assembly->MakeImprint(logicGas, Tm, Rm);
Does anyone see what might cause the assembly volume to not rotate about the Z axis?
Thanks
Geant4 Version: geant4-11-02-patch-02
Operating System: Cluster Linux version 4.18.0-553.33.1.el8_10.x86_64
Compiler/Version: UNK
CMake Version: UNK