Hi,
I want to make use out of multiple detectors (in total something between 5 and 15) and at the moment I’m building up the geometry such that a detector is always placed as a daughter object within another object which I’m actually placing multiple times.
Now I wonder, as I basically have only one(?) detector instance, how can I distinguish these detectors in terms of readout resp. energy deposition within them?
My code looks like this atm:
// Outer transportation box
G4Box box_dects_out = new G4Box(“box_dects_out”, 353/2mm, 25/2mm, 250/2mm);
G4LogicalVolume *box_detectors_out = new G4LogicalVolume(box_dects_out, Pur, “box_detectors_out”);
G4VPhysicalVolume box_detectors_out_phys = new G4PVPlacement(0, G4ThreeVector(0.m, -304mm, 0.m), box_detectors_out, “box_detectors_out”, logicWorld, false, 1, true);
// Inner box
G4Box box_dects_in = new G4Box(“box_dects_in”, 350/2mm, 22/2mm, 247/2mm);
G4LogicalVolume *box_detectors_in = new G4LogicalVolume(box_dects_in, worldMat, “box_detectors_in”);
G4VPhysicalVolume *box_detectors_in_phys = new G4PVPlacement(0, G4ThreeVector(0.*m, 0.*mm, 0.*m), box_detectors_in, “box_detectors_in”, box_detectors_out, false, 1, true);// Set up detector case
G4Box detector_case = new G4Box(“detector_case”, 52/2mm, 9/2mm, 22/2mm);
G4LogicalVolume *logDetector_case = new G4LogicalVolume(detector_case, worldMat, “logDetector_case”);
G4VPhysicalVolume *physDetector_case1 = new G4PVPlacement(0, G4ThreeVector(0.mm, -0mm, 0.*mm), logDetector_case, “logDetector_case1”, box_detectors_in, false, 1, true);
G4VPhysicalVolume *physDetector_case2 = new G4PVPlacement(0, G4ThreeVector(100.mm, -0mm, 0.*mm), logDetector_case, “logDetector_case2”, box_detectors_in, false, 1, true);
G4VPhysicalVolume *physDetector_case3 = new G4PVPlacement(0, G4ThreeVector(-100.mm, -0mm, 0.*mm), logDetector_case, “logDetector_case3”, box_detectors_in, false, 1, true);// Set up outer 0.5 mm Al filter
G4Box *al_filter_out = new G4Box(“al_filter_out”, (4.7/2+0.5)*mm, (0.5/2+0.5)*mm, (4.7/2+0.5)*mm);
G4LogicalVolume *logAl_filter_out = new G4LogicalVolume(al_filter_out, Al, “logAl_filter_out”);
G4VPhysicalVolume *physAl_filter_out1 = new G4PVPlacement(0, G4ThreeVector(-15.mm, -0mm, 0.*mm), logAl_filter_out, “logAl_filter_out1”, logDetector_case, false, 1, true);
G4VPhysicalVolume *physAl_filter_out2 = new G4PVPlacement(0, G4ThreeVector(15.mm, -0mm, 0.*mm), logAl_filter_out, “logAl_filter_out2”, logDetector_case, false, 1, true);
// Set up inner 0.5 mm Al filter
G4Box *al_filter_in = new G4Box(“al_filter_in”, (4.7/2+0.5/2)*mm, (0.5/2+0.5/2)*mm, (4.7/2+0.5/2)*mm);
G4LogicalVolume *logAl_filter_in = new G4LogicalVolume(al_filter_in, worldMat, “logAl_filter_in”);
G4VPhysicalVolume *physAl_filter_in = new G4PVPlacement(0, G4ThreeVector(0.mm, -0mm, 0.*mm), logAl_filter_in, “logAl_filter_in”, logAl_filter_out, false, 1, true);// Set up detectors
G4Box solidDetector = new G4Box(“solidDetector”, 4.7/2mm, 0.5/2mm, 4.7/2mm);
logicDetector = new G4LogicalVolume(solidDetector, BeO, “logicDetector”);
G4VPhysicalVolume *physDetector1 = new G4PVPlacement(0, G4ThreeVector(0.mm, 0mm, 0.*mm), logicDetector, “physDetector”, logAl_filter_in, false, 1, true);
Is this a meaningful way to go or should I do it differently?
I believe this is discussed here: Identification of unique physical volumes with IDs ,yet, I’m not quite sure that I understand it correctly. It seems I need to get the data out of G4StepPoint with a pointer to the physical volumes. Correct? But how exactly?