Session 6 : Exercise – 2015

Code for download: session6_start.tar.gz

Exercise 6a:

  • With use of G4AnalysisManager
    (see example B4/B4d ):

    1. 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];
    2. 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();
    3. Inspect generated file in Root with Root browser
      • The command to call Root in our environment:
        /usr/local/bin/root

Exercise 6b:

  • Inspect the implementation of a command using G4GenericMessenger in the EDEventAction 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 in EDEventAction
    • Add a new data member fRandomize of a G4bool type
    • Add a G4GenericMessenger object in EDPrimaryGeneratorAction and call its DeclareProperty method to create setRandomize command

Solution: session6_solution.tar.gz