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 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();
- Note that in there is added a new data member, fNtupleId, in the EDChamberSD class which allow to associate each tracker chamber with one of created ntuples
- 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:
- Add menu in GUI using command line interface
- Add a menu « View » in the toolbar (on apple computers, the menu bar is always at the top of the screen)
- In this View menu, add two buttons for setting the viewPoint at Theta/Phi (0,0) and (90,0)
- In this View menu, add a button for setting a viewPoint and ask for it (define a command without parameters)
- Explore visualization commands
Exercise 6c:
- 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