Hello,
I think I am having trouble reading results from my multifunctional detector properly. I set up a general particle source which varies in intensity which I can confirm from viewing it in opengl
However when I try to score dose from this using a multifunctional detector all the sources appear to deposit dose a nearly uniform intensity, giving a line profile down them like
The peaks appear to get more noisy as the flux should decrease which makes me feel like they are being normalised according to the number of photons travelling through the region, which is pretty non-intuitive to me.
When I instead run a scoring mesh using the macro commands I get a line profile like
which follows the trend I expect. However I only get it when I use the sum_w() method
“”"
MeshScoreMap scMap = fScoringMesh->GetScoreMap();
MeshScoreMap::const_iterator msMapItr = scMap.find(psName);
std::map<G4int, G4StatDouble*> * score = msMapItr->second->GetMap();
std::map<G4int, G4StatDouble*>::iterator value = score->find(idx);
double totED = value->second->sum_w() / unitValue;
“”"
Which I am unable to use with my multifunctional detector. My understanding is that the sum_w method seems to multiply the entry by some track weight but I have no idea how to access this.
Is anyone able to help out with why a multifunctional detector is not returning the correct scoring values?
At the moment I am accessing the multifunctional detector values through
if (IsMaster())
{
Run* reRun = (Run*) run;
G4SDManager* SDman = G4SDManager::GetSDMpointer();
G4MultiFunctionalDetector* mfd = (G4MultiFunctionalDetector*)(SDman->FindSensitiveDetector(“phantomSD”));
G4String Unit = mfd->GetPrimitive(0)->GetUnit();
G4double UnitValue = mfd->GetPrimitive(0)->GetUnitValue();
G4THitsMap<G4double>* Dose = reRun->GetHitsMap("phantomSD/DoseDeposit");
for (int Index = 0; Index < 100 * 100 * 3; Index++)
{
G4double* totED = (*Dose)[Index];
if (totED)
{
std::cout << "Dose at index " << Index << " is " << *totED << std::endl;
}
}
Eternal gratitude to anyone who can help out with this