Hi all, I am trying to create a voxelised spherical shell in which copy numbers correspond to specific theta and phi.
I used the G4PVParameterised class and assigned each voxel the same inner and outer radius, but different start/end theta and phi.
SphereParameterisation::SphereParameterisation(
G4double startTheta, G4double endTheta, G4double startPhi, G4double endPhi, G4double innerR, G4double outerR, G4int PhiNo, G4int ThetaNo)
: G4VPVParameterisation()
{
G4double finnerR = innerR;
G4double fouterR = outerR;
G4int fnPhi = PhiNo;
G4int fnTheta = ThetaNo;
G4double fstepPhi = (endPhi - startPhi) / PhiNo;
G4double fstepTheta = (endTheta - startTheta) / ThetaNo;
}
SphereParameterisation::~SphereParameterisation()
{ }void SphereParameterisation::ComputeTransformation
(const G4int copyNo, G4VPhysicalVolume* physVol) const
{
G4ThreeVector origin(0,0,0);
physVol->SetTranslation(origin);
physVol->SetRotation(0);
}void SphereParameterisation::ComputeDimensions
(G4Sphere& sphere, const G4int copyNo, const G4VPhysicalVolume*) const
{
sphere.SetInnerRadius(finnerR);
sphere.SetOuterRadius(fouterR);
sphere.SetStartPhiAngle(copyNo % fnPhi * fstepPhi);
sphere.SetDeltaPhiAngle(fstepPhi);
sphere.SetStartThetaAngle(int(copyNo / fnPhi) * fstepTheta);
sphere.SetDeltaThetaAngle(fstepTheta);
}
Then I implemented it in my detector construction.
G4Sphere* solidVoxel = new G4Sphere(“voxel”, 0.*cm, Rmax, 0.*deg, 360.*deg, 0.deg, 180.deg);
G4LogicalVolume logicVoxel = new G4LogicalVolume(solidVoxel, water, “voxel”);
G4VPVParameterisation param =
new SphereParameterisation(Thetamin, Thetamax, Phimin, Phimax, Rmin, Rmax, nPhi, nTheta);
new G4PVParameterised(“voxel”,logicVoxel,logicMotherSphere,kXAxis,nTotal,param,checkOverlaps);
The code was successfully compiled, but when I ran the visualisation, this comes up for every voxel and I can only see the mother volume but none of the voxels.
What does this warning imply? I guess it’s from an error in my parameterisation but I don’t know where to look at.
Thank you in advance for your help!