Exercises - Day 4 (May 22nd)

Content:
Introduction
Preparation
Exercises
Part I
Part II
Part III
Part IV

Solutions:
Part I
Part II
Part III
Part IV

Web:
SW references

Manual:
Appl. Dev. Man

Presentations:
Slides

Introduction

Today's exercises cover the following items:

A Geant4 application example is provided, which serves as basis of the exercises. The exercises include the modification and/or extension of the following classes:

The following diagram shows the class hierarchy of the sensitive detector and the hit objects:

Class Diagram 4A (Day 4)

Preparation

Perform the following steps to prepare the environment:
  1. Login to the machine lxplus.cern.ch (Note: To be changed to local linux machine)

  2. Create a directory for the example application, e.g.
    mkdir exampleday4

  3. Copy the tar-ball exercisesday4.tgz from /exercises/day4 into this directory and extract it:
    cd exampleday4
    cp /exercises/day4/exercisesday4.tgz .
    tar xzvf exercisesday4.tgz

  4. Set up the environment in your current working shell:
    source /exercises/config/env.sh

  5. Compile the example application:
    make
    (Remember to recompile the application after you changed the code in below exercises)

  6. Perform a test run:
    $G4WORKDIR/bin/Linux-g++/Tutorial test.mac

  7. If you managed to run the macro file successfully, you are ready to start the exercises. Good luck!

Exercises

Please note, that some exercises rely on the successful completion of previous exercises, i.e. previously introduced functionalities might be used at a later stage. These mandatory exercises are marked with a star next to the exercise number (*). If you don't manage to complete them by your own, try to understand the provided solutions and introduce the requested functionalites into your example.

Part I - Introductionary exercises

Exercise 4-1
Get familiar with the classes of the example application, which are subject of the exercises (see the
list above). Also try to understand the class hierarchies (abstract base class, concrete user implementation) of the relevant classes (the above diagrams might be helpful). Answer following questions:

Part II - Sensitive Detector, Readout Geometry and Hits

Exercise 4-2

Exercise 4-3*

Part III - Retrieval of information from tracks, steps and particle classes

Exercise 4-4
Introduce a conditional statement in the ProcessHits method of the sensitive detector, in order that hits are only created for primary particle tracks:

Exercise 4-5

Part IV - Analysis

Exercise 4-6

Exercise 4-7