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];
- Activate plotting of histograms using the UI command(s)
- Create & fill ntuples
- Define two ntuples representing the tracker chamber hits in each tracker chamber (one in the first arm and one in the second arm)
- the chamber layer number
- hit local position (x, y, z)
- Implement filling of the ntuples in
EDChamberSD::ProcessHits();
- Note that in there is added a new data member, fNtupleId, in the EDChamberSD class which allows to associate each tracker chamber with one of created ntuples
- Define two ntuples representing the tracker chamber hits in each tracker chamber (one in the first arm and one in the second arm)
- Inspect generated file in ROOT with the ROOT browser
- The command to call Root:
$ root
- The command to call Root:
- 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 - Implement a command to activate or inactivate the randomizing of the particle direction in the primary generator action using
G4GenericMessenger
in an analogous way as the command inEDEventAction
- Add a
G4GenericMessenger
object inEDPrimaryGeneratorAction
- Call its
DeclareProperty
method to createsetRandomize
command associated with already existing data memberfRandomize
of aG4bool
type
- Add a
Solution: session6_solution.tar.gz