Hi there,
I am trying to simulate light collection from plastic scintillator using a small silicon photodiode. Here is a screenshot of my geometry: the main detector volume is a series of polystyrene plastic scintillator sheets and you can see a small photodiode attached to the side of each sheet. I’ve used G4PVReplica to implement this repeated geometry.
The scintillator material has defined its fast and slow constant scintillator components, emission spectrum with photon energy (both fast and slow), absorption length and refractive index. So far I’ve just implemented the photodiodes as solid silicon using the built-in material definition.
So far, I’ve been successful in counting the number of photons produced in each scintillator sheet, by implementing the sheets as a sensitive detector. Naively, I’ve implemented the photodiodes as a sensitive detector as well to try and count the photons in the same way, but of course, no photons actually are able to pass into the photodiode.
Looking at the LXe optical example, it seems that I’ll need to do some boundary process checks in order to simulate photons being collected in the photodiodes. Admittedly, I’m struggling to decipher which parts from this example I’ll need for my simple use case and how to apply it to just the photodiode-scintillator boundary. Would someone be able to offer some advice for how to go about this?
Here is the hit processing for the sensitive detector, currently set up to count the total number of photons produced in the sensitive volume:
G4bool SensitiveDetector::ProcessHits(G4Step* step, G4TouchableHistory*) {
// energy deposit
G4double edep = step->GetTotalEnergyDeposit();
if (edep==0.) return false;
// Get calorimeter cell id
const G4VTouchable* touchable = step->GetPreStepPoint()->GetTouchable();
G4int layerNumber = touchable->GetReplicaNumber(1);
// Get hit accounting data for this cell
auto hit = (*fHitsCollection)[layerNumber];
if ( ! hit ) {
G4ExceptionDescription msg;
msg << "Cannot access hit " << layerNumber;
G4Exception("SensitiveDetector::ProcessHits()","MyCode0004", FatalException, msg);
}
G4double zmax = 128*3;
G4StepPoint* prePoint = step->GetPreStepPoint();
G4StepPoint* postPoint = step->GetPostStepPoint();
G4double z1 = prePoint->GetPosition().z() + zmax*0.5;
G4double z2 = postPoint->GetPosition().z() + zmax*0.5;
if (z1 >= 0.0 && z2 <= zmax) {
G4double z = z1 + G4UniformRand()*(z2-z1);
G4Track* track = step->GetTrack();
const G4DynamicParticle* theParticle = track->GetDynamicParticle();
const G4ParticleDefinition* particleDef = theParticle->GetParticleDefinition();
static G4ParticleDefinition* opticalphoton = G4OpticalPhoton::OpticalPhotonDefinition();
if (particleDef != opticalphoton) {
// loop over secondaries, create statistics
const std::vector<const G4Track*>* secondaries = step->GetSecondaryInCurrentStep();
for (auto sec : *secondaries) {
if (sec->GetDynamicParticle()->GetParticleDefinition() == opticalphoton) {
G4String creator_process = sec->GetCreatorProcess()->GetProcessName();
if (creator_process.compare("Scintillation") == 0) {
hit->AddPhoton();
}
}
}
}
}
return true;
}
Please let me know if you’d need further information to answer this question!