Hello experts,
I am running a simulation for a HPGe detector with a hole in the middle and I have developed this from the example B1. The issue I am having is I cannot run the simulation without randomizing the position of x0, y0, z0 and I will like to do this in such a way that the particle source fires in a circular manner along the symmetry axis of the detector because it is a cylinder. I have tried using GPS but I don’t think I implemented properly because all my initial position is set to zero.
I get this output messsage:
Here’s my detectorconstruction.cc code:
#include "G4Tubs.hh"
B1DetectorConstruction::B1DetectorConstruction()
: G4VUserDetectorConstruction(),
fScoringVolume(0)
{ }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
B1DetectorConstruction::~B1DetectorConstruction()
{ }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VPhysicalVolume* B1DetectorConstruction::Construct()
{
// Get nist material manager
G4NistManager* nist = G4NistManager::Instance();
// Envelope parameters
//
G4double env_sizeXY = 10*cm, env_sizeZ = 10*cm;
G4Material* env_mat = nist->FindOrBuildMaterial("G4_Ge");
G4double PI = 3.141592653589793238;
G4double pRMin = 0.2*cm, pRMax = 2.5*cm, pDz = 2.1*cm, pSPhi = 0., pDPhi = 2*PI;
// Option to switch on/off checking of volumes overlaps
//
G4bool checkOverlaps = true;
//
// World
//
G4double world_sizeXY = 1.2*env_sizeXY;
G4double world_sizeZ = 1.2*env_sizeZ;
G4Material* world_mat = nist->FindOrBuildMaterial("G4_AIR");
G4Box* solidWorld =
new G4Box("World", //its name
0.5*world_sizeXY, 0.5*world_sizeXY, 0.5*world_sizeZ); //its size
G4LogicalVolume* logicWorld =
new G4LogicalVolume(solidWorld, //its solid
world_mat, //its material
"World"); //its name
G4VPhysicalVolume* physWorld =
new G4PVPlacement(0, //no rotation
G4ThreeVector(), //at (0,0,0)
logicWorld, //its logical volume
"World", //its name
0, //its mother volume
false, //no boolean operation
0, //copy number
checkOverlaps); //overlaps checking
//
// Envelope
//
G4Tubs* solidEnv =
new G4Tubs("Envelope", //its name
pRMin, pRMax, pDz, pSPhi, pDPhi); //its size*/
G4LogicalVolume* logicEnv =
new G4LogicalVolume(solidEnv, //its solid
env_mat, //its material
"Envelope"); //its name
new G4PVPlacement(0, //no rotation
G4ThreeVector(), //at (0,0,0)
logicEnv, //its logical volume
"Envelope", //its name
logicWorld, //its mother volume
false, //no boolean operation
0, //copy number
checkOverlaps); //overlaps checking
// Set Envelope as scoring volume
//
fScoringVolume = logicEnv;
//
//always return the physical World
//
return physWorld;
}
And here is my PrimaryGeneratorAction file: