Code for download: session9_start.tar.gz
** These exercices are of course just a little sample of physics problems. **
Energy deposit depending on particle species:
- Add two more calorimeter hits:
- One to collect the deposit from charged particles in all layers.
- Another one for neutral particles.
- Add Edep histograms for these new quantities. In the run action, you will have to add the creation of these histograms as, for example:
// histogram 10 analysisManager->CreateH1("AllCharged", "Charged Edep in all layers", 100, 0., 800*MeV); // histogram 11 analysisManager->CreateH1("AllNeutral", "Neutral Edep in all layers", 100, 0., 10*MeV);
You will see that energy deposit from neutral particle is quite marginal. Explain why neutral particles deposit so few compared to charged ones.
Stability of energy deposit with cuts:
- A
runProton.mac
file has been created to allowyou to run 1000 protons in batch mode:./exampleED -m runProton.mac
This runProton.mac is simple:# Set particle production thresholds (cuts) # /run/setCut 1 mm /run/setCutForRegion EmCalorimeterRegion 1 mm # # Run processing # /gun/particle proton /run/beamOn 1000
- Run 1000 protons with
1 mm
cut, save yourED.root
as, eg,ED-1mm.root
- Run 1000 protons with
1 km
cut, save yourED.root
as, eg,ED-1km.root
- Compare the energy deposit distribution in calorimeter.
- Explain the observed result.
Production of secondaries with cuts:
- In the start code, there is added a new volume, a thin screen, far after the calorimeter. For this reason, the world volume has been made larger than in the previous exercises, as can be seen in the detector construction:
// Make world larger for this example: hx += 5*m; hy += 5*m; hz += 5*m;
This screen will be used for counting particles that exit from the calorimeter. It will be made sensitive, but we will not create hits and hits collections, but just store in the ntuple the quantities we are interested in.
- To this screen logical volume, attach a sensitive detector that you will have to complete. In the
ProcessHits()
of this sensitive detector, you will fill a Root ntuple:// Store hit in the ntuple G4AnalysisManager* analysisManager = G4AnalysisManager::Instance(); analysisManager->FillNtupleIColumn(2, 0, trackID); analysisManager->FillNtupleIColumn(2, 1, pdgCode); analysisManager->FillNtupleDColumn(2, 2, Ekin/MeV); analysisManager->FillNtupleDColumn(2, 3, localPosition.x()/cm); analysisManager->FillNtupleDColumn(2, 4, localPosition.y()/cm); analysisManager->FillNtupleDColumn(2, 5, time/ns); analysisManager->AddNtupleRow(2);
where
ItrackID
is the track ID,pdgCode
its PDG code,Ekin
the kinetic energy,localPosition
is the G4ThreeVector of local coordinate in the frame of the screen (seeEDChamberSD
to see how to get these coordinates, for example).This ntuple has been declared and shaped in the
RunAction
. - Run 1000 protons with
1 mm
cut, save yourED.root
as, eg,ED-1mm.root
- Run 1000 protons with
1 km
cut, save yourED.root
as, eg,ED-1km.root
- Compare the counting of particles at the screen level. Comment.
Change of secondary production with physics list:
- You will use several physics lists to compare neutron production and transport. With a
1 mm
cut, run the application with the following physics lists:- LHEP [known to be badly describing neutrons]
- FTFP_BERT [the one you use by default in this tutorial]
- FTFP_BERT_HP [the most precise one for what concerns neutron transport]
The physics list can be passed in batch on the command line, eg:
./exampleED -p LHEP -m runProton.mac
- Check the energy spectrum of neutrons reaching the screen for the 3 cases, and specially a low energy (eg: below 50 MeV).
Activate G4MTRunManager
in main()
and run in multi-threading mode.
- No other modification for MT mode are needed in this exercise.
Solution: session9_solution.tar.gz
Exercise ++:
The exercises marked as ++ are optional; they are recommended for participants who have already some experience with Geant4 and get some time left for practicing more than the basic exercise proposed above.
- There is no exercise++ for this session.