Code for download: session6_start.tar.gz
Exercise 6a:
- With use of
G4AnalysisManager
(see example B4/B4d ):- Create & fill histogram
- Define a 1D histogram for the energy deposited per event for each calorimeter layer
- Implement filling of histograms in the
EDEmCalorimeterSD::EndOfEvent()
function.
Hint:
To access the i-th calorimeter hit from fHitsCollection:
EDEmCalorimeterHit* hit = (EDEmCalorimeterHit*)(*fHitsCollection)[i];
- Create & fill ntuple
- Define two ntuples representing the tracker chamber hit in each tracker chamber:
- the chamber layer number
- hit local position (x, y, z)
- Implement filling of ntuple in
EDChamberSD::ProcessHits();
- Define two ntuples representing the tracker chamber hit in each tracker chamber:
- Inspect generated file in Root with Root browser
- The command to call Root in our environment:
/usr/local/bin/root
- The command to call Root in our environment:
- Create & fill histogram
Exercise 6b:
- Inspect the implementation of a command using
G4GenericMessenger
in theEDEventAction
class, execute the command to inactivate verbose mode and run a new event - Make randomizing of the particle direction optional, and then implement a command to select the randomize option using
G4GenericMessenger
in an analogous way as the command inEDEventAction
- Add a new data member
fRandomize
of aG4bool
type - Add a
G4GenericMessenger
object inEDPrimaryGeneratorAction
and call itsDeclareProperty
method to createsetRandomize
command
- Add a new data member
Solution: session6_solution.tar.gz