Hi Munther
I think we’ve got to the bottom of this. The good thing is that none of this affects tracking/physics - it’s purely a vis thing.
The existing code assumes the solid for visualising the phi section should have a start_phi
of offset-0.5*width
and a d_phi
of width
. The advantage is that the x-axis bi-sects the slice and correctly represents the local coordinate system adopted by replica navigation, which is used to place daughters, as described in the documentation:
For the phi
axis, the new coordinate system is rotated such that the X axis bisects the angle made by each wedge…
The documentation is vague:
The solid associated via the replicas’ logical volume should have the dimensions of the first volume created and must be of the correct symmetry/type, in order to assist in good visualisation.
The only time anyone would notice any local axes discrepancy is with /vis/touchable/localAxes
.
Looking at some test code written by the designers in 1995 (!) its looks like they adopt your convention:
G4Sphere* fSphere = new G4Sphere("Test Sphere",0.,80.,0*deg,360*deg,0*deg,360*
deg);
G4LogicalVolume *pMotherVol2P= new G4LogicalVolume(fSphere, 0, "lmoth2P", 0, 0, 0);
new G4PVPlacement(0,G4ThreeVector(),"pmoth2",pMotherVol2P,hall_phys2,false,0);
...
G4Sphere* fSphereP = new G4Sphere("Sliced Sphere Phi",0.,80.,0*deg,90*deg,0*deg,360*deg);
G4LogicalVolume* phiSphereLog= new G4LogicalVolume(fSphereP, 0, "PhiSlice", 0, 0, 0);
G4PVReplica phiRep("TestPhi",phiSphereLog,pMotherVol2P,kPhi,4,pi*0.5);
but it’s difficult to tell because it’s a full circle.
I’m going to consult. No-one else has commented in 25 years. Has anyone noticed? How many users would get a surprise if we changed? I’ll get back.
John
P.S. If we keep the existing vis code:
I think we should, in any case, improve the documentation.
…to assist in good visualisation. In particular, to make the local axes of the visualisable phi section correspond to the above, it should have a start_phi
of offset-0.5*width
and a d_phi
of width
.
Or for your preferred convention:
…to assist in good visualisation. In particular, the phi section should have a start_phi
of offset
and a d_phi
of width
.