Counting the capure nuclei

Hello,
I am shooting neutron to water and gadolinium mixture in Had06/Had04 example. I am trying to count the number of capture on water and number of capture on Gadolinium . I did the following modifcation in trackingaction
if (track->GetParentID() == 0 && track->GetDefinition() == G4Neutron::Neutron()) {
// Primary neutron
if (track->GetTrackStatus() == fStopAndKill && track->GetStep()->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName() == “nCapture”) {
// Primary neutron is captured
const G4TouchableHandle& touchable = track->GetStep()->GetPreStepPoint()->GetTouchableHandle();
const G4Material* material = touchable->GetVolume()->GetLogicalVolume()->GetMaterial();

if (material->GetName() == “Gadolinium”) {
// Captured on gadolinium
gadoliniumCaptureCount++;
} else if (material->GetName() == “Hydrogen”) {
// Captured on hydrogen
hydrogenCaptureCount++;
}
}
G4cout << "Gadolinium capture count: " << gadoliniumCaptureCount << G4endl;
G4cout << "Hydrogen capture count: " << hydrogenCaptureCount << G4endl;

}
The problem is number of capture on both are equal which is clearly not the case. How should I improve theabove code?

1- your if conditions to get material names seem ok, although somewhat redundant.
but what are these names : Gadolinium, Hydrogen ? from where do they come ?

To get the target nucleus of each individual capture, see example Hadr03: SteppingAction.cc, around lines 88-92

2- you count capture cases with “gadoliniumCapureCount” , “hydrogenCaptureCount” .
where these counters are defined and initialized ?

1 Like

Hii Maire,
I did it in TrackinAction of Had06
hydrogenCaptureCount = 0;
gadoliniumCaptureCount = 0;
if (track->GetParentID() == 0 && track->GetDefinition() == G4Neutron::Neutron()) {
// Primary neutron
if (track->GetTrackStatus() == fStopAndKill && track->GetStep()->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName() == “nCapture”) {
// Primary neutron is captured
const G4TouchableHandle& touchable = track->GetStep()->GetPreStepPoint()->GetTouchableHandle();
const G4Material* material = touchable->GetVolume()->GetLogicalVolume()->GetMaterial();

if (material->GetName() == “Gd”) {
// Captured on gadolinium
gadoliniumCaptureCount++;
} else if (material->GetName() == “proton”) {
// Captured on hydrogen
hydrogenCaptureCount++;
}
}
G4AnalysisManager::Instance()->FillH1(5, hydrogenCaptureCount);

G4AnalysisManager::Instance()->FillH1(16, gadoliniumCaptureCount);

G4cout << "Gadolinium capture count: " << gadoliniumCaptureCount << G4endl;
G4cout << "Hydrogen capture count: " << hydrogenCaptureCount << G4endl;
}

I want to count how many neutron captured on hydrogen and gadolinium separately. In Had03 as you, give Gd157 . All are captured on Gd157 non of on Hydrogen . This is giving me suspicion.

The abundance and capture cross section of Gd157 is 15.7% and 254000 b respectively. For Gd155 they are 14.8% and 60900 b. The capture cross section for H1 is 0.33 b. So it is not surprising that all the captures occur on Gd. (From your code, I do not see that the counter distinguishes Gd157 from Gd155 capture.) If you fired enough primary neutrons, eventually you would get a H1 capture.

1 Like