Start code: session9_start
with updated geometry with addition of a shield made of concrete.
The exercise shows one usage of the biasing classes.
We have a shield, made of concrete, which is inserted between the calorimeter and the screen of session 9. This shield is divided in 10 slices, using a replica.
We want to estimate the efficiency of the shield to neutrons, and characterize the neutrons which succeed in exiting the shield. As this one is doing its job, only a few neutrons can traverse this shield. The goal of the exercise is to bias the simulation in the shield to get more neutrons traversing.
The following items have been introduced:
BiasingOperator
, BiasingOperationSplitAndKill
ConstructSDandField()
method has been modified to attach the biasing operator to the logical volume of the shield slicesmain
program, a command line option -b
has been added to activate or not the biasing, this option controls the use or not of the G4GenericBiasingPhysics
physics constructor.Compile and run the code in a non-biased way (so-called analog way):
./exampleED -b off
Look at how the neutron processes appear when printing these processes with a command line.
Shoot a few protons, to verify that the shield is indeed preventing most of particles to traverse.
Run the code in biased mode:
./exampleED -b on
The BiasingOperator
must send the BiasingOperationSplitAndKill
biasing operation to be applied. In the code here, it does not. Make it returning the biasing operation using the proper method.
Run the code in biasing mode to verify that now particles go through the shield.
You will notice that the track weight has been added to the ntuple. Plot some quantities (eg: Ekin
) not using and using the weight: this second plot is the correct one.
root [] Screen->Draw("Ekin");
root [] Screen->Draw("Ekin","weight");
We will reduce the flux backward, for this apply a “Russian Roulette” technique. Look at the corresponding section of the code on the BiasingOperationSplitAndKill
class, which provides further hints to implement the killing.
In DetectorConstruction.cc, fix:
#include "G4SDManager.hh"
// ...
//
// Sensitive detectors
//
ChamberSD* chamber1SD = new ChamberSD("Chamber1SD", 0);
G4SDManager::GetSDMpointer()->AddNewDetector(chamber1SD);
SetSensitiveDetector("WirePlane1", chamber1SD);
ChamberSD* chamber2SD = new ChamberSD("Chamber2SD", 1);
G4SDManager::GetSDMpointer()->AddNewDetector(chamber2SD);
SetSensitiveDetector("WirePlane2", chamber2SD);
EmCalorimeterSD* calorimeterSD = new EmCalorimeterSD("EmCalorimeterSD");
G4SDManager::GetSDMpointer()->AddNewDetector(calorimeterSD);
SetSensitiveDetector("EmCell", calorimeterSD);
ScreenSD* screenSD = new ScreenSD("ScreenSD", 2);
G4SDManager::GetSDMpointer()->AddNewDetector(screenSD);
SetSensitiveDetector("Screen", screenSD);